activity-help.vue 5.8 KB

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