1.新增车队油卡功能

yj-dev
杨杰 2 years ago
parent 03d8c6e42b
commit 7780c061b4
  1. 16
      Utils/Api.js
  2. 19
      pages/goods/externalCoupon/externalCoupon.vue
  3. 162
      pages/goods/refuel-confirm/refuel-confirm.vue

@ -275,7 +275,13 @@ export const getDetailByCardNo = params => {
// 获取用户卡号列表
export const getUserCardList = params => {
return POST('GET', `${base}/highUserCard/getUserCardList`, params).then(res => res.data);
}
}
//根据油卡查询车牌列表
export const getCardListByCardNo = params => {
return POST('GET', `${base}/fleetOilCard/getCardListByCardNo`, params).then(res => res.data);
}
// 根据手机号获取汇联通工会卡列表
export const getHuiLianTongCardByPhone = params => {
return POST('GET', `${base}/highUserCard/getHuiLianTongCardByPhone`, params).then(res => res.data);
@ -299,7 +305,13 @@ export const getHuiLianTongCardConsume = params => {
// 汇联通工会卡支付
export const hltUnionCardPay = params => {
return POST('POST', `${base}/order/hltUnionCardPay`, params).then(res => res.data);
}
}
//车队油卡支付
export const fleetOilCardPay = params => {
return POST('POST', `${base}/order/fleetOilCardPay`, params).then(res => res.data);
}
//绑定卡包
export const bindHuiLianTongCard = params => {
return POST('POST', `${base}/highUserCard/bindCard`, params).then(res => res.data);

@ -28,7 +28,7 @@
</view>
<view class="product-list mart20 width90">
<view class="product" v-for="product in minecoupones" :key="product.id"
@tap="toGoods(product.highCoupon.id)">
@tap="toGoods(product.highCoupon.id,product.highCoupon.couponSource)">
<image mode="widthFix" :src="imageUrl+product.highCoupon.couponImg"></image>
<view class="name">{{ product.highCoupon.couponName }}</view>
<view class="info" v-if="product.highCoupon.payType == 1">
@ -259,12 +259,21 @@
});
},
//
toGoods(e) {
toGoods(e, item) {
if (app.globalData.userInfo) {
if (app.globalData.openId) {
uni.navigateTo({
url: '../../order/confirmation?id=' + e
})
if (item == 4) {
uni.showToast({
icon: 'none',
title: '系统维护中,暂时无法购买',
duration: 2000
})
} else {
uni.navigateTo({
url: '../../order/confirmation?id=' + e
})
}
} else {
uni.showToast({
icon: 'none',

@ -134,10 +134,10 @@
v-if="Integrastu == 2">
{{rebateIntegral}}
</view>
</view>
<view class=" width100 backcorfff alijusstart paddbotm10" style="padding-left: 2%;">
<image src="../../../static/img/sigh.png" mode="widthFix" class="icon20"></image>
<text class="fcor999 font13">积分抵扣与优惠券抵扣不同享</text>
</view>
<view class=" width100 backcorfff alijusstart paddbotm10" style="padding-left: 2%;">
<image src="../../../static/img/sigh.png" mode="widthFix" class="icon20"></image>
<text class="fcor999 font13">积分抵扣与优惠券抵扣不同享</text>
</view>
</view>
@ -175,6 +175,47 @@
<radio :checked="paytype=='gonghuika'" @click="changeRiado()" color="#0083f5" />
</view>
</view> -->
<view class="line1" v-if="oilUserCardlist"></view>
<view class="heightl60 paddleft10 fcor666 width100 backcorfff" v-if="oilUserCardlist"
@tap="paytype='fleettruck'">
<view class="width60 flleft font14">
车队油卡<text class="font14 fcor666 margle">余额: {{oilUserNoPrice}}</text>
</view>
<view class="flright width30 fotct" v-if="isUse">
<radio :checked="paytype=='fleettruck'" color="#0083f5" />
</view>
</view>
<view v-if="paytype=='fleettruck'">
<view class="heightl60 paddleft10 fcor333 fontwig6 font16 width100 backcorfff">车队油卡列表</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 class="width100 mart15 fcor333 font16 fontwig6 paddleft10">重要说明</view>
@ -239,7 +280,10 @@
addOrder,
cancelOrder,
oilPriceDiscountCompute,
getRebateIntegral
getRebateIntegral,
getUserCardList,
fleetOilCardPay,
getCardListByCardNo
} from '../../../Utils/Api.js';
import ssPaymentPassword from '../../../components/sanshui-payment-password/index.vue';
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue';
@ -278,7 +322,13 @@
availIntegal: 0, //
gasOrderList: '', //
rebateIntegral: '', //
Integrastu: 1 //
Integrastu: 1, //
oilUserCardlist: '', //
oilUserno: '', //
contactName: '', //
oilUserNoPrice: '', //
UserCard: '', //
cardNoNumber: '', //
}
},
onLoad(e) {
@ -292,6 +342,7 @@
this.priceValue[1] = 0;
this.reload();
this.calculatepayPrice();
this.getUserCardList();
},
methods: {
findUser() {
@ -312,6 +363,40 @@
}
});
},
//
getUserCardList() {
let datas = {
type: 3
}
getUserCardList(datas).then(res => {
if (res.return_code == '000000') {
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() {
let datas = {
@ -442,7 +527,7 @@
this.payPrice = Math.abs(parseFloat(this.orderPrice - (parseFloat(this.priceValue[1] / 100).toFixed(
2)) - this
.deductionPrice).toFixed(2));
}
}
this.getRebateIntegral();
},
rechangeload() {
@ -476,7 +561,7 @@
this.paytype = '';
} else {
this.isUse = true;
}
}
this.getRebateIntegral();
},
@ -550,12 +635,15 @@
})
return;
}
if (this.paytype == 'jifen') {
if (this.paytype == 'fleettruck') {
let params = {
"orderId": this.orderNo,
"password": this.PaymentPassword
"password": this.PaymentPassword,
"cardNo": this.oilUserno,
"carLicensePlate": this.cardNoNumber,
}
orderToGoldPay(params).then(res => {
fleetOilCardPay(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
uni.showToast({
@ -674,6 +762,13 @@
})
},
//
changeRiado1(item) {
this.oilUserno = item.cardNo;
this.contactName = item.contactName;
this.oilUserNoPrice = item.balance;
this.getCardListByCardNo(item.cardNo);
},
//
changeRiado() {
// if (!this.user.isSetHltCard && this.paytype == 'gonghuika') {
@ -735,10 +830,28 @@
})
return;
}
if (this.orderNo) {
this.orderToPay();
// if (this.orderNo) {
// this.orderToPay();
// return;
// }
if (this.paytype == 'fleettruck') {
let that = this;
uni.showModal({
title: '温馨提示',
content: '是否使用当前 ' + that.contactName + ' 车队油卡',
success: function(res) {
if (res.confirm) {
that.addorders();
}
}
})
return;
}
this.addorders();
},
//
addorders() {
uni.showLoading({
title: '提交订单中...'
})
@ -881,6 +994,15 @@
that.$refs.paymentPassword.modalFun('show');
}
if (that.paytype == 'fleettruck') {
if (!that.user.isSetPayPwd) {
uni.navigateTo({
url: '../../login/updatePas/updatePas'
})
return;
}
that.$refs.paymentPassword.modalFun('show');
}
if (that.paytype == 'oilcard') {
if (!that.user.isSetPayPwd) {
uni.navigateTo({
@ -1084,4 +1206,18 @@
// margin-left: 10px;
}
}
.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>

Loading…
Cancel
Save