|
@@ -1,437 +0,0 @@
|
|
|
-<template>
|
|
|
- <div class="voice">
|
|
|
- <template v-if="memberType !== 1">
|
|
|
- <div class="top-set">
|
|
|
- <div class="t-left">
|
|
|
- 自动接单
|
|
|
- </div>
|
|
|
- <div class="t-right">
|
|
|
- <el-switch @change="updateConfig" v-model="openAutoorder" :active-value="1" :inactive-value="0" active-color="#FC7200" inactive-color="#999" />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="top-set">
|
|
|
- <div class="t-left">
|
|
|
- 自动打印
|
|
|
- <span style="color: #999;">(开启后将为您自动打印小票)</span>
|
|
|
- </div>
|
|
|
- <div class="t-right">
|
|
|
- <el-switch @change="updateConfig" v-model="openPrintSwitch" :active-value="1" :inactive-value="0" active-color="#FC7200" inactive-color="#999" />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="voice-content">
|
|
|
- <div class="top-set" style="border-bottom: 1px solid #eee;">
|
|
|
- <div class="t-left">
|
|
|
- 自动发单设置
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="voice-list">
|
|
|
- <el-row>
|
|
|
- <el-col :span="24" v-for="(v,i) in list1" :key="i">
|
|
|
- <div class="item">
|
|
|
- <div class="left">
|
|
|
- <span class="name">{{v.name}}</span>
|
|
|
- <span class="time" @click="openSetTime(v,i)">[时长设置]</span>
|
|
|
- </div>
|
|
|
- <div class="right">
|
|
|
- <span @click="openSetTime(v)" v-if="!i">顾客下单{{autodeliveryOrderTime}}分钟后</span>
|
|
|
- <span @click="openSetTime(v)" v-if="i===1">期望送达前{{bookingAutodeliveryOrderTime}}分钟</span>
|
|
|
- <el-switch @change="change(v)" v-model="v.value" :active-value="1" :inactive-value="0" active-color="#FC7200" inactive-color="#999" />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="voice-content">
|
|
|
- <div class="top-set" style="border-bottom: 1px solid #eee;">
|
|
|
- <div class="t-left">
|
|
|
- 同步设置
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="voice-list">
|
|
|
- <el-row>
|
|
|
- <el-col :span="24" v-for="(v,i) in list" :key="i">
|
|
|
- <div class="item">
|
|
|
- <div class="left">
|
|
|
- <span class="name">{{v.name}}</span>
|
|
|
- </div>
|
|
|
- <div class="right">
|
|
|
- <el-switch @change="change(v)" v-model="v.value" :active-value="1" :inactive-value="0" active-color="#FC7200" inactive-color="#999" />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <div class="voice-content">
|
|
|
- <div class="top-set" style="border-bottom: 1px solid #eee;">
|
|
|
- <div class="t-left">
|
|
|
- 语音播报
|
|
|
- </div>
|
|
|
- <div class="t-right">
|
|
|
- <span>一键开启</span>
|
|
|
- <el-switch @change="changeMessageStatus" v-model="msasterSwitch" :active-value="1" :inactive-value="0" active-color="#FC7200" inactive-color="#999" />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="voice-list">
|
|
|
- <el-row>
|
|
|
- <el-col :span="8" v-for="(item, index) in voiceList" :key="index">
|
|
|
- <div class="item">
|
|
|
- <div class="left">
|
|
|
- <img @click="play(index)" src="../../../static/image/voice-icon.png" class="voice-icon" />
|
|
|
- <span>{{ item.name }}</span>
|
|
|
- </div>
|
|
|
- <div class="right">
|
|
|
- <el-switch @change="updateSavePushMessageStatus" v-model="item.msasterSwitch" :active-value="1" :inactive-value="0" active-color="#FC7200" inactive-color="#999" />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <el-dialog :title="!curIndex ? '即时单自动发单时间设置' : '预定单自动发单时间设置'" @close="getConfig" :visible.sync="centerDialogVisible" width="800px" center>
|
|
|
- <el-form label-width="120px">
|
|
|
- <el-form-item :label="!curIndex ? '顾客下单' : '期望送达前'">
|
|
|
- <el-input size="small" class="auto-time" v-model="time" clearable>
|
|
|
- <template slot="append">分钟{{curIndex ? '' : '后'}}</template>
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button size="medium" @click="getConfig">取 消</el-button>
|
|
|
- <el-button size='medium' type="primary" @click="confirm">确 定</el-button>
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
-import {
|
|
|
- getConfig,
|
|
|
- updateConfig,
|
|
|
- queryPushMessageStatus,
|
|
|
- updateSavePushMessageStatus,
|
|
|
-} from "../../api/setting.js";
|
|
|
-// import { floorListDelivery } from "../../api/shop.js";
|
|
|
-export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- voiceList: [],
|
|
|
- openAutoorder: 0,
|
|
|
- openPrintSwitch: 0,
|
|
|
- autodeliveryOrderTime: 0,
|
|
|
- bookingAutodeliveryOrderTime: 0,
|
|
|
- time: 0,
|
|
|
- msasterSwitch: 1,
|
|
|
- centerDialogVisible: false,
|
|
|
- memberType: this.$store.state.userInfo.memberType,
|
|
|
- list: [
|
|
|
- {
|
|
|
- name: "同步订单商品给骑手",
|
|
|
- value: 1,
|
|
|
- field: "syncGoodsDetailToDelivery",
|
|
|
- },
|
|
|
- {
|
|
|
- name: "同步打印客户联商品明细",
|
|
|
- value: 1,
|
|
|
- field: "customerLinkPrintGoodsDetail",
|
|
|
- },
|
|
|
- {
|
|
|
- name: "同步打印客户联商品价格",
|
|
|
- value: 1,
|
|
|
- field: "customerLinkPrintGoodsPrice",
|
|
|
- },
|
|
|
- ],
|
|
|
- curIndex: 0,
|
|
|
- list1: [
|
|
|
- {
|
|
|
- name: "即时单自动发单",
|
|
|
- value: 1,
|
|
|
- field: "openAutodelivery",
|
|
|
- },
|
|
|
- {
|
|
|
- name: "预定单自动发单",
|
|
|
- value: 1,
|
|
|
- field: "openBookingAutodelivery",
|
|
|
- },
|
|
|
- ],
|
|
|
- };
|
|
|
- },
|
|
|
- watch: {
|
|
|
- "$store.state.userInfo": {
|
|
|
- handler(newVal, oldVal) {
|
|
|
- this.memberType = newVal.memberType;
|
|
|
- },
|
|
|
- deep: true,
|
|
|
- },
|
|
|
- },
|
|
|
- created() {
|
|
|
- this.getConfig();
|
|
|
- this.queryPushMessageStatus();
|
|
|
- },
|
|
|
- methods: {
|
|
|
- change(e) {
|
|
|
- console.log(e);
|
|
|
- updateConfig({
|
|
|
- [e.field]: e.value,
|
|
|
- }).then((res) => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.getConfig();
|
|
|
- } else {
|
|
|
- e.value = !e.value;
|
|
|
- this.$message({
|
|
|
- type: "error",
|
|
|
- message: res.msg,
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- openSetTime(v, i) {
|
|
|
- if (!v.value) {
|
|
|
- return this.$message({
|
|
|
- type: "info",
|
|
|
- message: "请先开启自动配送再设置时长!",
|
|
|
- });
|
|
|
- }
|
|
|
- this.curIndex = i;
|
|
|
- if (!i) {
|
|
|
- this.time = this.autodeliveryOrderTime;
|
|
|
- } else if (i === 1) {
|
|
|
- this.time = this.bookingAutodeliveryOrderTime;
|
|
|
- }
|
|
|
- this.centerDialogVisible = true;
|
|
|
- },
|
|
|
- play(index) {
|
|
|
- let src = "https://pc.liebaoai.cn/audio/alone.mp3";
|
|
|
- switch (index) {
|
|
|
- case 0:
|
|
|
- src = "https://pc.liebaoai.cn/audio/new-order.mp3";
|
|
|
- break;
|
|
|
- case 1:
|
|
|
- src = "https://pc.liebaoai.cn/audio/order-received.mp3";
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- src = "https://pc.liebaoai.cn/audio/missed-orders.mp3";
|
|
|
- break;
|
|
|
- case 3:
|
|
|
- src = "https://pc.liebaoai.cn/audio/rider-cancel.mp3";
|
|
|
- break;
|
|
|
- case 4:
|
|
|
- src = "https://pc.liebaoai.cn/audio/user-go-cancel.mp3";
|
|
|
- break;
|
|
|
- case 5:
|
|
|
- src = "https://pc.liebaoai.cn/audio/not-enough.mp3";
|
|
|
- break;
|
|
|
- case 6:
|
|
|
- src = "https://pc.liebaoai.cn/audio/lower-than.mp3";
|
|
|
- break;
|
|
|
- case 7:
|
|
|
- src = "https://pc.liebaoai.cn/audio/over-time.mp3";
|
|
|
- break;
|
|
|
- case 8:
|
|
|
- src = "https://pc.liebaoai.cn/audio/rider-go-cancel.mp3";
|
|
|
- break;
|
|
|
-
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
- let mp3 = new Audio(src);
|
|
|
- mp3.play(); //播放 mp3这个音频对象
|
|
|
- },
|
|
|
- confirm() {
|
|
|
- this.centerDialogVisible = true;
|
|
|
- let data = {};
|
|
|
- if (!this.curIndex) {
|
|
|
- data = { autodeliveryOrderTime: this.time * 60 };
|
|
|
- } else if (this.curIndex === 1) {
|
|
|
- data = { bookingAutodeliveryOrderTime: this.time * 60 };
|
|
|
- }
|
|
|
- this.updateConfig(data);
|
|
|
- },
|
|
|
- changeMessageStatus() {
|
|
|
- this.voiceList = this.voiceList.map((v) => {
|
|
|
- v.msasterSwitch = this.msasterSwitch;
|
|
|
- return v;
|
|
|
- });
|
|
|
- this.updateSavePushMessageStatus();
|
|
|
- },
|
|
|
- getConfig() {
|
|
|
- this.centerDialogVisible = false;
|
|
|
- getConfig().then((res) => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.autodeliveryOrderTime = res.data.autodeliveryOrderTime / 60;
|
|
|
- this.bookingAutodeliveryOrderTime =
|
|
|
- res.data.bookingAutodeliveryOrderTime / 60;
|
|
|
- this.openAutoorder = res.data.openAutoorder;
|
|
|
- this.openPrintSwitch = res.data.openPrintSwitch;
|
|
|
- this.list = this.list.map((v) => {
|
|
|
- v.value = res.data[v.field];
|
|
|
- return v;
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- type: "error",
|
|
|
- message: res.msg,
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- queryPushMessageStatus() {
|
|
|
- queryPushMessageStatus().then((res) => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.voiceList = res.data;
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- type: "error",
|
|
|
- message: res.msg,
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- updateSavePushMessageStatus() {
|
|
|
- updateSavePushMessageStatus({ orderPushMessages: this.voiceList }).then(
|
|
|
- (res) => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "修改成功!",
|
|
|
- });
|
|
|
- this.queryPushMessageStatus();
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- type: "error",
|
|
|
- message: res.msg,
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- );
|
|
|
- },
|
|
|
- updateConfig(data) {
|
|
|
- updateConfig(data).then((res) => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.getConfig();
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- type: "error",
|
|
|
- message: res.msg,
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- },
|
|
|
-};
|
|
|
-</script>
|
|
|
-
|
|
|
-<style lang="scss" scoped>
|
|
|
-.voice {
|
|
|
- /deep/ .el-checkbox__input.is-checked .el-checkbox__inner,
|
|
|
- /deep/ .el-checkbox__input.is-indeterminate .el-checkbox__inner {
|
|
|
- background-color: #fc7200;
|
|
|
- border-color: #fc7200;
|
|
|
- }
|
|
|
- /deep/ .el-checkbox__input.is-checked + .el-checkbox__label {
|
|
|
- color: #fc7200;
|
|
|
- }
|
|
|
- /deep/ .el-button--primary {
|
|
|
- color: #fff;
|
|
|
- background-color: #fc7200;
|
|
|
- border-color: #fc7200;
|
|
|
- }
|
|
|
- .top-set {
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- align-items: center;
|
|
|
- padding: 20px;
|
|
|
- background-color: #fff;
|
|
|
- .t-left {
|
|
|
- font-size: 16px;
|
|
|
- font-family: PingFang SC;
|
|
|
- font-weight: bold;
|
|
|
- color: #333333;
|
|
|
- span {
|
|
|
- cursor: pointer;
|
|
|
- font-size: 14px;
|
|
|
- font-family: PingFang SC;
|
|
|
- font-weight: 400;
|
|
|
- color: #175199;
|
|
|
- }
|
|
|
- }
|
|
|
- .t-right {
|
|
|
- font-size: 14px;
|
|
|
- font-family: PingFang SC;
|
|
|
- font-weight: 400;
|
|
|
- color: #b1b1b1;
|
|
|
- }
|
|
|
- }
|
|
|
- .voice-content {
|
|
|
- margin-top: 10px;
|
|
|
- .voice-list {
|
|
|
- background-color: #fff;
|
|
|
- .item {
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- align-items: center;
|
|
|
- padding: 17px 22px 19px 18px;
|
|
|
- .left {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- .name {
|
|
|
- font-size: 14px;
|
|
|
- // font-weight: bold;
|
|
|
- }
|
|
|
- .time {
|
|
|
- margin-left: 10px;
|
|
|
- font-size: 12px;
|
|
|
- color: #175199;
|
|
|
- cursor: pointer;
|
|
|
- }
|
|
|
- .voice-icon {
|
|
|
- width: 15px;
|
|
|
- height: 12px;
|
|
|
- margin-right: 4px;
|
|
|
- margin-top: 2px;
|
|
|
- cursor: pointer;
|
|
|
- }
|
|
|
- span {
|
|
|
- font-size: 14px;
|
|
|
- font-family: PingFang SC;
|
|
|
- font-weight: 400;
|
|
|
- color: #333333;
|
|
|
- }
|
|
|
- }
|
|
|
- .right {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- font-size: 14px;
|
|
|
- color: #999999;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .delivery-list {
|
|
|
- display: flex;
|
|
|
- flex-wrap: wrap;
|
|
|
- margin-top: 20px;
|
|
|
- .delivery {
|
|
|
- margin: 0 20px 20px 0;
|
|
|
- width: 100px;
|
|
|
- height: 30px;
|
|
|
- line-height: 30px;
|
|
|
- text-align: center;
|
|
|
- border-radius: 25px;
|
|
|
- border: 1px solid #999;
|
|
|
- color: #999999;
|
|
|
- cursor: pointer;
|
|
|
- }
|
|
|
- .active {
|
|
|
- border: 1px solid #fc7200;
|
|
|
- color: #fff;
|
|
|
- background: #fc7200;
|
|
|
- }
|
|
|
- }
|
|
|
- .auto-time {
|
|
|
- width: 150px;
|
|
|
- }
|
|
|
-}
|
|
|
-</style>
|