index.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  1. <template>
  2. <mobile-frame :frameStyle="frameStyle" @toPath="toPath">
  3. <view class="main" id="top">
  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="list" v-for="(tag,indexs) in item.list" :key="indexs">
  25. <view class="title">
  26. <text>{{tag.title||'&nbsp;'}}</text>
  27. </view>
  28. <image class="image" :src="tag.url" mode=""></image>
  29. <view class="textOver name">
  30. {{tag.name}}
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="zero five">
  36. <view class="list" v-for="(item,index) in marketList" :key="index">
  37. <image class="image" :src="item.url" mode=""></image>
  38. <view class="name">
  39. {{item.name}}
  40. </view>
  41. <view class="other">
  42. <view class="money">
  43. <text>¥</text><text>{{item.money}}</text>
  44. </view>
  45. <view class="btn">
  46. <button type="default" size="mini">购买</button>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. <view class="backTop">
  53. <text class="iconfont icon-fanhuidingbu"></text>
  54. </view>
  55. </mobile-frame>
  56. </template>
  57. <script>
  58. export default {
  59. data() {
  60. return {
  61. frameStyle: {
  62. useBar: true
  63. },
  64. bannerList: [ // 轮播图
  65. {
  66. url: require('@/static/test.png')
  67. },
  68. {
  69. url: require('@/static/test.png')
  70. },
  71. {
  72. url: require('@/static/test.png')
  73. },
  74. {
  75. url: require('@/static/test.png')
  76. },
  77. ],
  78. btnList: [ //功能按钮
  79. {
  80. name: '商品分类',
  81. url: require('@/static/logo.png'),
  82. route: ''
  83. },
  84. {
  85. name: '首农专区',
  86. url: require('@/static/logo.png'),
  87. route: ''
  88. },
  89. {
  90. name: '地方特产',
  91. url: require('@/static/logo.png'),
  92. route: ''
  93. },
  94. {
  95. name: '进口食品',
  96. url: require('@/static/logo.png'),
  97. route: ''
  98. },
  99. {
  100. name: '扶贫专区',
  101. url: require('@/static/logo.png'),
  102. route: ''
  103. },
  104. {
  105. name: '自提门店',
  106. url: require('@/static/logo.png'),
  107. route: ''
  108. },
  109. {
  110. name: '点到优选',
  111. url: require('@/static/logo.png'),
  112. route: ''
  113. },
  114. {
  115. name: '活动专区',
  116. url: require('@/static/logo.png'),
  117. route: ''
  118. },
  119. {
  120. name: '兑换中心',
  121. url: require('@/static/logo.png'),
  122. route: ''
  123. },
  124. {
  125. name: '员工中心',
  126. url: require('@/static/logo.png'),
  127. route: ''
  128. },
  129. ],
  130. recomList: [ //推荐好物
  131. {
  132. list: [ //商品
  133. {
  134. title: '新品上架',
  135. url: require('@/static/test.png'),
  136. name: '商品名称'
  137. },
  138. {
  139. title: '',
  140. url: require('@/static/test.png'),
  141. name: '商品名称'
  142. },
  143. ]
  144. },
  145. {
  146. list: [ //商品
  147. {
  148. title: '发现好货',
  149. url: require('@/static/test.png'),
  150. name: '商品名称'
  151. },
  152. {
  153. title: '热销爆款',
  154. url: require('@/static/test.png'),
  155. name: '商品名称'
  156. },
  157. ]
  158. },
  159. {
  160. list: [ //商品
  161. {
  162. title: '首农精选',
  163. url: require('@/static/test.png'),
  164. name: '商品名称'
  165. },
  166. {
  167. title: '居家常备',
  168. url: require('@/static/test.png'),
  169. name: '商品名称'
  170. },
  171. ]
  172. },
  173. {
  174. list: [ //商品
  175. {
  176. title: '人气单品',
  177. url: require('@/static/test.png'),
  178. name: '商品名称'
  179. },
  180. {
  181. title: '夏季畅销',
  182. url: require('@/static/test.png'),
  183. name: '商品名称'
  184. },
  185. ]
  186. }
  187. ],
  188. marketList: [ //商品列表
  189. {
  190. url: require('@/static/test.png'),
  191. name: '商品名称',
  192. money: 10
  193. },
  194. {
  195. url: require('@/static/test.png'),
  196. name: '商品名称',
  197. money: 10
  198. },
  199. {
  200. url: require('@/static/test.png'),
  201. name: '商品名称',
  202. money: 10
  203. },
  204. {
  205. url: require('@/static/test.png'),
  206. name: '商品名称',
  207. money: 10
  208. },
  209. {
  210. url: require('@/static/test.png'),
  211. name: '商品名称',
  212. money: 10
  213. },
  214. ]
  215. };
  216. },
  217. onShow: function() {},
  218. methods: {
  219. toPath(e) {
  220. if (e && e.route) uni.redirectTo({
  221. url: `/${e.route}`
  222. })
  223. }
  224. }
  225. }
  226. </script>
  227. <style lang="scss">
  228. .main {
  229. padding: 2vw;
  230. .zero {
  231. margin: 0 0 2vw 0;
  232. }
  233. .one {
  234. background-color: var(--fFB1Color);
  235. border-radius: 20px;
  236. padding: 0 2vw;
  237. input {
  238. font-size: var(--font15Size);
  239. color: var(--f85Color);
  240. border-radius: 14px;
  241. width: 100%;
  242. padding: 1.5vw 0;
  243. }
  244. }
  245. .two {
  246. swiper {
  247. height: 50vw;
  248. border-radius: 5px;
  249. }
  250. .list {
  251. border-radius: 5px;
  252. .image {
  253. width: 100%;
  254. height: 100%;
  255. border-radius: 5px;
  256. }
  257. }
  258. }
  259. .thr {
  260. display: flex;
  261. flex-direction: row;
  262. justify-content: space-around;
  263. flex-wrap: wrap;
  264. .list {
  265. width: 17vw;
  266. text-align: center;
  267. margin: 0 0 2vw 0;
  268. .image {
  269. width: 100%;
  270. height: 16vw;
  271. margin: 0 0 1vw 0;
  272. }
  273. .name {
  274. font-size: var(--font13Size);
  275. }
  276. }
  277. }
  278. .four {
  279. display: flex;
  280. flex-direction: row;
  281. justify-content: space-around;
  282. flex-wrap: wrap;
  283. background-color: var(--f2Color);
  284. padding: 2vw 0 0 0;
  285. .recomList {
  286. display: flex;
  287. flex-direction: row;
  288. justify-content: space-around;
  289. width: 41vw;
  290. margin: 0 0 2vw 0;
  291. padding: 2vw;
  292. border-radius: 10px;
  293. background-image: linear-gradient(to bottom, rgba(250, 216, 213, 1) 5%, rgba(255, 255, 255, 1) 22%);
  294. .list {
  295. width: 20vw;
  296. text-align: center;
  297. .title {
  298. text-align: center;
  299. font-weight: bold;
  300. font-size: var(--font15Size);
  301. ;
  302. margin: 0 0 1vw 0;
  303. }
  304. .image {
  305. width: 18vw;
  306. height: 20vw;
  307. margin: 0 0 1vw 0;
  308. }
  309. .name {
  310. width: 17vw;
  311. font-size: var(--font12Size);
  312. ;
  313. border: 1px solid var(--fFB1Color);
  314. border-radius: 25px;
  315. padding: 0 1vw;
  316. text-align: center;
  317. }
  318. }
  319. }
  320. }
  321. .five {
  322. display: flex;
  323. flex-direction: row;
  324. flex-wrap: wrap;
  325. background-color: var(--f2Color);
  326. padding: 2vw 0 0 0;
  327. .list {
  328. width: 40vw;
  329. background-color: var(--fffColor);
  330. padding: 2vw;
  331. margin: 0 2vw 2vw 2vw;
  332. border-radius: 10px;
  333. .image {
  334. width: 100%;
  335. height: 35vw;
  336. }
  337. .name {
  338. font-size: var(--font14Size);
  339. margin: 0 0 1vw 0;
  340. }
  341. .other {
  342. display: flex;
  343. flex-direction: row;
  344. justify-content: space-between;
  345. .money {
  346. color: var(--fFB1Color);
  347. text:nth-child(1) {
  348. font-size: var(--font12Size);
  349. }
  350. }
  351. .btn {
  352. button {
  353. color: var(--fffColor);
  354. background-color: var(--fFB1Color);
  355. padding: 5px 2vw;
  356. font-size: var(--font14Size);
  357. line-height: 1;
  358. border-radius: 90px;
  359. }
  360. }
  361. }
  362. }
  363. .list:nth-child(2n) {
  364. margin: 0 0 2vw 2vw;
  365. }
  366. }
  367. }
  368. .backTop {
  369. position: fixed;
  370. bottom: 20vw;
  371. right: 5vw;
  372. text {
  373. font-size: 30px;
  374. background-color: #0000005f;
  375. border-radius: 90px;
  376. }
  377. }
  378. </style>