2.0.0相关修改更新
This commit is contained in:
@@ -66,19 +66,21 @@
|
||||
<u-icon name="arrow-right" color="#575B66" size="28" v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'"></u-icon>
|
||||
</view>
|
||||
<view class="favorable_right" :class="{column:item.value.length>0}" v-if="item.type=='product'">
|
||||
<view class="favorable_right_text" v-for="(items,indexs) in item.value" :key="indexs">
|
||||
<text>{{items.name}}</text>
|
||||
<text>X{{items.num}}</text>
|
||||
<text>-¥{{items.discountAmount || 0}}</text>
|
||||
</view>
|
||||
<u-icon v-if="item.value.length <= 0 && (listinfo.status == 'unpaid' || listinfo.status == 'paying')" name="arrow-right" color="#575B66" size="28"></u-icon>
|
||||
<view :class="{column:item.value.length>0}">
|
||||
<view class="favorable_right_text" v-for="(items,indexs) in item.value" :key="indexs">
|
||||
<text>{{items.name}}</text>
|
||||
<text>X{{items.num}}</text>
|
||||
<text>-¥{{items.discountAmount || 0}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<u-icon name="arrow-right" color="#575B66" size="28" style="margin-top: 5rpx;"></u-icon>
|
||||
</view>
|
||||
<view class="favorable_right" v-if="item.type=='points'" @click.stop="pointsChange">
|
||||
<text class="favorable_right_text" style="color: #666;margin-right: 16rpx;" v-if="calcUsablePointsData.usable">
|
||||
使用 {{ calcUsablePointsData.pointsNum}} 积分抵扣¥{{calcUsablePointsData.pointsNum/calcUsablePointsData.equivalentPoints}}
|
||||
</text>
|
||||
<text class="favorable_right_text" style="color: #666;margin-right: 16rpx;color: #DE4D3A;" v-else>
|
||||
{{calcUsablePointsData.unusableReason}}
|
||||
{{calcUsablePointsData.unusableReason||''}}
|
||||
</text>
|
||||
|
||||
<u-checkbox-group iconPlacement="right" @change="pointsChange">
|
||||
@@ -275,19 +277,24 @@
|
||||
|
||||
}
|
||||
}
|
||||
let calcUsablePointsData = {}
|
||||
if ( this.listinfo.orderInfo.pointsDiscountAmount ) {
|
||||
this.payAmount = this.payAmount + this.listinfo.orderInfo.pointsDiscountAmount
|
||||
this.isPointsChecked = true;
|
||||
calcUsablePointsData.pointsNum = this.listinfo.orderInfo.pointsDiscountAmount
|
||||
}
|
||||
|
||||
this.$emit("setPayAmount",{
|
||||
payAmount: this.listinfo.payAmount,
|
||||
userCouponInfos: this.userCouponInfos,
|
||||
freeCheck: this.freeCheck,
|
||||
isPointsChecked: this.isPointsChecked,
|
||||
calcUsablePointsData: calcUsablePointsData,
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
childOnShow() {
|
||||
console.log('isShow==',this.isShow)
|
||||
if (!this.isShow ) {
|
||||
this.getCalcUsablePoints()
|
||||
return;
|
||||
@@ -318,7 +325,7 @@
|
||||
//不包含优惠券的金额
|
||||
let currentPayAmount = (this.userCouponInfos.filter(v => v.type == 1).length > 0 ? Number(this.listinfo.payAmount) + couponData.discountAmount : this.listinfo.payAmount)
|
||||
// 判断优惠金额不能大于支付金额
|
||||
if ( couponData.discountAmount < currentPayAmount) {
|
||||
if ( couponData.discountAmount <= currentPayAmount) {
|
||||
|
||||
// if ( this.isPointsChecked && this.calcUsablePointsData) {
|
||||
// this.listinfo.payAmount = (this.listinfo.payAmount-(this.calcUsablePointsData.pointsNum/this.calcUsablePointsData.equivalentPoints)).toFixed(2);
|
||||
@@ -353,8 +360,8 @@
|
||||
// 商品券处理
|
||||
if ( productList.length > 0 ) {
|
||||
//商品券使用数量
|
||||
|
||||
|
||||
|
||||
let payAmount = this.listinfo.payAmount
|
||||
productList.map((item,index)=>{
|
||||
// 筛选选中商品券商品列表
|
||||
let productDetails = this.listinfo.details.filter(v => v.productId == item.proId);
|
||||
@@ -371,15 +378,15 @@
|
||||
productDetails.map((v,indexs) => {
|
||||
productDetailsNum += v.num;
|
||||
})
|
||||
console.log(minCouponList)
|
||||
for (let i = 0; i < v.num; i++){
|
||||
if ( productAllNum < productDetailsNum && productNum < item.num && ((v.memberPrice > 0 ? v.memberPrice : v.price) <= (this.listinfo.payAmount - productPayAmount) )) {
|
||||
if ( productAllNum < productDetailsNum && productNum < item.num && ((v.memberPrice > 0 ? v.memberPrice : v.price) <= (payAmount - productPayAmount) )) {
|
||||
productNum++
|
||||
productAllNum++
|
||||
productPayAmount += v.memberPrice > 0 ? v.memberPrice : v.price
|
||||
}
|
||||
|
||||
}
|
||||
payAmount = payAmount - productPayAmount
|
||||
|
||||
})
|
||||
|
||||
@@ -502,7 +509,7 @@
|
||||
}
|
||||
let res = await this.api.calcUsablePoints(params)
|
||||
this.calcUsablePointsData = res.data;
|
||||
if ( this.calcUsablePointsData.usable && this.listinfo.payAmount >= this.calcUsablePointsData.minPaymentAmount) {
|
||||
if ( this.calcUsablePointsData.usable && params.orderAmount >= this.calcUsablePointsData.minPaymentAmount) {
|
||||
this.calcUsablePointsData.pointsNum = this.calcUsablePointsData.accountPoints >= this.calcUsablePointsData.maxUsablePoints ? this.calcUsablePointsData.maxUsablePoints : this.calcUsablePointsData.accountPoints
|
||||
}
|
||||
},
|
||||
@@ -796,9 +803,11 @@
|
||||
}
|
||||
|
||||
}
|
||||
.favorable_right.column{
|
||||
.favorable_right{
|
||||
.column{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
.favorable_right_text{
|
||||
margin-bottom: 10rpx;
|
||||
text:nth-child(1){
|
||||
@@ -816,6 +825,10 @@
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.favorable_right.column{
|
||||
align-items: flex-start;
|
||||
}
|
||||
}
|
||||
.favorable.column{
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
},
|
||||
watch: {
|
||||
payAmount (newVal) {
|
||||
if ( this.payAmount < this.freeDingConfig.rechargeThreshold ) {
|
||||
if ( this.freeDingConfig && this.payAmount < this.freeDingConfig.rechargeThreshold ) {
|
||||
this.freeDisabled = true
|
||||
} else {
|
||||
this.freeDisabled = false
|
||||
@@ -46,7 +46,12 @@
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
if ( this.freeDingConfig && this.payAmount < this.freeDingConfig.rechargeThreshold ) {
|
||||
this.freeDisabled = true
|
||||
} else {
|
||||
this.freeDisabled = false
|
||||
}
|
||||
console.log(this.freeDisabled )
|
||||
},
|
||||
methods: {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user