Procházet zdrojové kódy

修改好友助力部分

c4az6 před 4 roky
rodič
revize
fe87babcb3
1 změnil soubory, kde provedl 17 přidání a 23 odebrání
  1. 17 23
      src/views/activityCenter/friendHelp/friendHelp.vue

+ 17 - 23
src/views/activityCenter/friendHelp/friendHelp.vue

@@ -80,40 +80,37 @@
       async handleHelpClick() {
         let state = this.getUrlParams('state')
         console.log("state", state)
-        switch (state) {
-/*           case '0':
-            this.$toast('已关注的老用户,不可助力!')
-            break; */
-          case '1':
-            this.$toast('您已助力!')
-            break;
-          case '2': case '0':
-            this.isLoading = true
-            let obj = {}
-            obj.acjoinId = this.acjoinId
-            obj.unionid = this.getUrlParams('unionid')
-            const { data: response } = await reqHelper(obj)
-            if(response.success!==1) {
+
+        if (state === '1') {
+          this.$toast('您已助力')
+        } else if (state === '0' || state === '2') {
+          this.isLoading = true
+          let obj = {}
+          obj.acjoinId = this.acjoinId
+          obj.unionid = this.getUrlParams('unionid')
+          const { data: response } = await reqHelper(obj)
+          if (response.success !== 1) {
+            setTimeout(() => {
               this.$toast(response.message)
-              this.isLoading = false
+            }, 500);
+            console.log(response.message)
+            if (this.skiptype === 'view') {
               // 跳转H5网页
               setTimeout(() => {
                 window.location.href = this.pathlink
               }, 1000);
-              return
             }
+          } else {
             this.$toast('助力成功!')
-            this.isLoading = false
-            break
+          }
         }
+        this.isLoading = false
         // 跳转H5页面或者微信小程序
         if (this.skiptype === 'view') {
           // 跳转H5网页
           setTimeout(() => {
             window.location.href = this.pathlink
           }, 1000);
-        } else {
-          // 跳转微信小程序
         }
       }
     },
@@ -130,9 +127,6 @@
       })
     },
     created() {
-      console.log("comming...")
-      let state = this.getUrlParams('state')
-      console.log("state", state)
       this.acjoinId = this.getUrlParams('acjoinId')
       this.getActivityInfo()