activity-help.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <template>
  2. <view>
  3. <!-- 确认助力 -->
  4. <u-popup :show="activityShowClose" mode="center" round="30" @close="close" :closeable="true" overlayOpacity="0.5"
  5. @touchmove.prevent.stop>
  6. <view class="activityShow">
  7. <view class="activityShow-one">
  8. <image :src="avatar" mode="" class="activityShow-one-img"></image>
  9. </view>
  10. <view class="activityShow-two">
  11. <image src="../../static/activity/beijingtwo.png" mode="" class="activityShow-two-img"></image>
  12. <text class="activityShow-two-text ells-one">{{ nickName }}</text>
  13. </view>
  14. <view class="activityShow-three">邀请您一起免费抽奖</view>
  15. <image class="activityShow-four" src="../../static/activity/tupian.jpg" mode=""></image>
  16. <view class="activityShow-five">一起免费抽奖</view>
  17. <view class="activityShow-six">收下好意可以帮助好友完成抽奖助力</view>
  18. <view class="activityShow-sixtwo">您也可以获得一个免费抽奖机会</view>
  19. <view class="activityShow-seven" @click="activityHelp()">
  20. <image src="../../static/activity/yuanjiao.png" mode="" class="activityShow-seven-img"></image>
  21. <view class="activityShow-seven-view">收下好意</view>
  22. </view>
  23. </view>
  24. </u-popup>
  25. <!-- 助力成功 -->
  26. <u-popup :show="closeShow" mode="center" round="30" @close="close" :closeable="true" overlayOpacity="0.5"
  27. @touchmove.prevent.stop>
  28. <view class="closeShow">
  29. <view class="closeShow-one">
  30. <image class="closeShow-one-imgone" src="../../static/activity/beijing.png" mode=""></image>
  31. <image class="closeShow-one-imgtwo" src="../../static/activity/beijingtwo.png" mode=""></image>
  32. <view class="closeShow-one-view">助力成功!</view>
  33. <view class="closeShow-one-viewtwo">您已获得一个免费抽奖机会</view>
  34. </view>
  35. <view class="closeShow-two" @click="close()">
  36. <image class="closeShow-two-img" src="../../static/activity/yuanjiao.png" mode=""></image>
  37. <view class="closeShow-two-view">确定</view>
  38. </view>
  39. </view>
  40. </u-popup>
  41. </view>
  42. </template>
  43. <script>
  44. import env from '../../config/env.js'
  45. import $http from '@/utils/request.js'
  46. export default {
  47. name: "activity-help",
  48. props: {
  49. //显示与隐藏
  50. activityShow: {
  51. type: [Boolean],
  52. default: false
  53. },
  54. //邀请码
  55. inviteCode: {
  56. type: [String],
  57. default: {}
  58. },
  59. //活动id
  60. marketingId: {
  61. type: [String],
  62. default: {}
  63. },
  64. },
  65. data() {
  66. return {
  67. closeShow: false, //邀请助力成功隐藏
  68. activityShowClose:true,//邀请
  69. avatar: '', //用户头像
  70. nickName: '', //用户昵称
  71. };
  72. },
  73. created() {
  74. if(this.inviteCode){
  75. $http.post(`/api/v1/mp/user/marketing/userInfo/${this.inviteCode}`, {}).then(res=>{
  76. if(res.code == 0) {
  77. this.avatar = env.filePublic + res.data.avatar.split(',')[0] + '?imageView2/2/w/170'
  78. this.nickName = res.data.nickName
  79. }
  80. })
  81. }
  82. },
  83. methods: {
  84. //关闭
  85. close() {
  86. this.$emit('close')
  87. },
  88. //确定助力
  89. activityHelp() {
  90. uni.showLoading({
  91. title: '助力中'
  92. });
  93. $http.post('/api/v1/mp/user/marketing/help', {
  94. inviteCode: this.inviteCode,
  95. marketingId: this.marketingId
  96. }).then(res => {
  97. uni.hideLoading();
  98. if (res.code == 0) {
  99. this.closeShow = true
  100. this.activityShowClose = false
  101. } else if (res.code == 500) {
  102. uni.$u.toast(res.msg);
  103. this.close()
  104. } else {}
  105. })
  106. }
  107. },
  108. }
  109. </script>
  110. <style lang="scss" scoped>
  111. .activityShow {
  112. text-align: center;
  113. width: 600rpx;
  114. &-one {
  115. position: relative;
  116. &-img {
  117. position: absolute;
  118. top: -75rpx;
  119. left: 235rpx;
  120. height: 134rpx;
  121. width: 134rpx;
  122. border-radius: 100%;
  123. background-color: #FDFDFC;
  124. }
  125. }
  126. &-two {
  127. position: relative;
  128. margin-top: 25rpx;
  129. &-img {
  130. width: 198rpx;
  131. height: 48rpx;
  132. }
  133. &-text {
  134. width: 170rpx;
  135. position: absolute;
  136. left: 220rpx;
  137. top: 6rpx;
  138. font-size: 28rpx;
  139. color: #FDFDFC;
  140. font-weight: bold;
  141. text-align: center;
  142. }
  143. }
  144. &-three {
  145. font-size: 36rpx;
  146. font-weight: bold;
  147. color: #333;
  148. }
  149. &-four {
  150. width: 410rpx;
  151. height: 362rpx;
  152. }
  153. &-five {
  154. color: #FF8B0A;
  155. font-size: 73rpx;
  156. font-family: YouSheBiaoTiHei;
  157. font-weight: 400;
  158. }
  159. &-six {
  160. color: #F78B3C;
  161. font-size: 26rpx;
  162. margin: 10rpx 0 4rpx 0;
  163. }
  164. &-sixtwo {
  165. color: #F78B3C;
  166. font-size: 26rpx;
  167. margin-bottom: 10rpx;
  168. }
  169. &-seven {
  170. position: relative;
  171. &-img {
  172. width: 340rpx;
  173. height: 88rpx;
  174. margin-top: 20rpx;
  175. margin-bottom: 40rpx;
  176. }
  177. &-view {
  178. font-size: 34rpx;
  179. color: #FDFBFB;
  180. position: absolute;
  181. top: 40rpx;
  182. left: 235rpx;
  183. }
  184. }
  185. }
  186. .closeShow {
  187. text-align: center;
  188. width: 570rpx;
  189. height: 700rpx;
  190. &-one {
  191. &-imgone {
  192. width: 570rpx;
  193. height: 700rpx;
  194. }
  195. &-imgtwo {
  196. position: absolute;
  197. left: -42rpx;
  198. top: 235rpx;
  199. height: 160rpx;
  200. width: 670rpx;
  201. }
  202. &-view {
  203. font-size: 122rpx;
  204. font-family: YouSheBiaoTiHei;
  205. position: absolute;
  206. top: 235rpx;
  207. left: 55rpx;
  208. color: #fff;
  209. }
  210. &-viewtwo {
  211. font-size: 32rpx;
  212. position: absolute;
  213. top: 400rpx;
  214. left: 95rpx;
  215. color: #fff;
  216. }
  217. }
  218. &-two {
  219. position: relative;
  220. &-img {
  221. width: 340rpx;
  222. height: 88rpx;
  223. position: absolute;
  224. left: 130rpx;
  225. bottom: 70rpx;
  226. }
  227. &-view {
  228. font-size: 34rpx;
  229. color: #FDFBFB;
  230. position: absolute;
  231. left: 260rpx;
  232. bottom: 93rpx;
  233. }
  234. }
  235. }
  236. </style>