activity-help.vue 5.0 KB

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