1.新增车队油卡功能

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

@ -276,6 +276,12 @@ export const getDetailByCardNo = params => {
export const getUserCardList = params => { export const getUserCardList = params => {
return POST('GET', `${base}/highUserCard/getUserCardList`, params).then(res => res.data); 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 => { export const getHuiLianTongCardByPhone = params => {
return POST('GET', `${base}/highUserCard/getHuiLianTongCardByPhone`, params).then(res => res.data); return POST('GET', `${base}/highUserCard/getHuiLianTongCardByPhone`, params).then(res => res.data);
@ -300,6 +306,12 @@ export const getHuiLianTongCardConsume = params => {
export const hltUnionCardPay = params => { export const hltUnionCardPay = params => {
return POST('POST', `${base}/order/hltUnionCardPay`, params).then(res => res.data); 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 => { export const bindHuiLianTongCard = params => {
return POST('POST', `${base}/highUserCard/bindCard`, params).then(res => res.data); return POST('POST', `${base}/highUserCard/bindCard`, params).then(res => res.data);

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

@ -175,6 +175,47 @@
<radio :checked="paytype=='gonghuika'" @click="changeRiado()" color="#0083f5" /> <radio :checked="paytype=='gonghuika'" @click="changeRiado()" color="#0083f5" />
</view> </view>
</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>
<view class="width100 mart15 fcor333 font16 fontwig6 paddleft10">重要说明</view> <view class="width100 mart15 fcor333 font16 fontwig6 paddleft10">重要说明</view>
@ -239,7 +280,10 @@
addOrder, addOrder,
cancelOrder, cancelOrder,
oilPriceDiscountCompute, oilPriceDiscountCompute,
getRebateIntegral getRebateIntegral,
getUserCardList,
fleetOilCardPay,
getCardListByCardNo
} from '../../../Utils/Api.js'; } from '../../../Utils/Api.js';
import ssPaymentPassword from '../../../components/sanshui-payment-password/index.vue'; import ssPaymentPassword from '../../../components/sanshui-payment-password/index.vue';
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue'; import wybPopup from '../../../components/wyb-popup/wyb-popup.vue';
@ -278,7 +322,13 @@
availIntegal: 0, // availIntegal: 0, //
gasOrderList: '', // gasOrderList: '', //
rebateIntegral: '', // rebateIntegral: '', //
Integrastu: 1 // Integrastu: 1, //
oilUserCardlist: '', //
oilUserno: '', //
contactName: '', //
oilUserNoPrice: '', //
UserCard: '', //
cardNoNumber: '', //
} }
}, },
onLoad(e) { onLoad(e) {
@ -292,6 +342,7 @@
this.priceValue[1] = 0; this.priceValue[1] = 0;
this.reload(); this.reload();
this.calculatepayPrice(); this.calculatepayPrice();
this.getUserCardList();
}, },
methods: { methods: {
findUser() { 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() { getRebateIntegral() {
let datas = { let datas = {
@ -550,12 +635,15 @@
}) })
return; return;
} }
if (this.paytype == 'jifen') { if (this.paytype == 'fleettruck') {
let params = { let params = {
"orderId": this.orderNo, "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(); uni.hideLoading();
if (res.return_code == '000000') { if (res.return_code == '000000') {
uni.showToast({ 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() { changeRiado() {
// if (!this.user.isSetHltCard && this.paytype == 'gonghuika') { // if (!this.user.isSetHltCard && this.paytype == 'gonghuika') {
@ -735,10 +830,28 @@
}) })
return; return;
} }
if (this.orderNo) { // if (this.orderNo) {
this.orderToPay(); // 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; return;
} }
this.addorders();
},
//
addorders() {
uni.showLoading({ uni.showLoading({
title: '提交订单中...' title: '提交订单中...'
}) })
@ -881,6 +994,15 @@
that.$refs.paymentPassword.modalFun('show'); 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.paytype == 'oilcard') {
if (!that.user.isSetPayPwd) { if (!that.user.isSetPayPwd) {
uni.navigateTo({ uni.navigateTo({
@ -1084,4 +1206,18 @@
// margin-left: 10px; // 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> </style>

Loading…
Cancel
Save