activity_dialog.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <view class="cu-modal" :class="{'show': visible}">
  3. <view class="mask" @click="close"></view>
  4. <view class=" cu-dialog task_dialog">
  5. <view class="relative wrapper">
  6. <image :src="resource.exchangeBgc" webp class="poster" mode="widthFix" />
  7. </view>
  8. <view class="content">
  9. <view class="text">兑换后您将获得:</view>
  10. <view class="img">
  11. <image class="img_con" :src="spuImg"></image>
  12. </view>
  13. <view>兑换后原有任务款即消耗,一经兑换无法找回,兑换后的奖品可在「仓库」中查看</view>
  14. <view class="btn">
  15. <view class="sub1" @click="close">我再想想</view>
  16. <view class="sub2" @click="submit">确定兑换</view>
  17. </view>
  18. </view>
  19. <view class="close">
  20. <image :src="resource.icon_close" class="x" @click="close" />
  21. </view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. import resource from '@/utils/resource'
  27. export default {
  28. data() {
  29. return {
  30. resource,
  31. visible: false,
  32. spuImg: '',
  33. hideTaskUserId: ''
  34. }
  35. },
  36. methods: {
  37. show(spuImg, taskId) {
  38. this.spuImg = spuImg
  39. this.visible = true
  40. this.hideTaskUserId = taskId
  41. },
  42. close() {
  43. this.visible = false
  44. },
  45. async submit() {
  46. await this.$service.award.hidetaskSynthesis(this.hideTaskUserId)
  47. .then(res => {
  48. this.$message.success('兑换成功!')
  49. this.visible = false
  50. this.$emit('refresh')
  51. })
  52. }
  53. }
  54. }
  55. </script>
  56. <style lang="scss" scoped>
  57. .show {
  58. z-index: 9999;
  59. }
  60. .mask {
  61. position: absolute;
  62. left: 0;
  63. right: 0;
  64. top: 0;
  65. bottom: 0;
  66. z-index: 9999;
  67. }
  68. .task_dialog {
  69. position: relative;
  70. height: 739rpx;
  71. width: 640rpx;
  72. margin: 0 55rpx;
  73. opacity: .9;
  74. background-color: #ffffff00;
  75. z-index: 10000;
  76. .wrapper {
  77. width: 100%;
  78. margin: 0 auto;
  79. position: relative;
  80. .poster {
  81. width: 100%;
  82. }
  83. }
  84. .content {
  85. position: absolute;
  86. bottom: 0;
  87. height: 572rpx;
  88. display: flex;
  89. flex-direction: column;
  90. flex-wrap: nowrap;
  91. align-items: center;
  92. justify-content: space-evenly;
  93. font-size: 28rpx;
  94. color: #fff;
  95. margin: 0 32rpx;
  96. text-align: center;
  97. z-index: 10002;
  98. .text {
  99. font-size: 32rpx;
  100. font-weight: 500;
  101. }
  102. .img {
  103. width: 320rpx;
  104. height: 247rpx;
  105. border: 2rpx soild #7f34f3;
  106. background-color: #f4ebff;
  107. border-radius: 15rpx;
  108. overflow: hidden;
  109. .img_con {
  110. width: 100%;
  111. height: 100%;
  112. }
  113. }
  114. .btn {
  115. display: flex;
  116. justify-content: space-between;
  117. width: 440rpx;
  118. .sub1 {
  119. width: 204rpx;
  120. height: 64rpx;
  121. line-height: 64rpx;
  122. background: linear-gradient(270deg, #34A7F9 0%, #10CBD4 100%);
  123. border-radius: 44rpx;
  124. }
  125. .sub2 {
  126. width: 204rpx;
  127. height: 64rpx;
  128. line-height: 64rpx;
  129. background: linear-gradient(90deg, #EB9466 0%, #EB3C65 100%);
  130. border-radius: 44rpx;
  131. }
  132. }
  133. }
  134. .close {
  135. position: absolute;
  136. top: 32rpx;
  137. right: 32rpx;
  138. z-index: 10002;
  139. .x {
  140. width: 60rpx;
  141. height: 60rpx;
  142. }
  143. }
  144. }
  145. </style>