1.新增卡券订单支付方式

yj-dev
杨杰 2 years ago
parent 7bfe5bd8f2
commit bdb3eec7f5
  1. 174
      pages/order/confirmation.vue

@ -161,6 +161,55 @@
<radio :checked="paytype=='3'" @click="changeRiado()" color="#0083f5" /> <radio :checked="paytype=='3'" @click="changeRiado()" color="#0083f5" />
</view> </view>
</view> </view>
<view class="width94 line1 mart5 marb5" v-if="item == 6"></view>
<view class="height50 width100 backcorfff" @tap="paytype='6'" v-if="item == 6">
<view class="width70 flleft fcor333 font16 text1" style="padding-left: 4%;">
油卡支付<text class="font14 fcor666 margle">可用余额: {{oilPirce}}</text>
</view>
<view class="width20 flright fotrt paddtright10 font15 fontwig6 fcor666 alijun"
style="align-items: center;" v-if="isUse">
<radio :checked="paytype=='6'" color="#0083f5" />
</view>
</view>
<view class="width94 line1 mart5 marb5" v-if="item == 7"></view>
<view class="height50 width100 backcorfff" @tap="paytype='7'" v-if="item == 7">
<view class="width70 flleft fcor333 font16 text1" style="padding-left: 4%;">
车队油卡<text class="font14 fcor666 margle">可用余额: {{oilUserNoPrice}}</text>
</view>
<view class="width20 flright fotrt paddtright10 font15 fontwig6 fcor666 alijun"
style="align-items: center;" v-if="isUse">
<radio :checked="paytype=='7'" color="#0083f5" />
</view>
</view>
</view>
<view v-if="paytype=='7'" class="backcorfff">
<view class="heightl60 paddleft10 fcor333 fontwig6 font16 width100 backcorfff flleft">车队油卡列表</view>
<view class="line1"></view>
<view class="heightl60 paddleft10 fcor666 width100 backcorfff" v-for="(item,index) in oilUserCardlist"
:key="index">
<view class="width60 flleft font14">
{{item.cardNo}}({{item.contactName}})
</view>
<view class="flright width30 fotct">
<radio :checked="oilUserno==item.cardNo" @click="changeRiado1(item)" color="#0083f5" />
</view>
</view>
<view class="username">
<view class="namecont font15">车牌号</view>
<input style="width: 70%;" placeholder="输入车牌号" class="font15" v-model="cardNoNumber">
<!-- <view class="date text1" >{{cardNoNumber}}</view> -->
<!-- </view> -->
<picker mode="selector" style="width: 20%;" :range="UserCard" range-key="carLicensePlate"
@change="bindUserCard">
<view class="date text1"
style="color: white;position: absolute;margin-top: -2px;min-width: 100px;">
11111{{cardNoNumber}}</view>
</picker>
<image class="flright" style="width: 15px;height: 15px;" src="../../static/img/downj.png">
</image>
</view>
</view> </view>
</view> </view>
<view class="width100 height110"></view> <view class="width100 height110"></view>
@ -210,7 +259,9 @@
getRebateIntegral, getRebateIntegral,
getHuiLianTongCardBalance, getHuiLianTongCardBalance,
getThirdPartyByDetail, getThirdPartyByDetail,
wechatPay wechatPay,
getUserCardList,
getCardListByCardNo
} from '../../Utils/Api.js'; } from '../../Utils/Api.js';
import wybPopup from '../../components/wyb-popup/wyb-popup.vue'; import wybPopup from '../../components/wyb-popup/wyb-popup.vue';
import cjSlider from '../../components/cj-slider/cj-slider.vue'; import cjSlider from '../../components/cj-slider/cj-slider.vue';
@ -260,7 +311,14 @@
contactPepole: '', // contactPepole: '', //
contactPhone: '', // contactPhone: '', //
contactAddress: '', // contactAddress: '', //
postPayType: '' // postPayType: '', //
oilUserCardlist: '', //
oilPirce: 0, //
oilUserno: '', //
contactName: '', //
oilUserNoPrice: '', //
UserCard: '', //
cardNoNumber: '', //
}; };
}, },
onLoad(option) { onLoad(option) {
@ -281,6 +339,7 @@
// that.paytype = ''; // that.paytype = '';
that.user = app.globalData.userInfo; that.user = app.globalData.userInfo;
that.findUser(); that.findUser();
this.getUserCardList();
}, },
onHide() { onHide() {
@ -352,6 +411,9 @@
if (this.user.hltCardNo) { if (this.user.hltCardNo) {
this.getHuiLianTongCardBalance(); this.getHuiLianTongCardBalance();
} }
if (res.return_data.oilCard) {
this.oilPirce = res.return_data.oilCard.amount;
}
this.getUserNormalDiscountList(); this.getUserNormalDiscountList();
uni.setStorage({ uni.setStorage({
key: "user", key: "user",
@ -360,6 +422,40 @@
} }
}); });
}, },
//
getUserCardList() {
let datas = {
type: 3
}
getUserCardList(datas).then(res => {
if (res.return_code == '000000' && res.return_data != '') {
this.oilUserCardlist = res.return_data;
this.oilUserno = res.return_data[0].cardNo;
this.contactName = res.return_data[0].contactName;
this.oilUserNoPrice = res.return_data[0].balance;
this.getCardListByCardNo(res.return_data[0].cardNo);
}
});
},
//
getCardListByCardNo(item) {
let datas = {
cardNo: item
}
getCardListByCardNo(datas).then(res => {
if (res.return_code == '000000' && res.return_data != '') {
this.UserCard = res.return_data;
this.cardNoNumber = res.return_data[0].carLicensePlate;
} else {
this.UserCard = '';
this.cardNoNumber = '';
}
});
},
//
bindUserCard(e) {
this.cardNoNumber = this.UserCard[e.target.value].carLicensePlate;
},
// //
getRebateIntegral() { getRebateIntegral() {
let datas = { let datas = {
@ -638,6 +734,14 @@
// //
wechatPay(item) { wechatPay(item) {
let that = this; let that = this;
if (that.paytype == '') {
uni.showToast({
title: '请选择支付方式',
icon: 'none',
duration: 2000
})
return;
}
if (that.paytype == '2') { if (that.paytype == '2') {
// #ifdef H5 // #ifdef H5
let params = { let params = {
@ -698,7 +802,8 @@
}) })
} }
}) })
} else if (that.paytype == '3') { }
if (that.paytype == '3') {
if (!that.user.isSetPayPwd) { if (!that.user.isSetPayPwd) {
uni.navigateTo({ uni.navigateTo({
url: '../login/updatePas/updatePas' url: '../login/updatePas/updatePas'
@ -730,12 +835,39 @@
return; return;
} }
that.$refs.paymentPassword.modalFun('show'); that.$refs.paymentPassword.modalFun('show');
} else { }
if (that.paytype == '7') {
if (!that.user.isSetPayPwd) {
uni.navigateTo({
url: '../login/updatePas/updatePas'
})
return;
}
that.$refs.paymentPassword.modalFun('show');
}
if (that.paytype == '6') {
if (!that.user.isSetPayPwd) {
uni.navigateTo({
url: '../login/updatePas/updatePas'
})
return;
}
if (!that.user.isSetOilCard) {
uni.showToast({ uni.showToast({
title: '请选择支付方式',
icon: 'none', icon: 'none',
duration: 2000 title: '当前账号还未绑定,前往绑定',
duration: 2000,
success() {
setTimeout(() => {
uni.navigateTo({
url: '../user/bindingCard/bindingCard'
}) })
}, 1000)
}
});
return;
}
that.$refs.paymentPassword.modalFun('show');
} }
}, },
submitHandle(e) { submitHandle(e) {
@ -788,10 +920,20 @@
}) })
return; return;
} }
if (this.paytype == '3' || this.paytype == '6' || this.paytype == '7') {
let cardNo;
if (this.paytype == 3) {
cardNo = this.user.hltCardNo.cardNo;
}
if (this.paytype == 6) {
cardNo = this.user.oilCard.cardNo;
}
if (this.paytype == 7) {
cardNo = this.oilUserno;
}
let params = { let params = {
"orderNo": this.orderId, "orderNo": this.orderId,
"cardNo": this.user.hltCardNo.cardNo, "cardNo": cardNo,
"password": this.PaymentPassword "password": this.PaymentPassword
} }
cardPay(params).then(res => { cardPay(params).then(res => {
@ -818,7 +960,7 @@
icon: 'none' icon: 'none'
}) })
}) })
}
}, },
payRequest: function(self) { payRequest: function(self) {
@ -1274,4 +1416,18 @@
} }
} }
} }
.username {
width: calc(100% - 100upx);
height: 100upx;
display: flex;
align-items: center;
border-bottom: 1px solid #f6f6f6;
padding: 8upx 20upx;
.namecont {
color: #666666;
width: 28%;
}
}
</style> </style>

Loading…
Cancel
Save