Procházet zdrojové kódy

订单流程修改

wcni před 5 roky
rodič
revize
2d51ba7b25

+ 9 - 3
pages/index/sureBuy.vue

@@ -203,7 +203,8 @@
 				store_id:'',
 				pricelist: [],
 				choseadress: '',
-				order_id:''
+				order_id:'',
+				address_id:'',
 			}
 		},
 		onLoad(options) {
@@ -284,6 +285,10 @@
 			goPay() {
 				let reg_phone = /^1[3456789]\d{9}$/;
 				if(this.radio == 1) {
+					if(this.address_id == '') {
+						this.$msg("请选择地址")
+						return;
+					}
 					this.gopaymoment();
 				}else if(this.radio == 0){
 					if(this.hotelname == '') {
@@ -368,10 +373,11 @@
 					success: (res) => {
 						if(res.data.code == 1000) {
 							let order_id = res.data.data.order_id; // 订单id
+							let store_id  = this.store.store_id;
 							let prices = this.prices;
 							let isform = 2;
-							uni.navigateTo({
-								url:`/pages/myOrder/paymoment?order_id=${order_id}&prices=${prices}?isform=${isform}`
+							uni.redirectTo({
+								url:`/pages/myOrder/paymoment?order_id=${order_id}&prices=${prices}&isform=${isform}&store_id=${store_id}`
 							})
 						}
 						

+ 1 - 1
pages/myOrder/adress.vue

@@ -135,7 +135,7 @@
 			},
 			//选择地址
 			checkAddress(item){
-				if(this.isform!=1) {
+				if(this.isform!=1&&this.isdelete) {
 					uni.$emit('getadress', item)
 					uni.navigateBack();
 				}

+ 5 - 2
pages/myOrder/finsh.vue

@@ -15,25 +15,28 @@
 			return{
 				order_id:'',
 				isform: 0,
+				store_id:''
 			}
 		},
 		onLoad(e) {
 			console.log(e);
 			this.order_id = e.order_id;
+			this.store_id = e.store_id;
 			this.isform = e.isform; // 1 从订单过来  2 从购物车过来
 		},
 		methods:{
 			// ji xu gou wu
 			submitRemin() {
 				console.log(this.isform);
+				let store_id = this.store_id;
 				if(this.isform == 1) {
 					uni.switchTab({
 						url: '/pages/myOrder/index'
 					})
 					uni.$emit('finshlist');
 				}else {
-					uni.navigateTo({
-						url: '/pages/index/cart'
+					uni.reLaunch({
+						url: `/pages/index/cart?store_id=${store_id}`
 					})
 				}
 				

+ 3 - 2
pages/myOrder/index.vue

@@ -281,14 +281,15 @@
 				})
 			},
 			gopay(e) {
-				console.log(e);
+				let store_id = e.store_id;
 				let prices = e.order_amount;
 				this.order_id = e.order_id;
 				let order_id = e.order_id;
 			    let isform = 1;
 				if(e.operate == '去付款') {
 					uni.navigateTo({
-				      url:`/pages/myOrder/paymoment?order_id=${order_id}&prices=${prices}&isform=${isform}`
+				      url:`/pages/myOrder/paymoment?order_id=${order_id}&prices=${prices}
+					  &isform=${isform}&store_id=${store_id}`
 				    })
 				}else if(e.operate == '删除') {
 					this.titles = '确认删除订单?'

+ 4 - 3
pages/myOrder/order.vue

@@ -73,7 +73,7 @@
 			<view @click="reminder(1)"  v-if="detail.order_state == 20&&detail.shipping_type==0" class="deleteOrder">催单</view>
 			<view @click="reminder(2)"  v-if="detail.order_state == 20&&detail.shipping_type==1" class="deleteOrder">联系酒店</view>
 			<view @click="cancelOrder(1)" v-if="detail.order_state == 10" class="deleteOrder">取消订单</view>
-			<view class="payOrder" v-if="detail.order_state == 10" @click="goPay">去付款</view>
+			<view class="payOrder" v-if="detail.order_state == 10" @click="goPay(detail)">去付款</view>
 			<!-- detail.order_state == 40 && detail.refund_state == 0 -->
 			<view v-if=" detail.status == '已发货'" @click="cancelOrder(3)" class="deleteOrder">确认收货</view>
 			<!-- <view v-if=" detail.status == '已收货'"  evaluation_state  class="deleteOrder">退货退款</view> -->
@@ -243,13 +243,14 @@
 				
 				
 			},
-			goPay() {
+			goPay(e) {
 				let prices = this.detail.order_amount;
 				let order_id = this.id;
+				let store_id = e.store_id;
 				let isform = 1;
 				uni.navigateTo({
 					url:`/pages/myOrder/paymoment?order_id=${order_id}
-					&prices=${prices}&isform=${isform}`
+					&prices=${prices}&isform=${isform}&store_id=${store_id}`
 				})
 			},
 			

+ 16 - 3
pages/myOrder/paymoment.vue

@@ -50,6 +50,7 @@
 				order_id:'',
 				isform: 0,
 				ratio_points: 2,
+				store_id: '',
 			}
 		},
 		onLoad(e) {
@@ -57,6 +58,7 @@
 			console.log("支付");
 			this.prices = e.prices;
 			this.order_id = e.order_id;
+			this.store_id = e.store_id;
 			this.getuserInfo();
 			this.isform = e.isform;
 			//this.ratio_points = e.ratio_points;
@@ -113,8 +115,9 @@
 						if(res.data.code == 1000) {
 							setTimeout(()=> {
 								let isform = this.isform;
+								let store_id = this.store_id;
 								uni.navigateTo({
-									url: `/pages/myOrder/finsh?isform=${isform}&order_id=${this.order_id}`
+									url: `/pages/myOrder/finsh?isform=${isform}&order_id=${this.order_id}&store_id=${store_id}`
 								})
 								//uni.navigateBack()
 							}, 1000)
@@ -150,12 +153,22 @@
 										let isform = this.isform;
 										let order_id = this.order_id;
 										uni.navigateTo({
-											url: `/pages/myOrder/finsh?isform=${isform}&order_id=${order_id}`
+											url: `/pages/myOrder/finsh?isform=${isform}&order_id=${order_id}&store_id=${store_id}`
 										})
 								    },
-								    fail: function (err) {
+								    fail: (err) => {
+										let order_id = this.order_id ;
+										uni.redirectTo({
+										        url: `/pages/myOrder/order?id=${order_id}`
+										});
 								    }
 							})
+						},
+						fail:(res) => {
+							let order_id = this.order_id ;
+							uni.redirectTo({
+							        url: `/pages/myOrder/order?id=${order_id}`
+							});
 						}
 					})
 				}else {