activity-help.vue 1.8 KB

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