index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <template>
  2. <mobile-frame :frameStyle="frameStyle" @toPath="toPath">
  3. <view class="main">
  4. <view class="zero one">
  5. <input type="text" placeholder="搜索商品">
  6. </view>
  7. <view class="zero two">
  8. <swiper class="swiper" circular :indicator-dots="true" indicator-color="#ffffff" indicator-active-color="#FB1438" :autoplay="true" :interval="3000" :duration="1000">
  9. <swiper-item class="list" v-for="(item,index) in bannerList" :key="index">
  10. <image class="image" :src="item.url" mode=""></image>
  11. </swiper-item>
  12. </swiper>
  13. </view>
  14. <view class="zero thr">
  15. <view class="list" v-for="(item,index) in btnList" :key="index">
  16. <image class="image" :src="item.url" mode=""></image>
  17. <view class="textOver name">
  18. {{item.name}}
  19. </view>
  20. </view>
  21. </view>
  22. <view class="zero four">
  23. <view class="recomList" v-for="(item,index) in recomList" :key="index">
  24. <view class="title">
  25. <text>{{item.title}}</text>
  26. <text>{{item.titles}}</text>
  27. </view>
  28. <view class="market">
  29. <view class="list" v-for="(tag,indexs) in item.list" :key="indexs">
  30. <image class="image" :src="tag.url" mode=""></image>
  31. <view class="name">
  32. {{item.name}}1
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="zero five">
  39. 数据列表
  40. </view>
  41. </view>
  42. </mobile-frame>
  43. </template>
  44. <script>
  45. export default {
  46. data() {
  47. return {
  48. frameStyle: {
  49. useBar: true
  50. },
  51. bannerList: [ // 轮播图
  52. {
  53. url: require('@/static/logo.png')
  54. },
  55. {
  56. url: require('@/static/logo.png')
  57. },
  58. {
  59. url: require('@/static/logo.png')
  60. },
  61. {
  62. url: require('@/static/logo.png')
  63. },
  64. ],
  65. btnList: [ //功能按钮
  66. {
  67. name: '商品分类',
  68. url: require('@/static/logo.png'),
  69. route: ''
  70. },
  71. {
  72. name: '首农专区',
  73. url: require('@/static/logo.png'),
  74. route: ''
  75. },
  76. {
  77. name: '地方特产',
  78. url: require('@/static/logo.png'),
  79. route: ''
  80. },
  81. {
  82. name: '进口食品',
  83. url: require('@/static/logo.png'),
  84. route: ''
  85. },
  86. {
  87. name: '扶贫专区',
  88. url: require('@/static/logo.png'),
  89. route: ''
  90. },
  91. {
  92. name: '自提门店',
  93. url: require('@/static/logo.png'),
  94. route: ''
  95. },
  96. {
  97. name: '点到优选',
  98. url: require('@/static/logo.png'),
  99. route: ''
  100. },
  101. {
  102. name: '活动专区',
  103. url: require('@/static/logo.png'),
  104. route: ''
  105. },
  106. {
  107. name: '兑换中心',
  108. url: require('@/static/logo.png'),
  109. route: ''
  110. },
  111. {
  112. name: '员工中心',
  113. url: require('@/static/logo.png'),
  114. route: ''
  115. },
  116. ],
  117. recomList: [ //推荐好物
  118. {
  119. title: '新品上架',
  120. titles: '',
  121. list: [ //产品
  122. {
  123. url: require('@/static/logo.png'),
  124. name: '产品名称'
  125. },
  126. {
  127. url: require('@/static/logo.png'),
  128. name: '产品名称'
  129. },
  130. ]
  131. },
  132. {
  133. title: '发现好货',
  134. titles: '热销爆款',
  135. list: [ //产品
  136. {
  137. url: require('@/static/logo.png'),
  138. name: '产品名称'
  139. },
  140. {
  141. url: require('@/static/logo.png'),
  142. name: '产品名称'
  143. },
  144. ]
  145. },
  146. {
  147. title: '首农精选',
  148. titles: '居家常备',
  149. list: [ //产品
  150. {
  151. url: require('@/static/logo.png'),
  152. name: '产品名称'
  153. },
  154. {
  155. url: require('@/static/logo.png'),
  156. name: '产品名称'
  157. },
  158. ]
  159. },
  160. {
  161. title: '人气单品',
  162. titles: '夏季畅销',
  163. list: [ //产品
  164. {
  165. url: require('@/static/logo.png'),
  166. name: '产品名称'
  167. },
  168. {
  169. url: require('@/static/logo.png'),
  170. name: '产品名称'
  171. },
  172. ]
  173. }
  174. ]
  175. };
  176. },
  177. onShow: function() {},
  178. methods: {
  179. toPath(e) {
  180. if (e && e.route) uni.redirectTo({
  181. url: `/${e.route}`
  182. })
  183. }
  184. }
  185. }
  186. </script>
  187. <style lang="scss">
  188. .main {
  189. padding: 2vw;
  190. .zero {
  191. margin: 0 0 2vw 0;
  192. }
  193. .one {
  194. background-color: var(--fFB1Color);
  195. border-radius: 20px;
  196. padding: 0 2vw;
  197. input {
  198. font-size: var(--font15Size);
  199. color: var(--f85Color);
  200. border-radius: 14px;
  201. width: 100%;
  202. padding: 1.5vw 0;
  203. }
  204. }
  205. .two {
  206. swiper {
  207. height: 50vw;
  208. border-radius: 5px;
  209. }
  210. .list {
  211. border-radius: 5px;
  212. .image {
  213. width: 100%;
  214. height: 100%;
  215. border-radius: 5px;
  216. }
  217. }
  218. }
  219. .thr {
  220. display: flex;
  221. flex-direction: row;
  222. justify-content: space-around;
  223. flex-wrap: wrap;
  224. .list {
  225. width: 17vw;
  226. text-align: center;
  227. margin: 0 0 2vw 0;
  228. .image {
  229. width: 100%;
  230. height: 16vw;
  231. margin: 0 0 1vw 0;
  232. }
  233. .name {
  234. font-size: var(--font13Size);
  235. }
  236. }
  237. }
  238. .four{
  239. .recomList{
  240. .title{
  241. }
  242. .market{
  243. .list{
  244. }
  245. }
  246. }
  247. }
  248. }
  249. </style>