代客下单修改,增加线上店铺装修页面
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
</div>
|
||||
<div
|
||||
class="isSeatFee img u-line-1 u-flex u-col-center u-row-center"
|
||||
v-else-if="!item.product_id"
|
||||
v-else-if="item.is_temporary"
|
||||
>
|
||||
<span>临时菜</span>
|
||||
</div>
|
||||
@@ -25,7 +25,7 @@
|
||||
<div class="good-info u-p-t-6">
|
||||
<div class="flex lh-16">
|
||||
<div class="name" :class="{ 'free-price': item.status === 'return' }">
|
||||
{{ item.name }}
|
||||
{{ item.name || item.product_name }}
|
||||
</div>
|
||||
<span class="good_info_discount" v-if="item.is_gift">赠</span>
|
||||
</div>
|
||||
@@ -177,6 +177,9 @@ const vipAllPrice = computed(() => {
|
||||
return 0;
|
||||
});
|
||||
const allPrice = computed(() => {
|
||||
if (props.item.discount_sale_amount * 1 != 0) {
|
||||
return props.item.number * props.item.discount_sale_amount;
|
||||
}
|
||||
return props.item.number * props.item.salePrice;
|
||||
});
|
||||
|
||||
@@ -199,7 +202,7 @@ const emits = defineEmits([
|
||||
"itemClick",
|
||||
]);
|
||||
function editNote() {
|
||||
emits("editNote", props.index);
|
||||
emits("editNote");
|
||||
}
|
||||
//购物车商品输入框数量改变
|
||||
function cartGoodsNumberChange(newval) {
|
||||
|
||||
@@ -8,18 +8,22 @@
|
||||
@changeNumber="changeNumber"
|
||||
:selCart="carts.selCart"
|
||||
@itemClick="itemClick(item)"
|
||||
@editNote="editNote"
|
||||
></carts-item>
|
||||
</div>
|
||||
<!-- 赠菜 -->
|
||||
<div class="cart-title"><span>以下是优惠菜品</span></div>
|
||||
<div class="cart-title" v-if="carts.giftList.length > 0"><span>以下是优惠菜品</span></div>
|
||||
<div v-for="(item, index) in carts.giftList" :key="index">
|
||||
<carts-item
|
||||
:item="item"
|
||||
@changeNumber="changeNumber"
|
||||
:selCart="carts.selCart"
|
||||
@itemClick="itemClick(item)"
|
||||
@editNote="editNote"
|
||||
></carts-item>
|
||||
</div>
|
||||
|
||||
<el-empty image-size="60" v-if="carts.isEmpty" description="点餐列表为空" />
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<div class="yiyouhui">{{ carts.yiyouhui }}</div>
|
||||
@@ -54,6 +58,11 @@ const props = defineProps({
|
||||
},
|
||||
});
|
||||
|
||||
const emits = defineEmits(["editNote"]);
|
||||
function editNote() {
|
||||
emits("editNote");
|
||||
}
|
||||
|
||||
const selCartId = ref(null);
|
||||
|
||||
const carts = useCartsStore();
|
||||
|
||||
@@ -37,12 +37,12 @@ const controls = ref([
|
||||
{ label: "整单备注", key: "all-note", disabled: false, per: "all-note" },
|
||||
{ label: "退菜", key: "", disabled: false, per: "order" },
|
||||
{ label: "免厨打", key: "is_print", disabled: false, per: "cart" },
|
||||
{ label: "单品改价", key: "", disabled: false, per: "cart" },
|
||||
{ label: "等叫", key: "", disabled: false, per: "cart" },
|
||||
{ label: "单品改价", key: "changePriceClick", disabled: false, per: "cart" },
|
||||
{ label: "等叫", key: "is_wait_call", disabled: false, per: "cart" },
|
||||
{ label: "整单等叫", key: "", disabled: false, per: "all-wating" },
|
||||
]);
|
||||
|
||||
const emits = defineEmits(["noteClick"]);
|
||||
const emits = defineEmits(["noteClick", "changePriceClick", "packClick"]);
|
||||
function controlsClick(item) {
|
||||
switch (item.key) {
|
||||
case "is_gift":
|
||||
@@ -57,8 +57,8 @@ function controlsClick(item) {
|
||||
case "del":
|
||||
carts.del(carts.selCart);
|
||||
break;
|
||||
case "save":
|
||||
carts.saveCart();
|
||||
case "changePriceClick":
|
||||
emits("changePriceClick", carts.selCart);
|
||||
break;
|
||||
case "one-note":
|
||||
emits("noteClick", true);
|
||||
@@ -66,8 +66,8 @@ function controlsClick(item) {
|
||||
case "all-note":
|
||||
emits("noteClick", false);
|
||||
break;
|
||||
case "order":
|
||||
carts.order();
|
||||
case "is_wait_call":
|
||||
carts.updateTag("is_wait_call", carts.selCart.is_wait_call ? 0 : 1);
|
||||
break;
|
||||
case "all-wating":
|
||||
carts.allWating();
|
||||
@@ -96,6 +96,9 @@ function returnLabel(item) {
|
||||
if (item.key == "is_print") {
|
||||
return carts.selCart.is_print ? "免厨打" : "打印";
|
||||
}
|
||||
if (item.key == "is_wait_call") {
|
||||
return carts.selCart.is_wait_call ? "取消等叫" : "等叫";
|
||||
}
|
||||
return item.label;
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<div class="u-flex" style="margin-top: 14px">
|
||||
<el-button v-if="!skuData.isGrounding" disabled style="width: 100%">已下架</el-button>
|
||||
<template v-else>
|
||||
<el-button type="primary" style="width: 100%">确 定</el-button>
|
||||
<el-button type="primary" style="width: 100%" @click="confirm">确 定</el-button>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
@@ -87,6 +87,7 @@ function open(data) {
|
||||
}
|
||||
function close() {
|
||||
show.value = false;
|
||||
number.value = 1;
|
||||
resetData();
|
||||
}
|
||||
const skuName = computed(() => {
|
||||
@@ -110,6 +111,27 @@ const skuData = computed(() => {
|
||||
});
|
||||
});
|
||||
|
||||
watch(
|
||||
() => skuData.value,
|
||||
(newval) => {
|
||||
if (newval) {
|
||||
number.value = newval.suitNum;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
const emits = defineEmits(["confirm"]);
|
||||
function confirm() {
|
||||
if (skuData.value) {
|
||||
emits("confirm", {
|
||||
sku_id: skuData.value.id,
|
||||
product_id: goods.value.id,
|
||||
number: number.value,
|
||||
});
|
||||
close();
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ open, close });
|
||||
</script>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<el-image v-if="item.coverImg" class="goods-image" :src="item.coverImg" fit="cover"></el-image>
|
||||
<div class="info">
|
||||
<div class="name u-flex u-flex-wrap">
|
||||
<span class="weight" v-if="item.type == 'weigh'">称重</span>
|
||||
<span class="weight" v-if="item.type == 'weight'">称重</span>
|
||||
<span>{{ item.name }}</span>
|
||||
</div>
|
||||
<div class="">¥{{ item.lowPrice }}</div>
|
||||
@@ -47,4 +47,14 @@ const props = defineProps({
|
||||
background-color: rgba(46, 46, 46, 0.38);
|
||||
}
|
||||
}
|
||||
.weight {
|
||||
height: 15px;
|
||||
background: linear-gradient(124deg, rgb(115, 201, 105) 6%, rgb(39, 146, 27) 93%);
|
||||
border-radius: 2px;
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
line-height: 15px;
|
||||
padding: 0px 2px;
|
||||
margin-right: 2px;
|
||||
}
|
||||
</style>
|
||||
138
src/views/tool/Instead/components/popup-cart-changePrice.vue
Normal file
138
src/views/tool/Instead/components/popup-cart-changePrice.vue
Normal file
@@ -0,0 +1,138 @@
|
||||
<template>
|
||||
<el-dialog title="单品改价" width="410px" v-model="show" @close="reset" :modal="modal">
|
||||
<div class="u-m-t-30 u-flex">
|
||||
<div class="no-wrap u-m-r-20">价格更改为</div>
|
||||
<el-input
|
||||
:min="min"
|
||||
placeholder="请输入更改后的价格"
|
||||
v-model="price"
|
||||
@blur="checkPrice"
|
||||
type="number"
|
||||
>
|
||||
<template #append>元</template>
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="u-m-t-16">
|
||||
<span class="color-red">*</span>
|
||||
<span>当前单品单价:{{ originPrice }}元</span>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<div>
|
||||
<el-button size="medium" @click="close">取消</el-button>
|
||||
<el-button size="medium" type="primary" @click="confirm">确定</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { ElMessage } from "element-plus";
|
||||
export default {
|
||||
props: {
|
||||
modal: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
vipUser: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {
|
||||
isVip: false,
|
||||
};
|
||||
},
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
min: 0,
|
||||
originPrice: "",
|
||||
price: "",
|
||||
show: false,
|
||||
goods: {
|
||||
productId: -999,
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isSeatFee() {
|
||||
return returnIsSeatFee(this.goods);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
checkPrice() {
|
||||
if (this.price < 0) {
|
||||
this.price = 0;
|
||||
}
|
||||
},
|
||||
changeSel(item) {
|
||||
item.checked = !item.checked;
|
||||
},
|
||||
reset() {
|
||||
this.price = "";
|
||||
},
|
||||
open(item) {
|
||||
console.log(item);
|
||||
this.show = true;
|
||||
const price = item.discount_sale_amount * 1 || item.salePrice * 1;
|
||||
this.price = price;
|
||||
this.originPrice = price;
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
this.price = "";
|
||||
this.originPrice = "";
|
||||
},
|
||||
async confirm() {
|
||||
if (this.price < 0) {
|
||||
return ElMessage.error("价格不能小于0");
|
||||
}
|
||||
this.$emit("confirm", this.price);
|
||||
this.close();
|
||||
// this.$emit("confirm", { note: note, num: this.number });
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-dialog__body) {
|
||||
margin-bottom: 14px;
|
||||
margin-top: 14px;
|
||||
padding: 0 20px;
|
||||
}
|
||||
:deep(.el-tag) {
|
||||
margin-top: 10px;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 5px;
|
||||
cursor: pointer;
|
||||
font-size: 15px;
|
||||
line-height: 35px;
|
||||
height: 35px;
|
||||
}
|
||||
.tags {
|
||||
.tag {
|
||||
margin: 10px 10px 0 0;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
padding: 10px 13px;
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
cursor: pointer;
|
||||
&.active {
|
||||
color: #1890ff;
|
||||
background: #e8f4ff;
|
||||
border-color: #a3d3ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
:deep(.el-dialog__body) {
|
||||
color: #333;
|
||||
}
|
||||
:deep(input::-webkit-outer-spin-button) {
|
||||
-webkit-appearance: none !important;
|
||||
}
|
||||
:deep(input::-webkit-inner-spin-button) {
|
||||
-webkit-appearance: none !important;
|
||||
}
|
||||
</style>
|
||||
111
src/views/tool/Instead/components/popup-linshiCai.vue
Normal file
111
src/views/tool/Instead/components/popup-linshiCai.vue
Normal file
@@ -0,0 +1,111 @@
|
||||
<template>
|
||||
<el-dialog title="添加临时菜" width="410px" v-model="show" @close="reset">
|
||||
<div>
|
||||
<div>将临时菜添加至购物车,不会影响总商品库</div>
|
||||
<div class="u-m-t-16">
|
||||
<el-form ref="form" :model="form" label-width="80px" :rules="rules">
|
||||
<el-form-item label="菜品名称" prop="product_name">
|
||||
<el-input v-model="form.product_name" placeholder="请输入菜品名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="价格" prop="discount_sale_amount">
|
||||
<el-input v-model="form.discount_sale_amount" placeholder="请输入价格" type="number">
|
||||
<template #append>元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="下单数量" prop="number">
|
||||
<el-input v-model="form.number" placeholder="请输入下单数量" type="number"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div>
|
||||
<el-button size="medium" @click="close">取消</el-button>
|
||||
<el-button size="medium" type="primary" @click="confirm">确定</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { ElMessage } from "element-plus";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
rules: {
|
||||
product_name: [{ required: true, message: "请输入菜品名称", trigger: "blur" }],
|
||||
discount_sale_amount: [{ required: true, message: "请输入菜品价格", trigger: "blur" }],
|
||||
number: [{ required: true, message: "请输入下单数量", trigger: "blur" }],
|
||||
},
|
||||
form: {
|
||||
product_name: "",
|
||||
discount_sale_amount: "",
|
||||
number: 1,
|
||||
remark: "",
|
||||
},
|
||||
category: [],
|
||||
units: [],
|
||||
option: {},
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
reset() {
|
||||
this.$refs.form.resetFields();
|
||||
},
|
||||
|
||||
open(opt) {
|
||||
this.show = true;
|
||||
this.option = opt;
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
},
|
||||
async submit() {
|
||||
this.$emit("confirm", this.form);
|
||||
this.close();
|
||||
},
|
||||
confirm() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
console.log(valid);
|
||||
if (this.form.discount_sale_amount * 1 <= 0 || this.form.discount_sale_amount * 1 <= 0) {
|
||||
return ElMessage.error("价格和数量必须大于0");
|
||||
}
|
||||
this.submit();
|
||||
} else {
|
||||
console.log("error submit!!");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
margin-bottom: 14px;
|
||||
margin-top: 14px;
|
||||
}
|
||||
::v-deep .el-form-item__label {
|
||||
text-align: left;
|
||||
}
|
||||
input[type="number"]::-webkit-inner-spin-button,
|
||||
input[type="number"]::-webkit-outer-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
::v-deep .el-input__inner::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
::v-deep .el-input__inner::-webkit-outer-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user