luck_num_dialog.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <view class="cu-modal" :class="{ show: visible }">
  3. <view class="mask" @click="close"></view>
  4. <view class="cu-dialog" style="background-color: transparent; width: 100%">
  5. <view
  6. v-if="type === 1"
  7. class="relative wrapper"
  8. :style="'background-image:url(' + ossurl.welfare.luckNumBg + ')'"
  9. >
  10. <view class="luck_num">
  11. <view class="num_list">
  12. <view
  13. class="num_item"
  14. v-for="(item, index) in numList"
  15. :key="index"
  16. :style="'background-image:url(' + ossurl.welfare.luckNum + ')'"
  17. >
  18. <view class="text">{{ item.sign }}</view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. <view v-else class="relative share_wrapper">
  24. <!-- <image class="width100 height100" :src="ossurl.welfare.inviteRule" mode="widthFix" />
  25. <view class="share_btn">
  26. <button open-type="share" class="share-btn btn-clear"></button>
  27. </view> -->
  28. </view>
  29. </view>
  30. <view class="cancel">
  31. <view class="close" @click="close">
  32. <text class="cuIcon-close"></text>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import resource from '@/utils/resource'
  39. import store from '@/store'
  40. import ossurl from '@/utils/ossurl'
  41. export default {
  42. data() {
  43. return {
  44. ossurl,
  45. resource,
  46. visible: false,
  47. type: 2,
  48. roomId: null,
  49. numList: []
  50. }
  51. },
  52. onShareAppMessage(res) {
  53. const user = store.getters.user
  54. return {
  55. title: `参与房间 和我一起免费抢手办吧!`,
  56. path: `/pages/weal_detail/index?id=${this.roomId}&userId=${this.user.username}`,
  57. imageUrl: ossurl.welfare.roomShare
  58. }
  59. },
  60. methods: {
  61. show(type, roomId) {
  62. this.type = type
  63. this.roomId = roomId
  64. if (type === 1) this.getLuckNum()
  65. this.visible = true
  66. },
  67. close() {
  68. this.visible = false
  69. },
  70. submit() {
  71. this.visible = false
  72. this.$emit('success')
  73. },
  74. async getLuckNum() {
  75. const res = await this.$service.weal.lucknumList(this.roomId)
  76. this.numList = res.data
  77. }
  78. }
  79. }
  80. </script>
  81. <style lang="scss" scoped>
  82. .mask {
  83. position: absolute;
  84. left: 0;
  85. right: 0;
  86. top: 0;
  87. bottom: 0;
  88. }
  89. .wrapper {
  90. width: 554rpx;
  91. height: 794rpx;
  92. margin: 0 auto;
  93. background-size: 100% 100%;
  94. padding-top: 380rpx;
  95. }
  96. .share_wrapper {
  97. width: 686rpx;
  98. margin: 0 auto;
  99. .share_btn {
  100. position: relative;
  101. width: 380rpx;
  102. height: 80rpx;
  103. position: absolute;
  104. bottom: 120rpx;
  105. left: 50%;
  106. transform: translateX(-50%);
  107. }
  108. .share_x {
  109. position: absolute;
  110. top: 6rpx;
  111. right: 6rpx;
  112. }
  113. }
  114. .luck_num {
  115. padding: 20rpx;
  116. height: 330rpx;
  117. overflow: scroll;
  118. z-index: 99;
  119. .num_list {
  120. width: 100%;
  121. height: 100%;
  122. text-align: center;
  123. .num_item {
  124. display: inline-block;
  125. width: 344rpx;
  126. height: 92rpx;
  127. margin-bottom: 20rpx;
  128. background-size: 100% 100%;
  129. position: relative;
  130. .text {
  131. width: 100%;
  132. height: 100%;
  133. font-size: 44rpx;
  134. font-family: Source Han Sans, Source Han Sans;
  135. font-weight: 500;
  136. color: #352600;
  137. letter-spacing: 4px;
  138. line-height: 92rpx;
  139. text-align: center;
  140. }
  141. .img {
  142. position: absolute;
  143. top: 0;
  144. left: 0;
  145. z-index: -1;
  146. }
  147. }
  148. }
  149. }
  150. .confirm {
  151. position: absolute;
  152. bottom: 30rpx;
  153. right: 42rpx;
  154. }
  155. .x {
  156. width: 48rpx;
  157. height: 48rpx;
  158. }
  159. .share-btn {
  160. position: absolute;
  161. left: 0;
  162. right: 0;
  163. top: 0;
  164. bottom: 0;
  165. }
  166. .cancel {
  167. position: fixed;
  168. bottom: 360rpx;
  169. right: 50%;
  170. margin-right: -32rpx;
  171. z-index: 100;
  172. .close {
  173. position: absolute;
  174. right: 0;
  175. width: 64rpx;
  176. height: 64rpx;
  177. background: #d8d8d8;
  178. border-radius: 64rpx;
  179. color: #444444;
  180. top: 30rpx;
  181. line-height: 64rpx;
  182. font-size: 32rpx;
  183. text-align: center;
  184. }
  185. }
  186. </style>