good-activity.vue 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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]" 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. }
  44. },
  45. mounted() {},
  46. onLoad(options) {
  47. console.log(options)
  48. this.specialInfo(options)
  49. },
  50. methods: {
  51. // 活动数据
  52. async specialInfo(options) {
  53. try {
  54. const { data } = await this.SpecialService.specialInfo({ organizeId: options.organizeId, activeId: options.jumpActiveId })
  55. this.active = data.active
  56. uni.setNavigationBarTitle({
  57. title: data.active.topic
  58. })
  59. this.skeletonShow = false
  60. } catch (error) {
  61. console.log('error', error)
  62. }
  63. },
  64. // 跳转活动商品列表
  65. activeProducts() {
  66. uni.navigateTo({
  67. url: '/pages/goods/active-product?activeImageId=' + this.active.activeImageVos[0].id
  68. })
  69. },
  70. }
  71. }
  72. </script>
  73. <style scoped lang="scss">
  74. .common_contant {
  75. height: 100%;
  76. box-sizing: border-box;
  77. }
  78. .img_big {
  79. width: 100vw;
  80. height: 100vh;
  81. }
  82. .product_all {
  83. background: #f7f7f7;
  84. display: flex;
  85. justify-content: space-between;
  86. flex-wrap: wrap;
  87. align-items: center;
  88. }
  89. </style>