good-activity.vue 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <view
  3. class="common_contant"
  4. :style="{
  5. padding: active.activeType == '2' ? '' : '24rpx',
  6. backgroundColor: active.activeType == '1' ? '#F7F7F7' : '#fff'
  7. }"
  8. >
  9. <tui-skeleton
  10. v-if="skeletonShow"
  11. backgroundColor="#fafafa"
  12. borderRadius="10rpx"
  13. :isLoading="true"
  14. :loadingType="5"
  15. ></tui-skeleton>
  16. <view v-else>
  17. <view class="img_big" v-if="active.activeType == '2'" @click="activeProducts">
  18. <image style="width: 100%;height: 100%;" :src="active.activeImageVos[0].image" mode="aspectFill"></image>
  19. </view>
  20. <view class="special_all" v-if="active.activeType == '3'">
  21. <SpecialItem v-for="(item, index) in active.activeImageVos" :key="index" :activeImage="item" />
  22. </view>
  23. <view class="product_all" v-if="active.activeType == '1'">
  24. <ProGood v-for="item in active.products" :key="item" :storeInfo="item" />
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import jumpMixins from '@/mixins/jumpMixins.js'
  31. import SpecialItem from './components/cm-special.vue'
  32. import ProGood from './components/procurement_good.vue'
  33. export default {
  34. components: {
  35. SpecialItem,
  36. ProGood
  37. },
  38. mixins: [jumpMixins],
  39. data() {
  40. return {
  41. skeletonShow: true,
  42. active: {}, // 活动数据
  43. refleshdata: {} // 刷新数据
  44. }
  45. },
  46. mounted() {},
  47. onLoad(options) {
  48. this.refleshdata = options
  49. this.specialInfo(options)
  50. },
  51. onPullDownRefresh() {
  52. this.skeletonShow = true
  53. this.specialInfo(this.refleshdata)
  54. uni.stopPullDownRefresh()
  55. },
  56. methods: {
  57. // 活动数据
  58. async specialInfo(options) {
  59. try {
  60. const { data } = await this.SpecialService.specialInfo({ organizeId: options.organizeId, activeId: options.jumpActiveId })
  61. this.active = data.active
  62. uni.setNavigationBarTitle({
  63. title: data.active.topic
  64. })
  65. this.skeletonShow = false
  66. } catch (error) {
  67. console.log('error', error)
  68. }
  69. },
  70. // 跳转活动商品列表
  71. activeProducts() {
  72. uni.navigateTo({
  73. url: '/pages/goods/active-product?activeImageId=' + this.active.activeImageVos[0].id
  74. })
  75. },
  76. }
  77. }
  78. </script>
  79. <style scoped lang="scss">
  80. .common_contant {
  81. height: 100%;
  82. box-sizing: border-box;
  83. }
  84. .img_big {
  85. width: 100vw;
  86. height: 100vh;
  87. }
  88. .product_all {
  89. background: #f7f7f7;
  90. display: flex;
  91. justify-content: space-between;
  92. flex-wrap: wrap;
  93. align-items: center;
  94. }
  95. </style>