소스 검색

余额充值

zhengjinyi 4 년 전
부모
커밋
561a470e0f

+ 1 - 12
components/cm-module/modelAlert/order-alert.vue

@@ -20,19 +20,11 @@
 				</view>				
 			</view>
 			<view class="content" v-if="modelType == 3">
-				<view class="content-title"></view>
-				<view class="text-content clearfix">
-					<view class="text">机构尚有¥{{payModelData.ableUserMoney.toFixed(2)}}的余额未抵扣,确定不抵扣直接确认订单吗?</view>
-					<view class="alert-btn" @click="hideConfirm">取消</view>
-					<view class="alert-btn" @click="paymentConfirm(3,dataInfo)">确定</view>
-				</view>				
-			</view>
-			<view class="content" v-if="modelType == 4">
 				<view class="content-title"></view>
 				<view class="text-content clearfix">
 					<view class="text">目前机构余额剩余¥{{payModelData.ableUserMoney.toFixed(2)}}是否抵扣订单?</view>
 					<view class="alert-btn" @click="hideConfirm">取消,不抵扣</view>
-					<view class="alert-btn" @click="paymentConfirm(4,dataInfo)">抵扣</view>
+					<view class="alert-btn" @click="paymentConfirm(3,dataInfo)">抵扣</view>
 				</view>				
 			</view>
 		</view>
@@ -48,9 +40,6 @@
 				type:Number,
 				default:3
 			},
-			orderID:{
-				type:Number
-			},
 			payModelData:{
 				type:Object
 			}

+ 5 - 1
components/cm-module/orderDetails/sellerDetaileButton.vue

@@ -9,7 +9,7 @@
 				分享订单
 			</view>	
 			<view class="btn btn-color" v-if="btnState.isConfirm" @click.stop="btnConfirm('confirm',order)">确认订单</view>
-			<view class="btn btn-color" v-if="btnState.isPay && ableUserMoney > 0" @click.stop="btnConfirm('balance',order)">余额抵扣</view>
+			<view class="btn btn-color" v-if="btnState.isPay && ableUserMoney > 0 && !rechargeGoods" @click.stop="btnConfirm('balance',order)">余额抵扣</view>
 		</view>
 	</view>
 </template>
@@ -27,6 +27,9 @@
 			ableUserMoney:{
 				type:Number
 			},
+			rechargeGoods:{
+				type:Boolean
+			},
 			shareCode:{
 				type:String
 			}
@@ -52,6 +55,7 @@
 			}
 		},
 		created(){
+			console.log(this.rechargeGoods);
 			this.initData(this.status)
 		},
 		computed: {

+ 2 - 2
pages/tabBar/home/home.vue

@@ -327,8 +327,8 @@
 				console.log(e.detail.query)
 			},
 			showTost(){
-				this.$util.msg("正在开发中,敬请期待~",2000)
-				// this.$api.navigateTo(`/seller/pages/login/login`)
+				// this.$util.msg("正在开发中,敬请期待~",2000)
+				this.$api.navigateTo(`/seller/pages/login/login`)
 				// uni.navigateToMiniProgram({
 				// 	appId: 'wx5a5cda32926f55ac',
 				// 	path: '/pages/tabBar/home/home',

+ 9 - 4
pages/user/order/order-details.vue

@@ -84,6 +84,7 @@
 				isPayModel:false,
 				modelType:0,
 				orderInfo:{},
+				alertOrderInfo:{},
 				payModelData:{},
 				addressData:{},				//地址信息初始化
 				information:{},				//订单信息初始化
@@ -187,8 +188,8 @@
 							this.$util.modal('','订单已申请全部退款,无需再付款!','确定','',false,() =>{})
 							break;
 						default:
-							if(data.onlinePayFlag == '1'){
-								this.$api.navigateTo(`/pages/user/order/order-payment?type=onlinePay&orderID=${data.orderId}`)
+							if(response.data.onlinePayFlag == '1'){
+								this.$api.navigateTo(`/pages/user/order/order-payment?type=onlinePay&Amount=${response.data.pendingPayments}&orderID=${data.orderId}`)
 							}else{
 								this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderID=${data.orderId}`)
 							}
@@ -204,7 +205,11 @@
 						let _data = {orderID:data.order.orderId}
 						this.$api.navigateTo(`/pages/user/order/success?type=deduction&data=${JSON.stringify({data:_data})}`)
 					}else{
-						this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderID=${data.order.orderId}`)
+						if(data.order.onlinePayFlag === '1'){
+							this.$api.navigateTo(`/pages/user/order/order-payment?type=onlinePay&Amount=${data.order.pendingPayments}&orderID=${data.order.orderId}`)
+						}else{
+							this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderID=${data.order.orderId}`)
+						}
 					}
 				}).catch(error =>{
 					this.$util.msg(error.msg,2000)
@@ -212,7 +217,7 @@
 			},
 			hanldCancelConfirm(data){//不使用余额抵扣直接跳转收银台
 				if(data.onlinePayFlag == '1'){
-					this.$api.navigateTo(`/pages/user/order/order-payment?type=onlinePay&orderID=${data.orderId}`)
+					this.$api.navigateTo(`/pages/user/order/order-payment?type=onlinePay&Amount=${this.orderInfo.pendingPayments}&orderID=${data.orderId}`)
 				}else{
 					this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderID=${data.orderId}`)
 				}

+ 8 - 2
pages/user/order/order-list.vue

@@ -157,6 +157,7 @@
 				pullFlag: true,
 				navbarHeight:'',
 				payModelData:{},
+				hanldOrderData:{},
 				modelType:0,
 				nomoreText: '上拉显示更多',
 			}
@@ -318,6 +319,7 @@
 						this.handOrderConfirm(data.orderId);
 						break
 					case 'pay':
+						this.hanldOrderData = data.order;
 						this.getOrderPaymentValidation(data)
 						break
 					case 'confirmation':
@@ -359,7 +361,11 @@
 						let _data = {orderID:data.order.orderId}
 						this.$api.navigateTo(`/pages/user/order/success?type=deduction&data=${JSON.stringify({data:_data})}`)
 					}else{
-						this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderID=${data.order.orderId}`)
+						if(data.order.onlinePayFlag === '1'){
+							this.$api.navigateTo(`/pages/user/order/order-payment?type=onlinePay&Amount=${data.order.pendingPayments}&orderID=${data.order.orderId}`)
+						}else{
+							this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderID=${data.order.orderId}`)
+						}
 					}
 				}).catch(error =>{
 					this.$util.msg(error.msg,2000)
@@ -367,7 +373,7 @@
 			},
 			hanldCancelConfirm(data){//不使用余额抵扣直接跳转收银台
 				if(data.onlinePayFlag == '1'){
-					this.$api.navigateTo(`/pages/user/order/order-payment?type=onlinePay&orderID=${data.orderId}`)
+					this.$api.navigateTo(`/pages/user/order/order-payment?type=onlinePay&Amount=${this.hanldOrderData.pendingPayments}&orderID=${data.orderId}`)
 				}else{
 					this.$api.navigateTo(`/pages/user/order/order-payment?type=payfirm&orderID=${data.orderId}`)
 				}

+ 3 - 3
seller/pages/order/create-order.vue

@@ -21,7 +21,7 @@
 		</seller-freight>
 		<freight-alert v-if="isfreightTip" ref="csPhone"></freight-alert>
 		<!-- 余额抵扣 -->
-		<view class="invoice-balance" v-show="!rechargeGoods">
+		<view class="invoice-balance" v-if="!rechargeGoods">
 			<view class="balabce-t">
 				<view class="balabce-t-le">余额抵扣</view>
 				<view class="balabce-t-ri">
@@ -111,7 +111,7 @@
 				freightData:{},			  //邮费数据
 				orderInfo:[],			  //提交的商品信息
 				payInfo:{},				  //订单信息
-				rechargeGoods:null,
+				rechargeGoods:false,
 				isIphoneX:this.$store.state.isIphoneX
 			}
 		},
@@ -143,7 +143,6 @@
 						this.isRequest = true
 						this.goodsData = resData.shopList
 						this.userMoney = resData.userMoney
-						this.rechargeGoods = resData.rechargeGoods
 					}).catch(error =>{
 						this.$util.msg(error.msg,2000)
 					})
@@ -158,6 +157,7 @@
 						this.isRequest = true
 						this.goodsData = resData.shopList
 						this.userMoney = resData.userMoney
+						this.rechargeGoods = resData.rechargeGoods
 					}).catch(error =>{
 						this.$util.msg(error.msg,2000)
 					})

+ 12 - 26
seller/pages/order/order-details.vue

@@ -22,6 +22,7 @@
 						  v-if= "isRequest" 
 						  :status= "btnStatus" 
 						  :order="information" 
+						  :rechargeGoods = "rechargeGoods"
 						  :ableUserMoney = "ableUserMoney"
 						  :shareCode= "shareCode"
 						   @buttonConfirm="handButtonConfirm">
@@ -94,6 +95,7 @@
 				receiptAmount:0,			//支付金额
 				returnedPurchaseFee:0,		//退款金额
 				navbarHeight:'',
+				rechargeGoods:false,
 				headerBtnPosi:	this.setHeaderBtnPosi(), //获取设备顶部胶囊高度
 				systeminfo: this.setSysteminfo(),		 //获取设备信息
 				isIphoneX:this.$store.state.isIphoneX,
@@ -124,6 +126,7 @@
 				queryOrderDetails({ orderID : this.orderID }).then(response =>{
 					let resData = response.data;
 					this.isRequest = true
+					this.rechargeGoods = resData.rechargeGoods
 					this.userID = resData.order.userID
 					this.shareCode = resData.shareCode
 					this.addressData = resData.userInfo
@@ -163,35 +166,18 @@
 				}
 			},
 			handOrderConfirm(data){//确认订单
-				if(this.ableUserMoney == 0){
-					this.$util.modal('提示','确认此订单?','确定','取消',true,() =>{
-						affirmOrder({orderID:this.orderID}).then(response =>{
-							this.$util.msg(response.msg,2000,true,'success');
-							this.initOrderDetaileData()
-						}).catch(error =>{
-							this.$util.msg(error.msg,2000)
-						})
+				this.$util.modal('提示','确认此订单?','确定','取消',true,() =>{
+					affirmOrder({orderID:this.orderID}).then(response =>{
+						this.$util.msg(response.msg,2000,true,'success');
+						this.initOrderDetaileData()
+					}).catch(error =>{
+						this.$util.msg(error.msg,2000)
 					})
-				}else{
-					this.isPayModel = true;
-					this.modelType = 3
-					this.payModelData = {
-						ableUserMoney:this.ableUserMoney,
-						orderId:this.orderID
-					}
-				}
+				})
 			},
-			hanldPaymentConfirm(data){//监听弹窗确认按钮
+			hanldPaymentConfirm(data){//监听余额抵扣按钮
 				switch(data.type){
 					case 3:
-						affirmOrder({orderID:this.orderID}).then(response =>{
-							this.$util.msg(response.msg,2000,true,'success');
-							this.initOrderDetaileData()
-						}).catch(error =>{
-							this.$util.msg(error.msg,2000)
-						})
-						break;
-					case 4:
 						this.OrderService.OrderBalanceDeduction({orderId:this.orderID}).then(response =>{
 							this.$util.msg('余额抵扣成功',2000)
 							this.initOrderDetaileData()
@@ -209,7 +195,7 @@
 						this.$util.modal('','订单已申请全部退款,无需再付款!','确定','',false,() =>{})
 					}else{
 						this.isPayModel = true;
-						this.modelType = 4
+						this.modelType = 3
 					}
 				}).catch(error =>{
 					this.$util.msg(error.msg,2000)

+ 0 - 1
seller/pages/order/order-list.vue

@@ -220,7 +220,6 @@
 				}
 			},
 			onClickScreenTab(index){
-				console.log(index)
 				this.screenTab = index
 				this.pageNum = 1
 				this.pullUpOn = true //切换时隐藏