leo 1 год назад
Родитель
Сommit
86404a8f08

+ 28 - 29
pages/claimCloudPhone/components/bargainingAssistance.vue

@@ -32,13 +32,13 @@
           </div>
         </div>
         <div
-          :class="['package-btn', {end: +type === 7}]"
+          :class="['package-btn', { end: +type === 7 }]"
           :style="!+type ? 'margin-bottom: 24px;' : ''"
           @click="btnFun"
         >
           {{ btnName }}
         </div>
-        <div class="package-expire" v-if="+type && time">
+        <div class="package-expire" v-if="+type">
           免单失效时间:<van-count-down :time="time" />
         </div>
       </template>
@@ -112,7 +112,7 @@
                   <div>{{ item.diskName }}</div>
                   <div>{{ item.phoneTypeStr }}</div>
                   <div>{{ item.validTime }}天</div>
-                  <div>{{ ['', '购买', '续费'][item.dataType]}}</div>
+                  <div>{{ ['', '购买', '续费'][item.dataType] }}</div>
                 </div>
               </template>
             </loadList>
@@ -348,7 +348,7 @@ export default {
       },
       codeNumber: '获取验证码',
       loginLoading: false,
-      endVisible: false // 被邀请人活动结束弹窗
+      endVisible: false, // 被邀请人活动结束弹窗
     };
   },
   components: {
@@ -366,7 +366,7 @@ export default {
       sessionStorage.removeItem('invitedPhone');
       sessionStorage.removeItem('invitedCode');
     }
-    if (+this.type === 1 || +this.type === 2) {
+    if (+this.type === 1 || +this.type === 2 || +this.type === 7) {
       this.getRule();
       this.getAssistAwardRecode();
     }
@@ -378,9 +378,10 @@ export default {
   computed: {
     time() {
       const { validityPeriodTimeStamp = 0 } = this.info;
-      return validityPeriodTimeStamp
-        ? validityPeriodTimeStamp - this.systemTime * 1000
-        : 0;
+      let time= null
+      time = validityPeriodTimeStamp ? validityPeriodTimeStamp - this.systemTime * 1000 : 0
+      time = +this.type === 7 ? 0 : time
+      return time
     },
     btnName() {
       let name = null;
@@ -517,6 +518,17 @@ export default {
         .then(async (res) => {
           if (res.success) {
             this.info = res.data;
+            // 砍价记录、云机发放记录
+            if (
+              [1, 2, 7].includes(this.info.bargainingStatus) &&
+              this.$refs.assistRecodeList &&
+              this.$refs.assistGetPhoneRecode
+            ) {
+              this.$refs.assistRecodeList.data = [];
+              this.$refs.assistGetPhoneRecode.data = [];
+              this.$refs.assistRecodeList.list();
+              this.$refs.assistGetPhoneRecode.list();
+            }
             localStorage.setItem(
               'bargainingStatusInfo',
               JSON.stringify(this.info),
@@ -524,7 +536,7 @@ export default {
             // 如果是被邀请人就不需要走下面流程
             if (Object.keys(this.inviteeData).length) {
               // 被邀请人活动结束
-              if(res.data.bargainingStatus === 5) this.endVisible = true
+              if (res.data.bargainingStatus === 5) this.endVisible = true;
               return;
             }
 
@@ -571,16 +583,6 @@ export default {
                 });
               }
             }
-            if (
-              [1, 2].includes(this.info.bargainingStatus) &&
-              this.$refs.assistRecodeList &&
-              this.$refs.assistGetPhoneRecode
-            ) {
-              this.$refs.assistRecodeList.data = [];
-              this.$refs.assistGetPhoneRecode.data = [];
-              this.$refs.assistRecodeList.list();
-              this.$refs.assistGetPhoneRecode.list();
-            }
           }
         })
         .catch((error) => {
@@ -666,7 +668,7 @@ export default {
         });
     },
     btnFun() {
-      if(+this.type === 7) return
+      if (+this.type === 7) return;
       if (!+this.type) this.assistanceBool = true;
       if (+this.type) {
         switch (this.info.bargainingStatus) {
@@ -864,7 +866,7 @@ export default {
     },
     endConfirm() {
       location.href = 'https://www.androidscloud.com';
-    }
+    },
   },
 };
 </script>
@@ -997,8 +999,8 @@ export default {
       text-align: center;
       font-style: normal;
       // margin-bottom: 24px;
-      &.end{
-        opacity: .5;
+      &.end {
+        opacity: 0.5;
       }
     }
     .package-expire {
@@ -1518,11 +1520,8 @@ export default {
     background: transparent;
   }
 
-  ::v-deep .end-visible-dialog{
-  background: #fff !important;
-}
+  ::v-deep .end-visible-dialog {
+    background: #fff !important;
+  }
 }
-
-
-
 </style>

+ 13 - 0
pages/claimCloudPhone/components/setMealItem.vue

@@ -96,6 +96,12 @@ export default {
                 }
                 this.$router.push(url);
               } else {
+                if (res.data.bargainingStatus === 6) {
+                  setTimeout(() => {
+                    this.$toast('活动已到期');
+                  });
+                  return;
+                }
                 setTimeout(() => {
                   this.$toast('已参加正在砍价活动,请退出后重新进入');
                 });
@@ -110,6 +116,13 @@ export default {
       this.$emit('buy', data);
     },
   },
+  computed: {
+    list() {
+      this.data.mealList.length > 10
+        ? this.data.mealList.slice(0, 9)
+        : this.data.mealList;
+    },
+  },
 };
 </script>
 <style lang="less" scoped>

+ 0 - 1
pages/claimCloudPhone/index.vue

@@ -81,7 +81,6 @@ 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: