优化修复问题
This commit is contained in:
@@ -154,6 +154,21 @@
|
||||
<el-input type="textarea" v-model.trim="form.bookingSms" placeholder="请输入台桌预订短信"
|
||||
style="width: 500px"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="电子围栏" prop="isOrderFence">
|
||||
<div class="column">
|
||||
<div class="center" style="display: flex;align-items: center;gap: 14px;">
|
||||
<el-switch v-model="form.isOrderFence" :active-value="1" :inactive-value="0"></el-switch>
|
||||
<div class="tips" style="font-size: 14px;color: #999;">开启后,用户只能在店铺附近xx公里内点餐</div>
|
||||
</div>
|
||||
<div class="center">
|
||||
<el-input v-model="form.orderFenceDistance" placeholder="请输入"
|
||||
@input="e => form.orderFenceDistance = filterNumberInput(e)" style="width: 250px;" :cus>
|
||||
<template #prepend>限制:</template>
|
||||
<template #append>公里</template>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio :value="1">营业中</el-radio>
|
||||
@@ -193,11 +208,13 @@ import { ElMessage } from "element-plus";
|
||||
import QRCode from "qrcode";
|
||||
import img_download_error from "@/assets/images/img_download_error.png";
|
||||
import ShopApi from "@/api/account/shop";
|
||||
import { filterNumberInput } from '@/utils/index'
|
||||
// import { tbShopInfo, tbShopInfoPut } from "@/api/user";
|
||||
// import { geocode } from "@/api/shop";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
filterNumberInput,
|
||||
img_download_error,
|
||||
showUpload: false,
|
||||
uploadIndex: 1,
|
||||
@@ -238,6 +255,18 @@ export default {
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
isOrderFence: [
|
||||
{
|
||||
trigger: "blur",
|
||||
validator: (rule, value, callback) => {
|
||||
if (this.form.isOrderFence === 1 && (!this.form.orderFenceDistance || this.form.orderFenceDistance <= 0)) {
|
||||
callback(new Error("请输入限制米数"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
}
|
||||
]
|
||||
},
|
||||
fileList: [],
|
||||
files: [],
|
||||
@@ -341,6 +370,7 @@ export default {
|
||||
const shopId = localStorage.getItem("shopId");
|
||||
const res = await ShopApi.get();
|
||||
this.form = { ...res, eatModel: res.eatModel ? res.eatModel.split(",") : [] };
|
||||
this.form.orderFenceDistance = res.orderFenceDistance / 1000
|
||||
if (res.businessTime) {
|
||||
const businessTime = res.businessTime.split("-");
|
||||
this.startTime = businessTime[0];
|
||||
@@ -368,6 +398,9 @@ export default {
|
||||
if (this.startTime && this.endTime) {
|
||||
this.form.businessTime = `${this.startTime}-${this.endTime}`;
|
||||
}
|
||||
if (this.form.isOrderFence == 1) {
|
||||
this.form.orderFenceDistance = this.form.orderFenceDistance * 1000
|
||||
}
|
||||
const res = await ShopApi.edit({
|
||||
...this.form,
|
||||
eatModel: this.form.eatModel.join(","),
|
||||
|
||||
Reference in New Issue
Block a user