index.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template>
  2. <view class="fui-wrap">
  3. <view class="search-content">
  4. <u-search placeholder="请输入关键字" v-model="keyword"></u-search>
  5. </view>
  6. <u-swiper :list="list" mode="none" :height="200" />
  7. <u-notice-bar :text="msg" :more-icon="false" color="#5af" bg-color="#d6e8f7"></u-notice-bar>
  8. <view style="width: 100%; margin-top: 20rpx">
  9. <u-grid
  10. :border="false"
  11. :col="3"
  12. @click="click"
  13. >
  14. <u-grid-item
  15. v-for="(baseListItem,baseListIndex) in baseList"
  16. :key="baseListIndex"
  17. >
  18. <view class="grid-item-icon" :style="{backgroundColor: baseListItem.bgColor}">
  19. <image :src="baseListItem.icon"></image>
  20. </view>
  21. <text class="grid-text">{{ baseListItem.title }}</text>
  22. </u-grid-item>
  23. </u-grid>
  24. </view>
  25. <u-gap height="10" bgColor="#bbb"></u-gap>
  26. <view class="u-page">
  27. <view class="u-page-title">
  28. <view class="line"></view>
  29. <view class="rectangle"></view>
  30. <view class="rectangle"></view>
  31. <view class="title-content">最新资讯</view>
  32. <view class="rectangle"></view>
  33. <view class="rectangle"></view>
  34. <view class="line"></view>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. export default {
  41. data() {
  42. debugger
  43. return {
  44. keyword: process.env.UNI_FILE_PREFIX ,
  45. list: [
  46. '/static/images/swiper/title.png',
  47. ],
  48. msg: '加快建设交通强国大会将于2024年8月在南京召开',
  49. baseList: [
  50. {
  51. name: 'photo',
  52. icon: '/static/images/icons/meeting_info.svg',
  53. bgColor: '#6abff9',
  54. title: '大会介绍',
  55. },
  56. {
  57. name: 'lock',
  58. icon: '/static/images/icons/meeting_apply.svg',
  59. bgColor: '#f1b06c',
  60. title: '会议报名',
  61. },
  62. {
  63. name: 'star',
  64. icon: '/static/images/icons/meeting_point.svg',
  65. title: '会议指南',
  66. bgColor: '#ee794d',
  67. },
  68. {
  69. name: 'star',
  70. icon: '/static/images/icons/meeting_doc.svg',
  71. title: '交流材料汇编',
  72. bgColor: '#e66b66',
  73. },
  74. {
  75. name: 'star',
  76. icon: '/static/images/icons/meeting_traffic.svg',
  77. title: '交通指引',
  78. bgColor: '#82cf92',
  79. },
  80. {
  81. name: 'star',
  82. icon: '/static/images/icons/meeting_contact.svg',
  83. title: '联系我们',
  84. bgColor: '#4a75f6',
  85. },
  86. ],
  87. indexList: [],
  88. urls: [
  89. 'https://cdn.uviewui.com/uview/album/1.jpg',
  90. 'https://cdn.uviewui.com/uview/album/2.jpg',
  91. 'https://cdn.uviewui.com/uview/album/3.jpg',
  92. 'https://cdn.uviewui.com/uview/album/4.jpg',
  93. 'https://cdn.uviewui.com/uview/album/5.jpg',
  94. 'https://cdn.uviewui.com/uview/album/6.jpg',
  95. 'https://cdn.uviewui.com/uview/album/7.jpg',
  96. 'https://cdn.uviewui.com/uview/album/8.jpg',
  97. 'https://cdn.uviewui.com/uview/album/9.jpg',
  98. 'https://cdn.uviewui.com/uview/album/10.jpg',
  99. ]
  100. };
  101. },
  102. onLoad() {
  103. this.loadmore();
  104. },
  105. methods: {
  106. click() {
  107. },
  108. scrolltolower() {
  109. this.loadmore();
  110. },
  111. loadmore() {
  112. for (let i = 0; i < 30; i++) {
  113. this.indexList.push({
  114. url: this.urls[uni.$u.random(0, this.urls.length - 1)],
  115. });
  116. }
  117. },
  118. },
  119. onShareAppMessage() {
  120. return {
  121. title: 'First UI组件库',
  122. };
  123. },
  124. };
  125. </script>
  126. <style lang="scss" src="./index.scss">
  127. </style>