shish 4 лет назад
Родитель
Сommit
b4ed8c22fe

+ 22 - 6
hdApp/src/admin/clear/info.vue

@@ -155,13 +155,29 @@ export default {
 				phoneNumber: mobile
 			});
 		},
-		async init() {
-			const { id } = this.option;
-			if (!id) {
-				return;
+		init() {
+			let id = 0
+			if(this.option.id){
+				id = this.option.id
+			}else{
+				//扫码打印结账单
+				//https://api.shop.huaml.com/#/admin/clear/info?id=322
+				if(this.option.q){
+					let currentUrl = decodeURIComponent(this.option.q);
+					id = currentUrl.substring(currentUrl.lastIndexOf("?id=") + 4)
+				}
+			}
+			if(Number(id)>0){
+				this.getInfo(Number(id))
 			}
-			const { data } = await getDetail(id);
-			this.detailInfo = data;
+		},
+		getInfo(id){
+			let that = this
+			getDetail({id}).then(res=>{
+				if(res.code == 1){
+					that.detailInfo = res.data
+				}
+			})
 		}
 	}
 };

+ 2 - 8
hdApp/src/api/clear/index.js

@@ -1,15 +1,9 @@
 import https from "@/plugins/luch-request_0.0.7/request";
 
-/** *
- * 采购订单详情
- */
-export const getDetail = async id => {
-	return https.get("/clear/get-full-info", { id });
+export const getDetail = data => {
+	return https.get("/clear/get-full-info", data);
 };
 
-/** *
- * 帐单
- */
 export const getClearList = async data => {
 	return https.get("/clear/list", data);
 };

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

@@ -41,7 +41,7 @@ export default {
 			var pages = getCurrentPages()
 			let currentRoute  = pages[pages.length-1].route;
 			if(this.$util.isEmpty(token)){
-				if(currentRoute == 'admin/home/workbench' || currentRoute == 'pagesPurchase/ghsProduct'){
+				if(currentRoute == 'admin/home/workbench' || currentRoute == 'pagesPurchase/ghsProduct' || currentRoute == 'pagesPurchase/gathering'){
 					wxLoginFn(true).then(res => {
 						let token = res.data.token || ''
 						//用于开启小程序自动登录

+ 13 - 1
hdApp/src/pagesPurchase/gathering.vue

@@ -131,7 +131,19 @@ export default {
       this.getClient()
     },
     initData () {
-      return purchaseDebtList({id:this.option.id,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime}).then(res => {
+
+      let id = 0
+      if(this.option.id){
+        id = this.option.id
+      }else{
+				//小票上的二维码打开结账页
+				//https://api.shop.huahb.cn/#/pagesPurchase/gathering?id=378
+				if(this.option.q){
+					let currentUrl = decodeURIComponent(this.option.q);
+					id = currentUrl.substring(currentUrl.lastIndexOf("?id=") + 4)
+				}
+      }
+      return purchaseDebtList({id:id,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime}).then(res => {
         this.detailsList = res.data.list.map(ele => {
           return {
             ...ele,

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

@@ -33,7 +33,7 @@ export default {
 		//https://shop.theflorist.cn/#/pages/pay/index?account=36123
 		if(option.q){
 			let currentUrl = decodeURIComponent(option.q);
-			let thisAccount = currentUrl.substr(currentUrl.lastIndexOf("account=") + 8)
+			let thisAccount = currentUrl.substring(currentUrl.lastIndexOf("account=") + 8)
 			console.log('扫码获取account',thisAccount)
 			option.account = thisAccount
 		}