优惠券详情

This commit is contained in:
夜良king
2023-01-06 10:33:10 +08:00
parent c8649caf1a
commit 7b7310ed75
2 changed files with 138 additions and 3 deletions

View File

@@ -274,6 +274,42 @@
{{ orderInfo.order.priceDetailDTO.couponPrice | unitPrice("¥") }}
</span>
</li>
<li v-if="orderInfo.order.priceDetailDTO.discountPriceDetail != undefined && orderInfo.order.priceDetailDTO.discountPriceDetail && orderInfo.order.priceDetailDTO.discountPriceDetail != null && orderInfo.order.priceDetailDTO.discountPriceDetail != ''">
<div class="label">
<Poptip trigger="hover" placement="left" width="200">
<Icon v-if="typeList.length > 0" type="ios-alert-outline" size="17" @click="getOrderPrice" color="#cc0000"/>
<template #content>
<div class="api" style="text-align:left;">
<table>
<thead>
<tr>
<th>优惠详情:</th>
</tr>
</thead>
<tbody>
<tr v-for="(item,index) in typeList" :key="index">
<td>{{item.promotionName}}</td>
<td>¥{{ item.discountPrice | unitPrice }}</td>
</tr>
</tbody>
</table>
</div>
</template>
</Poptip>
<span>优惠详情:</span>
</div>
</li>
<!-- <li v-if="showPrices">
<span class="label" style="color: #cc0000;font-size: 14px;" v-if="typeList.length > 0" >优惠详情:</span>
</li> -->
<!-- <li v-if="showPrices" v-for="(item,index) in typeList" :key="index">
<span class="label" v-if="index == 1 && typeList.length > 1" style="font-size:10px !important;"><a @click="gotoHomes" style="display: inline-block;border-bottom: 1px dashed;color:black;width:80px;">{{item.promotionName}}</a></span>
<span class="txt" style="border-bottom: 1px dashed;font-size:10px !important;" v-if="index == 1 && typeList.length > 1">¥{{ item.discountPrice | unitPrice }}</span>
<span class="label" v-if="index == 0 && typeList.length > 1" style="font-size:10px !important;"><a @click="gotoHomes" style="display: inline-block;border-top: 1px dashed;color:black;width:80px;">{{item.promotionName}}</a></span>
<span class="txt" style="border-top: 1px dashed;font-size:10px !important;" v-if="index == 0 && typeList.length > 1">¥{{ item.discountPrice | unitPrice }}</span>
<span class="label" v-if="typeList.length == 1 && index == 0" style="font-size:10px !important;"><a @click="gotoHomes" style="display: inline-block;border-top: 1px dashed;border-bottom: 1px dashed;color:black;width:80px;">{{item.promotionName}}</a></span>
<span class="txt" v-if="typeList.length == 1 && index == 0" style="border-top: 1px dashed;border-bottom: 1px dashed;font-size:10px !important;">¥{{ item.discountPrice | unitPrice }}</span>
</li> -->
<li>
<span class="label">运费:</span>
<span class="txt">{{
@@ -515,6 +551,8 @@ export default {
},
data() {
return {
typeList:[],
showPrices:false,
printHiddenFlag:false,//隐藏信息
printInfoObj:{
id: "printInfo",//要打印的id名 无#号
@@ -699,6 +737,9 @@ export default {
},
},
methods: {
gotoHomes(){
return false
},
//修改地址
regionClick() {
this.showRegion = true;
@@ -722,6 +763,28 @@ export default {
},
});
},
getOrderPrice(){
if(this.showPrices){
this.showPrices = false
}else if(!this.showPrices){
this.showPrices = true
}
},
getContentPrice(){
for (let i = 0; i < this.typeList.length; i++) {
for (let j = i + 1; j < this.typeList.length; j++) {
if (this.typeList[i].promotionId === this.typeList[j].promotionId) {
this.typeList[i].discountPrice = this.typeList[i].discountPrice + this.typeList[j].discountPrice
this.typeList.splice(j, 1)
}
}
}
console.log(this.typeList)
if(this.typeList.length >= 3){
console.log(123123)
this.getContentPrice()
}
},
// 获取订单详情
getDataList() {
this.loading = true;
@@ -731,6 +794,9 @@ export default {
this.orderInfo = res.result;
this.allowOperation = res.result.allowOperationVO;
this.data = res.result.orderItems;
this.typeList = JSON.parse(JSON.stringify(res.result.order.priceDetailDTO.discountPriceDetail));
this.getContentPrice()
this.getOrderPrice()
}
});
},
@@ -899,7 +965,7 @@ export default {
.goods-total {
padding: 20px;
height: 150px;
height: 220px;
width: 100%;
ul {
@@ -916,11 +982,13 @@ export default {
.label {
float: left;
width: 500px;
font-size: 14px;
text-align: right;
}
.txt {
float: left;
font-size: 14px;
width: 130px;
text-align: right;
font-family: verdana;