|
@@ -0,0 +1,425 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="background">
|
|
|
|
+ <div class="body-layer">
|
|
|
|
+ <div class="current">
|
|
|
|
+ <div class="current-in-total">出酒进度 [{{ index + 1 }} / {{ order.length }}]</div>
|
|
|
|
+ <div class="process">
|
|
|
|
+ <div class="process-bar">
|
|
|
|
+ <div class="process-complete" :style="`width: ${percent}%;`"></div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="process-percent">{{ percent }} %</div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="process-detail">
|
|
|
|
+ <span>{{ weight }}/{{ totalWeight }} 两</span>
|
|
|
|
+ <span>{{ volume }}/{{ totalVolume }} ML</span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <table class="queue">
|
|
|
|
+ <caption>出酒队列</caption>
|
|
|
|
+ <thead>
|
|
|
|
+ <tr>
|
|
|
|
+ <th class="col-1">序号</th>
|
|
|
|
+ <th class="col-2">酒品</th>
|
|
|
|
+ <th class="col-3">名称</th>
|
|
|
|
+ <th class="col-4">重量(两)</th>
|
|
|
|
+ <th class="col-5">体积(ML)</th>
|
|
|
|
+ <th class="col-6">状态</th>
|
|
|
|
+ </tr>
|
|
|
|
+ </thead>
|
|
|
|
+ <tbody>
|
|
|
|
+ <tr v-for="(wine, index) in order" :key="index">
|
|
|
|
+ <td>{{ index + 1 }}</td>
|
|
|
|
+ <td class="wine-image"><img :src="wine.picture" alt="..."></td>
|
|
|
|
+ <td>{{ wine.name }}</td>
|
|
|
|
+ <td>{{ wine.weight }}</td>
|
|
|
|
+ <td>{{ wine.volume }}</td>
|
|
|
|
+ <td :class="class_of(index)">{{ status_of(index) }}</td>
|
|
|
|
+ </tr>
|
|
|
|
+ </tbody>
|
|
|
|
+ </table>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="mask-layer" v-if="mask.show">
|
|
|
|
+ <div class="mask-box">
|
|
|
|
+ <div class="mask-title-box">
|
|
|
|
+ <div class="mask-title">{{ mask.title }}</div>
|
|
|
|
+ <div :style="`color: ${mask.color};`">{{ mask.subtitle }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ <img class="mask-icon" :src="mask.icon" alt="...">
|
|
|
|
+ <div class="mask-btn" v-if="mask.btn.need" @click="mask.btn.handler">{{ mask.btn.text }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+export default {
|
|
|
|
+ name: "WineOutPage",
|
|
|
|
+ props: {
|
|
|
|
+ order: {
|
|
|
|
+ type: Array,
|
|
|
|
+ required: true
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ index: -1,
|
|
|
|
+ volume: 0,
|
|
|
|
+ mask: {
|
|
|
|
+ show: false,
|
|
|
|
+ title: "",
|
|
|
|
+ subtitle: "",
|
|
|
|
+ color: "",
|
|
|
|
+ icon: "",
|
|
|
|
+ btn: {need: false, text: "", handler: null}
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ Enter() {
|
|
|
|
+ this.index = -1;
|
|
|
|
+ this.volume = 0;
|
|
|
|
+ this.mask = {
|
|
|
|
+ show: true,
|
|
|
|
+ title: "温馨提示",
|
|
|
|
+ subtitle: "请将容器静置于出酒口正下方",
|
|
|
|
+ color: "red",
|
|
|
|
+ icon: "/icon/cup.svg",
|
|
|
|
+ btn: {need: false, text: "", handler: null}
|
|
|
|
+ }
|
|
|
|
+ this.$utils.Android("isCupProperlyPlaced");
|
|
|
|
+ },
|
|
|
|
+ Leave() {
|
|
|
|
+ this.index = -1;
|
|
|
|
+ },
|
|
|
|
+ _onCupProperlyPlaced() {
|
|
|
|
+ this.index++;
|
|
|
|
+ this.volume = 0;
|
|
|
|
+ this.beforeOutWine();
|
|
|
|
+ },
|
|
|
|
+ _onErrorHappened(reason) {
|
|
|
|
+ this.$utils.Android("closeValveOf", this.order[this.index].cell);
|
|
|
|
+ this.$utils.Android("blowOutRemain");
|
|
|
|
+ this.mask = {
|
|
|
|
+ show: true,
|
|
|
|
+ title: "发生故障",
|
|
|
|
+ subtitle: reason,
|
|
|
|
+ color: "red",
|
|
|
|
+ icon: "/icon/error.svg",
|
|
|
|
+ btn: {
|
|
|
|
+ need: true, text: "确 认", handler: () => {
|
|
|
|
+ this.mask.show = false;
|
|
|
|
+ this.btn.need = false;
|
|
|
|
+ this.btn.handler = null;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ _onVolumeDelta(v) {
|
|
|
|
+ this.volume = v;
|
|
|
|
+ if (v >= this.order[this.index].volume) {
|
|
|
|
+ this.volume = this.order[this.index].volume;
|
|
|
|
+ this.$utils.Android("closeValveOf", this.order[this.index].cell);
|
|
|
|
+ this.$utils.Android("blowOutRemain");
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ _onBlowOutFinished() {
|
|
|
|
+ if (this.index === this.order.length - 1) {
|
|
|
|
+ this.allWineFinished();
|
|
|
|
+ } else {
|
|
|
|
+ this.someWineFinished();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ beforeOutWine() {
|
|
|
|
+ let sec = this.$utils.WaitCountDown, timer = null, text = "开 始 出 酒 ";
|
|
|
|
+ const start = () => {
|
|
|
|
+ if (timer !== null) clearInterval(timer);
|
|
|
|
+ timer = null;
|
|
|
|
+ this.mask.show = false;
|
|
|
|
+ this.mask.btn.handler = null;
|
|
|
|
+ this.$utils.Android("openValveOf", this.order[this.index].cell);
|
|
|
|
+ }
|
|
|
|
+ timer = setInterval(() => {
|
|
|
|
+ this.mask.btn.text = `${text} (${--sec}s)`;
|
|
|
|
+ if (sec === 0) start();
|
|
|
|
+ }, 1000);
|
|
|
|
+ this.mask = {
|
|
|
|
+ show: true,
|
|
|
|
+ title: "温馨提示",
|
|
|
|
+ subtitle: `即将出酒:${this.order[this.index].name}`,
|
|
|
|
+ color: "green",
|
|
|
|
+ icon: this.order[this.index].picture,
|
|
|
|
+ btn: {need: true, text: `${text} (${sec}s)`, handler: start}
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ allWineFinished() {
|
|
|
|
+ let sec = 10, timer = null, text = "返 回 列 表 ";
|
|
|
|
+ const toList = () => {
|
|
|
|
+ if (timer !== null) clearInterval(timer);
|
|
|
|
+ timer = null;
|
|
|
|
+ this.mask.show = false;
|
|
|
|
+ this.mask.btn.handler = null;
|
|
|
|
+ this.$utils.StatusDontKeep();
|
|
|
|
+ this.$emit("out2list");
|
|
|
|
+ }
|
|
|
|
+ timer = setInterval(() => {
|
|
|
|
+ this.mask.btn.text = `${text} (${--sec}s)`;
|
|
|
|
+ if (sec === 0) toList();
|
|
|
|
+ }, 1000);
|
|
|
|
+ this.mask = {
|
|
|
|
+ show: true,
|
|
|
|
+ title: "温馨提示",
|
|
|
|
+ subtitle: "所有酒品已全部取出,请拿好您的酒品",
|
|
|
|
+ color: "deepskyblue",
|
|
|
|
+ icon: "/icon/finish.svg",
|
|
|
|
+ btn: {need: true, text: `${text} (${sec}s)`, handler: toList}
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ someWineFinished() {
|
|
|
|
+ this.mask = {
|
|
|
|
+ show: true,
|
|
|
|
+ title: "温馨提示",
|
|
|
|
+ subtitle: `第 [${this.index + 1}/${this.order.length}] 款酒品已取完,请及时更换容器`,
|
|
|
|
+ color: "red",
|
|
|
|
+ icon: "icon/change.svg",
|
|
|
|
+ btn: {need: false, text: "", handler: null}
|
|
|
|
+ }
|
|
|
|
+ this.$utils.Android("isCupProperlyPlaced");
|
|
|
|
+ },
|
|
|
|
+ class_of(index) {
|
|
|
|
+ if (index < this.index) return "queue-over";
|
|
|
|
+ if (index === this.index) return "queue-outing";
|
|
|
|
+ return "queue-future";
|
|
|
|
+ },
|
|
|
|
+ status_of(index) {
|
|
|
|
+ if (index < this.index) return "✔ 已完成";
|
|
|
|
+ if (index === this.index) return "⭕ 正在出酒";
|
|
|
|
+ return "··· 排队中";
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ mounted() {
|
|
|
|
+ this.$utils.Register("errorHappened", this._onErrorHappened);
|
|
|
|
+ this.$utils.Register("cupProperlyPlaced", this._onCupProperlyPlaced);
|
|
|
|
+ this.$utils.Register("volumeDelta", this._onVolumeDelta);
|
|
|
|
+ this.$utils.Register("blowOutFinished", this._onBlowOutFinished);
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ percent() {
|
|
|
|
+ if (this.index === -1) return 0;
|
|
|
|
+ return (this.volume / this.order[this.index].volume * 100).toFixed(2);
|
|
|
|
+ },
|
|
|
|
+ weight() {
|
|
|
|
+ if (this.index === -1) return 0;
|
|
|
|
+ return (this.volume / this.order[this.index].volume * this.order[this.index].weight).toFixed(2);
|
|
|
|
+ },
|
|
|
|
+ totalWeight() {
|
|
|
|
+ if (this.index === -1) return 0;
|
|
|
|
+ return this.order[this.index].weight;
|
|
|
|
+ },
|
|
|
|
+ totalVolume() {
|
|
|
|
+ if (this.index === -1) return 0;
|
|
|
|
+ return this.order[this.index].volume;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style scoped>
|
|
|
|
+.background {
|
|
|
|
+ position: relative;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.background > div {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 0;
|
|
|
|
+ left: 0;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.body-layer {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: space-around;
|
|
|
|
+ z-index: 100;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.current {
|
|
|
|
+ width: 80%;
|
|
|
|
+ height: 200px;
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ align-items: center;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ padding: 20px 30px;
|
|
|
|
+ border: 1px solid black;
|
|
|
|
+ border-radius: 6px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.current-in-total {
|
|
|
|
+ font-size: 1.4em;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.process {
|
|
|
|
+ width: 100%;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.process-bar {
|
|
|
|
+ height: 0.8em;
|
|
|
|
+ background-color: lightgray;
|
|
|
|
+ border-radius: 10px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.process-bar {
|
|
|
|
+ width: calc(100% - 5em);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.process-complete {
|
|
|
|
+ height: 100%;
|
|
|
|
+ border-radius: inherit;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.process-complete {
|
|
|
|
+ background-color: #007BFF;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.process-percent {
|
|
|
|
+ width: 5em;
|
|
|
|
+ text-align: right;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.process-detail {
|
|
|
|
+ width: 100%;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ align-items: center;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.queue {
|
|
|
|
+ width: 80%;
|
|
|
|
+ border: none;
|
|
|
|
+ background-color: black;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.queue th {
|
|
|
|
+ height: 30px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.queue td, .queue th {
|
|
|
|
+ text-align: center;
|
|
|
|
+ background-color: white;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.queue > caption {
|
|
|
|
+ text-align: left;
|
|
|
|
+ margin-bottom: 5px;
|
|
|
|
+ font-size: 1.2em;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/* width: 1920 */
|
|
|
|
+.col-1 {
|
|
|
|
+ width: 5%;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.col-2 {
|
|
|
|
+ width: 10%;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.col-3 {
|
|
|
|
+ width: 45%;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.col-4 {
|
|
|
|
+ width: 10%;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.col-5 {
|
|
|
|
+ width: 10%;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.col-6 {
|
|
|
|
+ width: 20%;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.wine-image {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ padding: 4px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.wine-image > img {
|
|
|
|
+ width: 50px;
|
|
|
|
+ height: 75px;
|
|
|
|
+ object-fit: cover;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.queue-over {
|
|
|
|
+ color: green;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.queue-outing {
|
|
|
|
+ color: deepskyblue;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.queue-future {
|
|
|
|
+ color: dimgray;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.mask-layer {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+ background-color: rgba(15, 15, 15, 0.15);
|
|
|
|
+ z-index: 1000;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.mask-box {
|
|
|
|
+ width: 420px;
|
|
|
|
+ height: 280px;
|
|
|
|
+ background-color: white;
|
|
|
|
+ border-radius: 6px;
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ padding: 20px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.mask-title-box {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ align-items: center;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.mask-title {
|
|
|
|
+ font-size: 1.2em;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ margin-bottom: 10px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.mask-icon {
|
|
|
|
+ width: 90px;
|
|
|
|
+ height: 90px;
|
|
|
|
+ object-fit: contain;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.mask-btn {
|
|
|
|
+ width: 80%;
|
|
|
|
+ height: 2em;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ font-size: 1.1em;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ border: 1px solid deepskyblue;
|
|
|
|
+ border-radius: 4px;
|
|
|
|
+ color: deepskyblue;
|
|
|
|
+}
|
|
|
|
+</style>
|