Pārlūkot izejas kodu

feat: 核销金额

2912631854@qq.com 1 gadu atpakaļ
vecāks
revīzija
df32b609b6
1 mainītis faili ar 19 papildinājumiem un 5 dzēšanām
  1. 19 5
      pages/home/index.vue

+ 19 - 5
pages/home/index.vue

@@ -220,14 +220,28 @@
 				uni.scanCode({
 					onlyFromCamera: true,
 					success: (res) => {
-						console.log('扫描二维码成功,结果:' + res.result);
+						// uni.getStorageSync('homestayId'))
+						console.log('扫描二维码成功,结果:' + JSON.parse(res.result));
 						let obj = {
-							orderId: res.result,
+							orderId: JSON.parse(res.result).orderCode,
 							isDel: 1
 						}
-						uni.navigateTo({
-							url: '/pages/house/orderDetails?obj=' + JSON.stringify(obj)
-						})
+						console.log(obj);
+						if (JSON.parse(res.result).homestayId != uni.getStorageSync('homestayId')) {
+							uni.showToast({
+								title: '您的核销码不是该商家的核销码',
+								icon: 'none',
+								duration: 1500
+							})
+						} else {
+							uni.navigateTo({
+								url: '/pages/house/orderDetails?obj=' + JSON.stringify(obj)
+							})
+						}
+
+
+
+
 
 						// uni.navigateTo({
 						// 	url: '/pages/house/orderDetails?orderId=' + orderId