index.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <view class="content">
  3. <u-swiper height="200" :list="imageTopList"></u-swiper>
  4. <!-- 商品 -->
  5. <view class="goods">
  6. <u-section title="人气零食" v-if="goodsList.length" :show-line="false" sub-title="更多"></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="更多"></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 :count="15"></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:'https://cdn.uviewui.com/uview/example/fade.jpg'},
  39. {image:'https://cdn.uviewui.com/uview/example/fade.jpg'}
  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. }
  82. </script>
  83. <style lang="scss" scoped>
  84. .content {
  85. .goods{
  86. padding: 20upx 0;
  87. }
  88. .goods-list{
  89. padding: 20upx 0;
  90. display: flex;
  91. flex-wrap: wrap;
  92. justify-content: space-between;
  93. }
  94. }
  95. </style>