Ver código fonte

bugfix:处理已知bug

leo 1 ano atrás
pai
commit
71791a137f

+ 34 - 1
pages/claimCloudPhone/components/bargainingAssistance.vue

@@ -94,6 +94,7 @@
             <div>云机名称</div>
             <div>套餐类型</div>
             <div>云机时长</div>
+            <div>购买类型</div>
           </div>
           <div>
             <loadList
@@ -111,6 +112,7 @@
                   <div>{{ item.diskName }}</div>
                   <div>{{ item.phoneTypeStr }}</div>
                   <div>{{ item.validTime }}天</div>
+                  <div>{{ ['', '购买', '续费'][item.dataType]}}</div>
                 </div>
               </template>
             </loadList>
@@ -255,6 +257,21 @@
         </div>
       </div>
     </van-dialog>
+    <van-dialog
+      v-model="endVisible"
+      confirmButtonText="下载云机,尽享新人优惠"
+      confirmButtonColor="#169bd5"
+      @confirm="endConfirm"
+      style="background: #fff"
+      class="end-visible-dialog"
+    >
+      <div style="text-align: center; padding: 10px; color: #999">
+        感谢您对我们应用的支持和参与。<br />
+        我们的活动已经结束了,<br />
+        但是我们会不断努力,<br />
+        为您带来更多精彩的活动和内容。<br />
+      </div>
+    </van-dialog>
     <Verify
       @success="success"
       mode="pop"
@@ -331,6 +348,7 @@ export default {
       },
       codeNumber: '获取验证码',
       loginLoading: false,
+      endVisible: false // 被邀请人活动结束弹窗
     };
   },
   components: {
@@ -485,7 +503,9 @@ export default {
           duration: 0,
         });
       }
-      const params = {};
+      const params = {
+        operateActivityId: localStorage.getItem('auth.operateActivityId'),
+      };
       if (Object.keys(this.inviteeData).length) {
         params.userLaunchId = this.inviteeData.userLaunchId;
       }
@@ -503,6 +523,8 @@ export default {
             );
             // 如果是被邀请人就不需要走下面流程
             if (Object.keys(this.inviteeData).length) {
+              // 被邀请人活动结束
+              if(res.data.bargainingStatus === 5) this.endVisible = true
               return;
             }
 
@@ -512,6 +534,7 @@ export default {
                 break;
               case 4: // 失败,领取下一台云机界面
                 this.expireVisible = true;
+                return;
               case 7: // 活动已结束
                 return;
             }
@@ -839,6 +862,9 @@ export default {
           this.$toast.clear();
         });
     },
+    endConfirm() {
+      location.href = 'https://www.androidscloud.com';
+    }
   },
 };
 </script>
@@ -1491,5 +1517,12 @@ export default {
   ::v-deep .phone-container {
     background: transparent;
   }
+
+  ::v-deep .end-visible-dialog{
+  background: #fff !important;
+}
 }
+
+
+
 </style>

+ 9 - 5
pages/claimCloudPhone/components/setMealItem.vue

@@ -82,19 +82,23 @@ export default {
     add(data) {
       if (this.type) {
         this.$axios
-          .$get('activity/v5/assist/bargaining/current/bargainingStatus')
+          .$get('activity/v5/assist/bargaining/current/bargainingStatus', {
+            params: {
+              operateActivityId: localStorage.getItem('auth.operateActivityId'),
+            },
+          })
           .then((res) => {
             if (res.success) {
               if (!res.data.bargainingStatus) {
-                let url =  '/claimCloudPhone/1?menuRuleId=' + data.id
-                if(this.$route.query.userCardId) {
-                  url += `&userCardId=${this.$route.query.userCardId}`
+                let url = '/claimCloudPhone/1?menuRuleId=' + data.id;
+                if (this.$route.query.userCardId) {
+                  url += `&userCardId=${this.$route.query.userCardId}`;
                 }
                 this.$router.push(url);
               } else {
                 setTimeout(() => {
                   this.$toast('已参加正在砍价活动,请退出后重新进入');
-                })
+                });
               }
             }
           })

+ 10 - 19
pages/claimCloudPhone/index.vue

@@ -7,20 +7,6 @@
       <img src="@/assets/image/point.png" alt="" class="point" />
     </div>
     <div class="loader" v-else></div>
-    <van-dialog
-      v-model="visible"
-      confirmButtonText="下载云机,尽享新人优惠"
-      confirmButtonColor="#169bd5"
-      close-on-click-overlay
-      @confirm="confirm"
-    >
-      <div style="text-align: center; padding: 10px; color: #999">
-        感谢您对我们应用的支持和参与。<br />
-        我们的活动已经结束了,<br />
-        但是我们会不断努力,<br />
-        为您带来更多精彩的活动和内容。<br />
-      </div>
-    </van-dialog>
   </div>
 </template>
 
@@ -42,7 +28,6 @@ export default {
     if (this.$userAgent.isWx && !this.$userAgent.isMiniProgram) {
       return;
     }
-
     const {
       invitationUserName,
       operateActivityId,
@@ -51,7 +36,9 @@ export default {
     } = this.$route.query;
     if (invitationUserName && operateActivityId && userLaunchId) {
       // 删除旧的token
-      localStorage.removeItem('auth._token.password');
+      setTimeout(() => {
+        localStorage.removeItem('auth._token.password');
+      })
       // 如果有这个说明被邀请人
       localStorage.setItem('auth.inviteeNum', 1);
       // 活动Id
@@ -94,6 +81,7 @@ export default {
               'bargainingStatusInfo',
               JSON.stringify(res.data),
             );
+            console.log(res.data.bargainingStatus)
             // bargainingStatus 0 :选择云机界面  1:砍一刀界面 2;邀请好友页面 3:成功,领取下一台云机界面  4:失败,领取下一台云机界面  5:跳官网 6:活动结束选择云手机 7 是到活动页,活动结束
             switch (res.data.bargainingStatus) {
               case 0:
@@ -114,11 +102,14 @@ export default {
                 break;
             }
           }
+        })
+        .catch((error) => {
+          this.$toast(error.message);
+          setTimeout(() => {
+            this.leaveFun();
+          }, 1000);
         });
     },
-    confirm() {
-      location.href = 'https://www.androidscloud.com';
-    },
   },
 };
 </script>

+ 6 - 1
pages/claimCloudPhone/mixins/common.js

@@ -3,6 +3,7 @@ export default {
     data() {
         return {
             packageList: [], // 邀请人被邀请人选择的套餐
+            visible: false
         }
     },
     mounted() {
@@ -21,7 +22,11 @@ export default {
             this.$axios.$post('activity/v5/assist/bargaining/getActivitySortRuleAndActivityMealList', data).then(res => {
                 console.log(res)
                 if (res.success) {
-                    this.packageList = res.data
+                    if (obj.userCardId && !res.data[0]?.mealList?.length) {
+                        this.visible = true
+                        return
+                    }
+                    this.packageList = res.data || []
                 }
             }).finally(() => {
                 this.$toast.clear();

+ 14 - 2
pages/claimCloudPhone/zeroYuanClaim.vue

@@ -16,6 +16,18 @@
         </template>
       </div>
     </div>
+    <van-dialog
+      v-model="visible"
+      confirmButtonText="返回上一页"
+      confirmButtonColor="#169bd5"
+      close-on-click-overlay
+      @confirm="$router.go(-1)"
+    >
+      <div style="text-align: center; padding: 10px; color: #999">
+        很抱歉<br />
+        您的套餐不支持此活动进行续费
+      </div>
+    </van-dialog>
   </layout>
 </template>
 
@@ -33,12 +45,12 @@ export default {
   components: { layout, setMealItem },
   data() {
     return {
-      isNavBar: true
+      isNavBar: true,
     };
   },
   mounted() {
     const { userCardId, inviteeExits = 0 } = this.$route.query;
-    this.isNavBar = !(+inviteeExits)
+    this.isNavBar = !+inviteeExits;
     const obj = {
       personnelMealType: 1,
     };