@feedmepos/mf-order-setting 0.0.83 → 0.0.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{DisplaySystemView-BXy_OnbY.js → DisplaySystemView-4Bz8p26A.js} +1 -1
- package/dist/{KioskDevicesView-D3YR1e6K.js → KioskDevicesView-DdwFuenU.js} +1 -1
- package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-CuhL_Q5C.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-CxtLm_oh.js} +3 -3
- package/dist/{KioskSettingView-C3L9_8ag.js → KioskSettingView-D57KtQ-t.js} +289 -240
- package/dist/{KioskView-Cs6VBCj5.js → KioskView-fwBwUGCQ.js} +113 -103
- package/dist/{OrderSettingsView-BdaHRXda.js → OrderSettingsView-RhlyZmzs.js} +1772 -1766
- package/dist/{app-CP6AFTEu.js → app-ClOkRxOZ.js} +26 -6
- package/dist/app.js +1 -1
- package/dist/common/util/index.d.ts +9 -0
- package/dist/frontend/mf-order/src/app.d.ts +20 -0
- package/dist/frontend/mf-order/src/main.d.ts +20 -0
- package/dist/frontend/mf-order/src/modules/order-setting/kiosk/interface.d.ts +2 -0
- package/dist/frontend/mf-order/src/modules/order-setting/kiosk/languages.d.ts +7 -0
- package/dist/frontend/mf-order/src/stores/order-setting/index.d.ts +6 -0
- package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/ExternalSetting.vue.d.ts +8 -0
- package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/IntegratedDelivery.vue.d.ts +9 -0
- package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{index-LCS8oexE.js → index-5k7kGCpJ.js} +2 -2
- package/dist/{index-BckeUsPc.js → index-CKEbr9Es.js} +1 -1
- package/dist/{index-DoJzzpyh.js → index-I2YGevce.js} +1 -1
- package/dist/{order.dto-Bm04C1sQ.js → order.dto-Dbn-hRrm.js} +3294 -3235
- package/dist/package/entity/alert/alert-base.dto.d.ts +306 -0
- package/dist/package/entity/alert/alert.dto.d.ts +956 -0
- package/dist/package/entity/alert/alert.enum.d.ts +7 -0
- package/dist/package/entity/alert/categories/integration.d.ts +333 -0
- package/dist/package/entity/alert/categories/kiosk.d.ts +297 -0
- package/dist/package/entity/alert/categories/mini-program.d.ts +297 -0
- package/dist/package/entity/alert/investigation.dto.d.ts +86 -0
- package/dist/package/entity/alert/lark-callback.dto.d.ts +106 -0
- package/dist/package/entity/alert/suggestion.dto.d.ts +31 -0
- package/dist/package/entity/alert/suggestion.enum.d.ts +7 -0
- package/dist/package/entity/incoming-order/incoming-order-to-bill.dto.d.ts +80 -0
- package/dist/package/entity/incoming-order/incoming-order.dto.d.ts +575 -0
- package/dist/package/entity/index.d.ts +12 -0
- package/dist/package/entity/index.frontend.d.ts +1 -0
- package/dist/package/entity/member/member.dto.d.ts +2 -1
- package/dist/package/entity/order/order.do.d.ts +64 -7
- package/dist/package/entity/order/order.dto.d.ts +85 -67
- package/dist/package/entity/order/payment/payment.dto.d.ts +36 -28
- package/dist/package/entity/order-platform/external/auth/external-auth.dto.d.ts +9 -15
- package/dist/package/entity/order-platform/external/menu/external-master-menu.do.d.ts +33 -0
- package/dist/package/entity/order-platform/external/menu/external-menu.do.d.ts +1185 -23
- package/dist/package/entity/order-platform/external/order/external-order.do.d.ts +1104 -52
- package/dist/package/entity/order-platform/external/order/external-order.dto.d.ts +2914 -88
- package/dist/package/entity/order-platform/external/setting/external-setting.do.d.ts +38 -0
- package/dist/package/entity/order-platform/external/setting/external-setting.dto.d.ts +26 -0
- package/dist/package/entity/order-platform/foodpanda/foodpanda-availability.dto.d.ts +75 -0
- package/dist/package/entity/order-platform/foodpanda/foodpanda-order.do.d.ts +9 -0
- package/dist/package/entity/order-platform/foodpanda/foodpanda-settings.do.d.ts +13 -0
- package/dist/package/entity/order-platform/foodpanda/foodpanda-settings.dto.d.ts +3 -0
- package/dist/package/entity/order-platform/shopeefood/shopeefood.enum.d.ts +6 -0
- package/dist/package/entity/order-platform/tng/tng-order.do.d.ts +6 -6
- package/dist/package/entity/order-platform/tng/tng.dto.d.ts +2 -2
- package/dist/package/entity/order-setting/kiosk/kiosk.do.d.ts +3 -0
- package/dist/package/entity/order-setting/kiosk/kiosk.dto.d.ts +3 -0
- package/dist/package/entity/order-setting/kiosk/kiosk.enum.d.ts +12 -0
- package/dist/package/entity/order-setting/order-setting.do.d.ts +5 -0
- package/dist/package/entity/order-setting/order-setting.dto.d.ts +10 -0
- package/dist/package/entity/payment/payment.dto.d.ts +2 -2
- package/dist/package/entity/payment/transaction.d.ts +115 -30
- package/dist/package/entity/queue/queue.dto.d.ts +13 -11
- package/dist/package/entity/restaurant/restaurant.dto.d.ts +5 -0
- package/dist/package/entity/websocket/websocket.dto.d.ts +12 -0
- package/package.json +1 -1
- package/src/locales/en-US.json +5 -0
- package/src/locales/ja-JP.json +5 -0
- package/src/locales/th-TH.json +5 -0
- package/src/locales/zh-CN.json +5 -0
- package/src/modules/order-setting/kiosk/interface.ts +8 -0
- package/src/modules/order-setting/kiosk/languages.ts +29 -0
- package/src/stores/order-setting/mapper.spec.ts +44 -0
- package/src/stores/order-setting/mapper.ts +9 -2
- package/src/views/kiosk/settings/KioskSettingView.vue +63 -0
- package/src/views/order-settings/delivery/integrated-delivery/IntegratedDelivery.vue +6 -1
- package/src/views/order-settings/delivery/integrated-delivery/LinemanSetting.vue +2 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { defineComponent as G, openBlock as
|
|
2
|
-
import { u as se, a as pe, _ as de } from "./KioskDevicesView.vue_vue_type_script_setup_true_lang-
|
|
3
|
-
import { useDialog as
|
|
1
|
+
import { defineComponent as G, openBlock as h, createElementBlock as Q, createElementVNode as y, toDisplayString as A, unref as m, ref as v, defineAsyncComponent as ue, computed as T, onMounted as ce, watch as re, resolveComponent as w, createVNode as U, withCtx as oe, createBlock as E, createCommentVNode as F } from "vue";
|
|
2
|
+
import { u as se, a as pe, _ as de } from "./KioskDevicesView.vue_vue_type_script_setup_true_lang-CxtLm_oh.js";
|
|
3
|
+
import { useDialog as me, useSnackbar as ie } from "@feedmepos/ui-library";
|
|
4
4
|
import { useI18n as z, useCoreStore as ye } from "@feedmepos/mf-common";
|
|
5
|
-
import { F as fe, a as ve, S as N } from "./order.dto-
|
|
5
|
+
import { F as fe, a as ve, S as N } from "./order.dto-Dbn-hRrm.js";
|
|
6
6
|
import { defineStore as be } from "pinia";
|
|
7
|
-
import { O as H } from "./index-
|
|
8
|
-
import { u as _e } from "./app-
|
|
9
|
-
const
|
|
7
|
+
import { O as H } from "./index-I2YGevce.js";
|
|
8
|
+
import { u as _e } from "./app-ClOkRxOZ.js";
|
|
9
|
+
const he = { class: "flex flex-col gap-5 pb-6" }, Ce = { class: "fm-typo-en-body-md-400 block" }, Pe = { class: "fm-typo-en-title-md-600" }, we = /* @__PURE__ */ G({
|
|
10
10
|
__name: "KioskOtpDialog",
|
|
11
11
|
props: {
|
|
12
12
|
otp: {}
|
|
13
13
|
},
|
|
14
14
|
setup(e) {
|
|
15
15
|
const { t: a } = z();
|
|
16
|
-
return (l, c) => (
|
|
17
|
-
y("span",
|
|
16
|
+
return (l, c) => (h(), Q("div", he, [
|
|
17
|
+
y("span", Ce, A(m(a)("order.bindDeviceMessage")), 1),
|
|
18
18
|
y("div", Pe, A(e.otp), 1)
|
|
19
19
|
]));
|
|
20
20
|
}
|
|
@@ -76,7 +76,8 @@ const Ce = { class: "flex flex-col gap-5 pb-6" }, he = { class: "fm-typo-en-body
|
|
|
76
76
|
coverImagePortrait: null,
|
|
77
77
|
otaChannel: "",
|
|
78
78
|
autoCloseBill: null,
|
|
79
|
-
printReceiptAfterClose: null
|
|
79
|
+
printReceiptAfterClose: null,
|
|
80
|
+
languages: null
|
|
80
81
|
}, K = {
|
|
81
82
|
payAtCounter: null,
|
|
82
83
|
paid: null
|
|
@@ -86,7 +87,7 @@ const Ce = { class: "flex flex-col gap-5 pb-6" }, he = { class: "fm-typo-en-body
|
|
|
86
87
|
kiosk: Re(e.kioskSettings, (a = e.sequenceSettings) == null ? void 0 : a.kioskDineIn)
|
|
87
88
|
};
|
|
88
89
|
}, Re = (e, a) => {
|
|
89
|
-
var l, c, t, n,
|
|
90
|
+
var l, c, t, n, r, o, p, d, i, C, b, f;
|
|
90
91
|
return {
|
|
91
92
|
dineIn: Le(
|
|
92
93
|
a ?? {
|
|
@@ -99,12 +100,12 @@ const Ce = { class: "flex flex-col gap-5 pb-6" }, he = { class: "fm-typo-en-body
|
|
|
99
100
|
enabled: (e == null ? void 0 : e.canTakeaway) ?? !1,
|
|
100
101
|
submitOrderInstruction: (l = e == null ? void 0 : e.takeaway) != null && l.submitOrderInstruction ? {
|
|
101
102
|
payAtCounter: ((n = (t = (c = e == null ? void 0 : e.takeaway) == null ? void 0 : c.submitOrderInstruction) == null ? void 0 : t.payAtCounter) == null ? void 0 : n.en) ?? null,
|
|
102
|
-
paid: ((p = (o = (
|
|
103
|
+
paid: ((p = (o = (r = e == null ? void 0 : e.takeaway) == null ? void 0 : r.submitOrderInstruction) == null ? void 0 : o.paid) == null ? void 0 : p.en) ?? null
|
|
103
104
|
} : K
|
|
104
105
|
},
|
|
105
106
|
paymentSetting: {
|
|
106
107
|
paymentTypes: ((d = e == null ? void 0 : e.paymentSetting) == null ? void 0 : d.paymentTypes) ?? [],
|
|
107
|
-
offlinePaymentTypes: ((
|
|
108
|
+
offlinePaymentTypes: ((i = e == null ? void 0 : e.paymentSetting) == null ? void 0 : i.offlinePaymentTypes) ?? [],
|
|
108
109
|
ePaymentTypes: ((C = e == null ? void 0 : e.paymentSetting) == null ? void 0 : C.ePaymentTypes) ?? ve.parse({
|
|
109
110
|
card: {
|
|
110
111
|
terminal: !1,
|
|
@@ -117,7 +118,7 @@ const Ce = { class: "flex flex-col gap-5 pb-6" }, he = { class: "fm-typo-en-body
|
|
|
117
118
|
})
|
|
118
119
|
},
|
|
119
120
|
menuItem: {
|
|
120
|
-
showAllOnly: ((
|
|
121
|
+
showAllOnly: ((b = e == null ? void 0 : e.menuItem) == null ? void 0 : b.showAllOnly) ?? !1
|
|
121
122
|
},
|
|
122
123
|
otaChannel: (e == null ? void 0 : e.otaChannel) ?? "",
|
|
123
124
|
coverImageLandscape: (e == null ? void 0 : e.coverImageLandscape) ?? null,
|
|
@@ -125,10 +126,13 @@ const Ce = { class: "flex flex-col gap-5 pb-6" }, he = { class: "fm-typo-en-body
|
|
|
125
126
|
// Preserve "unset" as null — collapsing to a boolean here is what let an
|
|
126
127
|
// unrelated save overwrite the inherited dineInSettings value.
|
|
127
128
|
autoCloseBill: (e == null ? void 0 : e.autoCloseBill) ?? null,
|
|
128
|
-
printReceiptAfterClose: (e == null ? void 0 : e.printReceiptAfterClose) ?? null
|
|
129
|
+
printReceiptAfterClose: (e == null ? void 0 : e.printReceiptAfterClose) ?? null,
|
|
130
|
+
// Stored [] means the same thing as unset ("all languages"), so collapse it
|
|
131
|
+
// to null here — the form only ever has to reason about null vs a real set.
|
|
132
|
+
languages: (f = e == null ? void 0 : e.languages) != null && f.length ? [...e.languages] : null
|
|
129
133
|
};
|
|
130
134
|
}, Le = (e, a) => {
|
|
131
|
-
var l, c, t, n,
|
|
135
|
+
var l, c, t, n, r, o, p, d;
|
|
132
136
|
return {
|
|
133
137
|
enabled: !!a,
|
|
134
138
|
sequenceNumber: e,
|
|
@@ -147,14 +151,14 @@ const Ce = { class: "flex flex-col gap-5 pb-6" }, he = { class: "fm-typo-en-body
|
|
|
147
151
|
padDigit: a.displayStand.padDigit,
|
|
148
152
|
enablePaxDialog: a.displayStand.enablePaxDialog ?? !1,
|
|
149
153
|
submitOrderInstruction: a.displayStand.submitOrderInstruction ? {
|
|
150
|
-
payAtCounter: ((o = (
|
|
154
|
+
payAtCounter: ((o = (r = a.displayStand.submitOrderInstruction) == null ? void 0 : r.payAtCounter) == null ? void 0 : o.en) ?? null,
|
|
151
155
|
paid: ((d = (p = a.displayStand.submitOrderInstruction) == null ? void 0 : p.paid) == null ? void 0 : d.en) ?? null
|
|
152
156
|
} : K
|
|
153
157
|
} : J
|
|
154
158
|
};
|
|
155
159
|
}, Te = (e) => {
|
|
156
160
|
const a = (t) => {
|
|
157
|
-
var n,
|
|
161
|
+
var n, r, o, p;
|
|
158
162
|
return {
|
|
159
163
|
requiredSlot: !!t.displayStand,
|
|
160
164
|
displayStand: {
|
|
@@ -163,7 +167,7 @@ const Ce = { class: "flex flex-col gap-5 pb-6" }, he = { class: "fm-typo-en-body
|
|
|
163
167
|
payAtCounter: (n = t.displayStand.submitOrderInstruction) != null && n.payAtCounter ? {
|
|
164
168
|
en: t.displayStand.submitOrderInstruction.payAtCounter
|
|
165
169
|
} : null,
|
|
166
|
-
paid: (
|
|
170
|
+
paid: (r = t.displayStand.submitOrderInstruction) != null && r.paid ? {
|
|
167
171
|
en: t.displayStand.submitOrderInstruction.paid
|
|
168
172
|
} : null
|
|
169
173
|
}
|
|
@@ -180,29 +184,35 @@ const Ce = { class: "flex flex-col gap-5 pb-6" }, he = { class: "fm-typo-en-body
|
|
|
180
184
|
}
|
|
181
185
|
}
|
|
182
186
|
};
|
|
183
|
-
}, l = (t) =>
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
187
|
+
}, l = (t) => {
|
|
188
|
+
var n;
|
|
189
|
+
return {
|
|
190
|
+
canTakeaway: e.takeaway.enabled,
|
|
191
|
+
dineIn: t,
|
|
192
|
+
menuItem: e.menuItem,
|
|
193
|
+
coverImageLandscape: e.coverImageLandscape,
|
|
194
|
+
coverImagePortrait: e.coverImagePortrait,
|
|
195
|
+
otaChannel: e.otaChannel || void 0,
|
|
196
|
+
// Omit when unset so the backend's `?? config.autoCloseBill` inheritance
|
|
197
|
+
// still applies — sending `false` here would pin it off for good.
|
|
198
|
+
autoCloseBill: e.autoCloseBill ?? void 0,
|
|
199
|
+
printReceiptAfterClose: e.printReceiptAfterClose ?? void 0,
|
|
200
|
+
// Omit rather than send [] when the merchant restricts nothing, so the
|
|
201
|
+
// saved document stays free of a field that means "all languages" anyway.
|
|
202
|
+
languages: (n = e.languages) != null && n.length ? e.languages : void 0,
|
|
203
|
+
paymentSetting: c(e.paymentSetting),
|
|
204
|
+
takeaway: e.takeaway.submitOrderInstruction ? {
|
|
205
|
+
submitOrderInstruction: {
|
|
206
|
+
payAtCounter: e.takeaway.submitOrderInstruction.payAtCounter ? {
|
|
207
|
+
en: e.takeaway.submitOrderInstruction.payAtCounter
|
|
208
|
+
} : null,
|
|
209
|
+
paid: e.takeaway.submitOrderInstruction.paid ? {
|
|
210
|
+
en: e.takeaway.submitOrderInstruction.paid
|
|
211
|
+
} : null
|
|
212
|
+
}
|
|
213
|
+
} : void 0
|
|
214
|
+
};
|
|
215
|
+
}, c = (t) => ({
|
|
206
216
|
paymentTypes: t.paymentTypes,
|
|
207
217
|
offlinePaymentTypes: t.offlinePaymentTypes,
|
|
208
218
|
ePaymentTypes: t.ePaymentTypes
|
|
@@ -217,15 +227,15 @@ const Ce = { class: "flex flex-col gap-5 pb-6" }, he = { class: "fm-typo-en-body
|
|
|
217
227
|
convertOrderSettingDto: xe,
|
|
218
228
|
toOrderKioskSettingsDto: Te
|
|
219
229
|
}, Ue = be("orderSetting", () => {
|
|
220
|
-
const e =
|
|
230
|
+
const e = v({});
|
|
221
231
|
async function a() {
|
|
222
232
|
const n = await H.getOrderSetting();
|
|
223
233
|
c(n);
|
|
224
234
|
}
|
|
225
235
|
async function l() {
|
|
226
236
|
if (e.value.orderSetting && e.value.kiosk) {
|
|
227
|
-
const { _id: n, ...
|
|
228
|
-
...
|
|
237
|
+
const { _id: n, ...r } = e.value.orderSetting, o = W.toOrderKioskSettingsDto(e.value.kiosk), p = {
|
|
238
|
+
...r,
|
|
229
239
|
kioskSettings: o.kioskSettings
|
|
230
240
|
}, d = await H.updateOrderSetting(p);
|
|
231
241
|
c(d);
|
|
@@ -268,8 +278,8 @@ function qe(e) {
|
|
|
268
278
|
return a;
|
|
269
279
|
}
|
|
270
280
|
function Be(e, a) {
|
|
271
|
-
const [l, c, t] = Ne(e, a), n = Ve(a == null ? void 0 : a.locale),
|
|
272
|
-
return l + c.map(Me(n,
|
|
281
|
+
const [l, c, t] = Ne(e, a), n = Ve(a == null ? void 0 : a.locale), r = $e(a == null ? void 0 : a.locale);
|
|
282
|
+
return l + c.map(Me(n, r)).join(" ") + t;
|
|
273
283
|
}
|
|
274
284
|
function Ve(e) {
|
|
275
285
|
return (a) => a.toLocaleLowerCase(e);
|
|
@@ -282,60 +292,60 @@ function Me(e, a) {
|
|
|
282
292
|
}
|
|
283
293
|
function Ne(e, a = {}) {
|
|
284
294
|
const l = a.split ?? (a.separateNumbers ? qe : Z), c = a.prefixCharacters ?? j, t = a.suffixCharacters ?? j;
|
|
285
|
-
let n = 0,
|
|
295
|
+
let n = 0, r = e.length;
|
|
286
296
|
for (; n < e.length; ) {
|
|
287
297
|
const o = e.charAt(n);
|
|
288
298
|
if (!c.includes(o))
|
|
289
299
|
break;
|
|
290
300
|
n++;
|
|
291
301
|
}
|
|
292
|
-
for (;
|
|
293
|
-
const o =
|
|
302
|
+
for (; r > n; ) {
|
|
303
|
+
const o = r - 1, p = e.charAt(o);
|
|
294
304
|
if (!t.includes(p))
|
|
295
305
|
break;
|
|
296
|
-
|
|
306
|
+
r = o;
|
|
297
307
|
}
|
|
298
308
|
return [
|
|
299
309
|
e.slice(0, n),
|
|
300
|
-
l(e.slice(n,
|
|
301
|
-
e.slice(
|
|
310
|
+
l(e.slice(n, r)),
|
|
311
|
+
e.slice(r)
|
|
302
312
|
];
|
|
303
313
|
}
|
|
304
314
|
const He = { class: "py-[1.5rem]" }, We = { class: "px-[1.5rem]" }, Xe = { class: "pt-[1.5rem]" }, je = { class: "flex flex-col gap-10" }, Ge = { class: "fm-typo-en-title-sm-600" }, Qe = { class: "fm-typo-en-title-sm-400" }, ea = /* @__PURE__ */ G({
|
|
305
315
|
__name: "KioskView",
|
|
306
316
|
setup(e) {
|
|
307
317
|
var $, M;
|
|
308
|
-
const { t: a } = z(), { canManageOrderSetting: l } = _e(), c =
|
|
309
|
-
() => import("./KioskSettingView-
|
|
310
|
-
), t =
|
|
311
|
-
const
|
|
312
|
-
return
|
|
313
|
-
(s) => !
|
|
318
|
+
const { t: a } = z(), { canManageOrderSetting: l } = _e(), c = ue(
|
|
319
|
+
() => import("./KioskSettingView-D57KtQ-t.js")
|
|
320
|
+
), t = v("device"), n = se(), r = Ue(), o = pe(), p = me(), { currentRestaurant: d, restaurants: i, changeRestaurant: C } = ye(), b = ie(), f = v((($ = d.value) == null ? void 0 : $._id) ?? void 0), I = v(null), x = v(""), D = v(null), q = T(() => {
|
|
321
|
+
const u = x.value.trim().toLowerCase();
|
|
322
|
+
return i.value.filter(
|
|
323
|
+
(s) => !u || s.profile.name.toLowerCase().includes(u) || s._id.toLowerCase().includes(u)
|
|
314
324
|
).map((s) => ({
|
|
315
325
|
label: s.profile.name,
|
|
316
326
|
value: s._id
|
|
317
327
|
}));
|
|
318
328
|
});
|
|
319
|
-
async function
|
|
320
|
-
x.value =
|
|
329
|
+
async function g(u) {
|
|
330
|
+
x.value = u;
|
|
321
331
|
}
|
|
322
|
-
function
|
|
323
|
-
var s,
|
|
324
|
-
if (!
|
|
332
|
+
function O(u) {
|
|
333
|
+
var s, _;
|
|
334
|
+
if (!u) {
|
|
325
335
|
x.value = "";
|
|
326
336
|
return;
|
|
327
337
|
}
|
|
328
|
-
(
|
|
338
|
+
(_ = (s = D.value) == null ? void 0 : s.querySelector("input")) == null || _.select();
|
|
329
339
|
}
|
|
330
|
-
const P =
|
|
331
|
-
async function B(
|
|
332
|
-
const s =
|
|
333
|
-
await C(s), await V(),
|
|
340
|
+
const P = v(((M = d.value) == null ? void 0 : M._id) ?? "");
|
|
341
|
+
async function B(u) {
|
|
342
|
+
const s = i.value.find((_) => _._id == u);
|
|
343
|
+
await C(s), await V(), f.value = u, P.value = u;
|
|
334
344
|
}
|
|
335
345
|
async function V() {
|
|
336
346
|
if (l.value)
|
|
337
347
|
try {
|
|
338
|
-
await
|
|
348
|
+
await r.getSetting();
|
|
339
349
|
} catch {
|
|
340
350
|
}
|
|
341
351
|
await o.loadCheckouts(), await R();
|
|
@@ -344,20 +354,20 @@ const He = { class: "py-[1.5rem]" }, We = { class: "px-[1.5rem]" }, Xe = { class
|
|
|
344
354
|
I.value = null;
|
|
345
355
|
try {
|
|
346
356
|
await n.getDevices();
|
|
347
|
-
} catch (
|
|
348
|
-
I.value =
|
|
357
|
+
} catch (u) {
|
|
358
|
+
I.value = u instanceof N && u.status === 403 ? "forbidden" : "error";
|
|
349
359
|
}
|
|
350
360
|
}
|
|
351
361
|
const S = T(() => {
|
|
352
|
-
const
|
|
353
|
-
return l.value &&
|
|
362
|
+
const u = [{ label: a("order.deviceBinding"), value: "device" }];
|
|
363
|
+
return l.value && u.push({ label: a("order.settings"), value: "setting" }), u;
|
|
354
364
|
}), k = T(() => n.state.devices);
|
|
355
365
|
async function ee() {
|
|
356
366
|
try {
|
|
357
367
|
await n.requestOtp();
|
|
358
|
-
} catch (
|
|
359
|
-
|
|
360
|
-
title:
|
|
368
|
+
} catch (u) {
|
|
369
|
+
b.open({
|
|
370
|
+
title: u instanceof N && u.status === 403 ? a("order.bindDevicePermissionDenied") : a("order.bindDeviceFailed"),
|
|
361
371
|
type: "error"
|
|
362
372
|
});
|
|
363
373
|
return;
|
|
@@ -372,33 +382,33 @@ const He = { class: "py-[1.5rem]" }, We = { class: "px-[1.5rem]" }, Xe = { class
|
|
|
372
382
|
await R();
|
|
373
383
|
});
|
|
374
384
|
}
|
|
375
|
-
async function ae(
|
|
385
|
+
async function ae(u) {
|
|
376
386
|
try {
|
|
377
|
-
|
|
387
|
+
r.setKioskOrderSetting(u), await r.updateKioskSetting(), b.open({
|
|
378
388
|
title: a("order.kioskSettingSuccess"),
|
|
379
389
|
type: "success"
|
|
380
390
|
});
|
|
381
391
|
} catch {
|
|
382
|
-
|
|
392
|
+
b.open({
|
|
383
393
|
title: a("order.kioskSettingFailed"),
|
|
384
394
|
type: "error"
|
|
385
395
|
});
|
|
386
396
|
}
|
|
387
397
|
}
|
|
388
398
|
return ce(async () => {
|
|
389
|
-
var
|
|
390
|
-
(
|
|
391
|
-
}),
|
|
392
|
-
() =>
|
|
393
|
-
async (
|
|
394
|
-
|
|
399
|
+
var u;
|
|
400
|
+
(u = d.value) != null && u._id && (P.value = d.value._id, await V());
|
|
401
|
+
}), re(
|
|
402
|
+
() => i.value.length,
|
|
403
|
+
async (u) => {
|
|
404
|
+
f.value === void 0 && i.value.length > 0 && await B(i.value[0]._id);
|
|
395
405
|
},
|
|
396
406
|
{ immediate: !0 }
|
|
397
|
-
), (
|
|
398
|
-
const
|
|
399
|
-
return
|
|
400
|
-
U(
|
|
401
|
-
title:
|
|
407
|
+
), (u, s) => {
|
|
408
|
+
const _ = w("FmPageHead"), te = w("FmTabs"), ne = w("FmMenuItem"), le = w("FmSelect");
|
|
409
|
+
return h(), Q("div", He, [
|
|
410
|
+
U(_, {
|
|
411
|
+
title: m(a)("order.kiosk")
|
|
402
412
|
}, null, 8, ["title"]),
|
|
403
413
|
y("div", We, [
|
|
404
414
|
U(te, {
|
|
@@ -413,44 +423,44 @@ const He = { class: "py-[1.5rem]" }, We = { class: "px-[1.5rem]" }, Xe = { class
|
|
|
413
423
|
ref_key: "restaurantPicker",
|
|
414
424
|
ref: D
|
|
415
425
|
}, [
|
|
416
|
-
y("span", Ge, A(
|
|
417
|
-
y("span", Qe, A(
|
|
426
|
+
y("span", Ge, A(m(a)("order.activateLocation")), 1),
|
|
427
|
+
y("span", Qe, A(m(a)("order.selectRestaurant")) + ": ", 1),
|
|
418
428
|
U(le, {
|
|
419
429
|
class: "w-1/2",
|
|
420
|
-
modelValue:
|
|
430
|
+
modelValue: f.value,
|
|
421
431
|
"onUpdate:modelValue": [
|
|
422
|
-
s[1] || (s[1] = (L) =>
|
|
432
|
+
s[1] || (s[1] = (L) => f.value = L),
|
|
423
433
|
B
|
|
424
434
|
],
|
|
425
435
|
items: q.value,
|
|
426
|
-
placeholder:
|
|
436
|
+
placeholder: m(a)("order.searchRestaurant"),
|
|
427
437
|
searchable: "",
|
|
428
438
|
"search-debounce": 150,
|
|
429
|
-
"on-search":
|
|
430
|
-
onDropdownChanged:
|
|
439
|
+
"on-search": g,
|
|
440
|
+
onDropdownChanged: O
|
|
431
441
|
}, {
|
|
432
442
|
"append-menu": oe(() => [
|
|
433
|
-
q.value.length ? F("", !0) : (
|
|
443
|
+
q.value.length ? F("", !0) : (h(), E(ne, {
|
|
434
444
|
key: 0,
|
|
435
445
|
disabled: "",
|
|
436
|
-
label:
|
|
446
|
+
label: m(a)("order.noRestaurantFound")
|
|
437
447
|
}, null, 8, ["label"]))
|
|
438
448
|
]),
|
|
439
449
|
_: 1
|
|
440
450
|
}, 8, ["modelValue", "items", "placeholder"])
|
|
441
451
|
], 512),
|
|
442
|
-
t.value == "device" ? (
|
|
452
|
+
t.value == "device" ? (h(), E(de, {
|
|
443
453
|
key: 0,
|
|
444
454
|
devices: k.value,
|
|
445
455
|
"load-error": I.value,
|
|
446
456
|
onRequestOtp: ee,
|
|
447
457
|
onRetry: R
|
|
448
458
|
}, null, 8, ["devices", "load-error"])) : F("", !0),
|
|
449
|
-
t.value == "setting" &&
|
|
459
|
+
t.value == "setting" && m(l) ? (h(), E(m(c), {
|
|
450
460
|
key: `KioskSettingView-${P.value}`,
|
|
451
461
|
"restaurant-id": P.value,
|
|
452
462
|
onUpdateKioskOrderSetting: ae,
|
|
453
|
-
form:
|
|
463
|
+
form: m(r).state.kiosk ?? m(Ie)
|
|
454
464
|
}, null, 8, ["restaurant-id", "form"])) : F("", !0)
|
|
455
465
|
])
|
|
456
466
|
])
|