소스 검색

commit -m 快捷支付

zhengjinyi 2 년 전
부모
커밋
3d244afcfc

+ 47 - 39
components/cm-module/orderDetails/paymentRecord.vue

@@ -12,10 +12,14 @@
 			 	<text>暂无支付记录</text>
 			</view>
 			<view class="record-list" v-else>
-				<view class="record-item" v-for="(item,index) in discernReceiptList" :key="index">
-					<view class="item-time tt">{{ item.receiptDate }}</view>
-					<view class="item-time pp">{{ item.payTypeStr }}</view>
-					<view class="item-time mm">¥{{item.associateAmount.toFixed(2)}}</view>
+				<view class="record-item" v-for="(record,index) in discernReceiptList" :key="index">
+					<view class="record-item-t">
+						<view class="item-time mm">¥{{record.associateAmount.toFixed(2)}}</view>
+					</view>
+					<view class="record-item-t">
+						<view class="item-time tt">{{ record.receiptDate }}</view>
+						<view class="item-time pp">{{ payTypeText(record) }}</view>
+					</view>	
 				</view>
 			</view>
 		</view>
@@ -56,23 +60,21 @@
 					this.isEmpty = true
 				}
 			},
-			payTypeText (state){//处理支付记录文字
-				let stateText = '',
-					stateTextObject={
-						12:'企业网银',
-						13:'微信支付',
-						14:'支付宝',
-						15:'微信支付',
-						16:'余额抵扣',
-						18:'大额银联转账',
-					}
-				Object.keys(stateTextObject).forEach(key => {
-					if(key == state){
-						stateText = stateTextObject[key]
-					}
-				})
-				return stateText
-			},
+			payTypeText(record) {
+				//处理支付记录文字
+				const map = {
+					12: '企业网银',
+					13: '微信支付',
+					14: '支付宝',
+					15: '微信支付',
+					16: '余额抵扣',
+				}
+				if(record.payType === 28 || record.payType === 29 ){
+					return record.quickPayStr
+				}else{
+					return map[record.payType]
+				}
+			}
 		}
 	}
 </script>
@@ -120,28 +122,34 @@
 				float: left;
 				margin-top: 12rpx;
 				.record-item{
-					height: 40rpx;
+					height: auto;
 					width: 100%;
 					padding: 12rpx 0;
 					font-size: $font-size-28;
-					line-height: 40rpx;
 					float: left;
-					display: flex;
-					justify-content: center;
-					flex-direction: row;
-					.item-time{
-						&.mm{
-							flex: 3;
-							color: $text-color;
-							text-align: right;
-						}
-						&.pp{
-							flex: 3;
-							color: $text-color;
-						}
-						&.tt{
-							flex: 4;
-							color: #999999;
+					.record-item-t{
+						width: 100%;
+						height: 40rpx;
+						display: flex;
+						justify-content: center;
+						flex-direction: row;
+						.item-time{
+							line-height: 48rpx;
+							&.mm{
+								flex: 1;
+								color: $text-color;
+								text-align: left;
+							}
+							&.pp{
+								flex: 5;
+								color: #999999;
+								text-align: right;
+							}
+							&.tt{
+								flex: 5;
+								color: #999999;
+								text-align: left;
+							}
 						}
 					}
 				}

+ 0 - 1
pages/user/member/member-pay.vue

@@ -261,7 +261,6 @@ export default {
 			//快捷支付
 			try {
 				const res = await this.PayService.orderPayQuickPay(this.quickParams)
-				console.log('res', res.data)
 				const data = {
 					params: this.quickParams,
 					payData: res.data,

+ 4 - 0
pages/user/pay/card-comfirm.vue

@@ -88,6 +88,7 @@
 								class="form-input"
 								type="text"
 								disabled="false"
+								:class="handleBankExpireTime === '请选择信用卡有效期' ? 'none' : '' "
 								v-model="handleBankExpireTime"
 								placeholder="请选择信用卡有效期"
 							/>
@@ -339,6 +340,9 @@ page,
 			color: #333333;
 			float: right;
 			position: relative;
+			&.none{
+				color: #999999;
+			}
 			.card-input {
 				width: 568rpx;
 				height: 100%;

+ 47 - 33
pages/user/pay/card-order.vue

@@ -51,39 +51,41 @@
 						</view>
 					</view>
 					<view class="pay-checked">
-						<view class="pay-card-main" v-if="cardsList.length > 0">
-							<view class="pay-item-cell" @click="tabClick(3)">
-								<view class="item-icon">
-									<image
-										:src="
-											'https://static.caimei365.com/app/img/pay/icon_' +
-												defaultCards.bankCode +
-												'_@2x.png'
-										"
-									></image>
+						<template v-if="showQuickpayMode">
+							<view class="pay-card-main" v-if="cardsList.length > 0">
+								<view class="pay-item-cell" @click="tabClick(3)">
+									<view class="item-icon">
+										<image
+											:src="
+												'https://static.caimei365.com/app/img/pay/icon_' +
+													defaultCards.bankCode +
+													'_@2x.png'
+											"
+										></image>
+									</view>
+									<view class="item-texts"
+										>{{ defaultCards.bankName }}(
+										{{ defaultCards.quickPayBankNumber | bankNumeberFilter }} )</view
+									>
+									<view class="item-checked">
+										<text
+											class="iconfont"
+											:class="[tabCurrentIndex === 3 ? 'icon-yixuanze3' : 'icon-weixuanze']"
+										></text>
+									</view>
 								</view>
-								<view class="item-texts"
-									>{{ defaultCards.bankName }}(
-									{{ defaultCards.quickPayBankNumber | bankNumeberFilter }} )</view
-								>
-								<view class="item-checked">
-									<text
-										class="iconfont"
-										:class="[tabCurrentIndex === 3 ? 'icon-yixuanze3' : 'icon-weixuanze']"
-									></text>
+								<view class="pay-item-cell add" @click="hanldeShowPopup(1)">
+									<view class="item-texts add"><text>查看全部银行卡 / 添加新卡支付</text></view>
+									<view class="item-checked"> <text class="iconfont icon-xiayibu"></text> </view>
 								</view>
 							</view>
-							<view class="pay-item-cell add" @click="hanldeShowPopup(1)">
-								<view class="item-texts add"><text>查看全部银行卡 / 添加新卡支付</text></view>
-								<view class="item-checked"> <text class="iconfont icon-xiayibu"></text> </view>
-							</view>
-						</view>
-						<view class="pay-item" @click="handleAddCard(2)" v-else>
-							<view class="pay-item-cell">
-								<view class="item-texts add"><text>添加银行卡快捷付款</text></view>
-								<view class="item-checked"> <text class="iconfont icon-xiayibu"></text> </view>
+							<view class="pay-item" @click="handleAddCard(2)" v-else>
+								<view class="pay-item-cell">
+									<view class="item-texts add"><text>添加银行卡快捷付款</text></view>
+									<view class="item-checked"> <text class="iconfont icon-xiayibu"></text> </view>
+								</view>
 							</view>
-						</view>
+						</template>
 						<view class="pay-item" @click="tabClick(0)" v-if="showWeChatPayMode">
 							<view class="pay-item-cell">
 								<view class="item-icon"><text class="iconfont icon-weixinzhifu"></text></view>
@@ -133,7 +135,7 @@
 					</view>
 				</view>
 				<view class="pay-button" :style="{ paddingBottom: isIphoneX ? '68rpx' : '24rpx' }">
-					<view class="btn" @click.stop="buttonSubMit" :style="{ background: btnColor }">{{
+					<view class="btn" @click.stop="buttonSubMit" :class="isSubLoding ? 'disabled' : ''" :style="{ background: btnColor }">{{
 						buttonText
 					}}</view>
 				</view>
@@ -248,6 +250,7 @@ export default {
 			    payAmount: 0,
 			    shopOrderId: 0
 			},
+			isSubLoding:false
 		}
 	},
 	onLoad(option) {
@@ -315,7 +318,6 @@ export default {
 		        this.cardsList = res.data
 		        this.defaultCards = this.cardsList[0]
 		        this.quickParams.userId = user.userId 
-				this.quickParams.payAmount = this.payAmount
 		        this.quickParams.shopOrderId = Number(this.shopOrderId)
 		        this.quickParams.quickPayBankNumber = this.defaultCards.quickPayBankNumber 
 		        this.quickParams.quickPayMobile = this.defaultCards.quickPayMobile 
@@ -341,6 +343,7 @@ export default {
 			this.$api.navigateTo(`/pages/user/pay/card-comfirm?type=${index}&data=${JSON.stringify(data)}`)
 		},
 		buttonSubMit() {
+			if(this.isSubLoding){ return }
 			switch (this.tabCurrentIndex) {
 				case 0: // 微信支付
 					this.handleUmTrackEvent('Um_Event_ConfirmWechatPay', '微信支付')
@@ -361,6 +364,7 @@ export default {
 					this.orderPayQuickPay()
 					break
 			}
+			this.isSubLoding = true
 		},
 		handleUmTrackEvent(UmName, UmPageName) {
 			// 友盟埋点收集
@@ -376,7 +380,8 @@ export default {
 		async orderPayQuickPay() {
 			//快捷支付
 			try {
-				
+				this.quickParams.payAmount = this.payAmount
+				console.log('payAmount',this.quickParams.payAmount)
 				const res = await this.PayService.orderPayQuickPay(this.quickParams)
 				const data = {
 					params: this.quickParams,
@@ -384,11 +389,13 @@ export default {
 					orderId: this.orderId,
 					payAmount: this.payAmount
 				}
+				this.isSubLoding = false
 				this.$api.navigateTo(
 					`/pages/user/pay/card-comfirm-sub?type=3&data=${JSON.stringify(data)}`
 				)
 			} catch (error) {
 				this.$util.msg(error.msg, 2000)
+				this.isSubLoding = false
 			}
 		},
 		async handlePayOrderPayLink() {
@@ -402,7 +409,7 @@ export default {
 				return
 			}
 			if (this.payType == '1') {
-				if (this.payAmount != this.payableAmount) {
+				if (this.payAmount != this.obligation) {
 					this.contentModalText = '企业网银支付每次收取的手续费较高,建议一次性全额付款。'
 					this.modal = true
 					return
@@ -416,10 +423,12 @@ export default {
 				}
 			    const res = await this.PayService.PayOrderPayLink(linkParams)
 				this.payHttpUrl = res.data
+				this.isSubLoding = false
 				this.isShowTip = true
 				console.log('isShowTip',this.isShowTip)
 			} catch (error) {
 			    console.log(error)
+				this.isSubLoding = false
 			}
 		},
 		async MiniWxPayFor() {
@@ -445,9 +454,11 @@ export default {
 				shopOrderId: this.shopOrderId
 			}
 			this.weChatMiniOrderWxPay(params)
+			this.isSubLoding = false
 		},
 		handleClick() {
 			this.modal = false
+			this.isSubLoding = false
 		},
 		confirmEvent(value) {
 			//点击自定义键盘完成的回调函数
@@ -853,6 +864,9 @@ page {
 			margin: 0 auto;
 			text-align: center;
 			background: $btn-confirm;
+			&.disabled{
+				background: #e1e1e1 !important;
+			}
 		}
 	}
 }

+ 12 - 2
pages/user/pay/mixins/cardMixins.js

@@ -8,6 +8,7 @@ const cardMixins = {
             tabCurrentIndex: 0,
             weChatFlag: false, // 微信支付开关
             B2BpayFlag: false, //企业网银支付开关
+            QuickPayFlag: false, // 快捷支付开发
             buttonText: '微信支付',
             btnColor: '#0ABC64',
             cardsList:[],//查看银行列表
@@ -25,6 +26,9 @@ const cardMixins = {
         },
         showB2BpayMode() {
             return this.B2BpayFlag
+        },
+        showQuickpayMode() {
+            return this.QuickPayFlag
         }
     },
     methods: {
@@ -71,11 +75,17 @@ const cardMixins = {
         checkPayMode(range) {
             // 校验支付模式
             // test range = '4'
-            // 1微信 2支付宝 3个人网银 4企业网银
+            // 1微信 2支付宝 3个人网银 4企业网银 5快捷支付
             this.weChatFlag = range.indexOf('1') > -1
             this.B2BpayFlag = range.indexOf('4') > -1
+            this.QuickPayFlag = range.indexOf('5') > -1
             // 设置默认支付方式
-            this.tabCurrentIndex = this.weChatFlag ? 0 : this.B2BpayFlag ? 1 : 2
+            if(this.QuickPayFlag){
+                this.tabCurrentIndex = 3
+            }else{
+                this.tabCurrentIndex = this.weChatFlag ? 0 : this.B2BpayFlag ? 1 : 2
+            }
+            
             this.tabClick(this.tabCurrentIndex)
         }
     }

+ 3 - 3
services/pay.service.js

@@ -237,7 +237,7 @@ export default class PayService {
         return this.AjaxService.post({
             url:'/order/pay/quick/bind/card', 
             data, 
-            isLoading: false ,
+            isLoading: true ,
         }) 
     } 
     /**
@@ -274,7 +274,7 @@ export default class PayService {
         return this.AjaxService.post({
             url:'/order/pay/quick/pay', 
             data, 
-            isLoading: false ,
+            isLoading: true ,
         }) 
     } 
     /**
@@ -285,7 +285,7 @@ export default class PayService {
         return this.AjaxService.get({
             url:'/order/pay/quick/unbound/card', 
             data, 
-            isLoading: false ,
+            isLoading: true ,
         }) 
     } 
 }