activity-help.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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();exChange()">
  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. setTimeout(()=>{
  103. uni.$u.toast(res.msg);
  104. },500)
  105. this.close()
  106. } else {}
  107. })
  108. },
  109. exChange() {
  110. this.$emit('exChange')
  111. },
  112. },
  113. }
  114. </script>
  115. <style lang="scss" scoped>
  116. .activityShow {
  117. text-align: center;
  118. width: 600rpx;
  119. &-one {
  120. position: relative;
  121. &-img {
  122. position: absolute;
  123. top: -75rpx;
  124. left: 235rpx;
  125. height: 134rpx;
  126. width: 134rpx;
  127. border-radius: 100%;
  128. background-color: #FDFDFC;
  129. }
  130. }
  131. &-two {
  132. position: relative;
  133. margin-top: 25rpx;
  134. &-img {
  135. width: 198rpx;
  136. height: 48rpx;
  137. }
  138. &-text {
  139. width: 170rpx;
  140. position: absolute;
  141. left: 220rpx;
  142. top: 6rpx;
  143. font-size: 28rpx;
  144. color: #FDFDFC;
  145. font-weight: bold;
  146. text-align: center;
  147. }
  148. }
  149. &-three {
  150. font-size: 36rpx;
  151. font-weight: bold;
  152. color: #333;
  153. }
  154. &-four {
  155. width: 410rpx;
  156. height: 362rpx;
  157. }
  158. &-five {
  159. color: #FF8B0A;
  160. font-size: 73rpx;
  161. font-family: YouSheBiaoTiHei;
  162. font-weight: 400;
  163. }
  164. &-six {
  165. color: #F78B3C;
  166. font-size: 26rpx;
  167. margin: 10rpx 0 4rpx 0;
  168. }
  169. &-sixtwo {
  170. color: #F78B3C;
  171. font-size: 26rpx;
  172. margin-bottom: 10rpx;
  173. }
  174. &-seven {
  175. position: relative;
  176. &-img {
  177. width: 340rpx;
  178. height: 88rpx;
  179. margin-top: 20rpx;
  180. margin-bottom: 40rpx;
  181. }
  182. &-view {
  183. font-size: 34rpx;
  184. color: #FDFBFB;
  185. position: absolute;
  186. top: 40rpx;
  187. left: 235rpx;
  188. }
  189. }
  190. }
  191. .closeShow {
  192. text-align: center;
  193. width: 570rpx;
  194. height: 700rpx;
  195. &-one {
  196. &-imgone {
  197. width: 570rpx;
  198. height: 700rpx;
  199. }
  200. &-imgtwo {
  201. position: absolute;
  202. left: -42rpx;
  203. top: 235rpx;
  204. height: 160rpx;
  205. width: 670rpx;
  206. }
  207. &-view {
  208. font-size: 122rpx;
  209. font-family: YouSheBiaoTiHei;
  210. position: absolute;
  211. top: 235rpx;
  212. left: 55rpx;
  213. color: #fff;
  214. }
  215. &-viewtwo {
  216. font-size: 32rpx;
  217. position: absolute;
  218. top: 400rpx;
  219. left: 95rpx;
  220. color: #fff;
  221. }
  222. }
  223. &-two {
  224. position: relative;
  225. &-img {
  226. width: 340rpx;
  227. height: 88rpx;
  228. position: absolute;
  229. left: 130rpx;
  230. bottom: 70rpx;
  231. }
  232. &-view {
  233. font-size: 34rpx;
  234. color: #FDFBFB;
  235. position: absolute;
  236. left: 260rpx;
  237. bottom: 93rpx;
  238. }
  239. }
  240. }
  241. </style>