bug
This commit is contained in:
parent
b840bd3e99
commit
1321922b30
@ -38,15 +38,6 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view style="background-color: white;width: 94%;margin: 15px auto;">
|
<view style="background-color: white;width: 94%;margin: 15px auto;">
|
||||||
<view class="desc" v-if="isOilStorageCard">
|
|
||||||
<view style="display: flex;">
|
|
||||||
囤油卡
|
|
||||||
<span style="display: flex;">(余额:{{refuelBalance}}L)</span>
|
|
||||||
</view>
|
|
||||||
<view style="display: flex;">
|
|
||||||
<span style="margin-right: 10px;">- {{oilCardRedece}}L</span>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="desc" v-if="isStoreValueCard">
|
<view class="desc" v-if="isStoreValueCard">
|
||||||
<view style="display: flex;">
|
<view style="display: flex;">
|
||||||
@ -54,7 +45,32 @@
|
|||||||
<span style="display: flex;">(<span v-if="isUseChildCard">主卡</span>余额:¥{{user.cardBalance}})</span>
|
<span style="display: flex;">(<span v-if="isUseChildCard">主卡</span>余额:¥{{user.cardBalance}})</span>
|
||||||
</view>
|
</view>
|
||||||
<view style="display: flex;">
|
<view style="display: flex;">
|
||||||
<span style="margin-right: 10px;">-¥{{balanceRedece}}</span>
|
<span style="margin-right: 10px;display: flex;">
|
||||||
|
-¥{{balanceRedece}}
|
||||||
|
<span style="margin-left: 8px;margin-top: 8px;">
|
||||||
|
<!-- <uni-data-checkbox v-model="checkBalance" :multiple="true" :localdata="range" @change="changeBalance"></uni-data-checkbox> -->
|
||||||
|
<!-- <u-checkbox-group> -->
|
||||||
|
<!-- <u-checkbox v-model="checkBalance" @change="changeBalance"></u-checkbox> -->
|
||||||
|
<!-- </u-checkbox-group> -->
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="desc">
|
||||||
|
<view style="display: flex;">
|
||||||
|
囤油卡
|
||||||
|
<span style="display: flex;">(余额:{{refuelBalance}}L)</span>
|
||||||
|
</view>
|
||||||
|
<view style="display: flex;">
|
||||||
|
<span style="margin-right: 10px;display: flex;">
|
||||||
|
- {{oilCardRedece}}L
|
||||||
|
<span style="margin-left: 8px;margin-top: 8px;">
|
||||||
|
<u-checkbox-group>
|
||||||
|
<u-checkbox v-model="checkOilCard" :checked="checkOilCard" @change="changeOilCard" :disabled="oilCardRedece==0"></u-checkbox>
|
||||||
|
</u-checkbox-group>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -64,19 +80,33 @@
|
|||||||
<!-- <span style="display: flex;">(满减活动)</span> -->
|
<!-- <span style="display: flex;">(满减活动)</span> -->
|
||||||
</view>
|
</view>
|
||||||
<view style="display: flex;">
|
<view style="display: flex;">
|
||||||
<span style="margin-right: 10px;">-¥{{fullRedece}}</span>
|
<span style="margin-right: 10px;display: flex;">
|
||||||
|
-¥{{fullRedece}}
|
||||||
|
<span style="margin-left: 8px;margin-top: 8px;">
|
||||||
|
<u-checkbox-group>
|
||||||
|
<u-checkbox v-model="checkFull" :checked="checkFull" @change="changeFull"></u-checkbox>
|
||||||
|
</u-checkbox-group>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- <view class="desc" >
|
<view class="desc" v-if="cardsList.length>0">
|
||||||
<view style="display: flex;">
|
<view style="display: flex;">
|
||||||
优惠券优惠
|
优惠券优惠
|
||||||
<span style="display: flex;">(优惠券)</span>
|
<span style="display: flex;">(优惠券)</span>
|
||||||
</view>
|
</view>
|
||||||
<view style="display: flex;">
|
<view style="display: flex;">
|
||||||
<span style="margin-right: 10px;">-¥{{couponRedece}}</span>
|
<span style="margin-right: 10px;display: flex;">
|
||||||
|
-¥{{couponRedece}}
|
||||||
|
<span style="margin-left: 8px;margin-top: 8px;">
|
||||||
|
<u-checkbox-group>
|
||||||
|
<u-checkbox v-model="checkCoupon" :checked="checkCoupon" @change="changeCoupon"></u-checkbox>
|
||||||
|
</u-checkbox-group>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view> -->
|
|
||||||
|
|
||||||
<view class="desc" v-if="isGradePreferential">
|
<view class="desc" v-if="isGradePreferential">
|
||||||
<view style="display: flex;">
|
<view style="display: flex;">
|
||||||
@ -84,7 +114,14 @@
|
|||||||
<!-- <span style="display: flex;">({{userGrade.name}})</span> -->
|
<!-- <span style="display: flex;">({{userGrade.name}})</span> -->
|
||||||
</view>
|
</view>
|
||||||
<view style="display: flex;">
|
<view style="display: flex;">
|
||||||
<span style="margin-right: 10px;">-¥{{gradeRedece}}</span>
|
<span style="margin-right: 10px;display: flex;">
|
||||||
|
-¥{{gradeRedece}}
|
||||||
|
<span style="margin-left: 8px;margin-top: 8px;">
|
||||||
|
<u-checkbox-group>
|
||||||
|
<u-checkbox v-model="checkGrade" @change="changeGrade"></u-checkbox>
|
||||||
|
</u-checkbox-group>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="desc" v-if="!isFullPreferential && !isGradePreferential && !isOilStorageCard && !isStoreValueCard">无优惠</view>
|
<view class="desc" v-if="!isFullPreferential && !isGradePreferential && !isOilStorageCard && !isStoreValueCard">无优惠</view>
|
||||||
@ -189,6 +226,8 @@
|
|||||||
isGradePreferential:false,
|
isGradePreferential:false,
|
||||||
// 是否存在可使用的满减或折扣优惠
|
// 是否存在可使用的满减或折扣优惠
|
||||||
isFullPreferential:false,
|
isFullPreferential:false,
|
||||||
|
// 是否存在可使用的优惠券
|
||||||
|
isCoupons:false,
|
||||||
transferDTO:{
|
transferDTO:{
|
||||||
type:0,
|
type:0,
|
||||||
amount:0,
|
amount:0,
|
||||||
@ -198,11 +237,24 @@
|
|||||||
},
|
},
|
||||||
fixingLevel:{},
|
fixingLevel:{},
|
||||||
isUseChildCard:false,
|
isUseChildCard:false,
|
||||||
|
cardsList:[],
|
||||||
|
query: {
|
||||||
|
storeId: uni.getStorageSync("storeId"),
|
||||||
|
couponType: '',
|
||||||
|
useStatus: 0,
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10
|
||||||
|
},
|
||||||
|
checkBalance:false,
|
||||||
|
checkOilCard:false,
|
||||||
|
checkFull:false,
|
||||||
|
checkCoupon:false,
|
||||||
|
checkGrade:false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
this.orderNo = e.orderNo
|
this.orderNo = e.orderNo
|
||||||
// this.orderNo = "234520240113160238a6efad"
|
// this.orderNo = "2345202401161204280406d3"
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.getOilOrder();
|
this.getOilOrder();
|
||||||
@ -211,13 +263,52 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 选择储值卡
|
||||||
|
changeBalance(val){
|
||||||
|
console.log("balance",this.checkBalance,val);
|
||||||
|
},
|
||||||
|
// 选择囤油卡
|
||||||
|
changeOilCard(val){
|
||||||
|
console.log("oilcard",this.checkBalance,val);
|
||||||
|
if (val){
|
||||||
|
// this.payAmount = this.deductAmount - this.gradeRedece
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 选择满减或折扣
|
||||||
|
changeFull(val){
|
||||||
|
console.log("balance",this.checkBalance,val);
|
||||||
|
if (val){
|
||||||
|
this.payAmount = this.deductAmount - this.fullRedece
|
||||||
|
}else{
|
||||||
|
this.payAmount = this.deductAmount
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 选择优惠券
|
||||||
|
changeCoupon(val){
|
||||||
|
console.log("balance",this.checkBalance,val);
|
||||||
|
if (val){
|
||||||
|
this.payAmount = this.deductAmount - this.couponRedece
|
||||||
|
}else{
|
||||||
|
this.payAmount = this.deductAmount
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 选择会员等级
|
||||||
|
changeGrade(val){
|
||||||
|
console.log("balance",this.checkBalance,val);
|
||||||
|
if (val){
|
||||||
|
this.payAmount = this.deductAmount - this.gradeRedece
|
||||||
|
}else{
|
||||||
|
this.payAmount = this.deductAmount
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 支付接口
|
// 支付接口
|
||||||
payment(){
|
payment(){
|
||||||
let map = {
|
let map = {
|
||||||
orderNo : this.orderNo,
|
orderNo : this.orderNo,
|
||||||
payAmount : this.payAmount,
|
payAmount : this.payAmount,
|
||||||
// payAmount : "0.01",
|
// payAmount : "0.01",
|
||||||
discountAmount : this.fullRedece+this.gradeRedece+this.couponRedece,
|
discountAmount : (this.fullRedece*100+this.gradeRedece*100+this.couponRedece*100)/100,
|
||||||
oilCardAmount : JSON.stringify(this.refuelMoneyAfter),
|
oilCardAmount : JSON.stringify(this.refuelMoneyAfter),
|
||||||
oilCardLiters : this.oilCardRedece,
|
oilCardLiters : this.oilCardRedece,
|
||||||
balanceAmount : this.balanceRedece,
|
balanceAmount : this.balanceRedece,
|
||||||
@ -232,7 +323,6 @@
|
|||||||
method: 'post',
|
method: 'post',
|
||||||
data: map,
|
data: map,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
// console.log(res,_this.appltType)
|
|
||||||
let payProvider = "wxpay"
|
let payProvider = "wxpay"
|
||||||
if (_this.appltType== "WECHAT"){
|
if (_this.appltType== "WECHAT"){
|
||||||
payProvider = "wxpay"
|
payProvider = "wxpay"
|
||||||
@ -244,9 +334,7 @@
|
|||||||
url: "/business/allOrderInfo/orderStatus",
|
url: "/business/allOrderInfo/orderStatus",
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: {"orderNo":_this.orderNo,"status":"payFail"},
|
data: {"orderNo":_this.orderNo,"status":"payFail"},
|
||||||
}).then((ress)=>{
|
}).then((ress)=>{})
|
||||||
console.log(ress);
|
|
||||||
})
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title:res.data.error,
|
title:res.data.error,
|
||||||
icon:"none"
|
icon:"none"
|
||||||
@ -321,10 +409,13 @@
|
|||||||
|
|
||||||
// 查看是否有可使用的囤油卡
|
// 查看是否有可使用的囤油卡
|
||||||
chooseRefuelMoney(){
|
chooseRefuelMoney(){
|
||||||
|
console.log("oilCard");
|
||||||
let falg = false;
|
let falg = false;
|
||||||
for(let i = 0;i<this.refuelMoney.length;i++){
|
for(let i = 0;i<this.refuelMoney.length;i++){
|
||||||
if (this.refuelMoney[i].oilType == this.oilNameId){
|
if (this.refuelMoney[i].oilType == this.oilNameId){
|
||||||
|
if( this.refuelMoney[i].refuelMoney>0 ){
|
||||||
falg = true
|
falg = true
|
||||||
|
}
|
||||||
this.refuelBalance = this.refuelMoney[i].refuelMoney
|
this.refuelBalance = this.refuelMoney[i].refuelMoney
|
||||||
if (this.refuelMoney[i].refuelMoney>0){
|
if (this.refuelMoney[i].refuelMoney>0){
|
||||||
this.isOilStorageCard = true
|
this.isOilStorageCard = true
|
||||||
@ -335,23 +426,26 @@
|
|||||||
}else{
|
}else{
|
||||||
this.oilCardRedece = this.refuelMoney[i].refuelMoney
|
this.oilCardRedece = this.refuelMoney[i].refuelMoney
|
||||||
this.refuelMoneyAfter[i].refuelMoney = 0
|
this.refuelMoneyAfter[i].refuelMoney = 0
|
||||||
|
if (falg) {
|
||||||
this.chooseCardBalance(1)
|
this.chooseCardBalance(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (falg == false) {
|
if (falg == false) {
|
||||||
this.chooseCardBalance(0)
|
this.chooseCardBalance(0)
|
||||||
this.chooseGrade(this.user.id,this.user.gradeId)
|
// this.chooseGrade(this.user.id,this.user.gradeId)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 查看是否有可使用的储值卡金额
|
// 查看是否有可使用的储值卡金额
|
||||||
chooseCardBalance(val){
|
chooseCardBalance(val){
|
||||||
|
console.log("balance");
|
||||||
if (this.user.cardBalance>0) {
|
if (this.user.cardBalance>0) {
|
||||||
this.isStoreValueCard = true;
|
this.isStoreValueCard = true;
|
||||||
if (val == 0) {
|
if (val == 0) {
|
||||||
// 没有使用囤油卡
|
// 没有使用囤油卡
|
||||||
if (this.user.cardBalance >= this.oilOrder.orderAmount){
|
if (this.user.cardBalance >= (this.oilOrder.orderAmount - this.couponRedece)){
|
||||||
this.balanceRedece = this.oilOrder.orderAmount
|
this.balanceRedece = this.oilOrder.orderAmount - this.couponRedece
|
||||||
} else {
|
} else {
|
||||||
this.balanceRedece = this.user.cardBalance
|
this.balanceRedece = this.user.cardBalance
|
||||||
this.deductAmount = (this.oilOrder.orderAmount*100-this.balanceRedece*100)/100
|
this.deductAmount = (this.oilOrder.orderAmount*100-this.balanceRedece*100)/100
|
||||||
@ -380,6 +474,7 @@
|
|||||||
},
|
},
|
||||||
// 查看是否有可使用的会员等级优惠
|
// 查看是否有可使用的会员等级优惠
|
||||||
chooseGrade(userId,gradeId){
|
chooseGrade(userId,gradeId){
|
||||||
|
console.log("userGrade");
|
||||||
let that = this;
|
let that = this;
|
||||||
request({
|
request({
|
||||||
url: "business/userManager/userGrade/isUse",
|
url: "business/userManager/userGrade/isUse",
|
||||||
@ -676,6 +771,7 @@
|
|||||||
},
|
},
|
||||||
// 查看是否有可使用的优惠活动
|
// 查看是否有可使用的优惠活动
|
||||||
chooseFullOrCoupon(){
|
chooseFullOrCoupon(){
|
||||||
|
console.log("full");
|
||||||
this.transferDTO.amount = this.deductAmount
|
this.transferDTO.amount = this.deductAmount
|
||||||
this.transferDTO.mtUserLevel = this.userGrade.id
|
this.transferDTO.mtUserLevel = this.userGrade.id
|
||||||
this.transferDTO.oilId = this.oilId
|
this.transferDTO.oilId = this.oilId
|
||||||
@ -685,7 +781,6 @@
|
|||||||
method: 'post',
|
method: 'post',
|
||||||
data:_this.transferDTO,
|
data:_this.transferDTO,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
// console.log(res)
|
|
||||||
if (res.data.amount>0){
|
if (res.data.amount>0){
|
||||||
_this.payAmount = res.data.amount - _this.gradeRedece
|
_this.payAmount = res.data.amount - _this.gradeRedece
|
||||||
_this.fullRedece = res.data.favorableAmount
|
_this.fullRedece = res.data.favorableAmount
|
||||||
@ -693,10 +788,28 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 查看是否有可使用的优惠券
|
||||||
|
chooseCoupons(){
|
||||||
|
console.log("coupons");
|
||||||
|
request({
|
||||||
|
url: 'business/marketingActivity/cardFavorable/applet',
|
||||||
|
method: 'get',
|
||||||
|
params: this.query
|
||||||
|
}).then(res => {
|
||||||
|
if (res.data.records) {
|
||||||
|
console.log(res.data.records);
|
||||||
|
this.cardsList = res.data.records
|
||||||
|
if (this.cardsList.length>0){
|
||||||
|
this.couponRedece = this.cardsList[0].couponAmount
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
// 计算用户应付金额
|
// 计算用户应付金额
|
||||||
countPayMent(){
|
countPayMent(){
|
||||||
this.payAmount = this.deductAmount - this.gradeRedece - this.fullRedece - this.couponRedece;
|
this.payAmount = this.deductAmount;
|
||||||
|
console.log("111",this.deductAmount, this.gradeRedece, this.fullRedece, this.couponRedece);
|
||||||
},
|
},
|
||||||
|
|
||||||
// 根据店铺id查询用户信息
|
// 根据店铺id查询用户信息
|
||||||
@ -714,15 +827,14 @@
|
|||||||
}
|
}
|
||||||
_this.user = res.data.userVo;
|
_this.user = res.data.userVo;
|
||||||
_this.user = res.data.userVo;
|
_this.user = res.data.userVo;
|
||||||
// console.log(res.data.userVo.refuelMoney);
|
if (res.data.userVo.refuelMoney){
|
||||||
if (res.data.userVo.refuelMoney!=null && res.data.userVo.refuelMoney!=""){
|
|
||||||
_this.refuelMoney = JSON.parse(res.data.userVo.refuelMoney)
|
_this.refuelMoney = JSON.parse(res.data.userVo.refuelMoney)
|
||||||
_this.refuelMoneyAfter = JSON.parse(res.data.userVo.refuelMoney)
|
_this.refuelMoneyAfter = JSON.parse(res.data.userVo.refuelMoney)
|
||||||
_this.chooseRefuelMoney()
|
_this.chooseRefuelMoney()
|
||||||
}else{
|
}else{
|
||||||
_this.chooseCardBalance(0)
|
_this.chooseCardBalance(0)
|
||||||
_this.chooseGrade(res.data.userVo.gradeId)
|
|
||||||
}
|
}
|
||||||
|
_this.chooseGrade(res.data.userVo.id,res.data.userVo.gradeId)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获取油品订单
|
// 获取油品订单
|
||||||
@ -735,12 +847,12 @@
|
|||||||
orderNo: _this.orderNo
|
orderNo: _this.orderNo
|
||||||
},
|
},
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
// console.log(res)
|
|
||||||
if(res.data!=null){
|
if(res.data!=null){
|
||||||
_this.oilOrder = res.data
|
_this.oilOrder = res.data
|
||||||
_this.getStaffList(res.data.staffId)
|
_this.getStaffList(res.data.staffId)
|
||||||
_this.getStore(res.data.storeId)
|
_this.getStore(res.data.storeId)
|
||||||
_this.getOilNumber(res.data.storeId)
|
_this.getOilNumber(res.data.storeId)
|
||||||
|
_this.chooseCoupons()
|
||||||
_this.getUser(res.data.userId)
|
_this.getUser(res.data.userId)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -776,7 +888,6 @@
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
res.data.forEach(item => {
|
res.data.forEach(item => {
|
||||||
// console.log(item);
|
|
||||||
if (item.oilName == _this.oilOrder.oils) {
|
if (item.oilName == _this.oilOrder.oils) {
|
||||||
_this.oilPrice = item.gbPrice;
|
_this.oilPrice = item.gbPrice;
|
||||||
_this.oilName = item.oilNames;
|
_this.oilName = item.oilNames;
|
||||||
|
Loading…
Reference in New Issue
Block a user