Bladeren bron

余额充值

zhengjinyi 4 jaren geleden
bovenliggende
commit
3af84798eb

+ 11 - 3
components/cm-module/modelAlert/order-alert.vue

@@ -22,9 +22,17 @@
 			<view class="content" v-if="modelType == 3">
 				<view class="content-title"></view>
 				<view class="text-content clearfix">
-					<view class="text">目前机构余额剩余¥{{}}是否抵扣订单?</view>
-					<view class="alert-btn" @click="cancelConfirm">不抵扣,继续付款</view>
-					<view class="alert-btn" @click="btnConfirm">抵扣</view>
+					<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>				
 			</view>
 		</view>

+ 20 - 6
components/cm-module/orderDetails/sellerDetaileButton.vue

@@ -2,13 +2,14 @@
 	<view class="button-template" :style="{paddingBottom :isIphoneX ? '68rpx' : '0rpx'}">
 		<!-- 底部按钮 -->
 		<view class="button-content">
-			<view class="btn btn-cancel" v-if="btnState.isCancel"  @click.stop="btnConfirm('cancel')">取消订单</view>
-			<view class="btn btn-cancel" v-if="btnState.isDelete"  @click.stop="btnConfirm('delete')">删除订单</view>
+			<view class="btn btn-cancel" v-if="btnState.isCancel"  @click.stop="btnConfirm('cancel',order)">取消订单</view>
+			<view class="btn btn-cancel" v-if="btnState.isDelete"  @click.stop="btnConfirm('delete',order)">删除订单</view>
 			<view class="btn btn-color" @click.stop="onShareCode">
 				<view class="tips" v-if="shareCode">分享码:{{shareCode}}</view>
 				分享订单
 			</view>	
-			<view class="btn btn-color" v-if="btnState.isConfirm" @click.stop="btnConfirm('confirm')">确认订单</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>
 	</view>
 </template>
@@ -20,6 +21,12 @@
 			status:{
 				type:Number
 			},
+			order: {
+				type:Object
+			},
+			ableUserMoney:{
+				type:Number
+			},
 			shareCode:{
 				type:String
 			}
@@ -40,6 +47,7 @@
 					{label:'isDelete',val:[6],status: true},
 					{label:'isCancel',val:[0,111],status: true},
 					{label:'isConfirm',val:[0],status: true},
+					{label:'isPay',val:[11,12,13,21,22,23,111],status: true},
 				]
 			}
 		},
@@ -76,6 +84,7 @@
 						isDelete: false,
 						isCancel: false,
 						isConfirm: false,
+						isPay: false,
 					}
 				return 	btnState
 			},
@@ -86,8 +95,13 @@
 				this.$parent.isShareModal = true
 				this.$emit('shareConfirm')
 			},
-			btnConfirm(type){
-				this.$emit('buttonConfirm',type)
+			btnConfirm(type,order){
+				let data = {
+						type:type,
+						orderId:order.orderID,
+						order:order
+					}
+				this.$emit('buttonConfirm',data)
 			}
 		}
 	}
@@ -132,7 +146,7 @@
 			}
 			.btn-color{
 				background: $btn-confirm;
-				margin: 22rpx 0 22rpx 22rpx;
+				margin: 20rpx 0 20rpx 20rpx;
 				.tips{
 					width: 160rpx;
 					height: 34rpx;

+ 1 - 2
pages/goods/product.vue

@@ -914,7 +914,6 @@
 				margin-bottom: 24rpx;
 				text-align: left;
 			}
-	
 		}
 		.wrap-seve{
 			float: left;
@@ -967,7 +966,7 @@
 			display: inline-block;
 			float: left;
 			font-size: $font-size-24;
-			color: #D0D0D0;
+			color: #EBEBEB;
 			float: right;
 			padding-right: 48rpx;
 			overflow: hidden;

+ 3 - 1
pages/user/order/create-order.vue

@@ -20,7 +20,7 @@
 		</freight>
 		<freight-alert v-if="isfreightTip" ref="csPhone"></freight-alert>
 		<!-- 余额抵扣 -->
-		<view class="invoice-balance">
+		<view class="invoice-balance" v-show="!rechargeGoods">
 			<view class="balabce-t">
 				<view class="balabce-t-le">余额抵扣</view>
 				<view class="balabce-t-ri">
@@ -111,6 +111,7 @@
 				freightData:{},			  //邮费数据
 				orderInfo:[],			  //提交的商品信息
 				payInfo:{},				  //订单信息
+				rechargeGoods:null,		  //判断订单里有定金商品或者充值商品时,余额抵扣部分不显示
 				isIphoneX:this.$store.state.isIphoneX
 			}
 		},
@@ -141,6 +142,7 @@
 					this.isRequest = true
 					this.goodsData = resData.shopList
 					this.userMoney = resData.userMoney
+					this.rechargeGoods = resData.rechargeGoods
 				}).catch(error =>{
 					this.$util.msg(error.msg,2000)
 				})

+ 3 - 0
pages/user/order/order-details.vue

@@ -81,7 +81,10 @@
 				isRequest:false,			//是否加载完成渲染子组件
 				isOrderShare:false,
 				isShareModal:false,
+				isPayModel:false,
+				modelType:0,
 				orderInfo:{},
+				payModelData:{},
 				addressData:{},				//地址信息初始化
 				information:{},				//订单信息初始化
 				shopOrderData:{},			//商品信息初始化

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

@@ -342,8 +342,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}`)
 							}

+ 3 - 1
pages/user/order/order-payment.vue

@@ -172,10 +172,12 @@
 						this.PayOrderCheckoutCounter(this.orderID)
 						break;
 					case 'onlinePay':
+						this.invoiceStatus = true
 						this.nvabarData.haveBack = true
 						this.nvabarData.haveHome = false
 						this.nvabarData.title = '付款提示'
-						this.PayOrderCheckoutCounter(this.orderID)
+						this.payableAmount = e.Amount
+						// this.PayOrderCheckoutCounter(this.orderID)
 						this.payBringTitle = '您已通过线下转账的方式支付了订单部分款项,剩余款项依然需要使用线下转账方式,给您带来的不便敬请谅解'
 						break;
 				}

+ 3 - 1
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">
+		<view class="invoice-balance" v-show="!rechargeGoods">
 			<view class="balabce-t">
 				<view class="balabce-t-le">余额抵扣</view>
 				<view class="balabce-t-ri">
@@ -111,6 +111,7 @@
 				freightData:{},			  //邮费数据
 				orderInfo:[],			  //提交的商品信息
 				payInfo:{},				  //订单信息
+				rechargeGoods:null,
 				isIphoneX:this.$store.state.isIphoneX
 			}
 		},
@@ -142,6 +143,7 @@
 						this.isRequest = true
 						this.goodsData = resData.shopList
 						this.userMoney = resData.userMoney
+						this.rechargeGoods = resData.rechargeGoods
 					}).catch(error =>{
 						this.$util.msg(error.msg,2000)
 					})

+ 76 - 14
seller/pages/order/order-details.vue

@@ -21,10 +21,18 @@
 			<order-button ref="orderButton" 
 						  v-if= "isRequest" 
 						  :status= "btnStatus" 
+						  :order="information" 
+						  :ableUserMoney = "ableUserMoney"
 						  :shareCode= "shareCode"
 						   @buttonConfirm="handButtonConfirm">
 			</order-button>
 		</view>
+		<!-- 付款弹窗 -->
+		<order-model v-if="isPayModel" 
+					:payModelData="payModelData" 
+					:modelType='modelType' 
+					@paymentConfirm ='hanldPaymentConfirm'/>
+		<!-- 分享弹窗 -->			
 		<share-alert  :orderID="orderID" 
 					  v-if="isShareModal"  
 					  @shareConfirm ='onShareAppMessage'>
@@ -43,6 +51,7 @@
 	import refundRecord from '@/components/cm-module/orderDetails/refundRecord'		 //退款记录
 	import orderButton from '@/components/cm-module/orderDetails/sellerDetaileButton'	 //底部按钮
 	import shareAlert from '@/components/cm-module/modelAlert/sellerShareAlert.vue'			 //分享弹窗
+	import orderModel from '@/components/cm-module/modelAlert/order-alert'			 //付款弹窗
 	import { queryOrderDetails,cancelOrder,deleteOrder,affirmOrder } from "@/api/order.js" 
 	export default {
 		components:{
@@ -56,6 +65,7 @@
 			refundRecord,
 			orderButton,
 			shareAlert,
+			orderModel
 		},
 		data() {
 			return {
@@ -71,6 +81,10 @@
 				isRequest:false,			//是否加载完成渲染子组件
 				isOrderShare:false,
 				isShareModal:false,
+				isPayModel:false,
+				modelType:0,
+				ableUserMoney:'',			//机构余额
+				payModelData:{},
 				addressData:{},				//地址信息初始化
 				information:{},				//订单信息初始化
 				shopOrderData:{},			//商品信息初始化
@@ -122,6 +136,7 @@
 					this.discernReceiptList = resData.discernReceiptList
 					this.receiptAmount = resData.order.receiptAmount
 					this.returnedPurchaseFee = resData.order.returnedPurchaseFee
+					this.ableUserMoney = resData.ableUserMoney
 				}).catch(error =>{
 					this.$util.modal('提示','订单查询失败,请稍后重试~','确定','',false,() =>{
 						this.$api.switchTabTo('/seller/pages/index/index')
@@ -131,29 +146,76 @@
 			handButtonConfirm(data){//监听点击时间的按钮类型并执行...
 				this.handShowAlert(data)
 			},
-			handShowAlert(type){//判断点击的按钮类型并执行...
-				switch(type){
+			handShowAlert(data){//判断点击的按钮类型并执行...
+				switch(data.type){
 					case 'delete':
 						this.handOrderDetele();
-						break
+						break;
 					case 'cancel':
 						this.handCenceConfirm();
-						break
+						break;
 					case 'confirm':
-						this.handOrderConfirm()
-						break
+						this.handOrderConfirm(data)
+						break;
+					case 'balance':
+						this.getOrderPaymentValidation(data)
+						break;
 				}
 			},
-			handOrderConfirm(){//确认订单
-				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)
+			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)
+						})
 					})
-				})
+				}else{
+					this.isPayModel = true;
+					this.modelType = 3
+					this.payModelData = {
+						ableUserMoney:this.ableUserMoney,
+						orderId:this.orderID
+					}
+				}
+			},
+			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()
+						}).catch(error =>{
+							this.$util.msg(error.msg,2000)
+						})	
+						break;
+				}
+			},
+			getOrderPaymentValidation(data){//监听根据付款状态做操作
+				this.OrderService.OrderPaymentValidation({orderId:data.orderId}).then(response =>{
+					let dataCode = response.data.code
+					this.payModelData = response.data
+					if(dataCode == -1){
+						this.$util.modal('','订单已申请全部退款,无需再付款!','确定','',false,() =>{})
+					}else{
+						this.isPayModel = true;
+						this.modelType = 4
+					}
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000)
+				})	
 			},
+			
 			handOrderDetele(){//删除订单
 				this.$util.modal('提示','确认删除该订单吗?','确定','取消',true,() =>{
 					deleteOrder({orderID:this.orderID}).then(response =>{