浏览代码

bugfix:优化被邀请人、邀请人进入页面交互

leo 1 年之前
父节点
当前提交
3edb592b75

+ 13 - 5
pages/claimCloudPhone/chooseCloudPhone.vue

@@ -64,14 +64,18 @@ export default {
       loading: false,
       listLoading: false,
       isNavBar: true,
-      info: {}
+      info: {},
     };
   },
   mounted() {
-    if(localStorage.getItem('bargainingStatusInfo')) {
-      this.info = JSON.parse(localStorage.getItem('bargainingStatusInfo'))
+    if (+sessionStorage.getItem('activityEmd')) {
+      this.$toast('活动已到期');
+      return;
     }
-    this.isNavBar = !(+localStorage.getItem('auth.inviteeNum'))
+    if (localStorage.getItem('bargainingStatusInfo')) {
+      this.info = JSON.parse(localStorage.getItem('bargainingStatusInfo'));
+    }
+    this.isNavBar = !+localStorage.getItem('auth.inviteeNum');
     _self = this;
     // 用来监听微信返回上一页的
     const { exit } = this.$route.query;
@@ -85,6 +89,10 @@ export default {
   methods: {
     // 选增新增云手机 of 续费云手机
     selectJumpPhone(item) {
+      if (+sessionStorage.getItem('activityEmd')) {
+        this.$toast('活动已到期');
+        return;
+      }
       if (item === 2) {
         this.ids = [];
         this.visible = true;
@@ -127,7 +135,7 @@ export default {
     load() {
       this.pageNum++;
       this.getRenewalPackage(false);
-    }
+    },
   },
 };
 </script>

+ 27 - 18
pages/claimCloudPhone/components/bargainingAssistance.vue

@@ -32,17 +32,11 @@
           </div>
         </div>
         <div
-          class="package-btn"
+          :class="['package-btn', {end: +type === 7}]"
           :style="!+type ? 'margin-bottom: 24px;' : ''"
           @click="btnFun"
         >
-          {{
-            +type
-              ? info.bargainingStatus === 1
-                ? `继续砍价${info.remainingQuantity || 0}次`
-                : '邀请好友助力免单'
-              : '帮他助力'
-          }}
+          {{ btnName }}
         </div>
         <div class="package-expire" v-if="+type && time">
           免单失效时间:<van-count-down :time="time" />
@@ -79,12 +73,12 @@
                   <div v-if="item.assistType === 1">
                     道具砍掉<span>{{ item.assistPrice }}元</span>
                   </div>
-                  <div v-else-if="item.assistType === 2 || item.assistType === 3">
+                  <div
+                    v-else-if="item.assistType === 2 || item.assistType === 3"
+                  >
                     为您砍价<span>{{ item.assistPrice }}元</span>
                   </div>
-                  <div v-else>
-                    为您加油打气
-                  </div>
+                  <div v-else>为您加油打气</div>
                 </div>
               </div>
             </template>
@@ -370,6 +364,19 @@ export default {
         ? validityPeriodTimeStamp - this.systemTime * 1000
         : 0;
     },
+    btnName() {
+      let name = null;
+      if (+this.type === 7) {
+        name = '活动已到期';
+      } else {
+        name = +this.type
+          ? this.info.bargainingStatus === 1
+            ? `继续砍价${this.info.remainingQuantity || 0}次`
+            : '邀请好友助力免单'
+          : '帮他助力';
+      }
+      return name;
+    },
   },
   methods: {
     // 轮播活动参加的人的信息
@@ -505,7 +512,8 @@ export default {
                 break;
               case 4: // 失败,领取下一台云机界面
                 this.expireVisible = true;
-                break;
+              case 7: // 活动已结束
+                return;
             }
 
             const data = await this.getSystemTime();
@@ -635,6 +643,7 @@ export default {
         });
     },
     btnFun() {
+      if(+this.type === 7) return
       if (!+this.type) this.assistanceBool = true;
       if (+this.type) {
         switch (this.info.bargainingStatus) {
@@ -658,10 +667,7 @@ export default {
                   if (this.$userAgent.isSzx || this.$userAgent.isSzxBrowser) {
                     this.$native.share(shareInfo);
                   } else {
-                    if (
-                      this.$userAgent.isIos &&
-                      !this.$userAgent.isWx
-                    ) {
+                    if (this.$userAgent.isIos && !this.$userAgent.isWx) {
                       await this.$native.clipboard.writeText(res.data.link);
                       setTimeout(() => {
                         this.$toast.success('链接复制成功');
@@ -965,6 +971,9 @@ export default {
       text-align: center;
       font-style: normal;
       // margin-bottom: 24px;
+      &.end{
+        opacity: .5;
+      }
     }
     .package-expire {
       margin-top: 12px;
@@ -1040,7 +1049,7 @@ export default {
       &::-webkit-scrollbar {
         display: none !important; /* 对于 Chrome, Safari 和 Opera 隐藏滚动条 */
       }
-      .van-empty {
+      ::v-deep .van-empty {
         padding: 0 !important;
       }
     }

+ 39 - 4
pages/claimCloudPhone/index.vue

@@ -4,9 +4,23 @@
       style="height: 100%; width: 100%; background: #000; position: relative"
       v-if="$userAgent.isWx && !$userAgent.isMiniProgram"
     >
-    <img src="@/assets/image/point.png" alt="" class="point">
+      <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>
 
@@ -20,7 +34,9 @@ export default {
   },
   mixins: [common],
   data() {
-    return {};
+    return {
+      visible: false,
+    };
   },
   mounted() {
     if (this.$userAgent.isWx && !this.$userAgent.isMiniProgram) {
@@ -60,9 +76,17 @@ export default {
   },
   methods: {
     bargainingStatus() {
+      const { operateActivityId, bool = 0 } = this.$route.query;
+      let params = {};
+      if (+bool || (!+bool && operateActivityId)) {
+        params.operateActivityId = localStorage.getItem(
+          'auth.operateActivityId',
+        );
+      }
       this.$axios
         .$get('activity/v5/assist/bargaining/current/bargainingStatus', {
           headers: this.headers,
+          params,
         })
         .then((res) => {
           if (res.success) {
@@ -70,11 +94,19 @@ export default {
               'bargainingStatusInfo',
               JSON.stringify(res.data),
             );
-            // bargainingStatus 0 :选择云机界面  1:砍一刀界面 2;邀请好友页面 3:成功,领取下一台云机界面  4:失败,领取下一台云机界面
+            // bargainingStatus 0 :选择云机界面  1:砍一刀界面 2;邀请好友页面 3:成功,领取下一台云机界面  4:失败,领取下一台云机界面  5:跳官网 6:活动结束选择云手机 7 是到活动页,活动结束
             switch (res.data.bargainingStatus) {
               case 0:
+              case 6:
+                sessionStorage.setItem(
+                  'activityEmd',
+                  res.data.bargainingStatus,
+                );
                 this.$router.replace('/claimCloudPhone/chooseCloudPhone');
                 break;
+              case 5:
+                this.visible = true;
+                break;
               default:
                 this.$router.replace(
                   '/claimCloudPhone/' + res.data.bargainingStatus,
@@ -84,6 +116,9 @@ export default {
           }
         });
     },
+    confirm() {
+      location.href = 'https://www.androidscloud.com';
+    },
   },
 };
 </script>
@@ -94,7 +129,7 @@ export default {
   height: 100%;
   width: 100%;
 }
-.point{
+.point {
   position: absolute;
   top: 5%;
   right: 5%;