index.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <view class="content">
  3. <div class="app-list">
  4. <div class="item" v-for="(item,index) in applist" @click="linkTo(item)">
  5. <image class="logo" src="/static/logo.png"></image>
  6. <view class="text-area">
  7. <text class="name">{{item.name}}</text>
  8. </view>
  9. </div>
  10. </div>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. data() {
  16. return {
  17. applist: []
  18. }
  19. },
  20. onShow() {
  21. this.getData()
  22. },
  23. methods: {
  24. getData(){
  25. let applist=[];
  26. for(let i=0;i<11;i++){
  27. applist.push({
  28. id:i,
  29. name:"app-"+i,
  30. href:'http://baidu.com'
  31. })
  32. }
  33. this.applist=applist
  34. },
  35. linkTo(item){
  36. uni.navigateTo({
  37. url:`/pages/webview/webview?href=${item.href}&name=${item.name}`
  38. })
  39. }
  40. }
  41. }
  42. </script>
  43. <style lang="scss" scoped>
  44. .content {
  45. padding: 0 20rpx 100rpx;
  46. .app-list{
  47. display: flex;
  48. flex-wrap: wrap;
  49. .item{
  50. display: flex;
  51. justify-content: center;
  52. align-items: center;
  53. flex-direction: column;
  54. margin-bottom: 20rpx;
  55. padding:0 6rpx;
  56. box-sizing: border-box;
  57. width: 20%;
  58. .logo {
  59. display: block;
  60. width: 100rpx;
  61. height: 100rpx;
  62. }
  63. .text-area {
  64. margin: 0;
  65. padding: 0;
  66. height: 30rpx;
  67. .name {
  68. font-size: 30rpx;
  69. color: #666;
  70. line-height:1;
  71. }
  72. }
  73. }
  74. }
  75. }
  76. </style>