Browse Source

Merge branch 'activityCenter'

c4az6 4 years ago
parent
commit
dc54a3e7d8

+ 18 - 20
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':
-            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
+            }, 1000);
+            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,6 +127,7 @@
       })
     },
     created() {
+      console.log("comming...")
       this.acjoinId = this.getUrlParams('acjoinId')
       this.getActivityInfo()
 

+ 5 - 2
src/views/activityCenter/friendHelp/myHelp.vue

@@ -157,7 +157,6 @@
         } catch (error) {
           if (error.message !== 'endIterative') throw error
         }
-        console.log(`下一个奖品的邀请人数以及奖品的索引位置: ${tempNum}, ${tempIndex}`)
         // maxInviteNum:最后一个奖品所需要邀请的人数
         if (this.inviteObj.helpcount >= this.maxInviteNum) {
           tempNum = this.maxInviteNum
@@ -194,7 +193,11 @@
         // 显示领取奖励弹窗
         const { data: response } = await reqJudgeMobileIsNull({ unionid: this.unionid })
         console.log("领取奖品,判断手机号接口: ", response)
-        if (!response.result) return window.location.href = `https://mem.360lj.com/ym/ymallWechat/code?redirectCode=activityIndex&id=${this.id}`
+        if(process.env.VUE_APP_Name == "测试环境" || process.env.VUE_APP_Name == "开发环境") {
+          if (!response.result) return window.location.href = `https://mem.360lj.com/ym2/ymallWechat/code?redirectCode=activityIndex&id=${this.id}`
+        }else {
+          if (!response.result) return window.location.href = `https://mem.360lj.com/ym/ymallWechat/code?redirectCode=activityIndex&id=${this.id}`
+        }
         this.getPrizeModal = true
       },
       // 监听立即邀请按钮点击事件