Ver código fonte

Merge pull request #234 from John-Hong/John/John/release-2.16.0/KIP-11611

fix(KIP-11611): [DE][C端]临时停车,公众号入口,拒绝登陆以后,会跳两次登录页
Tron 1 ano atrás
pai
commit
a05882ba56

+ 31 - 21
src/pages/parkingFee/mixins/parkingReceipt/parkingReceipt.js

@@ -56,7 +56,9 @@ export default {
         2: {
           name:'开票中'
         }
-      }
+      },
+      // 用户拒绝登录
+      userStopLogin: false
     };
   },
   components: {
@@ -119,6 +121,13 @@ export default {
     }, 500)
     const invoiceindex = Number.parseInt(uni.getStorageSync('invoiceindex') || 1)
     this.$store.dispatch('clearUnlicensed');
+    // 如果是公众号访问的话,并且未登录, 除浦东静安之外,都不加载数据
+    if (this.$route.query.parkingFeeIsLogin === 'loginDenied') {
+      this.userStopLogin = ['JINGAN', 'PUDONG'].indexOf(this.source) < 0
+      this.isLoadMore = this.userStopLogin
+      this.invoice(invoiceindex)
+      return
+    }
     // 如果用户登录时 或者 是浦东和静安访问的话,展示开票内容
     if (this.isLogin === 'haveLoggedIn' || ['JINGAN', 'PUDONG'].indexOf(this.source) > -1) {
       this.invoice(invoiceindex);
@@ -160,6 +169,7 @@ export default {
       this.totalNum = 0.00;
       this.page = 0;
       this.list = [];
+      if (this.userStopLogin) return
       this.getInvoiceList();
     },
     goToDeatil(item) {
@@ -205,7 +215,7 @@ export default {
               confirmButtonColor: this.$theme[this.theme].primaryColor,
             })
               .then(() => {
-                
+
               })
               .catch(() => {
                 // on cancel
@@ -249,26 +259,26 @@ export default {
         } else {
           res = await invoicesCompleted(params)
         }
-          console.log('99', res)
-          if (res) {
-            this.total = res.size;
-            const listarr = res.content
-            if (listarr.length > 0) {
-              this.list = this.list.concat(res.content)
-            }
-            // 返回数据量小于pagesize,则表示此为最后一页
-            if (res.content.length < this.pagesize) {
-              this.isLoadMore = true;
-              this.loadStatus = 'nomore';
-            } else {
-              this.isLoadMore = false;
-            }
-            
-          } else {
+        console.log('99', res)
+        if (res) {
+          this.total = res.size;
+          const listarr = res.content
+          if (listarr.length > 0) {
+            this.list = this.list.concat(res.content)
+          }
+          // 返回数据量小于pagesize,则表示此为最后一页
+          if (res.content.length < this.pagesize) {
             this.isLoadMore = true;
             this.loadStatus = 'nomore';
+          } else {
+            this.isLoadMore = false;
           }
-          
+
+        } else {
+          this.isLoadMore = true;
+          this.loadStatus = 'nomore';
+        }
+
       } catch(err) {
         this.isLoadMore = false;
         if (this.page > 1) {
@@ -293,7 +303,7 @@ export default {
       this.boxids = ids
       console.log(423, ids);
       if (ids.length > this.choosekMax) {
-        
+
         Dialog.alert({
           title: '选择上限提示',
           message: '合并开票订单数量上限为200条,超出的部分请多次开具',
@@ -302,7 +312,7 @@ export default {
         }).then(() => {
           // on close
         });
-          return;
+        return;
       }
       this.calculatePrice(ids);
       return;