index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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. <u-list>
  37. <u-list-item
  38. v-for="(item, index) in indexList"
  39. :key="index"
  40. >
  41. <u-cell
  42. :title="`列表长度-${index + 1}`"
  43. >
  44. <u-avatar
  45. slot="icon"
  46. shape="square"
  47. size="35"
  48. :src="item.url"
  49. customStyle="margin: -3px 5px -3px 0"
  50. ></u-avatar>
  51. </u-cell>
  52. </u-list-item>
  53. </u-list>
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. export default {
  59. data() {
  60. return {
  61. keyword: '',
  62. list: [
  63. '/static/images/swiper/title.png',
  64. ],
  65. msg: '加快建设交通强国大会将于2024年8月在南京召开',
  66. baseList: [
  67. {
  68. name: 'photo',
  69. icon: '/static/images/icons/meeting_info.svg',
  70. bgColor: '#6abff9',
  71. title: '大会介绍',
  72. },
  73. {
  74. name: 'lock',
  75. icon: '/static/images/icons/meeting_apply.svg',
  76. bgColor: '#f1b06c',
  77. title: '会议报名',
  78. },
  79. {
  80. name: 'star',
  81. icon: '/static/images/icons/meeting_point.svg',
  82. title: '会议指南',
  83. bgColor: '#ee794d',
  84. },
  85. {
  86. name: 'star',
  87. icon: '/static/images/icons/meeting_doc.svg',
  88. title: '交流材料汇编',
  89. bgColor: '#e66b66',
  90. },
  91. {
  92. name: 'star',
  93. icon: '/static/images/icons/meeting_traffic.svg',
  94. title: '交通指引',
  95. bgColor: '#82cf92',
  96. },
  97. {
  98. name: 'star',
  99. icon: '/static/images/icons/meeting_contact.svg',
  100. title: '联系我们',
  101. bgColor: '#4a75f6',
  102. },
  103. ],
  104. indexList: [],
  105. urls: [
  106. 'https://cdn.uviewui.com/uview/album/1.jpg',
  107. 'https://cdn.uviewui.com/uview/album/2.jpg',
  108. 'https://cdn.uviewui.com/uview/album/3.jpg',
  109. 'https://cdn.uviewui.com/uview/album/4.jpg',
  110. 'https://cdn.uviewui.com/uview/album/5.jpg',
  111. 'https://cdn.uviewui.com/uview/album/6.jpg',
  112. 'https://cdn.uviewui.com/uview/album/7.jpg',
  113. 'https://cdn.uviewui.com/uview/album/8.jpg',
  114. 'https://cdn.uviewui.com/uview/album/9.jpg',
  115. 'https://cdn.uviewui.com/uview/album/10.jpg',
  116. ]
  117. };
  118. },
  119. onLoad() {
  120. this.loadmore();
  121. },
  122. methods: {
  123. click() {
  124. },
  125. scrolltolower() {
  126. this.loadmore();
  127. },
  128. loadmore() {
  129. for (let i = 0; i < 30; i++) {
  130. this.indexList.push({
  131. url: this.urls[uni.$u.random(0, this.urls.length - 1)],
  132. });
  133. }
  134. },
  135. },
  136. onShareAppMessage() {
  137. return {
  138. title: 'First UI组件库',
  139. };
  140. },
  141. };
  142. </script>
  143. <style lang="scss" src="./index.scss">
  144. </style>