Explorar el Código

订单支付-授信支付(填写账期)

gcz hace 3 semanas
padre
commit
3e62d9db15
Se han modificado 2 ficheros con 52 adiciones y 3 borrados
  1. 4 0
      center/orderdetails.vue
  2. 48 3
      center/pay.vue

+ 4 - 0
center/orderdetails.vue

@@ -112,6 +112,10 @@
 						<text class="copy-btn" @click="copyOrderNum(orderDetails[item.key])" v-if="item.key=='id'">复制</text>
 					</text>
 				</view>
+				<view class="order-info-item" v-if="orderDetails.payWay=='授信额度支付'">
+					<text class="til">账期</text>
+					<text class="con">{{orderDetails.rePaymentTime}}</text>
+				</view>
 				<view class="order-info-item">
 					<text class="til">是否他人代付</text>
 					<text class="con">{{orderDetails.ifRepay?'是':'否'}}</text>

+ 48 - 3
center/pay.vue

@@ -34,8 +34,21 @@
 						</view>
 						<u-radio name="shouxin" :disabled="balanceInfo.grantSurplus<params.payAmount" activeColor="#1677FF" size="36rpx"></u-radio>
 					</view>
+					<view class="repayment-time pay-way-item u-flex u-row-between" @click="showDate = true" v-if="params.paymentMode === 'shouxin'">
+						<view class="label">账期</view>
+						<view class="value">{{ params.rePaymentTime||'请选择账期' }}</view>
+					</view>
 				  </u-radio-group>
 			</view>
+			<u-datetime-picker
+				:show="showDate"
+				:value="params.rePaymentTime"
+				mode="date"
+				@confirm="confirmDateChange"
+				@cancel="showDate = false"
+				:minDate="minDate"
+				:maxDate="maxDate"
+			></u-datetime-picker>
 			<view class="full-btn" v-if="params.paymentMode&&cansubmit" @click="payRoute">去支付<text>¥ {{params.payAmount}}</text></view>
 			<view class="full-btn gray" v-else>去支付<text>¥ {{params.payAmount}}</text></view>
 			<u-popup :show="checkPassShow" @close="checkPassClose" mode="center">
@@ -87,6 +100,7 @@
 					openid:'',
 					payAmount:'',
 					payResult:{},
+					rePaymentTime: '',
 				},
 				checkPassShow:false,
 				paypass:'',
@@ -101,6 +115,9 @@
 				cansubmit:true,
 				needPayQuery:0,
 				payerId:'',
+				showDate: false,
+				minDate: new Date().getTime(),
+				maxDate: new Date(new Date().getFullYear() + 1, 11, 31).getTime(),
 			}
 		},
 		onShow(page) {	
@@ -157,12 +174,19 @@
 				this.checkPassShow = false;
 			},
 			payRoute(){
-				this.cansubmit = false;
 				if(this.params.paymentMode!='wx'){
+					if(this.params.paymentMode=='shouxin'&&!this.params.rePaymentTime){
+						uni.showToast({
+							title: '请选择账期',
+							icon: 'none'
+						});
+						return;
+					}
 					this.checkExistPayPassword();
 				}else{
 					this.gotoPay();
 				}
+				this.cansubmit = false;
 			},
 			checkExistPayPassword(){
 				if(this.balanceInfo.isSetPayPassword==0){
@@ -268,11 +292,13 @@
 					},1500)
 				}).catch(err=>{
 					console.log('balancePay',err.data);
+				}).finally(()=>{
+					this.cansubmit = true;
 				})
 			},
 			gotoQuotaPay(){
 				let that = this;
-				this.$u.api.quotaPay({orderId:this.params.orderId,payerId:this.payerId}).then(res=>{
+				this.$u.api.quotaPay({orderId:this.params.orderId,payerId:this.payerId,rePaymentTime:this.params.rePaymentTime}).then(res=>{
 					// console.log('res',res);
 					uni.showToast({
 						title:res.msg,
@@ -285,6 +311,8 @@
 					},1500)
 				}).catch(err=>{
 					console.log('quotaPay',err.data);
+				}).finally(()=>{
+					this.cansubmit = true;
 				})
 			},
 			wxPay(){
@@ -406,7 +434,12 @@
 			selectPayment(paymentType) {
 			    this.params.paymentMode = paymentType;
 			},
-			
+			confirmDateChange(e) {
+				console.log('confirmDateChange',e);
+				this.params.rePaymentTime = this.$u.timeFormat(e.value, 'yyyy-mm-dd');
+				console.log('this.params.rePaymentTime',this.params.rePaymentTime);
+				this.showDate = false;
+			},
 		}
 	}
 </script>
@@ -440,6 +473,9 @@
 				color: #D8D8D8;
 			}
 		}
+		&.repayment-time{
+			padding-bottom: 0;
+		}
 	}
 	.left{
 		font-size: 30rpx;
@@ -492,4 +528,13 @@
 		
 	}
 }
+.repayment-time {
+	.label {
+		font-size: 30rpx;
+		font-weight: 500;
+		color: #333333;
+		line-height: 42rpx;
+		margin-bottom: 10rpx;
+	}
+}
 </style>