index.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <template>
  2. <view class="content">
  3. <u-swiper height="250" :list="imageTopList"></u-swiper>
  4. <!-- 商品 -->
  5. <view class="goods">
  6. <u-section title="人气零食" v-if="goodsList.length" :show-line="false" sub-title="更多" @click="toGoods(1)"></u-section>
  7. <view class="goods-list" v-if="goodsList.length">
  8. <uni-coods v-for="item in goodsList" :key="item.id" :data="item"></uni-coods>
  9. </view>
  10. <u-section title="居家生活" v-if="goodsList.length" :show-line="false" sub-title="更多" @click="toGoods(2)"></u-section>
  11. <view class="goods-list" v-if="goodsList.length">
  12. <uni-coods v-for="item in goodsList" :key="item.id" :data="item"></uni-coods>
  13. </view>
  14. </view>
  15. <!-- 购物车 -->
  16. <uni-cart-fix></uni-cart-fix>
  17. </view>
  18. </template>
  19. <script>
  20. import {
  21. checkLogin
  22. } from '@/api/login.js'
  23. import {
  24. getMapStoreList
  25. } from '@/api/store.js'
  26. import {
  27. getLookUpDatas
  28. } from '@/api/data.js'
  29. import {
  30. getUnFinishedOrder
  31. } from '@/api/order.js'
  32. export default {
  33. components: {
  34. },
  35. data() {
  36. return {
  37. imageTopList:[
  38. {image:'/static/banner.png'},
  39. {image:'/static/banner.png'}
  40. ],
  41. goodsList:[
  42. {
  43. id: 21312312321,
  44. name: '啊撒旦解放拉萨酱豆腐爱丽丝反对萨拉地方就',
  45. src: 'https://cdn.uviewui.com/uview/example/fade.jpg',
  46. price: 50,
  47. status: 0
  48. },
  49. {
  50. id: 6465465465,
  51. name: '啊撒旦解放拉萨酱豆腐爱丽丝反对萨拉地方就',
  52. src: 'https://cdn.uviewui.com/uview/example/fade.jpg',
  53. price: 50,
  54. status: 1
  55. },
  56. {
  57. id: 234324,
  58. name: '啊撒旦解放拉萨酱豆腐爱丽丝反对萨拉地方就',
  59. src: 'https://cdn.uviewui.com/uview/example/fade.jpg',
  60. price: 50,
  61. status: 0
  62. },
  63. {
  64. id: 4453455,
  65. name: '啊撒旦解放拉萨酱豆腐爱丽丝反对萨拉地方就',
  66. src: 'https://cdn.uviewui.com/uview/example/fade.jpg',
  67. price: 50,
  68. status: 0
  69. }
  70. ]
  71. }
  72. },
  73. onReady() {
  74. },
  75. onShow() {
  76. },
  77. onLoad() {
  78. },
  79. methods: {
  80. // 更多商品
  81. toGoods(clsId){
  82. uni.navigateTo({
  83. url:"/pages/goods/goods?id="+clsId
  84. })
  85. }
  86. }
  87. }
  88. </script>
  89. <style lang="scss" scoped>
  90. .content {
  91. background: url(../../static/topBg.png) no-repeat top center;
  92. background-size: 100%;
  93. .goods{
  94. padding: 20upx 0;
  95. }
  96. .goods-list{
  97. padding: 20upx 0;
  98. display: flex;
  99. flex-wrap: wrap;
  100. justify-content: space-between;
  101. }
  102. }
  103. </style>