Browse Source

bug修复

zhaoxw 4 years ago
parent
commit
5d54c4b1e2
2 changed files with 7 additions and 5 deletions
  1. 2 2
      pages/cart/cart.vue
  2. 5 3
      pagesGood/orderPay.vue

+ 2 - 2
pages/cart/cart.vue

@@ -88,13 +88,13 @@
 			//  获取购物车列表
 			getCartData() {
 				NET.request(API.getCartList, {}, 'GET').then(res => {
-					res.data.merchants.forEach(item => {
+					res.data.merchants && res.data.merchants.forEach(item => {
 						item.allCheck = false
 						item.products.forEach(site => {
 							site.check = false
 						})
 					})
-					this.cartsList = res.data.merchants
+					this.cartsList = res.data.merchants || []
 				}).catch(error => {
 					this.$refs.uTips.show({
 						title: '获取购物车列表失败',

+ 5 - 3
pagesGood/orderPay.vue

@@ -131,7 +131,8 @@
 				couponList: [],
 				notes: '',
 				paySum: 0,
-				mineIntegral: {}
+				mineIntegral: {},
+				orderId: ''
 			}
 		},
 		onLoad(options) {
@@ -297,6 +298,7 @@
 					}, 'POST').then(res => {
 						if (res.isSuccess) {
 							if (res.data) {
+								this.orderId = res.data.orderId
 								uni.requestPayment({
 									provider: 'wxpay',
 									timeStamp: res.data.timeStamp,
@@ -313,12 +315,12 @@
 									fail: (error) => {
 										console.log('fail:' + JSON.stringify(error));
 										this.$refs.uTips.show({
-											title: '支付失败',
+											title: '支付未成功',
 											type: 'warning',
 										})
 										setTimeout(() => {
 											uni.reLaunch({
-												url: '/pagesMain/orderList?type=' + 1
+											    url: '/pagesMain/orderDetail?orderId=' + this.orderId + '&orderStatus=' + 1
 											});
 										}, 1000)
 									}