doll_allPrize.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <view class="cu-modal" :class="{ show: visible }">
  3. <view class="rule-mask" @click="close"></view>
  4. <view class="cu-dialog" style="background-color: transparent; width: 100%">
  5. <view class="relative wrapper">
  6. <image :src="ossurl.welfare.toys.rewardBg" class="rule" />
  7. <view class="prize">
  8. <view class="prize_scroll">
  9. <view
  10. v-for="(item, index) in prizeList"
  11. :key="item.spuId"
  12. class="prize_item"
  13. :class="{ rightMar: (index + 1) % 3 == 0 }"
  14. >
  15. <view class="prize_img">
  16. <image :src="item.cover" class="width100 height100" mode="aspectFit"/>
  17. </view>
  18. <view class="prize_text line-ellipsis">{{ item.name }}</view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="paddingT30 flex-align-center">
  24. <view class="close cuIcon-close" @click="close"></view>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import ossurl from '@/utils/ossurl'
  31. export default {
  32. props: {
  33. luckKing: Object
  34. },
  35. data() {
  36. return {
  37. ossurl,
  38. visible: false,
  39. type: 5,
  40. prizeList: [] // 抽到的奖励
  41. }
  42. },
  43. methods: {
  44. show(data) {
  45. this.visible = true
  46. this.$parent.$parent.$parent.lock = true
  47. this.prizeList = data
  48. },
  49. close() {
  50. this.visible = false
  51. this.$parent.$parent.$parent.lock = false
  52. }
  53. }
  54. }
  55. </script>
  56. <style lang="scss" scoped>
  57. .rule-mask {
  58. position: absolute;
  59. left: 0;
  60. right: 0;
  61. top: 0;
  62. bottom: 0;
  63. }
  64. .close {
  65. width: 64rpx;
  66. height: 64rpx;
  67. background: #d8d8d8;
  68. font-size: 32rpx;
  69. text-align: center;
  70. line-height: 64rpx;
  71. color: #444;
  72. border-radius: 50%;
  73. }
  74. .wrapper {
  75. z-index: 1001;
  76. width: 652rpx;
  77. height: 904rpx;
  78. margin: 0 auto;
  79. .rule {
  80. width: 100%;
  81. height: 100%;
  82. }
  83. .prize {
  84. position: absolute;
  85. top: 157rpx;
  86. left: 54rpx;
  87. right: 54rpx;
  88. height: 715rpx;
  89. overflow-y: scroll;
  90. .prize_scroll {
  91. width: 100%;
  92. display: flex;
  93. flex-direction: row;
  94. flex-wrap: wrap;
  95. justify-content: flex-start;
  96. }
  97. .prize_item {
  98. width: 160rpx;
  99. height: 233rpx;
  100. margin-right: 20rpx;
  101. margin-top: 23rpx;
  102. .prize_img {
  103. width: 160rpx;
  104. height: 200rpx;
  105. }
  106. .prize_text {
  107. color: #B58100;
  108. margin-top: 12rpx;
  109. text-align: center;
  110. }
  111. }
  112. .rightMar {
  113. margin-right: 0;
  114. }
  115. }
  116. }
  117. </style>