فهرست منبع

修改详情页面

wangxy 1 ماه پیش
والد
کامیت
26c0e2bdb1
1فایلهای تغییر یافته به همراه24 افزوده شده و 6 حذف شده
  1. 24 6
      pages/chanpinShop/usePay.js

+ 24 - 6
pages/chanpinShop/usePay.js

@@ -110,7 +110,7 @@ export function usePay(opt = {}) {
 				taocanId
 			}).then(res => {
 				uni.hideLoading();
-				if (res.data.code == 0) {
+				if (res.code == 0) {
 					Object.assign(wxData, res.data);
 					// 开始支付
 					wxPay(res.data);
@@ -149,7 +149,7 @@ export function usePay(opt = {}) {
 				taocanId
 			}).then(res => {
 				uni.hideLoading();
-				if (res.data.code == 0) {
+				if (res.code == 0) {
 					Object.assign(aliData, res.data);
 					// 开始支付
 					aliPay(res.data);
@@ -232,7 +232,7 @@ export function usePay(opt = {}) {
 	// 校验
 	function OrderCheckWx() {
 		orderCheck({
-			id: wxData.orderId
+			orderId: wxData.orderId
 		}).then(res => {
 			if (res.code == 0 && res.data) {
 				// 校验通过,支付成功
@@ -240,11 +240,20 @@ export function usePay(opt = {}) {
 			} else {
 				setTimeout(() => {
 					orderCheck({
-						id: wxData.orderId
+						orderId: wxData.orderId
 					}).then(res2 => {
 						if (res2.code == 0 && res2.data) {
 							// 校验通过,支付成功
 							paySuccessResult();
+						} else {
+							uni.hideLoading()
+							toast('支付二次查验失败,请联系管理员')
+							checkError && checkError({
+								type: 'OrderCheckWx',
+								msg: '支付二次查验失败,请联系管理员',
+								err: err1,
+								form: 'wx'
+							})
 						}
 					}).catch(err1 => {
 						uni.hideLoading()
@@ -317,7 +326,7 @@ export function usePay(opt = {}) {
 	// 校验
 	function OrderCheckAli() {
 		orderCheck({
-			id: aliData.orderId
+			orderId: aliData.orderId
 		}).then(res => {
 			if (res.code == 0 && res.data) {
 				// 校验通过,支付成功
@@ -325,11 +334,20 @@ export function usePay(opt = {}) {
 			} else {
 				setTimeout(() => {
 					orderCheck({
-						id: aliData.orderId
+						orderId: aliData.orderId
 					}).then(res2 => {
 						if (res2.code == 0 && res2.data) {
 							// 校验通过,支付成功
 							paySuccessResult();
+						} else {
+							uni.hideLoading()
+							toast('支付二次查验失败,请联系管理员')
+							checkError && checkError({
+								type: 'OrderCheckAli',
+								msg: '支付二次查验失败,请联系管理员',
+								err: err1,
+								form: 'ali'
+							})
 						}
 					}).catch(err1 => {
 						uni.hideLoading()