@movvjs/svelte-schedule-view 0.4.1-beta-3 → 0.4.1
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/.svelte-kit/__package__/i18n/index.js +2 -2
- package/.svelte-kit/__package__/schedule-view/Layout.svelte +60 -0
- package/.svelte-kit/__package__/schedule-view/Layout.svelte.d.ts +17 -0
- package/.svelte-kit/__package__/schedule-view/Schedule.svelte +76 -123
- package/.svelte-kit/__package__/schedule-view/Schedule.svelte.d.ts +0 -1
- package/.svelte-kit/generated/server/internal.js +1 -1
- package/dist/i18n/index.js +2 -2
- package/dist/schedule-view/Layout.svelte +60 -0
- package/dist/schedule-view/Layout.svelte.d.ts +17 -0
- package/dist/schedule-view/Schedule.svelte +76 -123
- package/dist/schedule-view/Schedule.svelte.d.ts +0 -1
- package/package.json +1 -1
- package/src/lib/i18n/index.ts +2 -2
- package/src/lib/schedule-view/Layout.svelte +54 -0
- package/src/lib/schedule-view/Schedule.svelte +81 -133
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { _, register
|
|
1
|
+
import { _, register } from 'svelte-i18n';
|
|
2
2
|
register('en', () => import('./locales/en.json'));
|
|
3
3
|
register('ko', () => import('./locales/ko.json'));
|
|
4
4
|
register('zh-cn', () => import('./locales/zh-cn.json'));
|
|
5
5
|
register('zh-tw', () => import('./locales/zh-tw.json'));
|
|
6
6
|
register('vi', () => import('./locales/vi.json'));
|
|
7
7
|
const t = _;
|
|
8
|
-
export { t
|
|
8
|
+
export { t };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<script>import "./assets/scss/indie_booking.scss";
|
|
2
|
+
import { dayjs } from "../dayjs";
|
|
3
|
+
import { isLoading, init, locale } from "svelte-i18n";
|
|
4
|
+
import Portal from "svelte-portal";
|
|
5
|
+
import { env } from "../store/env";
|
|
6
|
+
import { Alert, Confirm } from "./components/notifications";
|
|
7
|
+
import Loader from "./components/loader/Loader.svelte";
|
|
8
|
+
import { onMount } from "svelte";
|
|
9
|
+
init({
|
|
10
|
+
fallbackLocale: "en",
|
|
11
|
+
initialLocale: "en"
|
|
12
|
+
});
|
|
13
|
+
env.subscribe(($env) => {
|
|
14
|
+
locale.set($env.locale);
|
|
15
|
+
dayjs.locale($env.locale);
|
|
16
|
+
});
|
|
17
|
+
onMount(() => {
|
|
18
|
+
googleMaps();
|
|
19
|
+
function googleMaps() {
|
|
20
|
+
;
|
|
21
|
+
((g) => {
|
|
22
|
+
var h, a, k, p = "The Google Maps JavaScript API", c = "google", l = "importLibrary", q = "__ib__", m = document, b = window;
|
|
23
|
+
b = b[c] || (b[c] = {});
|
|
24
|
+
var d = b.maps || (b.maps = {}), r = /* @__PURE__ */ new Set(), e = new URLSearchParams(), u = () => h || (h = new Promise(async (f, n) => {
|
|
25
|
+
await (a = m.createElement("script"));
|
|
26
|
+
e.set("libraries", [...r] + "");
|
|
27
|
+
for (k in g)
|
|
28
|
+
e.set(k.replace(/[A-Z]/g, (t) => "_" + t[0].toLowerCase()), g[k]);
|
|
29
|
+
e.set("callback", c + ".maps." + q);
|
|
30
|
+
a.src = `https://maps.${c}apis.com/maps/api/js?` + e;
|
|
31
|
+
d[q] = f;
|
|
32
|
+
a.onerror = () => h = n(Error(p + " could not load."));
|
|
33
|
+
a.nonce = m.querySelector("script[nonce]")?.nonce || "";
|
|
34
|
+
m.head.append(a);
|
|
35
|
+
}));
|
|
36
|
+
d[l] ? console.warn(p + " only loads once. Ignoring:", g) : d[l] = (f, ...n) => r.add(f) && u().then(() => d[l](f, ...n));
|
|
37
|
+
})({
|
|
38
|
+
key: "AIzaSyDe1e91bi67YTTnPGQlKTHXeNqMPOYkjW0",
|
|
39
|
+
v: "weekly",
|
|
40
|
+
region: "kr",
|
|
41
|
+
language: navigator?.language || "en"
|
|
42
|
+
// Use the 'v' parameter to indicate the version to use (weekly, beta, alpha, etc.).
|
|
43
|
+
// Add other bootstrap parameters as needed, using camel case.
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<Portal target="body">
|
|
50
|
+
{#if !$isLoading}
|
|
51
|
+
<div id="indie_booking_wrapper">
|
|
52
|
+
<Loader />
|
|
53
|
+
<Alert />
|
|
54
|
+
<Confirm />
|
|
55
|
+
<slot><!-- optional fallback --></slot>
|
|
56
|
+
</div>
|
|
57
|
+
{:else}
|
|
58
|
+
<!-- i18n loading. . . . -->
|
|
59
|
+
{/if}
|
|
60
|
+
</Portal>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import './assets/scss/indie_booking.scss';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: Record<string, never>;
|
|
5
|
+
events: {
|
|
6
|
+
[evt: string]: CustomEvent<any>;
|
|
7
|
+
};
|
|
8
|
+
slots: {
|
|
9
|
+
default: {};
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export type LayoutProps = typeof __propDef.props;
|
|
13
|
+
export type LayoutEvents = typeof __propDef.events;
|
|
14
|
+
export type LayoutSlots = typeof __propDef.slots;
|
|
15
|
+
export default class Layout extends SvelteComponent<LayoutProps, LayoutEvents, LayoutSlots> {
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -1,29 +1,26 @@
|
|
|
1
1
|
<script context="module">export const isEdit = writable(false);
|
|
2
2
|
</script>
|
|
3
3
|
|
|
4
|
-
<script>import "
|
|
5
|
-
import toast, { Toaster } from "svelte-french-toast";
|
|
6
|
-
import { onMount } from "svelte";
|
|
4
|
+
<script>import { Toaster } from "svelte-french-toast";
|
|
7
5
|
import { writable } from "svelte/store";
|
|
8
6
|
import { cloneDeep } from "lodash-es";
|
|
9
7
|
import consola from "consola";
|
|
10
|
-
import QS from "qs";
|
|
11
|
-
import Axios from "axios";
|
|
12
8
|
import { dayjs } from "../dayjs";
|
|
13
|
-
import { t
|
|
9
|
+
import { t } from "../i18n";
|
|
14
10
|
import { env } from "../store/env";
|
|
15
|
-
import { API_URL } from "../axios/constant";
|
|
16
11
|
import { BookingAPI } from "./api";
|
|
17
12
|
import { copiedBooking, originalBooking } from "./stores/booking";
|
|
18
13
|
import { comma } from "./utils";
|
|
19
14
|
import { loader } from "./components/loader";
|
|
20
|
-
import { alert
|
|
21
|
-
import
|
|
15
|
+
import { alert } from "./components/notifications";
|
|
16
|
+
import Layout from "./Layout.svelte";
|
|
22
17
|
import Map from "./Map.svelte";
|
|
23
18
|
import ServiceZone from "./ServiceZone.svelte";
|
|
24
19
|
import Plan from "./Plan.svelte";
|
|
25
20
|
import BookingInfo from "./BookingInfo.svelte";
|
|
26
|
-
import
|
|
21
|
+
import { API_URL } from "../axios/constant";
|
|
22
|
+
import QS from "qs";
|
|
23
|
+
import Axios from "axios";
|
|
27
24
|
const { stdt, price, priceDifference, isModifiable } = originalBooking;
|
|
28
25
|
const {
|
|
29
26
|
price: editPrice,
|
|
@@ -33,7 +30,6 @@ const {
|
|
|
33
30
|
fullName,
|
|
34
31
|
selectedPrice
|
|
35
32
|
} = copiedBooking;
|
|
36
|
-
let initialized = false;
|
|
37
33
|
let on = false;
|
|
38
34
|
let resolver;
|
|
39
35
|
$:
|
|
@@ -50,38 +46,6 @@ export function init(options) {
|
|
|
50
46
|
throw new Error("token\uC744 \uB123\uC5B4\uC8FC\uC138\uC694.");
|
|
51
47
|
if (!locale)
|
|
52
48
|
throw new Error("locale\uC744 \uB123\uC5B4\uC8FC\uC138\uC694.");
|
|
53
|
-
if (locale) {
|
|
54
|
-
i18nInit({ fallbackLocale: "en", initialLocale: locale });
|
|
55
|
-
dayjs.locale(locale);
|
|
56
|
-
}
|
|
57
|
-
googleMaps();
|
|
58
|
-
function googleMaps() {
|
|
59
|
-
;
|
|
60
|
-
((g) => {
|
|
61
|
-
var h, a, k, p = "The Google Maps JavaScript API", c = "google", l = "importLibrary", q = "__ib__", m = document, b = window;
|
|
62
|
-
b = b[c] || (b[c] = {});
|
|
63
|
-
var d = b.maps || (b.maps = {}), r = /* @__PURE__ */ new Set(), e = new URLSearchParams(), u = () => h || (h = new Promise(async (f, n) => {
|
|
64
|
-
await (a = m.createElement("script"));
|
|
65
|
-
e.set("libraries", [...r] + "");
|
|
66
|
-
for (k in g)
|
|
67
|
-
e.set(k.replace(/[A-Z]/g, (t2) => "_" + t2[0].toLowerCase()), g[k]);
|
|
68
|
-
e.set("callback", c + ".maps." + q);
|
|
69
|
-
a.src = `https://maps.${c}apis.com/maps/api/js?` + e;
|
|
70
|
-
d[q] = f;
|
|
71
|
-
a.onerror = () => h = n(Error(p + " could not load."));
|
|
72
|
-
a.nonce = m.querySelector("script[nonce]")?.nonce || "";
|
|
73
|
-
m.head.append(a);
|
|
74
|
-
}));
|
|
75
|
-
d[l] ? console.warn(p + " only loads once. Ignoring:", g) : d[l] = (f, ...n) => r.add(f) && u().then(() => d[l](f, ...n));
|
|
76
|
-
})({
|
|
77
|
-
key: "AIzaSyDe1e91bi67YTTnPGQlKTHXeNqMPOYkjW0",
|
|
78
|
-
v: "weekly",
|
|
79
|
-
region: "kr",
|
|
80
|
-
language: navigator?.language || "en"
|
|
81
|
-
// Use the 'v' parameter to indicate the version to use (weekly, beta, alpha, etc.).
|
|
82
|
-
// Add other bootstrap parameters as needed, using camel case.
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
49
|
env.set({
|
|
86
50
|
target,
|
|
87
51
|
accessToken: token.accessToken,
|
|
@@ -91,7 +55,6 @@ export function init(options) {
|
|
|
91
55
|
isDev
|
|
92
56
|
});
|
|
93
57
|
consola.withTag("svelte-schedule-view").info("\uC124\uC815\uB41C env", $env);
|
|
94
|
-
initialized = true;
|
|
95
58
|
return {
|
|
96
59
|
open
|
|
97
60
|
};
|
|
@@ -196,91 +159,81 @@ async function save() {
|
|
|
196
159
|
}
|
|
197
160
|
</script>
|
|
198
161
|
|
|
199
|
-
<
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
<
|
|
204
|
-
|
|
205
|
-
<Confirm />
|
|
206
|
-
|
|
207
|
-
<section class="indie_pop_wrap scroll" class:on>
|
|
208
|
-
{#if on}
|
|
209
|
-
<div class="pop_base full_2 indie_passengers_info_pop">
|
|
210
|
-
<button type="button" class="btn_close" on:click={() => close()}>닫기</button>
|
|
211
|
-
|
|
212
|
-
<!-- 예약관리 > 예약_view > Schedule -->
|
|
213
|
-
<section class="indie_dispatch_passenger_sche_w booking_schedule">
|
|
214
|
-
<!-- 지도 부분 -->
|
|
215
|
-
<Map />
|
|
216
|
-
<!-- 예약 > 스케쥴 -->
|
|
217
|
-
<div class="indie_booking_schedule_modify_box">
|
|
218
|
-
<div class="header_b">
|
|
219
|
-
<div class="tags">
|
|
220
|
-
<span>{$originalBooking.code}</span>
|
|
221
|
-
<strong>{$t(`serviceType.${$originalBooking.serviceType}`)}</strong>
|
|
222
|
-
</div>
|
|
223
|
-
<p class="date_text">{dayjs($stdt).format('ll (dd)')}</p>
|
|
224
|
-
<!-- <select class="indie_select_nor">
|
|
225
|
-
<option value="">2023-10-16 (Mon)</option>
|
|
226
|
-
<option value="">2023-10-16 (Mon)</option>
|
|
227
|
-
</select> -->
|
|
162
|
+
<Toaster />
|
|
163
|
+
<Layout>
|
|
164
|
+
<section class="indie_pop_wrap scroll" class:on>
|
|
165
|
+
{#if on}
|
|
166
|
+
<div class="pop_base full_2 indie_passengers_info_pop">
|
|
167
|
+
<button type="button" class="btn_close" on:click={() => close()}>닫기</button>
|
|
228
168
|
|
|
229
|
-
|
|
230
|
-
|
|
169
|
+
<!-- 예약관리 > 예약_view > Schedule -->
|
|
170
|
+
<section class="indie_dispatch_passenger_sche_w booking_schedule">
|
|
171
|
+
<!-- 지도 부분 -->
|
|
172
|
+
<Map />
|
|
173
|
+
<!-- 예약 > 스케쥴 -->
|
|
174
|
+
<div class="indie_booking_schedule_modify_box">
|
|
175
|
+
<div class="header_b">
|
|
176
|
+
<div class="tags">
|
|
177
|
+
<span>{$originalBooking.code}</span>
|
|
178
|
+
<strong>{$t(`serviceType.${$originalBooking.serviceType}`)}</strong>
|
|
179
|
+
</div>
|
|
180
|
+
<p class="date_text">{dayjs($stdt).format('ll (dd)')}</p>
|
|
181
|
+
<!-- <select class="indie_select_nor">
|
|
182
|
+
<option value="">2023-10-16 (Mon)</option>
|
|
183
|
+
<option value="">2023-10-16 (Mon)</option>
|
|
184
|
+
</select> -->
|
|
231
185
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
<Plan />
|
|
235
|
-
<BookingInfo />
|
|
236
|
-
</div>
|
|
186
|
+
<!-- <button type="button" class="btn_close">닫기</button> -->
|
|
187
|
+
</div>
|
|
237
188
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
<!-- * 차액 발생시 -->
|
|
244
|
-
{#if difference > 0 || difference < 0}
|
|
245
|
-
<!-- 검정 표현 -->
|
|
246
|
-
<strong>{comma(targetPrice.before.amount)} {forex}</strong>
|
|
189
|
+
<div class="contents_b">
|
|
190
|
+
<ServiceZone />
|
|
191
|
+
<Plan />
|
|
192
|
+
<BookingInfo />
|
|
193
|
+
</div>
|
|
247
194
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
<!-- * 차액 미 발생시 검정색 표현-->
|
|
258
|
-
<strong>{comma(targetPrice.new.amount)} {forex}</strong>
|
|
259
|
-
{/if}
|
|
260
|
-
</dd>
|
|
261
|
-
</dl>
|
|
262
|
-
</div>
|
|
195
|
+
<div class="footer_b">
|
|
196
|
+
<div class="left">
|
|
197
|
+
<dl class="priceAll">
|
|
198
|
+
<dt>{$t('booking.totalPrice')}</dt>
|
|
199
|
+
<dd>
|
|
200
|
+
<!-- * 차액 발생시 -->
|
|
201
|
+
{#if difference > 0 || difference < 0}
|
|
202
|
+
<!-- 검정 표현 -->
|
|
203
|
+
<strong>{comma(targetPrice.before.amount)} {forex}</strong>
|
|
263
204
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
205
|
+
<!-- 빨간색 표현 -->
|
|
206
|
+
<span>
|
|
207
|
+
{difference > 0 ? ' + ' : ' - '}
|
|
208
|
+
{comma(Math.abs(difference))}
|
|
209
|
+
{forex}
|
|
210
|
+
= {comma(targetPrice.new.amount)}
|
|
211
|
+
{forex}
|
|
212
|
+
</span>
|
|
270
213
|
{:else}
|
|
271
|
-
|
|
272
|
-
<
|
|
214
|
+
<!-- * 차액 미 발생시 검정색 표현-->
|
|
215
|
+
<strong>{comma(targetPrice.new.amount)} {forex}</strong>
|
|
273
216
|
{/if}
|
|
274
|
-
</
|
|
275
|
-
</
|
|
217
|
+
</dd>
|
|
218
|
+
</dl>
|
|
219
|
+
</div>
|
|
220
|
+
|
|
221
|
+
<div class="right">
|
|
222
|
+
<button type="button" class="indie_btn_nor md line2" on:click={() => close()}>{$t('booking.cancel')}</button>
|
|
223
|
+
{#if !$isEdit}
|
|
224
|
+
{#if $isModifiable}
|
|
225
|
+
<button type="button" class="indie_btn_nor md line2 modify" on:click={() => edit()}>{$t('booking.modify')}</button>
|
|
226
|
+
{/if}
|
|
227
|
+
{:else}
|
|
228
|
+
<button type="button" class="indie_btn_nor md line2" on:click={() => reset()}>{$t('booking.reset')}</button>
|
|
229
|
+
<button type="button" class="indie_btn_nor md blue" on:click={() => save()}>{$t('booking.save')}</button>
|
|
230
|
+
{/if}
|
|
276
231
|
</div>
|
|
277
|
-
</
|
|
278
|
-
<!-- // 배차 - 탑승자 정보 및 스케줄 -->
|
|
232
|
+
</div>
|
|
279
233
|
</div>
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
</Portal>
|
|
234
|
+
</section>
|
|
235
|
+
<!-- // 배차 - 탑승자 정보 및 스케줄 -->
|
|
236
|
+
</div>
|
|
237
|
+
{/if}
|
|
238
|
+
</section>
|
|
239
|
+
</Layout>
|
|
@@ -21,7 +21,7 @@ export const options = {
|
|
|
21
21
|
app: ({ head, body, assets, nonce, env }) => "<!DOCTYPE html>\n<html lang=\"en\">\n\t<head>\n\t\t<meta charset=\"utf-8\" />\n\t\t<link rel=\"icon\" href=\"" + assets + "/favicon.png\" />\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n\t\t<meta name=\"referrer\" content=\"no-referrer\" />\n\t\t" + head + "\n\t</head>\n\t<body data-sveltekit-preload-data=\"hover\">\n\t\t<div>" + body + "</div>\n\t</body>\n</html>\n",
|
|
22
22
|
error: ({ status, message }) => "<!doctype html>\n<html lang=\"en\">\n\t<head>\n\t\t<meta charset=\"utf-8\" />\n\t\t<title>" + message + "</title>\n\n\t\t<style>\n\t\t\tbody {\n\t\t\t\t--bg: white;\n\t\t\t\t--fg: #222;\n\t\t\t\t--divider: #ccc;\n\t\t\t\tbackground: var(--bg);\n\t\t\t\tcolor: var(--fg);\n\t\t\t\tfont-family:\n\t\t\t\t\tsystem-ui,\n\t\t\t\t\t-apple-system,\n\t\t\t\t\tBlinkMacSystemFont,\n\t\t\t\t\t'Segoe UI',\n\t\t\t\t\tRoboto,\n\t\t\t\t\tOxygen,\n\t\t\t\t\tUbuntu,\n\t\t\t\t\tCantarell,\n\t\t\t\t\t'Open Sans',\n\t\t\t\t\t'Helvetica Neue',\n\t\t\t\t\tsans-serif;\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t.error {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tmax-width: 32rem;\n\t\t\t\tmargin: 0 1rem;\n\t\t\t}\n\n\t\t\t.status {\n\t\t\t\tfont-weight: 200;\n\t\t\t\tfont-size: 3rem;\n\t\t\t\tline-height: 1;\n\t\t\t\tposition: relative;\n\t\t\t\ttop: -0.05rem;\n\t\t\t}\n\n\t\t\t.message {\n\t\t\t\tborder-left: 1px solid var(--divider);\n\t\t\t\tpadding: 0 0 0 1rem;\n\t\t\t\tmargin: 0 0 0 1rem;\n\t\t\t\tmin-height: 2.5rem;\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t}\n\n\t\t\t.message h1 {\n\t\t\t\tfont-weight: 400;\n\t\t\t\tfont-size: 1em;\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t@media (prefers-color-scheme: dark) {\n\t\t\t\tbody {\n\t\t\t\t\t--bg: #222;\n\t\t\t\t\t--fg: #ddd;\n\t\t\t\t\t--divider: #666;\n\t\t\t\t}\n\t\t\t}\n\t\t</style>\n\t</head>\n\t<body>\n\t\t<div class=\"error\">\n\t\t\t<span class=\"status\">" + status + "</span>\n\t\t\t<div class=\"message\">\n\t\t\t\t<h1>" + message + "</h1>\n\t\t\t</div>\n\t\t</div>\n\t</body>\n</html>\n"
|
|
23
23
|
},
|
|
24
|
-
version_hash: "
|
|
24
|
+
version_hash: "3ouolu"
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
export async function get_hooks() {
|
package/dist/i18n/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { _, register
|
|
1
|
+
import { _, register } from 'svelte-i18n';
|
|
2
2
|
register('en', () => import('./locales/en.json'));
|
|
3
3
|
register('ko', () => import('./locales/ko.json'));
|
|
4
4
|
register('zh-cn', () => import('./locales/zh-cn.json'));
|
|
5
5
|
register('zh-tw', () => import('./locales/zh-tw.json'));
|
|
6
6
|
register('vi', () => import('./locales/vi.json'));
|
|
7
7
|
const t = _;
|
|
8
|
-
export { t
|
|
8
|
+
export { t };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<script>import "./assets/scss/indie_booking.scss";
|
|
2
|
+
import { dayjs } from "../dayjs";
|
|
3
|
+
import { isLoading, init, locale } from "svelte-i18n";
|
|
4
|
+
import Portal from "svelte-portal";
|
|
5
|
+
import { env } from "../store/env";
|
|
6
|
+
import { Alert, Confirm } from "./components/notifications";
|
|
7
|
+
import Loader from "./components/loader/Loader.svelte";
|
|
8
|
+
import { onMount } from "svelte";
|
|
9
|
+
init({
|
|
10
|
+
fallbackLocale: "en",
|
|
11
|
+
initialLocale: "en"
|
|
12
|
+
});
|
|
13
|
+
env.subscribe(($env) => {
|
|
14
|
+
locale.set($env.locale);
|
|
15
|
+
dayjs.locale($env.locale);
|
|
16
|
+
});
|
|
17
|
+
onMount(() => {
|
|
18
|
+
googleMaps();
|
|
19
|
+
function googleMaps() {
|
|
20
|
+
;
|
|
21
|
+
((g) => {
|
|
22
|
+
var h, a, k, p = "The Google Maps JavaScript API", c = "google", l = "importLibrary", q = "__ib__", m = document, b = window;
|
|
23
|
+
b = b[c] || (b[c] = {});
|
|
24
|
+
var d = b.maps || (b.maps = {}), r = /* @__PURE__ */ new Set(), e = new URLSearchParams(), u = () => h || (h = new Promise(async (f, n) => {
|
|
25
|
+
await (a = m.createElement("script"));
|
|
26
|
+
e.set("libraries", [...r] + "");
|
|
27
|
+
for (k in g)
|
|
28
|
+
e.set(k.replace(/[A-Z]/g, (t) => "_" + t[0].toLowerCase()), g[k]);
|
|
29
|
+
e.set("callback", c + ".maps." + q);
|
|
30
|
+
a.src = `https://maps.${c}apis.com/maps/api/js?` + e;
|
|
31
|
+
d[q] = f;
|
|
32
|
+
a.onerror = () => h = n(Error(p + " could not load."));
|
|
33
|
+
a.nonce = m.querySelector("script[nonce]")?.nonce || "";
|
|
34
|
+
m.head.append(a);
|
|
35
|
+
}));
|
|
36
|
+
d[l] ? console.warn(p + " only loads once. Ignoring:", g) : d[l] = (f, ...n) => r.add(f) && u().then(() => d[l](f, ...n));
|
|
37
|
+
})({
|
|
38
|
+
key: "AIzaSyDe1e91bi67YTTnPGQlKTHXeNqMPOYkjW0",
|
|
39
|
+
v: "weekly",
|
|
40
|
+
region: "kr",
|
|
41
|
+
language: navigator?.language || "en"
|
|
42
|
+
// Use the 'v' parameter to indicate the version to use (weekly, beta, alpha, etc.).
|
|
43
|
+
// Add other bootstrap parameters as needed, using camel case.
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<Portal target="body">
|
|
50
|
+
{#if !$isLoading}
|
|
51
|
+
<div id="indie_booking_wrapper">
|
|
52
|
+
<Loader />
|
|
53
|
+
<Alert />
|
|
54
|
+
<Confirm />
|
|
55
|
+
<slot><!-- optional fallback --></slot>
|
|
56
|
+
</div>
|
|
57
|
+
{:else}
|
|
58
|
+
<!-- i18n loading. . . . -->
|
|
59
|
+
{/if}
|
|
60
|
+
</Portal>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import './assets/scss/indie_booking.scss';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: Record<string, never>;
|
|
5
|
+
events: {
|
|
6
|
+
[evt: string]: CustomEvent<any>;
|
|
7
|
+
};
|
|
8
|
+
slots: {
|
|
9
|
+
default: {};
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export type LayoutProps = typeof __propDef.props;
|
|
13
|
+
export type LayoutEvents = typeof __propDef.events;
|
|
14
|
+
export type LayoutSlots = typeof __propDef.slots;
|
|
15
|
+
export default class Layout extends SvelteComponent<LayoutProps, LayoutEvents, LayoutSlots> {
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -1,29 +1,26 @@
|
|
|
1
1
|
<script context="module">export const isEdit = writable(false);
|
|
2
2
|
</script>
|
|
3
3
|
|
|
4
|
-
<script>import "
|
|
5
|
-
import toast, { Toaster } from "svelte-french-toast";
|
|
6
|
-
import { onMount } from "svelte";
|
|
4
|
+
<script>import { Toaster } from "svelte-french-toast";
|
|
7
5
|
import { writable } from "svelte/store";
|
|
8
6
|
import { cloneDeep } from "lodash-es";
|
|
9
7
|
import consola from "consola";
|
|
10
|
-
import QS from "qs";
|
|
11
|
-
import Axios from "axios";
|
|
12
8
|
import { dayjs } from "../dayjs";
|
|
13
|
-
import { t
|
|
9
|
+
import { t } from "../i18n";
|
|
14
10
|
import { env } from "../store/env";
|
|
15
|
-
import { API_URL } from "../axios/constant";
|
|
16
11
|
import { BookingAPI } from "./api";
|
|
17
12
|
import { copiedBooking, originalBooking } from "./stores/booking";
|
|
18
13
|
import { comma } from "./utils";
|
|
19
14
|
import { loader } from "./components/loader";
|
|
20
|
-
import { alert
|
|
21
|
-
import
|
|
15
|
+
import { alert } from "./components/notifications";
|
|
16
|
+
import Layout from "./Layout.svelte";
|
|
22
17
|
import Map from "./Map.svelte";
|
|
23
18
|
import ServiceZone from "./ServiceZone.svelte";
|
|
24
19
|
import Plan from "./Plan.svelte";
|
|
25
20
|
import BookingInfo from "./BookingInfo.svelte";
|
|
26
|
-
import
|
|
21
|
+
import { API_URL } from "../axios/constant";
|
|
22
|
+
import QS from "qs";
|
|
23
|
+
import Axios from "axios";
|
|
27
24
|
const { stdt, price, priceDifference, isModifiable } = originalBooking;
|
|
28
25
|
const {
|
|
29
26
|
price: editPrice,
|
|
@@ -33,7 +30,6 @@ const {
|
|
|
33
30
|
fullName,
|
|
34
31
|
selectedPrice
|
|
35
32
|
} = copiedBooking;
|
|
36
|
-
let initialized = false;
|
|
37
33
|
let on = false;
|
|
38
34
|
let resolver;
|
|
39
35
|
$:
|
|
@@ -50,38 +46,6 @@ export function init(options) {
|
|
|
50
46
|
throw new Error("token\uC744 \uB123\uC5B4\uC8FC\uC138\uC694.");
|
|
51
47
|
if (!locale)
|
|
52
48
|
throw new Error("locale\uC744 \uB123\uC5B4\uC8FC\uC138\uC694.");
|
|
53
|
-
if (locale) {
|
|
54
|
-
i18nInit({ fallbackLocale: "en", initialLocale: locale });
|
|
55
|
-
dayjs.locale(locale);
|
|
56
|
-
}
|
|
57
|
-
googleMaps();
|
|
58
|
-
function googleMaps() {
|
|
59
|
-
;
|
|
60
|
-
((g) => {
|
|
61
|
-
var h, a, k, p = "The Google Maps JavaScript API", c = "google", l = "importLibrary", q = "__ib__", m = document, b = window;
|
|
62
|
-
b = b[c] || (b[c] = {});
|
|
63
|
-
var d = b.maps || (b.maps = {}), r = /* @__PURE__ */ new Set(), e = new URLSearchParams(), u = () => h || (h = new Promise(async (f, n) => {
|
|
64
|
-
await (a = m.createElement("script"));
|
|
65
|
-
e.set("libraries", [...r] + "");
|
|
66
|
-
for (k in g)
|
|
67
|
-
e.set(k.replace(/[A-Z]/g, (t2) => "_" + t2[0].toLowerCase()), g[k]);
|
|
68
|
-
e.set("callback", c + ".maps." + q);
|
|
69
|
-
a.src = `https://maps.${c}apis.com/maps/api/js?` + e;
|
|
70
|
-
d[q] = f;
|
|
71
|
-
a.onerror = () => h = n(Error(p + " could not load."));
|
|
72
|
-
a.nonce = m.querySelector("script[nonce]")?.nonce || "";
|
|
73
|
-
m.head.append(a);
|
|
74
|
-
}));
|
|
75
|
-
d[l] ? console.warn(p + " only loads once. Ignoring:", g) : d[l] = (f, ...n) => r.add(f) && u().then(() => d[l](f, ...n));
|
|
76
|
-
})({
|
|
77
|
-
key: "AIzaSyDe1e91bi67YTTnPGQlKTHXeNqMPOYkjW0",
|
|
78
|
-
v: "weekly",
|
|
79
|
-
region: "kr",
|
|
80
|
-
language: navigator?.language || "en"
|
|
81
|
-
// Use the 'v' parameter to indicate the version to use (weekly, beta, alpha, etc.).
|
|
82
|
-
// Add other bootstrap parameters as needed, using camel case.
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
49
|
env.set({
|
|
86
50
|
target,
|
|
87
51
|
accessToken: token.accessToken,
|
|
@@ -91,7 +55,6 @@ export function init(options) {
|
|
|
91
55
|
isDev
|
|
92
56
|
});
|
|
93
57
|
consola.withTag("svelte-schedule-view").info("\uC124\uC815\uB41C env", $env);
|
|
94
|
-
initialized = true;
|
|
95
58
|
return {
|
|
96
59
|
open
|
|
97
60
|
};
|
|
@@ -196,91 +159,81 @@ async function save() {
|
|
|
196
159
|
}
|
|
197
160
|
</script>
|
|
198
161
|
|
|
199
|
-
<
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
<
|
|
204
|
-
|
|
205
|
-
<Confirm />
|
|
206
|
-
|
|
207
|
-
<section class="indie_pop_wrap scroll" class:on>
|
|
208
|
-
{#if on}
|
|
209
|
-
<div class="pop_base full_2 indie_passengers_info_pop">
|
|
210
|
-
<button type="button" class="btn_close" on:click={() => close()}>닫기</button>
|
|
211
|
-
|
|
212
|
-
<!-- 예약관리 > 예약_view > Schedule -->
|
|
213
|
-
<section class="indie_dispatch_passenger_sche_w booking_schedule">
|
|
214
|
-
<!-- 지도 부분 -->
|
|
215
|
-
<Map />
|
|
216
|
-
<!-- 예약 > 스케쥴 -->
|
|
217
|
-
<div class="indie_booking_schedule_modify_box">
|
|
218
|
-
<div class="header_b">
|
|
219
|
-
<div class="tags">
|
|
220
|
-
<span>{$originalBooking.code}</span>
|
|
221
|
-
<strong>{$t(`serviceType.${$originalBooking.serviceType}`)}</strong>
|
|
222
|
-
</div>
|
|
223
|
-
<p class="date_text">{dayjs($stdt).format('ll (dd)')}</p>
|
|
224
|
-
<!-- <select class="indie_select_nor">
|
|
225
|
-
<option value="">2023-10-16 (Mon)</option>
|
|
226
|
-
<option value="">2023-10-16 (Mon)</option>
|
|
227
|
-
</select> -->
|
|
162
|
+
<Toaster />
|
|
163
|
+
<Layout>
|
|
164
|
+
<section class="indie_pop_wrap scroll" class:on>
|
|
165
|
+
{#if on}
|
|
166
|
+
<div class="pop_base full_2 indie_passengers_info_pop">
|
|
167
|
+
<button type="button" class="btn_close" on:click={() => close()}>닫기</button>
|
|
228
168
|
|
|
229
|
-
|
|
230
|
-
|
|
169
|
+
<!-- 예약관리 > 예약_view > Schedule -->
|
|
170
|
+
<section class="indie_dispatch_passenger_sche_w booking_schedule">
|
|
171
|
+
<!-- 지도 부분 -->
|
|
172
|
+
<Map />
|
|
173
|
+
<!-- 예약 > 스케쥴 -->
|
|
174
|
+
<div class="indie_booking_schedule_modify_box">
|
|
175
|
+
<div class="header_b">
|
|
176
|
+
<div class="tags">
|
|
177
|
+
<span>{$originalBooking.code}</span>
|
|
178
|
+
<strong>{$t(`serviceType.${$originalBooking.serviceType}`)}</strong>
|
|
179
|
+
</div>
|
|
180
|
+
<p class="date_text">{dayjs($stdt).format('ll (dd)')}</p>
|
|
181
|
+
<!-- <select class="indie_select_nor">
|
|
182
|
+
<option value="">2023-10-16 (Mon)</option>
|
|
183
|
+
<option value="">2023-10-16 (Mon)</option>
|
|
184
|
+
</select> -->
|
|
231
185
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
<Plan />
|
|
235
|
-
<BookingInfo />
|
|
236
|
-
</div>
|
|
186
|
+
<!-- <button type="button" class="btn_close">닫기</button> -->
|
|
187
|
+
</div>
|
|
237
188
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
<!-- * 차액 발생시 -->
|
|
244
|
-
{#if difference > 0 || difference < 0}
|
|
245
|
-
<!-- 검정 표현 -->
|
|
246
|
-
<strong>{comma(targetPrice.before.amount)} {forex}</strong>
|
|
189
|
+
<div class="contents_b">
|
|
190
|
+
<ServiceZone />
|
|
191
|
+
<Plan />
|
|
192
|
+
<BookingInfo />
|
|
193
|
+
</div>
|
|
247
194
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
<!-- * 차액 미 발생시 검정색 표현-->
|
|
258
|
-
<strong>{comma(targetPrice.new.amount)} {forex}</strong>
|
|
259
|
-
{/if}
|
|
260
|
-
</dd>
|
|
261
|
-
</dl>
|
|
262
|
-
</div>
|
|
195
|
+
<div class="footer_b">
|
|
196
|
+
<div class="left">
|
|
197
|
+
<dl class="priceAll">
|
|
198
|
+
<dt>{$t('booking.totalPrice')}</dt>
|
|
199
|
+
<dd>
|
|
200
|
+
<!-- * 차액 발생시 -->
|
|
201
|
+
{#if difference > 0 || difference < 0}
|
|
202
|
+
<!-- 검정 표현 -->
|
|
203
|
+
<strong>{comma(targetPrice.before.amount)} {forex}</strong>
|
|
263
204
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
205
|
+
<!-- 빨간색 표현 -->
|
|
206
|
+
<span>
|
|
207
|
+
{difference > 0 ? ' + ' : ' - '}
|
|
208
|
+
{comma(Math.abs(difference))}
|
|
209
|
+
{forex}
|
|
210
|
+
= {comma(targetPrice.new.amount)}
|
|
211
|
+
{forex}
|
|
212
|
+
</span>
|
|
270
213
|
{:else}
|
|
271
|
-
|
|
272
|
-
<
|
|
214
|
+
<!-- * 차액 미 발생시 검정색 표현-->
|
|
215
|
+
<strong>{comma(targetPrice.new.amount)} {forex}</strong>
|
|
273
216
|
{/if}
|
|
274
|
-
</
|
|
275
|
-
</
|
|
217
|
+
</dd>
|
|
218
|
+
</dl>
|
|
219
|
+
</div>
|
|
220
|
+
|
|
221
|
+
<div class="right">
|
|
222
|
+
<button type="button" class="indie_btn_nor md line2" on:click={() => close()}>{$t('booking.cancel')}</button>
|
|
223
|
+
{#if !$isEdit}
|
|
224
|
+
{#if $isModifiable}
|
|
225
|
+
<button type="button" class="indie_btn_nor md line2 modify" on:click={() => edit()}>{$t('booking.modify')}</button>
|
|
226
|
+
{/if}
|
|
227
|
+
{:else}
|
|
228
|
+
<button type="button" class="indie_btn_nor md line2" on:click={() => reset()}>{$t('booking.reset')}</button>
|
|
229
|
+
<button type="button" class="indie_btn_nor md blue" on:click={() => save()}>{$t('booking.save')}</button>
|
|
230
|
+
{/if}
|
|
276
231
|
</div>
|
|
277
|
-
</
|
|
278
|
-
<!-- // 배차 - 탑승자 정보 및 스케줄 -->
|
|
232
|
+
</div>
|
|
279
233
|
</div>
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
</Portal>
|
|
234
|
+
</section>
|
|
235
|
+
<!-- // 배차 - 탑승자 정보 및 스케줄 -->
|
|
236
|
+
</div>
|
|
237
|
+
{/if}
|
|
238
|
+
</section>
|
|
239
|
+
</Layout>
|
package/package.json
CHANGED
package/src/lib/i18n/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _, register
|
|
1
|
+
import { _, register } from 'svelte-i18n'
|
|
2
2
|
|
|
3
3
|
register('en', () => import('./locales/en.json'))
|
|
4
4
|
register('ko', () => import('./locales/ko.json'))
|
|
@@ -8,4 +8,4 @@ register('vi', () => import('./locales/vi.json'))
|
|
|
8
8
|
|
|
9
9
|
const t = _
|
|
10
10
|
|
|
11
|
-
export { t
|
|
11
|
+
export { t }
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import './assets/scss/indie_booking.scss'
|
|
3
|
+
|
|
4
|
+
import { dayjs } from '$lib/dayjs'
|
|
5
|
+
import { isLoading, init, locale } from 'svelte-i18n'
|
|
6
|
+
import Portal from 'svelte-portal'
|
|
7
|
+
|
|
8
|
+
import { env } from '$lib/store/env'
|
|
9
|
+
|
|
10
|
+
import { Alert, Confirm } from './components/notifications'
|
|
11
|
+
|
|
12
|
+
import Loader from './components/loader/Loader.svelte'
|
|
13
|
+
import { onMount } from 'svelte'
|
|
14
|
+
|
|
15
|
+
init({
|
|
16
|
+
fallbackLocale: 'en',
|
|
17
|
+
initialLocale: 'en'
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
env.subscribe($env => {
|
|
21
|
+
locale.set($env.locale)
|
|
22
|
+
dayjs.locale($env.locale)
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
onMount(() => {
|
|
26
|
+
googleMaps()
|
|
27
|
+
|
|
28
|
+
function googleMaps() {
|
|
29
|
+
// https://developers.google.com/maps/documentation/javascript/load-maps-js-api?hl=ko#dynamic-library-import
|
|
30
|
+
// prettier-ignore
|
|
31
|
+
;(g=>{var h,a,k,p="The Google Maps JavaScript API",c="google",l="importLibrary",q="__ib__",m=document,b=window;b=b[c]||(b[c]={});var d=b.maps||(b.maps={}),r=new Set,e=new URLSearchParams,u=()=>h||(h=new Promise(async(f,n)=>{await (a=m.createElement("script"));e.set("libraries",[...r]+"");for(k in g)e.set(k.replace(/[A-Z]/g,t=>"_"+t[0].toLowerCase()),g[k]);e.set("callback",c+".maps."+q);a.src=`https://maps.${c}apis.com/maps/api/js?`+e;d[q]=f;a.onerror=()=>h=n(Error(p+" could not load."));a.nonce=m.querySelector("script[nonce]")?.nonce||"";m.head.append(a)}));d[l]?console.warn(p+" only loads once. Ignoring:",g):d[l]=(f,...n)=>r.add(f)&&u().then(()=>d[l](f,...n))})({
|
|
32
|
+
key: "AIzaSyDe1e91bi67YTTnPGQlKTHXeNqMPOYkjW0",
|
|
33
|
+
v: "weekly",
|
|
34
|
+
region: "kr",
|
|
35
|
+
language: navigator?.language || "en",
|
|
36
|
+
// Use the 'v' parameter to indicate the version to use (weekly, beta, alpha, etc.).
|
|
37
|
+
// Add other bootstrap parameters as needed, using camel case.
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
})
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<Portal target="body">
|
|
44
|
+
{#if !$isLoading}
|
|
45
|
+
<div id="indie_booking_wrapper">
|
|
46
|
+
<Loader />
|
|
47
|
+
<Alert />
|
|
48
|
+
<Confirm />
|
|
49
|
+
<slot><!-- optional fallback --></slot>
|
|
50
|
+
</div>
|
|
51
|
+
{:else}
|
|
52
|
+
<!-- i18n loading. . . . -->
|
|
53
|
+
{/if}
|
|
54
|
+
</Portal>
|
|
@@ -13,19 +13,14 @@
|
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
15
|
<script lang="ts">
|
|
16
|
-
import '
|
|
17
|
-
import toast, { Toaster } from 'svelte-french-toast'
|
|
18
|
-
import { onMount } from 'svelte'
|
|
16
|
+
import { Toaster } from 'svelte-french-toast'
|
|
19
17
|
import { writable } from 'svelte/store'
|
|
20
18
|
import { cloneDeep } from 'lodash-es'
|
|
21
19
|
import consola from 'consola'
|
|
22
|
-
import QS from 'qs'
|
|
23
|
-
import Axios from 'axios'
|
|
24
20
|
|
|
25
21
|
import { dayjs } from '$lib/dayjs'
|
|
26
|
-
import { t
|
|
22
|
+
import { t } from '$lib/i18n'
|
|
27
23
|
import { env } from '$lib/store/env'
|
|
28
|
-
import { API_URL } from '$lib/axios/constant'
|
|
29
24
|
|
|
30
25
|
import type { Locale, Target } from '$scheduleView/types'
|
|
31
26
|
import { BookingAPI } from '$scheduleView/api'
|
|
@@ -33,31 +28,16 @@
|
|
|
33
28
|
import { comma } from '$scheduleView/utils'
|
|
34
29
|
|
|
35
30
|
import { loader } from '$scheduleView/components/loader'
|
|
36
|
-
import { alert
|
|
37
|
-
import Loader from './components/loader/Loader.svelte'
|
|
31
|
+
import { alert } from '$scheduleView/components/notifications'
|
|
38
32
|
|
|
33
|
+
import Layout from '$scheduleView/Layout.svelte'
|
|
39
34
|
import Map from '$scheduleView/Map.svelte'
|
|
40
35
|
import ServiceZone from '$scheduleView/ServiceZone.svelte'
|
|
41
36
|
import Plan from '$scheduleView/Plan.svelte'
|
|
42
37
|
import BookingInfo from '$scheduleView/BookingInfo.svelte'
|
|
43
|
-
import
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
// googleMaps()
|
|
47
|
-
|
|
48
|
-
// function googleMaps() {
|
|
49
|
-
// // https://developers.google.com/maps/documentation/javascript/load-maps-js-api?hl=ko#dynamic-library-import
|
|
50
|
-
// // prettier-ignore
|
|
51
|
-
// ;(g=>{var h,a,k,p="The Google Maps JavaScript API",c="google",l="importLibrary",q="__ib__",m=document,b=window;b=b[c]||(b[c]={});var d=b.maps||(b.maps={}),r=new Set,e=new URLSearchParams,u=()=>h||(h=new Promise(async(f,n)=>{await (a=m.createElement("script"));e.set("libraries",[...r]+"");for(k in g)e.set(k.replace(/[A-Z]/g,t=>"_"+t[0].toLowerCase()),g[k]);e.set("callback",c+".maps."+q);a.src=`https://maps.${c}apis.com/maps/api/js?`+e;d[q]=f;a.onerror=()=>h=n(Error(p+" could not load."));a.nonce=m.querySelector("script[nonce]")?.nonce||"";m.head.append(a)}));d[l]?console.warn(p+" only loads once. Ignoring:",g):d[l]=(f,...n)=>r.add(f)&&u().then(()=>d[l](f,...n))})({
|
|
52
|
-
// key: "AIzaSyDe1e91bi67YTTnPGQlKTHXeNqMPOYkjW0",
|
|
53
|
-
// v: "weekly",
|
|
54
|
-
// region: "kr",
|
|
55
|
-
// language: navigator?.language || "en",
|
|
56
|
-
// // Use the 'v' parameter to indicate the version to use (weekly, beta, alpha, etc.).
|
|
57
|
-
// // Add other bootstrap parameters as needed, using camel case.
|
|
58
|
-
// });
|
|
59
|
-
// }
|
|
60
|
-
// })
|
|
38
|
+
import { API_URL } from '$lib/axios/constant'
|
|
39
|
+
import QS from 'qs'
|
|
40
|
+
import Axios from 'axios'
|
|
61
41
|
|
|
62
42
|
const { stdt, price, priceDifference, isModifiable } = originalBooking
|
|
63
43
|
const {
|
|
@@ -69,7 +49,6 @@
|
|
|
69
49
|
selectedPrice
|
|
70
50
|
} = copiedBooking
|
|
71
51
|
|
|
72
|
-
let initialized = false
|
|
73
52
|
let on = false
|
|
74
53
|
let resolver: (value: Awaited<ReturnType<typeof open>>) => void
|
|
75
54
|
|
|
@@ -91,26 +70,6 @@
|
|
|
91
70
|
if (!token) throw new Error('token을 넣어주세요.')
|
|
92
71
|
if (!locale) throw new Error('locale을 넣어주세요.')
|
|
93
72
|
|
|
94
|
-
if (locale) {
|
|
95
|
-
i18nInit({ fallbackLocale: 'en', initialLocale: locale })
|
|
96
|
-
dayjs.locale(locale)
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
googleMaps()
|
|
100
|
-
|
|
101
|
-
function googleMaps() {
|
|
102
|
-
// https://developers.google.com/maps/documentation/javascript/load-maps-js-api?hl=ko#dynamic-library-import
|
|
103
|
-
// prettier-ignore
|
|
104
|
-
;(g=>{var h,a,k,p="The Google Maps JavaScript API",c="google",l="importLibrary",q="__ib__",m=document,b=window;b=b[c]||(b[c]={});var d=b.maps||(b.maps={}),r=new Set,e=new URLSearchParams,u=()=>h||(h=new Promise(async(f,n)=>{await (a=m.createElement("script"));e.set("libraries",[...r]+"");for(k in g)e.set(k.replace(/[A-Z]/g,t=>"_"+t[0].toLowerCase()),g[k]);e.set("callback",c+".maps."+q);a.src=`https://maps.${c}apis.com/maps/api/js?`+e;d[q]=f;a.onerror=()=>h=n(Error(p+" could not load."));a.nonce=m.querySelector("script[nonce]")?.nonce||"";m.head.append(a)}));d[l]?console.warn(p+" only loads once. Ignoring:",g):d[l]=(f,...n)=>r.add(f)&&u().then(()=>d[l](f,...n))})({
|
|
105
|
-
key: "AIzaSyDe1e91bi67YTTnPGQlKTHXeNqMPOYkjW0",
|
|
106
|
-
v: "weekly",
|
|
107
|
-
region: "kr",
|
|
108
|
-
language: navigator?.language || "en",
|
|
109
|
-
// Use the 'v' parameter to indicate the version to use (weekly, beta, alpha, etc.).
|
|
110
|
-
// Add other bootstrap parameters as needed, using camel case.
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
|
|
114
73
|
env.set({
|
|
115
74
|
target,
|
|
116
75
|
accessToken: token.accessToken,
|
|
@@ -121,7 +80,6 @@
|
|
|
121
80
|
})
|
|
122
81
|
|
|
123
82
|
consola.withTag('svelte-schedule-view').info('설정된 env', $env)
|
|
124
|
-
initialized = true
|
|
125
83
|
return {
|
|
126
84
|
open
|
|
127
85
|
}
|
|
@@ -255,91 +213,81 @@
|
|
|
255
213
|
}
|
|
256
214
|
</script>
|
|
257
215
|
|
|
258
|
-
<
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
<
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
<
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
<
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
<
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
{
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
{difference > 0 ? ' + ' : ' - '}
|
|
310
|
-
{comma(Math.abs(difference))}
|
|
311
|
-
{forex}
|
|
312
|
-
= {comma(targetPrice.new.amount)}
|
|
313
|
-
{forex}
|
|
314
|
-
</span>
|
|
315
|
-
{:else}
|
|
316
|
-
<!-- * 차액 미 발생시 검정색 표현-->
|
|
317
|
-
<strong>{comma(targetPrice.new.amount)} {forex}</strong>
|
|
318
|
-
{/if}
|
|
319
|
-
</dd>
|
|
320
|
-
</dl>
|
|
321
|
-
</div>
|
|
322
|
-
|
|
323
|
-
<div class="right">
|
|
324
|
-
<button type="button" class="indie_btn_nor md line2" on:click={() => close()}>{$t('booking.cancel')}</button>
|
|
325
|
-
{#if !$isEdit}
|
|
326
|
-
{#if $isModifiable}
|
|
327
|
-
<button type="button" class="indie_btn_nor md line2 modify" on:click={() => edit()}>{$t('booking.modify')}</button>
|
|
328
|
-
{/if}
|
|
216
|
+
<Toaster />
|
|
217
|
+
<Layout>
|
|
218
|
+
<section class="indie_pop_wrap scroll" class:on>
|
|
219
|
+
{#if on}
|
|
220
|
+
<div class="pop_base full_2 indie_passengers_info_pop">
|
|
221
|
+
<button type="button" class="btn_close" on:click={() => close()}>닫기</button>
|
|
222
|
+
|
|
223
|
+
<!-- 예약관리 > 예약_view > Schedule -->
|
|
224
|
+
<section class="indie_dispatch_passenger_sche_w booking_schedule">
|
|
225
|
+
<!-- 지도 부분 -->
|
|
226
|
+
<Map />
|
|
227
|
+
<!-- 예약 > 스케쥴 -->
|
|
228
|
+
<div class="indie_booking_schedule_modify_box">
|
|
229
|
+
<div class="header_b">
|
|
230
|
+
<div class="tags">
|
|
231
|
+
<span>{$originalBooking.code}</span>
|
|
232
|
+
<strong>{$t(`serviceType.${$originalBooking.serviceType}`)}</strong>
|
|
233
|
+
</div>
|
|
234
|
+
<p class="date_text">{dayjs($stdt).format('ll (dd)')}</p>
|
|
235
|
+
<!-- <select class="indie_select_nor">
|
|
236
|
+
<option value="">2023-10-16 (Mon)</option>
|
|
237
|
+
<option value="">2023-10-16 (Mon)</option>
|
|
238
|
+
</select> -->
|
|
239
|
+
|
|
240
|
+
<!-- <button type="button" class="btn_close">닫기</button> -->
|
|
241
|
+
</div>
|
|
242
|
+
|
|
243
|
+
<div class="contents_b">
|
|
244
|
+
<ServiceZone />
|
|
245
|
+
<Plan />
|
|
246
|
+
<BookingInfo />
|
|
247
|
+
</div>
|
|
248
|
+
|
|
249
|
+
<div class="footer_b">
|
|
250
|
+
<div class="left">
|
|
251
|
+
<dl class="priceAll">
|
|
252
|
+
<dt>{$t('booking.totalPrice')}</dt>
|
|
253
|
+
<dd>
|
|
254
|
+
<!-- * 차액 발생시 -->
|
|
255
|
+
{#if difference > 0 || difference < 0}
|
|
256
|
+
<!-- 검정 표현 -->
|
|
257
|
+
<strong>{comma(targetPrice.before.amount)} {forex}</strong>
|
|
258
|
+
|
|
259
|
+
<!-- 빨간색 표현 -->
|
|
260
|
+
<span>
|
|
261
|
+
{difference > 0 ? ' + ' : ' - '}
|
|
262
|
+
{comma(Math.abs(difference))}
|
|
263
|
+
{forex}
|
|
264
|
+
= {comma(targetPrice.new.amount)}
|
|
265
|
+
{forex}
|
|
266
|
+
</span>
|
|
329
267
|
{:else}
|
|
330
|
-
|
|
331
|
-
<
|
|
268
|
+
<!-- * 차액 미 발생시 검정색 표현-->
|
|
269
|
+
<strong>{comma(targetPrice.new.amount)} {forex}</strong>
|
|
332
270
|
{/if}
|
|
333
|
-
</
|
|
334
|
-
</
|
|
271
|
+
</dd>
|
|
272
|
+
</dl>
|
|
273
|
+
</div>
|
|
274
|
+
|
|
275
|
+
<div class="right">
|
|
276
|
+
<button type="button" class="indie_btn_nor md line2" on:click={() => close()}>{$t('booking.cancel')}</button>
|
|
277
|
+
{#if !$isEdit}
|
|
278
|
+
{#if $isModifiable}
|
|
279
|
+
<button type="button" class="indie_btn_nor md line2 modify" on:click={() => edit()}>{$t('booking.modify')}</button>
|
|
280
|
+
{/if}
|
|
281
|
+
{:else}
|
|
282
|
+
<button type="button" class="indie_btn_nor md line2" on:click={() => reset()}>{$t('booking.reset')}</button>
|
|
283
|
+
<button type="button" class="indie_btn_nor md blue" on:click={() => save()}>{$t('booking.save')}</button>
|
|
284
|
+
{/if}
|
|
335
285
|
</div>
|
|
336
|
-
</
|
|
337
|
-
<!-- // 배차 - 탑승자 정보 및 스케줄 -->
|
|
286
|
+
</div>
|
|
338
287
|
</div>
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
</Portal>
|
|
288
|
+
</section>
|
|
289
|
+
<!-- // 배차 - 탑승자 정보 및 스케줄 -->
|
|
290
|
+
</div>
|
|
291
|
+
{/if}
|
|
292
|
+
</section>
|
|
293
|
+
</Layout>
|