代课下单添加显示

This commit is contained in:
魏啾 2024-12-06 17:28:38 +08:00
parent 850509ba04
commit a546fd3fb5
1 changed files with 69 additions and 47 deletions

View File

@ -1,9 +1,5 @@
<template> <template>
<div <div class="flex order-item u-m-b-14 relative" :class="[isActive]" @click="itemClick">
class="flex order-item u-m-b-14 relative"
:class="[isActive]"
@click="itemClick"
>
<div class="absolute status-box"> <div class="absolute status-box">
<span class="pack" v-if="item.isPack === 'true'"> </span> <span class="pack" v-if="item.isPack === 'true'"> </span>
<span class="da" v-if="item.isPrint || item.isPrint === null"> </span> <span class="da" v-if="item.isPrint || item.isPrint === null"> </span>
@ -12,16 +8,10 @@
</div> </div>
<div class="flex u-col-top"> <div class="flex u-col-top">
<div class="img"> <div class="img">
<div <div class="isSeatFee img u-line-1 u-flex u-col-center u-row-center" v-if="isSeatFee">
class="isSeatFee img u-line-1 u-flex u-col-center u-row-center"
v-if="isSeatFee"
>
<span>{{ item.name }}</span> <span>{{ item.name }}</span>
</div> </div>
<div <div class="isSeatFee img u-line-1 u-flex u-col-center u-row-center" v-else-if="!item.productId">
class="isSeatFee img u-line-1 u-flex u-col-center u-row-center"
v-else-if="!item.productId"
>
<span> 临时菜 </span> <span> 临时菜 </span>
</div> </div>
<img v-else :src="item.coverImg" class="" alt="" /> <img v-else :src="item.coverImg" class="" alt="" />
@ -31,9 +21,7 @@
<div class="name" :class="{ 'free-price': item.status === 'return' }"> <div class="name" :class="{ 'free-price': item.status === 'return' }">
{{ item.name }} {{ item.name }}
</div> </div>
<span class="good_info_discount" v-if="item.isGift === 'true'" <span class="good_info_discount" v-if="item.isGift === 'true'"></span>
></span
>
</div> </div>
<div v-if="item.typeEnum == 'weight'" class="specSnap"> <div v-if="item.typeEnum == 'weight'" class="specSnap">
{{ currentPrice }}/{{ item.unit }} {{ currentPrice }}/{{ item.unit }}
@ -41,6 +29,12 @@
<div v-if="item.specSnap" class="specSnap"> <div v-if="item.specSnap" class="specSnap">
{{ item.specSnap }} {{ item.specSnap }}
</div> </div>
<div v-if="item.proGroupInfo" class="specSnapss">
<span>{{ item.groupType == 0 ? '固定套餐' : '可选套餐' }}:</span>
<span v-for="(a, b) in proGroupInfo" :key="a.proId">
{{ b == 0 ? '' : ',' }}{{ a.proName }}
</span>
</div>
<div class="" v-if="placeNum == 0"> <div class="" v-if="placeNum == 0">
<div class="note" v-if="item.note">备注:{{ item.note }}</div> <div class="note" v-if="item.note">备注:{{ item.note }}</div>
@ -62,19 +56,10 @@
<div class="order-input-number"> <div class="order-input-number">
<i class="icon-remove" @click="changeOrderNumber(true)"></i> <i class="icon-remove" @click="changeOrderNumber(true)"></i>
<div style="width: 40px" class="number-box"> <div style="width: 40px" class="number-box">
<el-input <el-input :min="0" type="number" @input="cartGoodsNumberInput" @change="cartGoodsNumberChange"
:min="0" v-model="number" placeholder="0"></el-input>
type="number"
@input="cartGoodsNumberInput"
@change="cartGoodsNumberChange"
v-model="number"
placeholder="0"
></el-input>
</div> </div>
<i <i class="el-icon-circle-plus icon-add" @click="changeOrderNumber(false)"></i>
class="el-icon-circle-plus icon-add"
@click="changeOrderNumber(false)"
></i>
</div> </div>
</div> </div>
</div> </div>
@ -99,11 +84,9 @@
<div v-if="isShowVipPrice && vipAllPrice != allPrice"> <div v-if="isShowVipPrice && vipAllPrice != allPrice">
{{ vipAllPrice }} {{ vipAllPrice }}
</div> </div>
<div <div :class="{
:class="{
'free-price': isShowVipPrice && vipAllPrice != allPrice, 'free-price': isShowVipPrice && vipAllPrice != allPrice,
}" }">
>
<span> {{ allPrice }}</span> <span> {{ allPrice }}</span>
</div> </div>
</div> </div>
@ -173,6 +156,9 @@ export default {
} }
return this.memberPrice ? this.memberPrice : this.item.salePrice return this.memberPrice ? this.memberPrice : this.item.salePrice
}, },
proGroupInfo() {
return JSON.parse(this.item.proGroupInfo)
},
discountNewPrice() { discountNewPrice() {
const item = this.item; const item = this.item;
const originPrice = this.isShowVipPrice ? this.vipAllPrice : this.allPrice const originPrice = this.isShowVipPrice ? this.vipAllPrice : this.allPrice
@ -254,19 +240,23 @@ export default {
::v-deep .number-box .el-input__inner { ::v-deep .number-box .el-input__inner {
border: none; border: none;
} }
::v-deep .el-button--text { ::v-deep .el-button--text {
color: #000; color: #000;
} }
::v-deep .number-box .el-input__inner { ::v-deep .number-box .el-input__inner {
border: none; border: none;
padding: 0 4px; padding: 0 4px;
text-align: center; text-align: center;
} }
.isSeatFee { .isSeatFee {
background: #3f9eff; background: #3f9eff;
color: #fff; color: #fff;
font-size: 12px; font-size: 12px;
} }
.icon-remove { .icon-remove {
border: 1px solid #d8d8d8; border: 1px solid #d8d8d8;
width: 22px; width: 22px;
@ -286,11 +276,13 @@ export default {
background: #999; background: #999;
} }
} }
.icon-add { .icon-add {
color: rgb(34, 191, 100); color: rgb(34, 191, 100);
font-size: 22px; font-size: 22px;
cursor: pointer; cursor: pointer;
} }
.flex.order-item { .flex.order-item {
padding: 4px; padding: 4px;
border-radius: 2px; border-radius: 2px;
@ -301,6 +293,7 @@ export default {
justify-content: space-between; justify-content: space-between;
background-color: rgba(0, 0, 0, 0); background-color: rgba(0, 0, 0, 0);
transition: all 0.3s; transition: all 0.3s;
.status-box { .status-box {
width: 18px; width: 18px;
position: absolute; position: absolute;
@ -309,6 +302,7 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 2px; gap: 2px;
>span { >span {
display: block; display: block;
width: 18px; width: 18px;
@ -320,9 +314,11 @@ export default {
color: #fff; color: #fff;
} }
} }
.isWaitCall { .isWaitCall {
background: #d3adf7; background: #d3adf7;
} }
.pack { .pack {
background: #35ac6a; background: #35ac6a;
} }
@ -330,9 +326,11 @@ export default {
.da { .da {
background: #35ac6a; background: #35ac6a;
} }
.tui { .tui {
background: #ac4735; background: #ac4735;
} }
&.active { &.active {
background-color: rgba(0, 0, 0, 0.04); background-color: rgba(0, 0, 0, 0.04);
} }
@ -354,6 +352,27 @@ export default {
font-size: 12px; font-size: 12px;
margin-top: 3px; margin-top: 3px;
} }
.specSnapss {
display: flex;
justify-content: flex-start;
align-items: center;
flex-wrap: wrap;
color: #999;
font-size: 12px;
margin-top: 3px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
.specSnap {
color: #999;
font-size: 12px;
margin-top: 3px;
}
}
} }
.name { .name {
@ -375,6 +394,7 @@ export default {
} }
} }
} }
.note { .note {
max-width: 70%; max-width: 70%;
font-size: 12px; font-size: 12px;
@ -384,6 +404,7 @@ export default {
margin-top: 5px; margin-top: 5px;
word-break: break-all; word-break: break-all;
} }
.order-number-box { .order-number-box {
position: relative; position: relative;
@ -415,6 +436,7 @@ export default {
} }
} }
} }
.good_info_discount { .good_info_discount {
height: 16px; height: 16px;
padding: 0 3px; padding: 0 3px;