active-product.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <view class="">
  3. <tui-skeleton
  4. v-if="skeletonShow"
  5. backgroundColor="#fafafa"
  6. borderRadius="10rpx"
  7. :isLoading="true"
  8. :loadingType="5"
  9. ></tui-skeleton>
  10. <view class="active-product" v-else>
  11. <ProGood v-for="item in activeProductList" :key="item" :storeInfo="item" />
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. import ProGood from './components/procurement_good.vue'
  17. export default {
  18. components: {
  19. ProGood,
  20. },
  21. data() {
  22. return {
  23. skeletonShow: true,
  24. activeProductList: [] // 活动商品列表
  25. }
  26. },
  27. onLoad(options) {
  28. this.activeProduct(options)
  29. },
  30. methods: {
  31. // 楼层商品数据
  32. async activeProduct(options) {
  33. try{
  34. const {data} = await this.SpecialService.activeProduct({imageId: options.activeImageId})
  35. this.activeProductList = data
  36. uni.setNavigationBarTitle({
  37. title: data[0].topic
  38. })
  39. this.skeletonShow = false
  40. }catch(error){
  41. console.log(error)
  42. }
  43. }
  44. }
  45. }
  46. </script>
  47. <style lang="scss">
  48. page {
  49. background-color: #f7f7f7;
  50. }
  51. .active-product {
  52. background: #f7f7f7;
  53. display: flex;
  54. flex-wrap: wrap;
  55. padding: 24rpx;
  56. justify-content: space-between;
  57. }
  58. </style>