activity-help.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. } else {
  68. uni.$u.toast(res.msg);
  69. this.close()
  70. }
  71. })
  72. }
  73. },
  74. }
  75. </script>
  76. <style lang="scss" scoped>
  77. </style>