activity-help.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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.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="30" @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. activityShowClose:true,//邀请
  67. avatar: '', //用户头像
  68. nickName: '', //用户昵称
  69. };
  70. },
  71. created() {
  72. if(this.inviteCode){
  73. $http.post(`/api/v1/mp/user/marketing/userInfo/${this.inviteCode}`, {}).then(res=>{
  74. if(res.code == 0) {
  75. this.avatar = env.filePublic + res.data.avatar.split(',')[0] + '?imageView2/2/w/170'
  76. this.nickName = res.data.nickName
  77. }
  78. })
  79. }
  80. },
  81. methods: {
  82. //关闭
  83. close() {
  84. this.$emit('close')
  85. },
  86. //确定助力
  87. activityHelp() {
  88. uni.showLoading({
  89. title: '助力中'
  90. });
  91. $http.post('/api/v1/mp/user/marketing/help', {
  92. inviteCode: this.inviteCode,
  93. marketingId: this.marketingId
  94. }).then(res => {
  95. uni.hideLoading();
  96. if (res.code == 0) {
  97. this.closeShow = true
  98. this.activityShowClose = false
  99. } else if (res.code == 500) {
  100. uni.$u.toast(res.msg);
  101. this.close()
  102. } else {}
  103. })
  104. }
  105. },
  106. }
  107. </script>
  108. <style lang="scss" scoped>
  109. .activityShow {
  110. text-align: center;
  111. width: 600rpx;
  112. &-one {
  113. position: relative;
  114. &-img {
  115. position: absolute;
  116. top: -75rpx;
  117. left: 235rpx;
  118. height: 134rpx;
  119. width: 134rpx;
  120. border-radius: 100%;
  121. background-color: #FDFDFC;
  122. }
  123. }
  124. &-two {
  125. position: relative;
  126. margin-top: 25rpx;
  127. &-img {
  128. width: 198rpx;
  129. height: 48rpx;
  130. }
  131. &-text {
  132. width: 170rpx;
  133. position: absolute;
  134. left: 220rpx;
  135. top: 6rpx;
  136. font-size: 28rpx;
  137. color: #FDFDFC;
  138. font-weight: bold;
  139. text-align: center;
  140. }
  141. }
  142. &-three {
  143. font-size: 36rpx;
  144. font-weight: bold;
  145. color: #333;
  146. }
  147. &-four {
  148. width: 410rpx;
  149. height: 362rpx;
  150. }
  151. &-five {
  152. color: #FF8B0A;
  153. font-size: 73rpx;
  154. font-family: YouSheBiaoTiHei;
  155. font-weight: 400;
  156. }
  157. &-six {
  158. color: #F78B3C;
  159. font-size: 26rpx;
  160. line-height: 60rpx;
  161. }
  162. &-seven {
  163. position: relative;
  164. &-img {
  165. width: 340rpx;
  166. height: 88rpx;
  167. margin-top: 20rpx;
  168. margin-bottom: 40rpx;
  169. }
  170. &-view {
  171. font-size: 34rpx;
  172. color: #FDFBFB;
  173. position: absolute;
  174. top: 40rpx;
  175. left: 235rpx;
  176. }
  177. }
  178. }
  179. .closeShow {
  180. text-align: center;
  181. width: 570rpx;
  182. height: 700rpx;
  183. &-one {
  184. &-imgone {
  185. width: 570rpx;
  186. height: 700rpx;
  187. }
  188. &-imgtwo {
  189. position: absolute;
  190. left: -42rpx;
  191. top: 235rpx;
  192. height: 160rpx;
  193. width: 670rpx;
  194. }
  195. &-view {
  196. font-size: 122rpx;
  197. font-family: YouSheBiaoTiHei;
  198. position: absolute;
  199. top: 235rpx;
  200. left: 55rpx;
  201. color: #fff;
  202. }
  203. }
  204. &-two {
  205. position: relative;
  206. &-img {
  207. width: 340rpx;
  208. height: 88rpx;
  209. position: absolute;
  210. left: 130rpx;
  211. bottom: 70rpx;
  212. }
  213. &-view {
  214. font-size: 34rpx;
  215. color: #FDFBFB;
  216. position: absolute;
  217. left: 260rpx;
  218. bottom: 93rpx;
  219. }
  220. }
  221. }
  222. </style>