activity-help.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <view>
  3. <!-- 确认助力 -->
  4. <u-popup :show="activityShow" mode="center" round="17" @close="close" :closeable="true" overlayOpacity="0.5" @touchmove.prevent.stop>
  5. <view class="choiceShow-wrap">
  6. <view style="width: 400rpx; height: 400rpx;line-height: 400rpx; text-align: center;">
  7. 是否帮好友助力
  8. </view>
  9. <button @click="activityHelp()">确定助力</button>
  10. </view>
  11. </u-popup>
  12. <!-- 助力成功 -->
  13. <u-popup :show="closeShow" mode="center" round="17" @close="close" :closeable="true" overlayOpacity="0.5" @touchmove.prevent.stop>
  14. <view class="choiceShow-wrap">
  15. <view style="width: 400rpx; height: 400rpx;line-height: 400rpx; text-align: center;">
  16. 助力成功
  17. </view>
  18. <button @click="close()">取消</button>
  19. </view>
  20. </u-popup>
  21. </view>
  22. </template>
  23. <script>
  24. import env from '../../config/env.js'
  25. import $http from '@/utils/request.js'
  26. export default {
  27. name:"activity-help",
  28. props: {
  29. //显示与隐藏
  30. activityShow: {
  31. type: [Boolean],
  32. default: false
  33. },
  34. //邀请码
  35. inviteCode: {
  36. type: [String],
  37. default: {}
  38. },
  39. //活动id
  40. marketingId: {
  41. type: [String],
  42. default: {}
  43. },
  44. },
  45. data() {
  46. return {
  47. closeShow: false,//邀请助力成功隐藏
  48. };
  49. },
  50. methods: {
  51. //关闭
  52. close() {
  53. this.$emit('close')
  54. },
  55. //确定助力
  56. activityHelp() {
  57. uni.showLoading({
  58. title: '助力中'
  59. });
  60. $http.post('/api/v1/mp/user/marketing/help', {
  61. inviteCode:this.inviteCode,
  62. marketingId: this.marketingId
  63. }).then(res => {
  64. uni.hideLoading();
  65. if(res.code == 0){
  66. this.closeShow = true
  67. }
  68. this.close()
  69. })
  70. }
  71. },
  72. }
  73. </script>
  74. <style lang="scss" scoped>
  75. </style>