activity-help.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. console.log(this.marketingId);
  62. console.log(this.inviteCode);
  63. uni.showLoading({
  64. title: '助力中'
  65. });
  66. $http.post('/api/v1/mp/user/marketing/help', {
  67. inviteCode:this.inviteCode,
  68. marketingId: this.marketingId
  69. }).then(res => {
  70. uni.hideLoading();
  71. if(res.code == 0){
  72. this.closeShow = true
  73. }
  74. this.close()
  75. })
  76. }
  77. },
  78. }
  79. </script>
  80. <style lang="scss" scoped>
  81. </style>