Ver código fonte

现金购买商品支付

DELL 3 anos atrás
pai
commit
90a734264e

+ 11 - 16
packageGoods/components/purchase-popup/purchase-popup.vue

@@ -116,11 +116,13 @@
 			
 			confirmPrize() {
 				let flag = false
-				let data = {
-					goodsId: this.payInfo.goodsId,
-					skuId: this.payInfo.skuId,
-					orderNum: this.orderNum,
-				}
+				// let data = {
+				// 	goodsId: this.payInfo.goodsId,
+				// 	skuId: this.payInfo.skuId,
+				// 	num: this.orderNum,
+				// 	resource:'PAYMENT',
+				// }
+				// console.log(data);
 				if (flag) return
 				if (this.payInfo.quantity == 0) {
 					uni.$u.toast('库存不足');
@@ -134,17 +136,10 @@
 					title: '购买中'
 				});
 				flag = true
-				$http.post('/api/v1/mp/user/exchange/submit', data).then(res => {
-					uni.hideLoading();
-					flag = false
-					if (res.code == 0) {
-						this.$emit('success')
-					} else if (res.code == 1021) {
-						uni.$u.toast(res.msg);
-					}
-				}).catch(() => {
-					flag = false
-					uni.hideLoading();
+				
+				uni.hideLoading();
+				uni.navigateTo({
+					url: `/packageGoods/order/settlement?goodsId=${ this.payInfo.goodsId }&skuId=${ this.payInfo.skuId?this.payInfo.skuId:0 }&num=${ this.orderNum }`
 				})
 			},
 			

+ 19 - 3
packageGoods/order/settlement.vue

@@ -136,14 +136,25 @@
 				areaShow: false,
 				toAddressShow: false,
 				
-				wxAddress: {}
+				wxAddress: {},
+				payment: '',
 			}
 		},
 		onLoad(opthios) {
+			console.log(opthios);
 			if (opthios.ids) {
 				this.ids = JSON.parse(opthios.ids)
 				this.getDetail()
 			}
+			if(opthios.goodsId){
+				this.payment = {
+					goodsId:opthios.goodsId,
+					skuId:opthios.skuId,
+					num:opthios.num,
+					resource:2,
+				}
+				this.getDetail()
+			}
 		},
 		onShow() {
 			if (this.toAddressShow) {
@@ -244,10 +255,15 @@
 				uni.showLoading({
 					title: '加载中'
 				});
-				$http.post('/api/v1/mp/user/deliver/order/settle', {
+				let data = {
 					ids: this.ids
-				}).then(res => {
+				}
+				if(this.payment != ""){
+					data = this.payment
+				}
+				$http.post('/api/v1/mp/user/deliver/order/settle', data ).then(res => {
 					uni.hideLoading();
+					console.log(res);
 					if (res.code == 0) {
 						this.info = res.data
 						this.addr = res.data.addr