index.vue 5.5 KB

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