goods.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <view class="container">
  3. <view class="prizes">
  4. <image class="title" :src="'https://file.rongcyl.cn/festatic/bkm/imgv2/first/title.png'" mode="widthFix"></image>
  5. <view class="prizesList" v-for="(item, index) in prizeList">
  6. <image class="bk" :src="'https://file.rongcyl.cn/festatic/bkm/imgv2/first/bk2.png'" mode="scaleToFill"></image>
  7. <view class="prizesTitle">
  8. {{ $selectDictLabel(rewardType, item.type) }}
  9. </view>
  10. <view class="prizesImgOne" v-if="item.type == 22">
  11. <view class="image" v-for="(item2, index2) in item.prizeList" @click="showImg(item2)">
  12. <image :class="item2.leftNum == 0 ? '' : ''" :src="item2.icon" mode="heightFix"></image>
  13. </view>
  14. </view>
  15. <view class="prizesImg" v-else>
  16. <view class="image" v-for="(item2, index2) in item.prizeList" @click="showImg(item2)">
  17. <image :class="item2.leftNum == 0 ? '' : ''" :src="item2.icon" mode="heightFix"></image>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. <imgPopup ref="imgPopup" />
  23. </view>
  24. </template>
  25. <script>
  26. import imgPopup from '@/component/imgPopup.vue'
  27. import { rewardType } from '@/utils/commonConfig.js'
  28. import { prizeListApi } from '@/api/drawCard.js'
  29. export default {
  30. data() {
  31. return {
  32. rewardType: rewardType,
  33. params: {
  34. raffleId: null,
  35. },
  36. prizeList: [],
  37. }
  38. },
  39. components: {
  40. imgPopup,
  41. },
  42. onLoad(query) {
  43. if (query.raffleId) {
  44. this.params.raffleId = query.raffleId
  45. this.getPrizeList()
  46. }
  47. },
  48. onShow() {},
  49. methods: {
  50. showImg(value) {
  51. this.$refs.imgPopup.show(value)
  52. },
  53. getPrizeList() {
  54. prizeListApi(this.params).then(res => {
  55. console.log(res, '奖池预览')
  56. this.prizeList = res.data
  57. })
  58. },
  59. },
  60. }
  61. </script>
  62. <style scoped lang="scss">
  63. .container {
  64. background: #9ec8f9;
  65. padding-top: 15px;
  66. overflow: auto;
  67. }
  68. .prizes {
  69. .title {
  70. width: 103px;
  71. margin: 0 auto;
  72. }
  73. .prizesList {
  74. margin: 20px;
  75. position: relative;
  76. overflow: hidden;
  77. // z-index: 5;
  78. .bk {
  79. width: 100%;
  80. height: 100%;
  81. position: absolute;
  82. top: 0;
  83. }
  84. .prizesTitle {
  85. position: relative;
  86. height: 30px;
  87. line-height: 30px;
  88. width: 100%;
  89. margin-left: 1px;
  90. margin-top: 15px;
  91. padding-left: 15px;
  92. color: #fff;
  93. font-weight: 800;
  94. background: linear-gradient(90deg, rgba(89, 166, 255, 0.8) 0%, rgba(158, 200, 249, 0) 100%);
  95. }
  96. .prizesImg {
  97. position: relative;
  98. display: grid;
  99. grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
  100. margin: 15px;
  101. white-space: wrap;
  102. text-align: center;
  103. // overflow: auto;
  104. .image {
  105. text-align: center;
  106. image {
  107. display: inline-block;
  108. width: 20vw;
  109. height: 20vw;
  110. // border-radius: 10px;
  111. margin: 0 5px;
  112. }
  113. }
  114. }
  115. .prizesImgOne {
  116. position: relative;
  117. display: flex;
  118. justify-content: center;
  119. margin: 15px;
  120. .image {
  121. text-align: center;
  122. image {
  123. display: inline-block;
  124. width: 45vw;
  125. height: 45vw;
  126. border-radius: 10px;
  127. margin: 0 5px;
  128. }
  129. }
  130. }
  131. }
  132. }
  133. </style>