shish 2 лет назад
Родитель
Сommit
f33225a48d
2 измененных файлов с 27 добавлено и 3 удалено
  1. 26 2
      hdApp/src/admin/ghs/pay.vue
  2. 1 1
      hdApp/src/mixins/globalMixins.js

+ 26 - 2
hdApp/src/admin/ghs/pay.vue

@@ -72,8 +72,32 @@
 			},
 			specialInit() {
 				let that = this
-				let id = this.option.id?this.option.id:0
-				let salt = this.option.salt?this.option.salt:''
+				let id = 0
+				let salt = ''
+				if(this.option.id && this.option.salt){
+					id = this.option.id?this.option.id:0
+					salt = this.option.salt?this.option.salt:''
+				}else{
+					if(this.option.q){
+						let currentUrl = decodeURIComponent(this.option.q)
+						let str = currentUrl.substring(currentUrl.lastIndexOf("?") + 1)
+						var sceneItem = str.split("&");
+						var arr, name, value;
+						var sceneArray = new Array();
+						for (var i = 0, l = sceneItem.length; i < l; i++) {
+							arr = sceneItem[i].split("=");
+							name = arr[0];
+							value = arr[1];
+							sceneArray[name] = value;
+						}
+						if(sceneArray.id){
+							id =sceneArray.id
+						}
+						if(sceneArray.salt){
+							salt = sceneArray.salt
+						}
+					}
+				}
 				this.id = id
 				this.salt = salt
 				getGhsData({id:id,salt:salt}).then(res=>{

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

@@ -43,7 +43,7 @@ export default {
 			if(this.$util.isEmpty(token)){
 				//首页、花店采购页、欠款单列表页、结账单详情页、花材详情页等
 				if(currentRoute == 'admin/home/workbench' || currentRoute == 'pagesPurchase/ghsProduct' || currentRoute == 'pagesPurchase/gathering' || currentRoute == 'admin/clear/info' || currentRoute == 'pagesPurchase/purDetails' || 
-				currentRoute == 'admin/ghsProduct/detail' || currentRoute == 'admin/ljh/info' || currentRoute == 'pagesPurchase/shopping' || currentRoute == 'pagesPurchase/order' || currentRoute == 'pagesPurchase/wechatPay'){
+				currentRoute == 'admin/ghsProduct/detail' || currentRoute == 'admin/ljh/info' || currentRoute == 'pagesPurchase/shopping' || currentRoute == 'pagesPurchase/order' || currentRoute == 'pagesPurchase/wechatPay' || currentRoute == 'admin/ghs/pay'){
 					wxLoginFn(true).then(res => {
 						let token = res.data.token || ''
 						//用于开启小程序自动登录