Răsfoiți Sursa

修复结账单页面报错

shish 4 ani în urmă
părinte
comite
7fb0befbb6
2 a modificat fișierele cu 12 adăugiri și 20 ștergeri
  1. 10 19
      hdApp/src/admin/clear/info.vue
  2. 2 1
      hdApp/src/mixins/globalMixins.js

+ 10 - 19
hdApp/src/admin/clear/info.vue

@@ -119,28 +119,19 @@ export default {
 				name: ""
 				name: ""
 			},
 			},
 			detailInfo: {},
 			detailInfo: {},
-			loading: false,
-			notLogin:true
+			loading: false
 		};
 		};
 	},
 	},
 	computed: {
 	computed: {
 		...mapGetters(["getLoginInfo"])
 		...mapGetters(["getLoginInfo"])
 	},
 	},
-	watch: {
-		getLoginInfo: {
-			handler(newValue) {
-				if(!this.$util.isEmpty(newValue.admin) && newValue.admin.currentShopId > 0){
-					this.notLogin = false
-				}				
-			}
-		}
-	},
-	onLoad() {
-		if(this.$util.isEmpty(this.getLoginInfo.admin) || this.getLoginInfo.admin.currentShopId == 0){
-			this.notLogin = true
-		}
-	},
 	methods: {
 	methods: {
+		notLogin(){
+			if(!this.$util.isEmpty(this.getLoginInfo.admin) && this.getLoginInfo.admin.currentShopId > 0){
+				return false
+			}
+			return true
+		},
 		remindLogin(){
 		remindLogin(){
 			let that = this
 			let that = this
 			this.$util.confirmModal({content:'您还没有登录,请先登录',okText:'去登录'},() => {
 			this.$util.confirmModal({content:'您还没有登录,请先登录',okText:'去登录'},() => {
@@ -148,14 +139,14 @@ export default {
 			})
 			})
 		},
 		},
 		getDetail(s){
 		getDetail(s){
-			if(this.notLogin){
+			if(this.notLogin()){
 				this.remindLogin()
 				this.remindLogin()
 				return false
 				return false
 			}
 			}
 			this.pageTo({url: '/pagesPurchase/purDetails',query: {id: s.id,}})
 			this.pageTo({url: '/pagesPurchase/purDetails',query: {id: s.id,}})
 		},
 		},
 		cancelFn(info){
 		cancelFn(info){
-			if(this.notLogin){
+			if(this.notLogin()){
 				this.remindLogin()
 				this.remindLogin()
 				return false
 				return false
 			}
 			}
@@ -170,7 +161,7 @@ export default {
 			})
 			})
 		},
 		},
 		toClear(info){
 		toClear(info){
-			if(this.notLogin){
+			if(this.notLogin()){
 				this.remindLogin()
 				this.remindLogin()
 				return false
 				return false
 			}
 			}

+ 2 - 1
hdApp/src/mixins/globalMixins.js

@@ -41,7 +41,8 @@ export default {
 			var pages = getCurrentPages()
 			var pages = getCurrentPages()
 			let currentRoute  = pages[pages.length-1].route;
 			let currentRoute  = pages[pages.length-1].route;
 			if(this.$util.isEmpty(token)){
 			if(this.$util.isEmpty(token)){
-				if(currentRoute == 'admin/home/workbench' || currentRoute == 'pagesPurchase/ghsProduct' || currentRoute == 'pagesPurchase/gathering'){
+				//首页、花店采购页、欠款单列表页、结账单详情页
+				if(currentRoute == 'admin/home/workbench' || currentRoute == 'pagesPurchase/ghsProduct' || currentRoute == 'pagesPurchase/gathering' || currentRoute == 'admin/clear/info'){
 					wxLoginFn(true).then(res => {
 					wxLoginFn(true).then(res => {
 						let token = res.data.token || ''
 						let token = res.data.token || ''
 						//用于开启小程序自动登录
 						//用于开启小程序自动登录