prince_goods.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <view class="cu-modal" :class="{'show': visible}">
  3. <view class="prince-goods-mask" @click="close"></view>
  4. <view class="cu-dialog" style="background-color: transparent; width:100%">
  5. <view class="relative wrapper">
  6. <image :src="resource.prince_rank_bg" class="bg" mode="scaleToFill"/>
  7. <view class="flex-align-center">
  8. <image :src="resource.prince_goods_title" class="title" />
  9. </view>
  10. <view class="flex-wrap flex-align-between marginT27">
  11. <view v-for="item in list" :key="item.spuId" class="item" @click="showDetail(item.spu)">
  12. <image :src="resource.prince_goods_wrapper" class="goods-wrapper" />
  13. <image :src="item.spu.cover" mode="scaleToFill" class="image" />
  14. <image v-if="item.theNextFlag === 1" :src="resource.prince_next_flag" class="next-flag" />
  15. </view>
  16. </view>
  17. </view>
  18. <view class="paddingT30 flex-align-center">
  19. <image :src="resource.close" class="x" @click="close" />
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import resource from '@/utils/resource'
  26. import { LEVEL_MAP } from '@/utils/config'
  27. export default {
  28. props: {
  29. poolId: Number
  30. },
  31. data() {
  32. return {
  33. LEVEL_MAP,
  34. resource,
  35. list: [],
  36. visible: false,
  37. refreshing: false
  38. }
  39. },
  40. methods: {
  41. show() {
  42. this.$parent.$parent.$parent.lock = true
  43. this.visible = true
  44. this.getData()
  45. },
  46. close() {
  47. this.$parent.$parent.$parent.lock = false
  48. this.visible = false
  49. this.list = []
  50. },
  51. async getData() {
  52. const res = await this.$service.award.kingGoods(this.poolId)
  53. this.list = res || []
  54. },
  55. showDetail(spu) {
  56. this.$emit('showDetail', spu)
  57. }
  58. }
  59. }
  60. </script>
  61. <style lang="scss" scoped>
  62. .prince-goods-mask {
  63. position: absolute;
  64. left: 0;
  65. right: 0;
  66. top: 0;
  67. bottom: 0;
  68. }
  69. .wrapper {
  70. z-index: 1001;
  71. margin: 0 28rpx;
  72. position: relative;
  73. padding: 52rpx 28rpx 80rpx;
  74. background: rgba(0, 0, 0, 0.6);
  75. border-radius: 16rpx;
  76. .bg {
  77. position: absolute;
  78. left: 0;
  79. top: 0;
  80. width: 100%;
  81. height: 100%;
  82. }
  83. .title {
  84. width: 234rpx;
  85. height: 46rpx;
  86. }
  87. .item {
  88. width: 200rpx;
  89. height: 238rpx;
  90. position: relative;
  91. transform: scale(0.95);
  92. border-radius: 8rpx;
  93. overflow: hidden;
  94. .goods-wrapper {
  95. position: absolute;
  96. right: 0;
  97. top: 0;
  98. width: 100%;
  99. height: 100%;
  100. }
  101. .image {
  102. width: 200rpx;
  103. height: 238rpx;
  104. }
  105. .next-flag {
  106. position: absolute;
  107. right: 0;
  108. top: 0;
  109. width: 106rpx;
  110. height: 102rpx;
  111. }
  112. }
  113. }
  114. .x {
  115. width: 60rpx;
  116. height: 60rpx;
  117. }
  118. </style>