增加会员价展示
This commit is contained in:
@@ -365,3 +365,19 @@ text {
|
|||||||
.filter-gray {
|
.filter-gray {
|
||||||
filter: grayscale(1);
|
filter: grayscale(1);
|
||||||
}
|
}
|
||||||
|
.youhui-tips{
|
||||||
|
background: #fff;
|
||||||
|
min-width: 150px;
|
||||||
|
border-radius: 4px;
|
||||||
|
border: 1px solid #ebeef5!important;
|
||||||
|
padding: 12px;
|
||||||
|
color: #606266;
|
||||||
|
line-height: 1.4;
|
||||||
|
text-align: justify;
|
||||||
|
font-size: 14px;
|
||||||
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
::v-deep .youhui-tips .popper__arrow{
|
||||||
|
border-top-color: #ebeef5;
|
||||||
|
}
|
||||||
@@ -30,9 +30,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="" v-if="placeNum == 0">
|
<div class="" v-if="placeNum == 0">
|
||||||
<div class="note" v-if="item.note">
|
<div class="note" v-if="item.note">备注:{{ item.note || "" }}</div>
|
||||||
备注:{{ item.note || "" }}
|
|
||||||
</div>
|
|
||||||
<div class="note flex" v-else>
|
<div class="note flex" v-else>
|
||||||
<span>备注:</span>
|
<span>备注:</span>
|
||||||
<span class="el-icon-edit u-font-12" @click="editNote"></span>
|
<span class="el-icon-edit u-font-12" @click="editNote"></span>
|
||||||
@@ -69,15 +67,22 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="color-333 total-price">
|
<div class="color-333 total-price">
|
||||||
<div v-if="item.isGift === 'true' || item.status == 'return'">¥0</div>
|
<template v-if="item.isGift === 'true' || item.status == 'return'">
|
||||||
<div
|
<div>¥0</div>
|
||||||
:class="{
|
<div class="free-price">
|
||||||
'free-price': item.isGift === 'true' || item.status == 'return',
|
<span v-if="isSeatFee"> ¥{{ item.totalAmount }}</span>
|
||||||
}"
|
<span v-else> ¥{{ isShowVipPrice ? vipAllPrice : allPrice }}</span>
|
||||||
>
|
</div>
|
||||||
<span v-if="isSeatFee"> ¥{{ item.totalAmount }}</span>
|
</template>
|
||||||
<span v-else> ¥{{ (item.salePrice*item.number+(item.packAmount||0)).toFixed(2) }}</span>
|
<template v-else>
|
||||||
</div>
|
<div v-if="isSeatFee">¥{{ item.totalAmount }}</div>
|
||||||
|
<div v-else>
|
||||||
|
<div v-if="isShowVipPrice&&vipAllPrice!=allPrice">¥{{ vipAllPrice }}</div>
|
||||||
|
<div :class="{ 'free-price': isShowVipPrice&&vipAllPrice!=allPrice }">
|
||||||
|
<span> ¥{{ allPrice }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -86,6 +91,10 @@
|
|||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
|
isShowVipPrice: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
//是否是餐位费
|
//是否是餐位费
|
||||||
isSeatFee: {
|
isSeatFee: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@@ -133,6 +142,23 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
vipAllPrice() {
|
||||||
|
const item = this.item;
|
||||||
|
const price =
|
||||||
|
this.isShowVipPrice &&
|
||||||
|
item.memberPrice != null &&
|
||||||
|
item.memberPrice != undefined
|
||||||
|
? (item.memberPrice<=0?item.salePrice:item.memberPrice)
|
||||||
|
: item.salePrice;
|
||||||
|
return (price * item.number + (item.packAmount || 0)).toFixed(2);
|
||||||
|
},
|
||||||
|
|
||||||
|
allPrice() {
|
||||||
|
const item = this.item;
|
||||||
|
|
||||||
|
const price = item.salePrice;
|
||||||
|
return (price * item.number + (item.packAmount || 0)).toFixed(2);
|
||||||
|
},
|
||||||
isActive() {
|
isActive() {
|
||||||
const isSel =
|
const isSel =
|
||||||
this.selIndex === this.index && this.placeNum === this.selPlaceNum;
|
this.selIndex === this.index && this.placeNum === this.selPlaceNum;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
:data="quans.fullReductionCoupon"
|
:data="quans.fullReductionCoupon"
|
||||||
@cell-click="fullReductionCouponClick"
|
@cell-click="fullReductionCouponClick"
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="80" label="">
|
<el-table-column type="index" width="80" label="" v-if="quans.fullReductionCoupon.length>0">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
@change="fullReductionCouponClick(scope.row)"
|
@change="fullReductionCouponClick(scope.row)"
|
||||||
|
|||||||
@@ -32,7 +32,12 @@
|
|||||||
<i class="el-icon-user"></i>
|
<i class="el-icon-user"></i>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="ft-13 color-000">{{ vipUser.nickName }}</div>
|
<div class="u-flex">
|
||||||
|
<div class="ft-13 color-000">{{ vipUser.nickName }}</div>
|
||||||
|
<div class="vip" v-if="vipUser.isVip">
|
||||||
|
VIP{{ vipUser.isVip }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div style="margin-top: 2px" class="color-666 ft-12">
|
<div style="margin-top: 2px" class="color-666 ft-12">
|
||||||
余额:{{ vipUser.amount }}
|
余额:{{ vipUser.amount }}
|
||||||
</div>
|
</div>
|
||||||
@@ -277,6 +282,7 @@
|
|||||||
<!-- 当前购物车列表 -->
|
<!-- 当前购物车列表 -->
|
||||||
<template v-if="order.list.length">
|
<template v-if="order.list.length">
|
||||||
<cart-item
|
<cart-item
|
||||||
|
:isShowVipPrice="isShowVipPrice"
|
||||||
@itemClick="changeOrderSel"
|
@itemClick="changeOrderSel"
|
||||||
@changeOrderNumber="changeOrderNumber"
|
@changeOrderNumber="changeOrderNumber"
|
||||||
@cartGoodsNumberInput="cartGoodsNumberInput"
|
@cartGoodsNumberInput="cartGoodsNumberInput"
|
||||||
@@ -327,6 +333,7 @@
|
|||||||
第{{ orderItem.placeNum }}次下单
|
第{{ orderItem.placeNum }}次下单
|
||||||
</div>
|
</div>
|
||||||
<cart-item
|
<cart-item
|
||||||
|
:isShowVipPrice="isShowVipPrice"
|
||||||
@itemClick="changeOrderOldSel"
|
@itemClick="changeOrderOldSel"
|
||||||
:canChangeNumber="false"
|
:canChangeNumber="false"
|
||||||
v-for="(item, index) in orderItem.info"
|
v-for="(item, index) in orderItem.info"
|
||||||
@@ -382,15 +389,23 @@
|
|||||||
|
|
||||||
<div class="w-full bottom">
|
<div class="w-full bottom">
|
||||||
<div class="border-top">
|
<div class="border-top">
|
||||||
<div class="flex row-right youhui" v-if="giftLen">
|
<div class="flex row-right youhui" v-if="youhuiAllPrice > 0">
|
||||||
<span> 已优惠¥{{ allGiftMoney }} </span>
|
<el-tooltip placement="top" effect="light" popper-class="youhui-tips">
|
||||||
<i class="el-icon-arrow-right"></i>
|
<div slot="content">
|
||||||
|
<div class="u-flex">
|
||||||
|
<span>会员优惠:{{ vipDiscountPrice }} </span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<span> 已优惠¥{{ youhuiAllPrice }} </span>
|
||||||
|
<i class="el-icon-arrow-right"></i>
|
||||||
|
</el-tooltip>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex row-between">
|
<div class="flex row-between">
|
||||||
<el-button type="text" @click="printOrder"
|
<el-button type="text" @click="printOrder"
|
||||||
>打印制作单</el-button
|
>打印制作单</el-button
|
||||||
>
|
>
|
||||||
|
<!-- <span v-if="youhuiAllPrice>0" class="youhuiAllPrice">已优惠:{{youhuiAllPrice}} ></span> -->
|
||||||
<!-- <el-checkbox
|
<!-- <el-checkbox
|
||||||
v-model="order.allPack"
|
v-model="order.allPack"
|
||||||
:disabled="!this.order.list.length"
|
:disabled="!this.order.list.length"
|
||||||
@@ -1378,6 +1393,7 @@ import {
|
|||||||
returnGiftArr,
|
returnGiftArr,
|
||||||
returnPackFee,
|
returnPackFee,
|
||||||
formatOrderGoodsList,
|
formatOrderGoodsList,
|
||||||
|
returnVipDiscountPrice,
|
||||||
} from "./util.js";
|
} from "./util.js";
|
||||||
import { $status } from "@/utils/table.js";
|
import { $status } from "@/utils/table.js";
|
||||||
|
|
||||||
@@ -1610,6 +1626,9 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
isShowVipPrice() {
|
||||||
|
return this.vipUser.isVip ? true : false;
|
||||||
|
},
|
||||||
manjian() {
|
manjian() {
|
||||||
let result = 0;
|
let result = 0;
|
||||||
if (this.quansSelArr.length < 0) {
|
if (this.quansSelArr.length < 0) {
|
||||||
@@ -1630,8 +1649,8 @@ export default {
|
|||||||
const total = (amount - this.manjian) * this.createOrder.discount;
|
const total = (amount - this.manjian) * this.createOrder.discount;
|
||||||
return total <= 0 ? 0 : total;
|
return total <= 0 ? 0 : total;
|
||||||
},
|
},
|
||||||
yinFuJinE(){
|
yinFuJinE() {
|
||||||
const total=this.currentPayMoney-( this.points.toMoney||0)
|
const total = this.currentPayMoney - (this.points.toMoney || 0);
|
||||||
return total.toFixed(2);
|
return total.toFixed(2);
|
||||||
},
|
},
|
||||||
disableTuicai() {
|
disableTuicai() {
|
||||||
@@ -1724,6 +1743,7 @@ export default {
|
|||||||
}, "");
|
}, "");
|
||||||
return result.substring(0, result.length - 1);
|
return result.substring(0, result.length - 1);
|
||||||
},
|
},
|
||||||
|
|
||||||
allPrice() {
|
allPrice() {
|
||||||
const oldPrice = this.order.old.list.reduce((a, b) => {
|
const oldPrice = this.order.old.list.reduce((a, b) => {
|
||||||
const bTotal = b.info
|
const bTotal = b.info
|
||||||
@@ -1747,10 +1767,40 @@ export default {
|
|||||||
this.order.seatFee.totalAmount *
|
this.order.seatFee.totalAmount *
|
||||||
(returnStatus.includes(this.order.seatFee.status) ? 0 : 1);
|
(returnStatus.includes(this.order.seatFee.status) ? 0 : 1);
|
||||||
return (
|
return (
|
||||||
(oldPrice + price + +packFee + seatFee) *
|
(oldPrice + price + +packFee + seatFee - this.youhuiAllPrice) *
|
||||||
this.createOrder.discount
|
this.createOrder.discount
|
||||||
).toFixed(2);
|
).toFixed(2);
|
||||||
},
|
},
|
||||||
|
vipDiscountPrice() {
|
||||||
|
if (!this.vipUser.isVip) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
const oldMemberPrice = this.order.old.list.reduce((a, b) => {
|
||||||
|
const bTotal = b.info
|
||||||
|
.filter(
|
||||||
|
(v) =>
|
||||||
|
v.isGift !== "true" &&
|
||||||
|
v.memberPrice &&
|
||||||
|
v.memberPrice != v.salePrice
|
||||||
|
)
|
||||||
|
.reduce((prve, cur) => {
|
||||||
|
return prve + cur.number * (cur.salePrice - cur.memberPrice);
|
||||||
|
}, 0);
|
||||||
|
return a + bTotal;
|
||||||
|
}, 0);
|
||||||
|
const nowMemberprice = this.order.list
|
||||||
|
.filter(
|
||||||
|
(v) =>
|
||||||
|
v.isGift !== "true" && v.memberPrice && v.memberPrice != v.salePrice
|
||||||
|
)
|
||||||
|
.reduce((a, b) => {
|
||||||
|
return a + b.number * (b.salePrice - b.memberPrice);
|
||||||
|
}, 0);
|
||||||
|
return (oldMemberPrice + nowMemberprice).toFixed(2);
|
||||||
|
},
|
||||||
|
youhuiAllPrice() {
|
||||||
|
return (this.vipDiscountPrice * 1 + this.allGiftMoney * 1).toFixed(2);
|
||||||
|
},
|
||||||
allNumber() {
|
allNumber() {
|
||||||
const oldNumber = this.order.old.list.reduce((a, b) => {
|
const oldNumber = this.order.old.list.reduce((a, b) => {
|
||||||
const bTotal = b.info.reduce((prve, cur) => {
|
const bTotal = b.info.reduce((prve, cur) => {
|
||||||
@@ -1810,7 +1860,7 @@ export default {
|
|||||||
this.getGoods();
|
this.getGoods();
|
||||||
},
|
},
|
||||||
currentPayMoney: function (newval) {
|
currentPayMoney: function (newval) {
|
||||||
if (this.createOrder.data.memberId||this.vipUser.id) {
|
if (this.createOrder.data.memberId || this.vipUser.id) {
|
||||||
this.getCalcUsablePoints().then((res) => {
|
this.getCalcUsablePoints().then((res) => {
|
||||||
this.pointsValueChange(this.points.value);
|
this.pointsValueChange(this.points.value);
|
||||||
});
|
});
|
||||||
@@ -1857,7 +1907,7 @@ export default {
|
|||||||
this.createOrder.discount = 1;
|
this.createOrder.discount = 1;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"vipUser.id": function (val) {
|
"vipUser.id": function (val) {
|
||||||
// if (!this.table.tableId) {
|
// if (!this.table.tableId) {
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
@@ -1996,18 +2046,18 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async getCalcUsablePoints() {
|
async getCalcUsablePoints() {
|
||||||
const memberId= this.createOrder.data.memberId || this.vipUser.id
|
const memberId = this.createOrder.data.memberId || this.vipUser.id;
|
||||||
if(!memberId){
|
if (!memberId) {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
const pointsRes = await $calcUsablePoints({
|
const pointsRes = await $calcUsablePoints({
|
||||||
memberId:memberId,
|
memberId: memberId,
|
||||||
orderAmount: this.currentPayMoney.toFixed(2),
|
orderAmount: this.currentPayMoney.toFixed(2),
|
||||||
});
|
});
|
||||||
this.points.res = pointsRes;
|
this.points.res = pointsRes;
|
||||||
this.points.minDeductionPoints = pointsRes.minDeductionPoints;
|
this.points.minDeductionPoints = pointsRes.minDeductionPoints;
|
||||||
this.points.maxUsablePoints = pointsRes.maxUsablePoints;
|
this.points.maxUsablePoints = pointsRes.maxUsablePoints;
|
||||||
if(this.points.selected){
|
if (this.points.selected) {
|
||||||
this.points.value = Math.min(
|
this.points.value = Math.min(
|
||||||
this.vipUser.accountPoints,
|
this.vipUser.accountPoints,
|
||||||
this.points.res.maxUsablePoints || 0
|
this.points.res.maxUsablePoints || 0
|
||||||
@@ -3736,6 +3786,22 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.youhui-tips{
|
||||||
|
background: #fff;
|
||||||
|
min-width: 150px;
|
||||||
|
border-radius: 4px;
|
||||||
|
border: 1px solid #ebeef5;
|
||||||
|
padding: 12px;
|
||||||
|
color: #606266;
|
||||||
|
line-height: 1.4;
|
||||||
|
text-align: justify;
|
||||||
|
font-size: 14px;
|
||||||
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
::v-deep .youhui-tips .popper__arrow{
|
||||||
|
border-top-color: #ebeef5;
|
||||||
|
}
|
||||||
.selQuan {
|
.selQuan {
|
||||||
border: 1px solid #d9d9d9;
|
border: 1px solid #d9d9d9;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
@@ -3926,7 +3992,15 @@ input[type="number"]::-webkit-outer-spin-button {
|
|||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
line-height: 16px;
|
line-height: 16px;
|
||||||
}
|
}
|
||||||
|
.vip {
|
||||||
|
font-size: 10px;
|
||||||
|
padding: 2px 5px;
|
||||||
|
background: #f7793d;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 4px;
|
||||||
|
margin-left: 10px;
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
::v-deep .el-dialog__footer {
|
::v-deep .el-dialog__footer {
|
||||||
border-top: 1px solid #efefef;
|
border-top: 1px solid #efefef;
|
||||||
}
|
}
|
||||||
@@ -4034,6 +4108,11 @@ input[type="number"]::-webkit-outer-spin-button {
|
|||||||
.mt-14 {
|
.mt-14 {
|
||||||
margin-top: 14px;
|
margin-top: 14px;
|
||||||
}
|
}
|
||||||
|
.youhuiAllPrice {
|
||||||
|
color: #c12a2a;
|
||||||
|
font-size: 13px;
|
||||||
|
line-height: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
.my-btn {
|
.my-btn {
|
||||||
outline: none;
|
outline: none;
|
||||||
|
|||||||
@@ -5,13 +5,13 @@ export function returnPackFee(arr, isOld = true) {
|
|||||||
const bTotal = b.info
|
const bTotal = b.info
|
||||||
.filter((v) => v.isGift !== "true" && v.status !== "return")
|
.filter((v) => v.isGift !== "true" && v.status !== "return")
|
||||||
.reduce((prve, cur) => {
|
.reduce((prve, cur) => {
|
||||||
return prve + (cur.packFee || cur.packAmount||0);
|
return prve + (cur.packFee || cur.packAmount || 0);
|
||||||
}, 0);
|
}, 0);
|
||||||
return a + bTotal;
|
return a + bTotal;
|
||||||
}, 0);
|
}, 0);
|
||||||
} else {
|
} else {
|
||||||
return arr.filter(v => v.status !== 'return' && v.isGift !== 'true').reduce((a, b) => {
|
return arr.filter(v => v.status !== 'return' && v.isGift !== 'true').reduce((a, b) => {
|
||||||
return a + (b.packFee || b.packAmount||0);
|
return a + (b.packFee || b.packAmount || 0);
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,28 +90,35 @@ export function returnGiftArr(arr) {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
export function formatOrderGoodsList(arr){
|
export function formatOrderGoodsList(arr) {
|
||||||
const goodsMap = {}
|
const goodsMap = {}
|
||||||
for (let i in arr) {
|
for (let i in arr) {
|
||||||
const goods = arr[i]
|
const goods = arr[i]
|
||||||
if (goods.productName != '客座费') {
|
if (goods.productName != '客座费') {
|
||||||
if (goodsMap.hasOwnProperty(goods.placeNum)) {
|
if (goodsMap.hasOwnProperty(goods.placeNum)) {
|
||||||
goodsMap[goods.placeNum||1].push(goods)
|
goodsMap[goods.placeNum || 1].push(goods)
|
||||||
} else {
|
} else {
|
||||||
goodsMap[goods.placeNum||1] = [goods]
|
goodsMap[goods.placeNum || 1] = [goods]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return Object.entries(goodsMap).map(([key, value]) => ({
|
return Object.entries(goodsMap).map(([key, value]) => ({
|
||||||
info: value,
|
info: value,
|
||||||
placeNum: key||1
|
placeNum: key || 1
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
export function returnIsSeatFee(item){
|
export function returnIsSeatFee(item) {
|
||||||
if(!item){
|
if (!item) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return item.productId=="-999"
|
return item.productId == "-999"
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 计算购物车会员优惠价格
|
||||||
|
*/
|
||||||
|
export function returnVipDiscountPrice() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user