shish 2 месяцев назад
Родитель
Сommit
acfbd85407

+ 4 - 4
ghsApp/src/admin/billing/result.vue

@@ -75,12 +75,12 @@ export default {
 		...mapGetters({ loginInfo: "getLoginInfo",dictInfo:"getDictionariesInfo" }),
 		...mapGetters({ loginInfo: "getLoginInfo",dictInfo:"getDictionariesInfo" }),
 	},
 	},
 	onShareAppMessage(res) {
 	onShareAppMessage(res) {
-		console.log("pagesOrder/showOrder?id="+this.detailInfo.purchaseId)
+		console.log("pagesOrder/showOrder?id="+this.detailInfo.id)
 		return {
 		return {
 			title: this.title,
 			title: this.title,
 			desc: "",
 			desc: "",
       imageUrl: IMGHOST+'/custom/order_share.jpg',
       imageUrl: IMGHOST+'/custom/order_share.jpg',
-			path: "pagesOrder/showOrder?id="+this.detailInfo.purchaseId,
+			path: "pagesOrder/showOrder?id="+this.detailInfo.id,
 		}
 		}
 	},
 	},
   methods: {
   methods: {
@@ -126,7 +126,7 @@ export default {
       })
       })
     },
     },
 		shareOrder(){
 		shareOrder(){
-			console.log("pagesOrder/showOrder?id="+this.detailInfo.purchaseId)
+			console.log("pagesOrder/showOrder?id="+this.detailInfo.id)
 			let that = this
 			let that = this
 			let miniOriginalId = that.dictInfo.miniOriginalId && that.dictInfo.miniOriginalId.current && that.dictInfo.miniOriginalId.current.ghs ? that.dictInfo.miniOriginalId.current.ghs : ''
 			let miniOriginalId = that.dictInfo.miniOriginalId && that.dictInfo.miniOriginalId.current && that.dictInfo.miniOriginalId.current.ghs ? that.dictInfo.miniOriginalId.current.ghs : ''
 			uni.share({
 			uni.share({
@@ -138,7 +138,7 @@ export default {
 				imageUrl: IMGHOST+'/custom/order_share.jpg',//图片一定要有,不然会分享失败
 				imageUrl: IMGHOST+'/custom/order_share.jpg',//图片一定要有,不然会分享失败
 				miniProgram: {
 				miniProgram: {
 					id: miniOriginalId,//小程序原始id,发起分享的 App 与小程序属于同一微信开放平台账号
 					id: miniOriginalId,//小程序原始id,发起分享的 App 与小程序属于同一微信开放平台账号
-					path: "pagesOrder/showOrder?id="+this.detailInfo.purchaseId,
+					path: "pagesOrder/showOrder?id="+this.detailInfo.id,
 					type: 0,// 0-正式版; 1-测试版; 2-体验版
 					type: 0,// 0-正式版; 1-测试版; 2-体验版
 					webUrl: 'https://www.wixhb.com'
 					webUrl: 'https://www.wixhb.com'
 				},
 				},

+ 5 - 5
ghsApp/src/admin/billing/toPay.vue

@@ -121,17 +121,17 @@ export default {
 		...mapGetters({dictInfo:"getDictionariesInfo" }),
 		...mapGetters({dictInfo:"getDictionariesInfo" }),
 	},
 	},
 	onShareAppMessage(res) {
 	onShareAppMessage(res) {
-		console.log("pagesOrder/showOrder?id="+this.orderInfo.purchaseId)
+		console.log("pagesOrder/showOrder?id="+this.orderInfo.id)
 		return {
 		return {
 			title: this.title,
 			title: this.title,
 			desc: "",
 			desc: "",
 			imageUrl: IMGHOST+'/custom/order_share.jpg',
 			imageUrl: IMGHOST+'/custom/order_share.jpg',
-			path: "pagesOrder/showOrder?id="+this.orderInfo.purchaseId,
+			path: "pagesOrder/showOrder?id="+this.orderInfo.id,
 		}
 		}
 	},
 	},
   methods: {
   methods: {
 		shareOrder(){
 		shareOrder(){
-			console.log("pagesOrder/showOrder?id="+this.orderInfo.purchaseId)
+			console.log("pagesOrder/showOrder?id="+this.orderInfo.id)
 			let that = this
 			let that = this
 			let miniOriginalId = that.dictInfo.miniOriginalId && that.dictInfo.miniOriginalId.current && that.dictInfo.miniOriginalId.current.ghs ? that.dictInfo.miniOriginalId.current.ghs : ''
 			let miniOriginalId = that.dictInfo.miniOriginalId && that.dictInfo.miniOriginalId.current && that.dictInfo.miniOriginalId.current.ghs ? that.dictInfo.miniOriginalId.current.ghs : ''
 			uni.share({
 			uni.share({
@@ -143,7 +143,7 @@ export default {
 				imageUrl: IMGHOST+'/custom/order_share.jpg',//图片一定要有,不然会分享失败
 				imageUrl: IMGHOST+'/custom/order_share.jpg',//图片一定要有,不然会分享失败
 				miniProgram: {
 				miniProgram: {
 					id: miniOriginalId,//小程序原始id,发起分享的 App 与小程序属于同一微信开放平台账号
 					id: miniOriginalId,//小程序原始id,发起分享的 App 与小程序属于同一微信开放平台账号
-					path: "pagesOrder/showOrder?id="+this.orderInfo.purchaseId,
+					path: "pagesOrder/showOrder?id="+this.orderInfo.id,
 					type: 0,// 0-正式版; 1-测试版; 2-体验版
 					type: 0,// 0-正式版; 1-测试版; 2-体验版
 					webUrl: 'https://www.wixhb.com'
 					webUrl: 'https://www.wixhb.com'
 				},
 				},
@@ -361,4 +361,4 @@ export default {
   font-size:32upx;
   font-size:32upx;
   font-weight: bold;
   font-weight: bold;
 }
 }
-</style>
+</style>

+ 4 - 4
ghsApp/src/admin/home/order.vue

@@ -229,12 +229,12 @@ export default {
   },
   },
   onShareAppMessage(res) {
   onShareAppMessage(res) {
     this.fromDetail.status = 1;
     this.fromDetail.status = 1;
-    console.log('pagesOrder/showOrder?id=' + this.currentInfo.purchaseId);
+    console.log('pagesOrder/showOrder?id=' + this.currentInfo.id);
     return {
     return {
       title: this.currentTitle,
       title: this.currentTitle,
       desc: '',
       desc: '',
       imageUrl: IMGHOST + '/custom/order_share.jpg',
       imageUrl: IMGHOST + '/custom/order_share.jpg',
-      path: 'pagesOrder/showOrder?id=' + this.currentInfo.purchaseId
+      path: 'pagesOrder/showOrder?id=' + this.currentInfo.id
     };
     };
   },
   },
   methods: {
   methods: {
@@ -252,7 +252,7 @@ export default {
     shareOrder(info) {
     shareOrder(info) {
       this.currentInfo = info;
       this.currentInfo = info;
       this.fromDetail.status = 1;
       this.fromDetail.status = 1;
-      console.log('pagesOrder/showOrder?id=' + info.purchaseId);
+      console.log('pagesOrder/showOrder?id=' + info.id);
       let that = this;
       let that = this;
       let miniOriginalId =
       let miniOriginalId =
         that.dictInfo.miniOriginalId && that.dictInfo.miniOriginalId.current && that.dictInfo.miniOriginalId.current.ghs
         that.dictInfo.miniOriginalId && that.dictInfo.miniOriginalId.current && that.dictInfo.miniOriginalId.current.ghs
@@ -278,7 +278,7 @@ export default {
         imageUrl: IMGHOST + '/custom/order_share.jpg', //图片一定要有,不然会分享失败
         imageUrl: IMGHOST + '/custom/order_share.jpg', //图片一定要有,不然会分享失败
         miniProgram: {
         miniProgram: {
           id: miniOriginalId, //小程序原始id,发起分享的 App 与小程序属于同一微信开放平台账号
           id: miniOriginalId, //小程序原始id,发起分享的 App 与小程序属于同一微信开放平台账号
-          path: 'pagesOrder/showOrder?id=' + info.purchaseId,
+          path: 'pagesOrder/showOrder?id=' + info.id,
           type: 0, // 0-正式版; 1-测试版; 2-体验版
           type: 0, // 0-正式版; 1-测试版; 2-体验版
           webUrl: 'https://www.wixhb.com'
           webUrl: 'https://www.wixhb.com'
         },
         },

+ 1 - 0
ghsApp/src/api/order/index.js

@@ -292,3 +292,4 @@ export const getTree = data => https.get("/order-tree/get-tree", data);
 
 
 export const getMergeOrderList = data => https.get("/order/merge-order-list", data);
 export const getMergeOrderList = data => https.get("/order/merge-order-list", data);
 
 
+export const getCgSalt = data => https.get("/order/cg-salt", data);

+ 5 - 5
ghsApp/src/pagesOrder/detail.vue

@@ -759,12 +759,12 @@ export default {
 		...mapGetters({ loginInfo: "getLoginInfo",dictInfo:"getDictionariesInfo" }),
 		...mapGetters({ loginInfo: "getLoginInfo",dictInfo:"getDictionariesInfo" }),
 	},
 	},
 	onShareAppMessage(res) {
 	onShareAppMessage(res) {
-		console.log("pagesOrder/showOrder?id="+this.detailInfo.purchaseId)
+		console.log("pagesOrder/showOrder?id="+this.detailInfo.id)
 		return {
 		return {
 			title: this.title,
 			title: this.title,
 			desc: "",
 			desc: "",
 			imageUrl: IMGHOST+'/custom/order_share.jpg',
 			imageUrl: IMGHOST+'/custom/order_share.jpg',
-			path: "pagesOrder/showOrder?id="+this.detailInfo.purchaseId,
+			path: "pagesOrder/showOrder?id="+this.detailInfo.id,
 		}
 		}
 	},
 	},
 	methods: {
 	methods: {
@@ -1304,7 +1304,7 @@ export default {
 			uni.previewImage({ urls: [url] })
 			uni.previewImage({ urls: [url] })
 		},
 		},
 		shareOrder(){
 		shareOrder(){
-			console.log("pagesOrder/showOrder?id="+this.detailInfo.purchaseId)
+			console.log("pagesOrder/showOrder?id="+this.detailInfo.id)
 			let that = this
 			let that = this
 			let miniOriginalId = that.dictInfo.miniOriginalId && that.dictInfo.miniOriginalId.current && that.dictInfo.miniOriginalId.current.ghs ? that.dictInfo.miniOriginalId.current.ghs : ''
 			let miniOriginalId = that.dictInfo.miniOriginalId && that.dictInfo.miniOriginalId.current && that.dictInfo.miniOriginalId.current.ghs ? that.dictInfo.miniOriginalId.current.ghs : ''
 			uni.share({
 			uni.share({
@@ -1316,7 +1316,7 @@ export default {
 				imageUrl: IMGHOST+'/custom/order_share.jpg',//图片一定要有,不然会分享失败
 				imageUrl: IMGHOST+'/custom/order_share.jpg',//图片一定要有,不然会分享失败
 				miniProgram: {
 				miniProgram: {
 					id: miniOriginalId,//小程序原始id,发起分享的 App 与小程序属于同一微信开放平台账号
 					id: miniOriginalId,//小程序原始id,发起分享的 App 与小程序属于同一微信开放平台账号
-					path: "pagesOrder/showOrder?id="+this.detailInfo.purchaseId,
+					path: "pagesOrder/showOrder?id="+this.detailInfo.id,
 					type: 0,// 0-正式版; 1-测试版; 2-体验版
 					type: 0,// 0-正式版; 1-测试版; 2-体验版
 					webUrl: 'https://www.wixhb.com'
 					webUrl: 'https://www.wixhb.com'
 				},
 				},
@@ -2410,4 +2410,4 @@ export default {
 		opacity: 1;
 		opacity: 1;
 	}
 	}
 }
 }
-</style>
+</style>

+ 69 - 11
ghsApp/src/pagesOrder/showOrder.vue

@@ -11,16 +11,25 @@
 </template>
 </template>
 <script>
 <script>
 import { getWeixinId } from "@/api/invite/index"
 import { getWeixinId } from "@/api/invite/index"
+import { getCgSalt } from "@/api/order"
 export default {
 export default {
     name: "showCgOrder",
     name: "showCgOrder",
 	data() {
 	data() {
 		return {
 		return {
 			getAppIdList:{},
 			getAppIdList:{},
 			showButton:false,
 			showButton:false,
-			id:0
+			id:0,
+			purchaseId:0,
+			cgSalt:'',
+			saltRequestId:0,
+			saltPromise:null,
+			loadedOptionId:0,
+			ignoreNextShowId:0
 		};
 		};
 	},
 	},
-	onLoad() {
+	onLoad(option) {
+		this.setOptionInfo(option || this.option || {}, true)
+		this.ignoreNextShowId = this.id
 		let that = this
 		let that = this
 		getWeixinId().then(res => {
 		getWeixinId().then(res => {
 			that.getAppIdList = res.data
 			that.getAppIdList = res.data
@@ -28,27 +37,76 @@ export default {
 		})
 		})
 	},
 	},
 	onShow() {
 	onShow() {
-		if(this.option.id){
-			this.id = this.option.id
+		const option = this.option || {}
+		const id = option.id || 0
+		if(id && this.ignoreNextShowId == id){
+			this.ignoreNextShowId = 0
+			this.setOptionInfo(option)
+			return false
 		}
 		}
+		this.setOptionInfo(option, true)
 	},
 	},
 	methods: {
 	methods: {
 		init(){
 		init(){
-			if(this.option.id){
-				this.id = this.option.id
+			this.setOptionInfo(this.option || {}, true)
+		},
+		setOptionInfo(option, refreshSalt = false){
+			const id = option.id || 0
+			if(!id){
+				return false
+			}
+			if(this.id != id){
+				this.cgSalt = ''
+				this.purchaseId = 0
+				this.saltRequestId = 0
+				this.saltPromise = null
+			}
+			this.id = id
+			if(refreshSalt || this.loadedOptionId != id){
+				this.loadedOptionId = id
+				this.getCgSaltInfo()
 			}
 			}
 		},
 		},
-		showCgOrder() {
+		getCgSaltInfo(){
+			if(!this.id){
+				return Promise.resolve(false)
+			}
+			if(this.saltPromise && this.saltRequestId == this.id){
+				return this.saltPromise
+			}
+			this.saltRequestId = this.id
+			this.saltPromise = getCgSalt({id:this.id}).then(res => {
+				this.purchaseId = res.data.purchaseId || 0
+				this.cgSalt = res.data.cgSalt || ''
+				this.saltPromise = null
+				return this.cgSalt
+			}).catch(err => {
+				this.saltPromise = null
+				throw err
+			})
+			return this.saltPromise
+		},
+		async showCgOrder() {
 			let that = this
 			let that = this
-			console.log('pagesPurchase/purDetails?id='+that.option.id)
+			if(!that.cgSalt){
+				await that.getCgSaltInfo()
+			}
+			const salt = that.cgSalt || ''
+			const purchaseId = that.purchaseId || 0
+			if(!purchaseId || !salt){
+				that.$msg('订单信息获取失败')
+				return false
+			}
+			console.log('pagesPurchase/purDetails?id='+purchaseId+'&salt='+salt)
 			uni.navigateToMiniProgram({
 			uni.navigateToMiniProgram({
 				//姜枫-2021.04.13
 				//姜枫-2021.04.13
 				appId: that.getAppIdList.hd.miniAppId,
 				appId: that.getAppIdList.hd.miniAppId,
-				path: 'pagesPurchase/purDetails?id='+that.option.id,
+				path: 'pagesPurchase/purDetails?id='+purchaseId+'&salt='+salt,
 				//develop 开发版 trial 体验版 release 正式版
 				//develop 开发版 trial 体验版 release 正式版
 				envVersion: process.env.NODE_ENV === 'development' ? 'develop' : 'release',
 				envVersion: process.env.NODE_ENV === 'development' ? 'develop' : 'release',
 				extraData: {
 				extraData: {
-					'id': that.option.id
+					'id': purchaseId,
+					'salt': salt
 				},
 				},
 				success (res) {
 				success (res) {
 				}
 				}
@@ -101,4 +159,4 @@ export default {
 		}
 		}
 	}
 	}
 }
 }
-</style>
+</style>