优化更新
This commit is contained in:
@@ -30,10 +30,7 @@
|
||||
<div class="isSeatFee img u-line-1 u-flex u-col-center u-row-center" v-if="isSeatFee">
|
||||
<span>{{ item.name }}</span>
|
||||
</div>
|
||||
<div
|
||||
class="isSeatFee img u-line-1 u-flex u-col-center u-row-center"
|
||||
v-else-if="item.is_temporary"
|
||||
>
|
||||
<div class="isSeatFee img u-line-1 u-flex u-col-center u-row-center" v-else-if="item.is_temporary">
|
||||
<span>临时菜</span>
|
||||
</div>
|
||||
<img v-else :src="item.coverImg" class="" alt="" />
|
||||
@@ -62,7 +59,9 @@
|
||||
<div class="note" v-if="item.remark">备注:{{ item.remark }}</div>
|
||||
<div class="note flex" v-else>
|
||||
<span>备注:</span>
|
||||
<el-icon v-if="!isOld" @click="editNote" color="#999"><EditPen /></el-icon>
|
||||
<el-icon v-if="!isOld" @click="editNote" color="#999">
|
||||
<EditPen />
|
||||
</el-icon>
|
||||
</div>
|
||||
</div>
|
||||
<div class="note" v-if="placeNum != 0 && item.note">备注:{{ item.remark || "" }}</div>
|
||||
@@ -75,17 +74,13 @@
|
||||
<div class="" v-else>X{{ item.number }}</div>
|
||||
<div class="absolute" v-if="canChangeNumber">
|
||||
<div class="order-input-number">
|
||||
<el-icon color="#d8d8d8" size="22" @click="changeOrderNumber(-1)"><Remove /></el-icon>
|
||||
<el-icon color="#d8d8d8" size="22" @click="changeOrderNumber(-1)">
|
||||
<Remove />
|
||||
</el-icon>
|
||||
|
||||
<div style="width: 60px; margin: 0 4px" class="number-box">
|
||||
<el-input
|
||||
:min="0"
|
||||
type="number"
|
||||
@input="cartGoodsNumberInput"
|
||||
@change="cartGoodsNumberChange"
|
||||
v-model="number"
|
||||
placeholder="0"
|
||||
></el-input>
|
||||
<el-input :min="0" type="number" @input="cartGoodsNumberInput" @change="cartGoodsNumberChange"
|
||||
v-model="number" placeholder="0"></el-input>
|
||||
</div>
|
||||
<el-icon color="#22bf64" size="22" @click="changeOrderNumber(1)">
|
||||
<CirclePlusFilled />
|
||||
@@ -93,7 +88,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="color-333 total-price">
|
||||
<template v-if="item.is_gift || item.status == 'return'">
|
||||
<div>¥0</div>
|
||||
@@ -103,28 +97,32 @@
|
||||
</div>
|
||||
</template>
|
||||
<!-- 单品改价 -->
|
||||
<template
|
||||
v-else-if="
|
||||
item.discount_sale_amount * 1 > 0 &&
|
||||
discount_before_price != allPrice &&
|
||||
!item.is_temporary
|
||||
"
|
||||
>
|
||||
<template v-else-if="
|
||||
item.discount_sale_amount * 1 > 0 &&
|
||||
discount_before_price != allPrice &&
|
||||
!item.is_temporary
|
||||
">
|
||||
<div>¥{{ to2(allPrice) }}</div>
|
||||
<div class="free-price">
|
||||
<span>¥{{ to2(discount_before_price) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div>
|
||||
<div v-if="item.isLimitDiscount || item.is_time_discount">
|
||||
<div>
|
||||
¥{{ to2(item.limitDiscountPrice) }}
|
||||
</div>
|
||||
<div class="free-price">
|
||||
<span>¥{{ to2(item.salePrice) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div v-if="useVipPrice && vipAllPrice * 1 != allPrice * 1">
|
||||
¥{{ to2(vipAllPrice) }}
|
||||
</div>
|
||||
<div
|
||||
:class="{
|
||||
'free-price': useVipPrice && vipAllPrice != allPrice,
|
||||
}"
|
||||
>
|
||||
<div :class="{
|
||||
'free-price': useVipPrice && vipAllPrice != allPrice,
|
||||
}">
|
||||
<span>¥{{ to2(allPrice) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -349,7 +347,7 @@ onMounted(() => {
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
|
||||
> span {
|
||||
>span {
|
||||
display: block;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
@@ -367,6 +365,7 @@ onMounted(() => {
|
||||
|
||||
.pack {
|
||||
background: #35ac6a;
|
||||
|
||||
.number {
|
||||
background: #f56c6c;
|
||||
color: #fff;
|
||||
@@ -379,8 +378,10 @@ onMounted(() => {
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
.tui {
|
||||
position: relative;
|
||||
|
||||
.number {
|
||||
background: #f56c6c;
|
||||
color: #fff;
|
||||
@@ -393,6 +394,7 @@ onMounted(() => {
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
.da {
|
||||
background: #35ac6a;
|
||||
}
|
||||
|
||||
@@ -1,58 +1,34 @@
|
||||
<template>
|
||||
<div class="goods-item">
|
||||
<el-image
|
||||
v-if="item.coverImg"
|
||||
class="goods-image"
|
||||
:src="item.coverImg + '?x-oss-process=image/resize,m_lfit,w_100,h_100'"
|
||||
fit="cover"
|
||||
></el-image>
|
||||
<el-image v-if="item.coverImg" class="goods-image"
|
||||
:src="item.coverImg + '?x-oss-process=image/resize,m_lfit,w_100,h_100'" fit="cover"></el-image>
|
||||
<div class="info" @click="itemClick">
|
||||
<div class="name u-flex u-flex-wrap">
|
||||
<span class="weight" v-if="item.type == 'weight'">称重</span>
|
||||
<span class="u-line-3">{{ item.name }}</span>
|
||||
</div>
|
||||
<div class="">¥{{ item.lowPrice }}</div>
|
||||
<div class="" v-if="item.isLimitDiscount">
|
||||
<span class="o_price">¥{{ item.lowPrice }}</span>
|
||||
<span>¥{{ item.limitDiscountPrice }}</span>
|
||||
</div>
|
||||
<div v-else>¥{{ item.lowPrice }}</div>
|
||||
</div>
|
||||
<div
|
||||
class="status"
|
||||
v-if="
|
||||
item.isSoldStock ||
|
||||
!item.isSale ||
|
||||
!item.isSaleTime ||
|
||||
(item.isStock && item.stockNumber * 1 <= 0)
|
||||
"
|
||||
>
|
||||
<svg-icon
|
||||
@click="ElMessage.error('该商品已下架')"
|
||||
v-if="!item.isSale"
|
||||
iconClass="yi-xiajia"
|
||||
color="#fff"
|
||||
size="60"
|
||||
></svg-icon>
|
||||
<svg-icon
|
||||
@click="
|
||||
ElMessage.error('该商品不在可售时间内') ||
|
||||
isProductAvailable(item.days, item.startTime, item.endTime)
|
||||
"
|
||||
v-else-if="!item.isSaleTime"
|
||||
iconClass="no-sale"
|
||||
color="#fff"
|
||||
size="60"
|
||||
></svg-icon>
|
||||
<svg-icon
|
||||
@click="ElMessage.error('该商品已售罄')"
|
||||
v-else-if="item.isSoldStock"
|
||||
iconClass="shouqing"
|
||||
color="#fff"
|
||||
size="60"
|
||||
></svg-icon>
|
||||
<svg-icon
|
||||
@click="ElMessage.error('库存不足')"
|
||||
v-else-if="item.isStock && item.stockNumber * 1 <= 0"
|
||||
iconClass="stock_null"
|
||||
color="#fff"
|
||||
size="60"
|
||||
></svg-icon>
|
||||
<div class="status" v-if="
|
||||
item.isSoldStock ||
|
||||
!item.isSale ||
|
||||
!item.isSaleTime ||
|
||||
(item.isStock && item.stockNumber * 1 <= 0)
|
||||
">
|
||||
<svg-icon @click="ElMessage.error('该商品已下架')" v-if="!item.isSale" iconClass="yi-xiajia" color="#fff"
|
||||
size="60"></svg-icon>
|
||||
<svg-icon @click="
|
||||
ElMessage.error('该商品不在可售时间内') ||
|
||||
isProductAvailable(item.days, item.startTime, item.endTime)
|
||||
" v-else-if="!item.isSaleTime" iconClass="no-sale" color="#fff" size="60"></svg-icon>
|
||||
<svg-icon @click="ElMessage.error('该商品已售罄')" v-else-if="item.isSoldStock" iconClass="shouqing" color="#fff"
|
||||
size="60"></svg-icon>
|
||||
<svg-icon @click="ElMessage.error('库存不足')" v-else-if="item.isStock && item.stockNumber * 1 <= 0"
|
||||
iconClass="stock_null" color="#fff" size="60"></svg-icon>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -105,10 +81,12 @@ function isProductAvailable(sellDaysStr, startTimeStr, endTimeStr) {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
|
||||
.goods-image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.info {
|
||||
position: absolute;
|
||||
box-sizing: border-box;
|
||||
@@ -122,6 +100,7 @@ function isProductAvailable(sellDaysStr, startTimeStr, endTimeStr) {
|
||||
background-color: rgba(46, 46, 46, 0.38);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.status {
|
||||
position: absolute;
|
||||
box-sizing: border-box;
|
||||
@@ -134,9 +113,11 @@ function isProductAvailable(sellDaysStr, startTimeStr, endTimeStr) {
|
||||
background-color: rgba($color: #000000, $alpha: 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.svg-icon) {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.weight {
|
||||
height: 15px;
|
||||
background: linear-gradient(124deg, rgb(115, 201, 105) 6%, rgb(39, 146, 27) 93%);
|
||||
@@ -147,4 +128,10 @@ function isProductAvailable(sellDaysStr, startTimeStr, endTimeStr) {
|
||||
padding: 0px 2px;
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
.o_price {
|
||||
font-size: 10px;
|
||||
text-decoration: line-through;
|
||||
opacity: .8;
|
||||
}
|
||||
</style>
|
||||
@@ -42,22 +42,11 @@
|
||||
<span class="u-font-14">部分抵扣</span>
|
||||
</el-radio> -->
|
||||
</el-radio-group>
|
||||
<el-input-number
|
||||
class="u-m-l-10"
|
||||
v-if="score.sel != -1"
|
||||
v-model="usePointsNumber"
|
||||
step-strictly
|
||||
:step="pointsRes.equivalentPoints"
|
||||
placeholder="请输入积分抵扣数量"
|
||||
:min="pointsRes.minDeductionPoints"
|
||||
:max="pointsRes.maxUsablePoints"
|
||||
@change="pointsToMoney"
|
||||
></el-input-number>
|
||||
<el-input-number class="u-m-l-10" v-if="score.sel != -1" v-model="usePointsNumber" step-strictly
|
||||
:step="pointsRes.equivalentPoints" placeholder="请输入积分抵扣数量" :min="pointsRes.minDeductionPoints"
|
||||
:max="pointsRes.maxUsablePoints" @change="pointsToMoney"></el-input-number>
|
||||
</div>
|
||||
<p
|
||||
class="u-font-14 color-666 u-m-t-10"
|
||||
v-if="pointsRes.unusableReason && !pointsRes.usable"
|
||||
>
|
||||
<p class="u-font-14 color-666 u-m-t-10" v-if="pointsRes.unusableReason && !pointsRes.usable">
|
||||
<span class="color-red">*</span>
|
||||
<span>{{ pointsRes.unusableReason }}</span>
|
||||
</p>
|
||||
@@ -70,7 +59,9 @@
|
||||
<span class="u-font-14 font-bold u-m-r-20">团购代金券</span>
|
||||
<div class="u-flex my-select">
|
||||
<span class="u-m-r-10">代金券名称</span>
|
||||
<el-icon><ArrowDown /></el-icon>
|
||||
<el-icon>
|
||||
<ArrowDown />
|
||||
</el-icon>
|
||||
</div>
|
||||
<svg-icon iconClass="scan" size="30" class="u-m-l-10 cur-pointer"></svg-icon>
|
||||
</div>
|
||||
@@ -78,7 +69,9 @@
|
||||
<span class="u-font-14 font-bold u-m-r-20">优惠券</span>
|
||||
<div class="u-flex my-select" @click="openCoupon">
|
||||
<span class="u-m-r-10">选择优惠券</span>
|
||||
<el-icon><ArrowDown /></el-icon>
|
||||
<el-icon>
|
||||
<ArrowDown />
|
||||
</el-icon>
|
||||
</div>
|
||||
</div>
|
||||
<div class="u-m-t-20" v-if="quansSelArr.length > 0">
|
||||
@@ -121,16 +114,13 @@
|
||||
<div class="u-m-t-30">
|
||||
<p class="u-font-16 font-bold u-m-r-20 font-bold u-flex">选择支付方式</p>
|
||||
<div class="u-m-t-20">
|
||||
<el-button
|
||||
v-for="(item, index) in payTypes.list"
|
||||
:key="index"
|
||||
size="large"
|
||||
:type="index == payTypes.sel ? 'primary' : ''"
|
||||
:disabled="canUsePayType(item)"
|
||||
@click="changePayType(index)"
|
||||
>
|
||||
{{ item.payName }}
|
||||
</el-button>
|
||||
<div>
|
||||
<el-button v-for="(item, index) in payTypes.list" :key="index" size="large"
|
||||
:type="index == payTypes.sel ? 'primary' : ''" :disabled="canUsePayType(item)"
|
||||
@click="changePayType(index)">
|
||||
{{ item.payName }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="u-m-t-20">
|
||||
<el-button type="primary" size="large" @click="nowPayClick()">立即支付</el-button>
|
||||
@@ -206,26 +196,17 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- 扫码 -->
|
||||
<scanPay
|
||||
ref="refScanPay"
|
||||
:order="orderInfo"
|
||||
@confirm="refScanPayConfirm"
|
||||
@paysuccess="paysuccess"
|
||||
></scanPay>
|
||||
<scanPay ref="refScanPay" :order="orderInfo" @confirm="refScanPayConfirm" @paysuccess="paysuccess"></scanPay>
|
||||
<!-- 打折 -->
|
||||
<discount ref="refDiscount" @confirm="discountConfirm"></discount>
|
||||
<!-- 优惠券 -->
|
||||
<popup-coupon ref="refCoupon" :user="user" @confirm="refCouponConfirm"></popup-coupon>
|
||||
<!-- 挂账 -->
|
||||
<chooseGuaZahng
|
||||
ref="refGuaZhang"
|
||||
:payMoney="currentpayMoney"
|
||||
@confirm="refGuaZhangConfirm"
|
||||
></chooseGuaZahng>
|
||||
<chooseGuaZahng ref="refGuaZhang" :payMoney="currentpayMoney" @confirm="refGuaZhangConfirm"></chooseGuaZahng>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
<script setup>
|
||||
import * as UTILS from "@/utils/coupon-utils.js";
|
||||
|
||||
import * as quanUtil from "../quan_util.js";
|
||||
@@ -237,7 +218,7 @@ const shopUser = useUserStore();
|
||||
const carts = useCartsStore();
|
||||
import popupCoupon from "./popup-coupon.vue";
|
||||
import PointsApi from "@/api/account/points";
|
||||
|
||||
import limitTimeDiscountApi from '@/api/market/limitTimeDiscount.js'
|
||||
import payTypeApi from "@/api/account/payType";
|
||||
import payApi from "@/api/order/pay";
|
||||
import scanPay from "./scan-pay.vue";
|
||||
@@ -357,7 +338,7 @@ function discountShow(e) {
|
||||
const props = defineProps({
|
||||
table: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
default: () => { },
|
||||
},
|
||||
user: {
|
||||
type: Object,
|
||||
@@ -371,7 +352,7 @@ const props = defineProps({
|
||||
},
|
||||
orderInfo: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
default: () => { },
|
||||
},
|
||||
});
|
||||
|
||||
@@ -488,6 +469,26 @@ function changePayType(i) {
|
||||
refScanPayOpen(payType);
|
||||
}
|
||||
|
||||
// 根据用户id获取新客立减金额,返回null代表不可用
|
||||
const newCustomerDiscount = ref(null)
|
||||
async function getConsumeDiscountAjax() {
|
||||
try {
|
||||
if (props.user.id) {
|
||||
newCustomerDiscount.value = await limitTimeDiscountApi.getConsumeDiscount({
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
shopUserId: props.user.id,
|
||||
orderId: props.orderInfo.id
|
||||
})
|
||||
console.log('根据用户id获取新客立减金额,返回null代表不可用', newCustomerDiscount.value);
|
||||
if (newCustomerDiscount.value !== null) {
|
||||
carts.newUserDiscount = newCustomerDiscount.value.amount
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
function returnPayParams() {
|
||||
console.log("carts.orderCostSummary", carts.orderCostSummary);
|
||||
return {
|
||||
@@ -511,6 +512,9 @@ function returnPayParams() {
|
||||
couponList: carts.coupons.map((v) => v.id),
|
||||
userId: props.user.userId || "",
|
||||
allPack: carts.dinnerType == "take-out" ? 1 : 0,
|
||||
limitRate: carts.limitDiscountRes,
|
||||
newCustomerDiscountId: newCustomerDiscount.value !== null ? newCustomerDiscount.value.id : '', // 新客立减Id
|
||||
newCustomerDiscountAmount: newCustomerDiscount.value !== null ? newCustomerDiscount.value.amount : 0, // 新客立减金额
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -550,7 +554,7 @@ function nowPayClick(payType) {
|
||||
.then(() => {
|
||||
payOrder("cash");
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => { });
|
||||
return;
|
||||
}
|
||||
if (payType == "member-account") {
|
||||
@@ -680,9 +684,25 @@ watch(
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// 获取当前店铺可用的限时折扣
|
||||
async function getlimitTimeDiscount() {
|
||||
try {
|
||||
const res = await limitTimeDiscountApi.getLimitTimeDiscount({
|
||||
shopId: localStorage.getItem("shopId")
|
||||
})
|
||||
|
||||
console.log('获取当前店铺可用的限时折扣===', res);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
carts.payParamsInit();
|
||||
getPaytype();
|
||||
getlimitTimeDiscount()
|
||||
getConsumeDiscountAjax()
|
||||
});
|
||||
defineExpose({
|
||||
nowPayClick,
|
||||
@@ -696,6 +716,7 @@ defineExpose({
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.vip {
|
||||
padding: 2px 5px;
|
||||
background: #f7793d;
|
||||
@@ -704,27 +725,33 @@ defineExpose({
|
||||
margin-left: 10px;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.order-box {
|
||||
display: flex;
|
||||
padding: 20px 20px;
|
||||
background-color: #f7f7fa;
|
||||
min-height: 100%;
|
||||
|
||||
.left,
|
||||
.right {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.left {
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
.right {
|
||||
border-left: 1px solid #ebebeb;
|
||||
padding-left: 20px;
|
||||
|
||||
.order-info {
|
||||
font-size: 14px;
|
||||
.title {
|
||||
}
|
||||
.value {
|
||||
}
|
||||
|
||||
.title {}
|
||||
|
||||
.value {}
|
||||
|
||||
.price {
|
||||
color: #fa5555;
|
||||
font-size: 20px;
|
||||
@@ -732,6 +759,7 @@ defineExpose({
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.my-select {
|
||||
border: 1px solid #d9d9d9;
|
||||
border-radius: 4px;
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
<template>
|
||||
<div
|
||||
class="box"
|
||||
v-loading="!carts.isLinkFinshed"
|
||||
element-loading-text="购物车连接初始化中,请稍等……"
|
||||
>
|
||||
<div class="box" v-loading="!carts.isLinkFinshed" element-loading-text="购物车连接初始化中,请稍等……">
|
||||
<div class="content">
|
||||
<div class="top">
|
||||
<div class="left u-flex u-col-center">
|
||||
@@ -13,12 +9,7 @@
|
||||
<el-button type="primary" v-if="!user.id">选择用户</el-button>
|
||||
|
||||
<div v-else class="flex cur-pointer">
|
||||
<img
|
||||
v-if="user.headImg && user.headImg != 'null'"
|
||||
class="headimg"
|
||||
:src="user.headImg"
|
||||
alt=""
|
||||
/>
|
||||
<img v-if="user.headImg && user.headImg != 'null'" class="headimg" :src="user.headImg" alt="" />
|
||||
<div v-else class="headimg flex flex-x-y-center">
|
||||
<i class="el-icon-user"></i>
|
||||
</div>
|
||||
@@ -34,19 +25,11 @@
|
||||
</div>
|
||||
</div>
|
||||
<el-popover placement="right" width="333" trigger="click" ref="refTable">
|
||||
<el-input
|
||||
placeholder="请输入内容"
|
||||
prefix-icon="search"
|
||||
v-model="tableSearchText"
|
||||
@input="tablesearchInput"
|
||||
></el-input>
|
||||
<el-input placeholder="请输入内容" prefix-icon="search" v-model="tableSearchText"
|
||||
@input="tablesearchInput"></el-input>
|
||||
<div style="max-height: 398px; overflow-y: scroll" class="u-m-t-12">
|
||||
<div
|
||||
class="u-flex u-row-between u-p-t-8 table-item u-p-b-8 u-p-r-30"
|
||||
v-for="(item, index) in tableList"
|
||||
:key="index"
|
||||
@click="tableClick(item, index)"
|
||||
>
|
||||
<div class="u-flex u-row-between u-p-t-8 table-item u-p-b-8 u-p-r-30" v-for="(item, index) in tableList"
|
||||
:key="index" @click="tableClick(item, index)">
|
||||
<span>{{ item.name }}</span>
|
||||
<span :style="{ color: returnTableColor(item.status) }">
|
||||
{{ returnTableLabel(item.status) }}
|
||||
@@ -64,14 +47,11 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<el-input
|
||||
placeholder="请输入商品名称"
|
||||
v-model="goods.query.name"
|
||||
clearable
|
||||
@change="getGoods"
|
||||
>
|
||||
<el-input placeholder="请输入商品名称" v-model="goods.query.name" clearable @change="getGoods">
|
||||
<template #suffix>
|
||||
<el-icon class="el-input__icon"><search /></el-icon>
|
||||
<el-icon class="el-input__icon">
|
||||
<search />
|
||||
</el-icon>
|
||||
</template>
|
||||
</el-input>
|
||||
</div>
|
||||
@@ -81,83 +61,51 @@
|
||||
<div class="diners">
|
||||
<!-- 就餐类型 -->
|
||||
<el-button-group v-model="diners.sel" style="width: 100%; display: flex">
|
||||
<el-button
|
||||
:class="{ active: index == diners.sel }"
|
||||
v-for="(item, index) in diners.list"
|
||||
:disabled="dinerDisabled(item, index)"
|
||||
@click="changeDinersSel(index)"
|
||||
:key="index"
|
||||
>
|
||||
<el-button :class="{ active: index == diners.sel }" v-for="(item, index) in diners.list"
|
||||
:disabled="dinerDisabled(item, index)" @click="changeDinersSel(index)" :key="index">
|
||||
{{ item.label }}
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
|
||||
<div class="u-flex u-font-14 clear u-m-t-10 perpoles">
|
||||
<div
|
||||
@click="showDinerNumber"
|
||||
class="u-flex u-p-r-14 u-m-r-14"
|
||||
style="border-right: 1px solid #ebebeb; line-height: 1"
|
||||
>
|
||||
<div @click="showDinerNumber" class="u-flex u-p-r-14 u-m-r-14"
|
||||
style="border-right: 1px solid #ebebeb; line-height: 1">
|
||||
<span>就餐人数:{{ perpole || "-" }} 位</span>
|
||||
<el-icon><ArrowRight /></el-icon>
|
||||
<el-icon>
|
||||
<ArrowRight />
|
||||
</el-icon>
|
||||
</div>
|
||||
<el-button link type="primary" :disabled="carts.isEmpty" @click="clearCarts">
|
||||
清空
|
||||
</el-button>
|
||||
</div>
|
||||
<!-- 购物车 -->
|
||||
<cartsList
|
||||
@editNote="showNote(true)"
|
||||
@createOrder="createOrder"
|
||||
@hideOrder="hideOrder"
|
||||
@clearOldOrder="clearOldOrder"
|
||||
:showOrder="showOrder"
|
||||
:goodsList="carts.goods"
|
||||
:dinerType="diners.sel"
|
||||
:perpole="perpole"
|
||||
:remark="remark"
|
||||
:table="table"
|
||||
ref="refCart"
|
||||
></cartsList>
|
||||
<cartsList @editNote="showNote(true)" @createOrder="createOrder" @hideOrder="hideOrder"
|
||||
@clearOldOrder="clearOldOrder" :showOrder="showOrder" :goodsList="carts.goods" :dinerType="diners.sel"
|
||||
:perpole="perpole" :remark="remark" :table="table" ref="refCart"></cartsList>
|
||||
</div>
|
||||
<div class="center">
|
||||
<!-- 购物车控制操作按钮 -->
|
||||
<Controls
|
||||
@noteClick="showNote"
|
||||
@packClick="showPack"
|
||||
@changePriceClick="showChangePrice"
|
||||
@return="refReturnCartShow"
|
||||
@rottable="rottableShow"
|
||||
@changeCartNumberShow="refChangeNumberShow"
|
||||
/>
|
||||
<Controls @noteClick="showNote" @packClick="showPack" @changePriceClick="showChangePrice"
|
||||
@return="refReturnCartShow" @rottable="rottableShow" @changeCartNumberShow="refChangeNumberShow" />
|
||||
</div>
|
||||
<div class="right">
|
||||
<template v-if="!showOrder">
|
||||
<div class="flex categoty u-col-center">
|
||||
<div
|
||||
class="show_more_btn"
|
||||
:class="{ showAll: category.showAll }"
|
||||
@click="toggleShowAll"
|
||||
>
|
||||
<div class="show_more_btn" :class="{ showAll: category.showAll }" @click="toggleShowAll">
|
||||
<div class="flex">
|
||||
<div class="flex showmore">
|
||||
<el-icon color="#fff"><ArrowDown /></el-icon>
|
||||
<el-icon color="#fff">
|
||||
<ArrowDown />
|
||||
</el-icon>
|
||||
</div>
|
||||
<span>{{ category.showAll ? "收起" : "展开" }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex categorys" :class="{ 'flex-wrap': category.showAll }">
|
||||
<div
|
||||
v-for="(item, index) in category.list"
|
||||
:key="index"
|
||||
@click="changeCategoryId(item)"
|
||||
>
|
||||
<el-tag
|
||||
size="large"
|
||||
:type="goods.query.categoryId === item.id ? 'primary' : 'info'"
|
||||
effect="dark"
|
||||
>
|
||||
<div v-for="(item, index) in category.list" :key="index" @click="changeCategoryId(item)">
|
||||
<el-tag size="large" :type="goods.query.categoryId === item.id ? 'primary' : 'info'" effect="dark">
|
||||
{{ item.name }}
|
||||
</el-tag>
|
||||
</div>
|
||||
@@ -166,29 +114,19 @@
|
||||
<div v-if="carts.goods.length <= 0" class="no-goods">未找到相关商品</div>
|
||||
<div class="goods-list">
|
||||
<div class="lingshicai" @click="showaddLingShiCai">
|
||||
<el-icon size="26"><Plus /></el-icon>
|
||||
<el-icon size="26">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
<div class="u-m-t-10">临时菜</div>
|
||||
</div>
|
||||
<GoodsItem
|
||||
:item="item"
|
||||
@itemClick="goodsClick(item)"
|
||||
v-for="item in carts.goods"
|
||||
:key="item.id"
|
||||
></GoodsItem>
|
||||
<GoodsItem :item="item" @itemClick="goodsClick(item)" v-for="item in carts.goods" :key="item.id">
|
||||
</GoodsItem>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 订单信息展示 -->
|
||||
<Order
|
||||
ref="refOrder"
|
||||
:orderInfo="carts.oldOrder"
|
||||
@chooseUser="showChooseUser"
|
||||
@paysuccess="refresh"
|
||||
:table="table"
|
||||
:perpole="perpole"
|
||||
v-else
|
||||
:user="user"
|
||||
></Order>
|
||||
<Order ref="refOrder" :orderInfo="carts.oldOrder" @chooseUser="showChooseUser" @paysuccess="refresh"
|
||||
:table="table" :perpole="perpole" v-else :user="user"></Order>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -203,11 +141,7 @@
|
||||
<!-- 临时菜 -->
|
||||
<addLingShiCai ref="refAddLingShiCai" @confirm="addLingShiCaiConfirm"></addLingShiCai>
|
||||
<!-- 改价 -->
|
||||
<changePrice
|
||||
ref="refChangePrice"
|
||||
:useVipPrice="carts.useVipPrice"
|
||||
@confirm="changePriceConfirm"
|
||||
></changePrice>
|
||||
<changePrice ref="refChangePrice" :useVipPrice="carts.useVipPrice" @confirm="changePriceConfirm"></changePrice>
|
||||
<!-- 称重商品 -->
|
||||
<change-weight ref="refChangeWeight" @confirm="changeWeightConfirm"></change-weight>
|
||||
<!-- 可选套餐 -->
|
||||
@@ -421,6 +355,7 @@ async function createOrder(key) {
|
||||
placeNum: carts.oldOrder.placeNum * 1 + 1,
|
||||
waitCall: false,
|
||||
vipPrice: user.value.id && user.value.isVip,
|
||||
limitRate: carts.limitDiscountRes
|
||||
});
|
||||
clearTimeout(loadingTimer);
|
||||
loading.close();
|
||||
@@ -553,7 +488,7 @@ async function getTableDetail(params) {
|
||||
const res = await tableApi.get(params);
|
||||
return res;
|
||||
}
|
||||
function tablesearchInput() {}
|
||||
function tablesearchInput() { }
|
||||
//返回桌台状态颜色
|
||||
function returnTableColor(key) {
|
||||
const item = $status[key];
|
||||
@@ -773,11 +708,15 @@ function clearCarts() {
|
||||
});
|
||||
}
|
||||
function addCarts(item, isWeight = false) {
|
||||
console.log('index.addCarts===', item);
|
||||
|
||||
|
||||
|
||||
if (isWeight) {
|
||||
carts.add({ pack_number: diners.sel ? 1 : 0, ...item });
|
||||
carts.add({ pack_number: diners.sel ? 1 : 0, ...item, is_time_discount: item.isLimitDiscount ? 1 : 0 });
|
||||
return;
|
||||
}
|
||||
carts.add({ pack_number: diners.sel ? item.number : 0, ...item });
|
||||
carts.add({ pack_number: diners.sel ? item.number : 0, ...item, is_time_discount: item.isLimitDiscount ? 1 : 0 });
|
||||
}
|
||||
|
||||
watch(
|
||||
@@ -804,11 +743,11 @@ onMounted(async () => {
|
||||
// 获取历史订单数据
|
||||
const res = id
|
||||
? await orderApi.getHistoryList({
|
||||
orderId: id,
|
||||
})
|
||||
orderId: id,
|
||||
})
|
||||
: await orderApi.getHistoryList({
|
||||
tableCode,
|
||||
});
|
||||
tableCode,
|
||||
});
|
||||
const noPayStatus = {
|
||||
cancelled: "订单已取消",
|
||||
done: "订单已关闭",
|
||||
@@ -893,20 +832,24 @@ watch(
|
||||
|
||||
<style lang="scss" scoped>
|
||||
$pl: 30px;
|
||||
|
||||
.box {
|
||||
padding: 20px 20px 10px 20px;
|
||||
height: 100%;
|
||||
|
||||
.content {
|
||||
background-color: #fff;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 20px 20px 20px 0;
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding-bottom: 20px;
|
||||
border-bottom: 1px solid #ebebeb;
|
||||
margin-left: $pl;
|
||||
|
||||
.left {
|
||||
flex: 1;
|
||||
|
||||
@@ -917,39 +860,48 @@ $pl: 30px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.diancan {
|
||||
padding-top: 10px;
|
||||
display: flex;
|
||||
height: 100%;
|
||||
max-height: calc(100vh - 256px);
|
||||
|
||||
.left {
|
||||
width: 350px;
|
||||
padding-right: 14px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.diners {
|
||||
padding-left: $pl;
|
||||
}
|
||||
|
||||
.perpoles {
|
||||
padding-left: $pl;
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
flex: 1;
|
||||
overflow-x: hidden;
|
||||
overflow-y: scroll;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
.center {
|
||||
overflow-x: hidden;
|
||||
overflow-y: scroll;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
@@ -964,18 +916,22 @@ $pl: 30px;
|
||||
background: rgba(24, 144, 255, 0.1) !important;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
:deep(.diners .el-button-group) {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
:deep(.diners .el-button-group .el-button) {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
:deep(.categorys .el-tag--plain.el-tag--info) {
|
||||
border: 1px solid #dcdfe6;
|
||||
color: #000;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
:deep(.categorys .el-tag) {
|
||||
min-width: 80px;
|
||||
height: 38px;
|
||||
@@ -991,6 +947,7 @@ $pl: 30px;
|
||||
margin: 0 10px 10px 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.categoty {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
@@ -1036,20 +993,24 @@ $pl: 30px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.goods-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 15px;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
:deep(.carts) {
|
||||
padding-left: $pl;
|
||||
}
|
||||
|
||||
:deep(.left) {
|
||||
.bottom {
|
||||
padding-left: $pl;
|
||||
}
|
||||
}
|
||||
|
||||
.lingshicai {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
@@ -1064,11 +1025,13 @@ $pl: 30px;
|
||||
border: 1px solid #dddfe6;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
:deep(.el-tag--dark.el-tag--info) {
|
||||
background-color: #fff;
|
||||
color: #000;
|
||||
border: 1px solid #dcdfe6;
|
||||
}
|
||||
|
||||
.table-item {
|
||||
cursor: pointer;
|
||||
transition: 0.2s ease-in-out;
|
||||
@@ -1077,12 +1040,15 @@ $pl: 30px;
|
||||
background: #f4f9ff;
|
||||
}
|
||||
}
|
||||
|
||||
.no-goods {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.choose-user {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.headimg {
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
@@ -1090,6 +1056,7 @@ $pl: 30px;
|
||||
border-radius: 2px;
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
.vip {
|
||||
padding: 2px 5px;
|
||||
background: #f7793d;
|
||||
|
||||
Reference in New Issue
Block a user