ts-glitter 21.1.8 → 21.1.9
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/lowcode/Entry.js +14 -1
- package/lowcode/Entry.ts +13 -1
- package/lowcode/backend-manager/bg-line.js +18 -10
- package/lowcode/backend-manager/bg-line.ts +19 -10
- package/lowcode/backend-manager/bg-list-component.js +1 -2
- package/lowcode/backend-manager/bg-list-component.ts +1 -1
- package/lowcode/backend-manager/bg-notify.js +17 -10
- package/lowcode/backend-manager/bg-notify.ts +19 -11
- package/lowcode/backend-manager/bg-recommend.js +15 -9
- package/lowcode/backend-manager/bg-recommend.ts +16 -9
- package/lowcode/backend-manager/bg-sns.js +16 -9
- package/lowcode/backend-manager/bg-sns.ts +18 -11
- package/lowcode/backend-manager/bg-widget.js +325 -261
- package/lowcode/backend-manager/bg-widget.ts +117 -45
- package/lowcode/cms-plugin/auto-fcm-history.js +15 -6
- package/lowcode/cms-plugin/auto-fcm-history.ts +18 -11
- package/lowcode/cms-plugin/auto-reply.js +17 -1
- package/lowcode/cms-plugin/auto-reply.ts +16 -1
- package/lowcode/cms-plugin/exhibition-list.js +11 -2
- package/lowcode/cms-plugin/exhibition-list.ts +12 -2
- package/lowcode/cms-plugin/live_capture.js +2 -2
- package/lowcode/cms-plugin/live_capture.ts +2 -2
- package/lowcode/cms-plugin/model/order.d.ts +1 -0
- package/lowcode/cms-plugin/module/order-excel.js +15 -1
- package/lowcode/cms-plugin/module/order-excel.ts +22 -2
- package/lowcode/cms-plugin/module/table-storage.js +11 -0
- package/lowcode/cms-plugin/module/table-storage.ts +12 -0
- package/lowcode/cms-plugin/permission-setting.js +16 -9
- package/lowcode/cms-plugin/permission-setting.ts +18 -10
- package/lowcode/cms-plugin/reconciliation-area.js +12 -3
- package/lowcode/cms-plugin/reconciliation-area.ts +13 -3
- package/lowcode/cms-plugin/shopping-allowance-manager.js +12 -3
- package/lowcode/cms-plugin/shopping-allowance-manager.ts +13 -3
- package/lowcode/cms-plugin/shopping-invoice-manager.js +12 -3
- package/lowcode/cms-plugin/shopping-invoice-manager.ts +13 -4
- package/lowcode/cms-plugin/shopping-order-manager.js +12 -3
- package/lowcode/cms-plugin/shopping-order-manager.ts +13 -4
- package/lowcode/cms-plugin/shopping-product-setting.js +16 -10
- package/lowcode/cms-plugin/shopping-product-setting.ts +17 -10
- package/lowcode/cms-plugin/shopping-product-stock.js +17 -11
- package/lowcode/cms-plugin/shopping-product-stock.ts +18 -11
- package/lowcode/cms-plugin/shopping-setting-basic.js +129 -38
- package/lowcode/cms-plugin/shopping-setting-basic.ts +134 -38
- package/lowcode/cms-plugin/stock-history.js +14 -7
- package/lowcode/cms-plugin/stock-history.ts +15 -7
- package/lowcode/cms-plugin/stock-stores.js +13 -6
- package/lowcode/cms-plugin/stock-stores.ts +14 -6
- package/lowcode/cms-plugin/stock-vendors.js +13 -6
- package/lowcode/cms-plugin/stock-vendors.ts +14 -6
- package/lowcode/cms-plugin/user-list.js +24 -7
- package/lowcode/cms-plugin/user-list.ts +25 -7
- package/lowcode/css/editor.css +9 -4
- package/lowcode/public-components/product/pd-class.js +11 -2
- package/lowcode/public-components/product/pd-class.ts +16 -3
- package/lowcode/public-components/public/ad.js +42 -10
- package/lowcode/public-components/public/ad.ts +28 -1
- package/lowcode/public-models/product.ts +1 -0
- package/lowcode/view-model/saas-view-model.js +394 -379
- package/lowcode/view-model/saas-view-model.ts +1451 -1405
- package/package.json +1 -1
- package/src/api-public/controllers/user.js +4 -4
- package/src/api-public/controllers/user.js.map +1 -1
- package/src/api-public/controllers/user.ts +4 -4
- package/src/api-public/services/checkout-event.js +7 -17
- package/src/api-public/services/checkout-event.js.map +1 -1
- package/src/api-public/services/fb-api.d.ts +4 -3
- package/src/api-public/services/fb-api.js +72 -27
- package/src/api-public/services/fb-api.js.map +1 -1
- package/src/api-public/services/fb-api.ts +183 -127
- package/src/api-public/services/user.d.ts +6 -5
- package/src/api-public/services/user.js +19 -27
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +14 -10
- package/src/seo-config.js +1 -0
- package/src/seo-config.js.map +1 -1
- package/src/seo-config.ts +1 -0
- package/src/services/app.js +7 -17
- package/src/services/app.js.map +1 -1
|
@@ -30,51 +30,53 @@ export class SaasViewModel {
|
|
|
30
30
|
if (!userData.phone) {
|
|
31
31
|
SaasViewModel.accountSetting(gvc);
|
|
32
32
|
}
|
|
33
|
-
resolve(html `
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
onclick="${gvc.event((e, event) => {
|
|
33
|
+
resolve(html ` <div
|
|
34
|
+
class="btn btn-outline-secondary dropdown-toggle border-0 px-2 position-relative"
|
|
35
|
+
data-bs-toggle="dropdown"
|
|
36
|
+
aria-haspopup="true"
|
|
37
|
+
aria-expanded="false"
|
|
38
|
+
onclick="${gvc.event((e, event) => {
|
|
40
39
|
event.stopPropagation();
|
|
41
40
|
event.preventDefault();
|
|
42
41
|
})}"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
42
|
+
disabled="true"
|
|
43
|
+
>
|
|
44
|
+
<div class="d-flex align-items-center ">
|
|
45
|
+
<img
|
|
46
|
+
src="https://assets.imgix.net/~text?bg=7ED379&txtclr=ffffff&w=100&h=100&txtsize=40&txt=${userData
|
|
47
|
+
.userData.name}&txtfont=Helvetica&txtalign=middle,center"
|
|
48
|
+
class="rounded-circle"
|
|
49
|
+
width="48"
|
|
50
|
+
alt="Avatar"
|
|
51
|
+
style="width:40px;height:40px;"
|
|
52
|
+
/>
|
|
53
|
+
<div class="d-none d-sm-block ps-2">
|
|
54
|
+
<div class="fs-xs lh-1 opacity-60 fw-500">Hello,</div>
|
|
55
|
+
<div class="fs-sm fw-500">${userData.userData.name}</div>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
<div
|
|
60
|
+
class="dropdown-menu position-absolute"
|
|
61
|
+
style="top:50px; ${document.body.clientWidth > 768 ? 'right: 0 !important;' : 'left: -110px;'}"
|
|
62
|
+
>
|
|
63
|
+
<a
|
|
64
|
+
class="dropdown-item cursor_pointer d-flex align-items-center"
|
|
65
|
+
onclick="${gvc.event(() => {
|
|
64
66
|
gvc.glitter.setUrlParameter('tab', 'ai-point');
|
|
65
67
|
gvc.recreateView();
|
|
66
68
|
})}"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
><img
|
|
70
|
+
src="https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/size1440_s*px$_sas0s9s0s1sesas0_1697354801736-Glitterlogo.png"
|
|
71
|
+
class="me-2"
|
|
72
|
+
style="width:24px;height: 24px;"
|
|
73
|
+
/>剩餘『${gvc.bindView(() => {
|
|
72
74
|
const id = gvc.glitter.getUUID();
|
|
73
75
|
const vm = {
|
|
74
76
|
loading: true,
|
|
75
77
|
sum: 0,
|
|
76
78
|
};
|
|
77
|
-
AiPointsApi.getSum({}).then(
|
|
79
|
+
AiPointsApi.getSum({}).then(res => {
|
|
78
80
|
vm.sum = parseInt(res.response.sum, 10);
|
|
79
81
|
vm.loading = false;
|
|
80
82
|
gvc.notifyDataChange(id);
|
|
@@ -94,23 +96,27 @@ export class SaasViewModel {
|
|
|
94
96
|
},
|
|
95
97
|
};
|
|
96
98
|
})}』點</a
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
>
|
|
100
|
+
<a
|
|
101
|
+
class="dropdown-item cursor_pointer d-flex align-items-center"
|
|
102
|
+
onclick="${gvc.event(() => {
|
|
101
103
|
gvc.glitter.setUrlParameter('tab', 'sms-points');
|
|
102
104
|
gvc.recreateView();
|
|
103
105
|
})}"
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
>
|
|
107
|
+
<div
|
|
108
|
+
class="me-2 d-flex align-items-center justify-content-center fs-6"
|
|
109
|
+
style="width:24px;height: 24px;"
|
|
110
|
+
>
|
|
111
|
+
<i class="fa-solid fa-comment-sms"></i>
|
|
112
|
+
</div>
|
|
113
|
+
剩餘『${gvc.bindView(() => {
|
|
108
114
|
const id = gvc.glitter.getUUID();
|
|
109
115
|
const vm = {
|
|
110
116
|
loading: true,
|
|
111
117
|
sum: 0,
|
|
112
118
|
};
|
|
113
|
-
SmsPointsApi.getSum({}).then(
|
|
119
|
+
SmsPointsApi.getSum({}).then(res => {
|
|
114
120
|
vm.sum = parseInt(res.response.sum, 10);
|
|
115
121
|
vm.loading = false;
|
|
116
122
|
gvc.notifyDataChange(id);
|
|
@@ -119,11 +125,9 @@ export class SaasViewModel {
|
|
|
119
125
|
bind: id,
|
|
120
126
|
view: () => {
|
|
121
127
|
if (vm.loading) {
|
|
122
|
-
return html `
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
style="height:20px;width: 20px;"></div>
|
|
126
|
-
</div>`;
|
|
128
|
+
return html ` <div class="h-100 d-flex align-items-center">
|
|
129
|
+
<div class="spinner-border" style="height:20px;width: 20px;"></div>
|
|
130
|
+
</div>`;
|
|
127
131
|
}
|
|
128
132
|
else {
|
|
129
133
|
return `${vm.sum.toLocaleString()}`;
|
|
@@ -134,45 +138,55 @@ export class SaasViewModel {
|
|
|
134
138
|
},
|
|
135
139
|
};
|
|
136
140
|
})}』點</a
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
+
>
|
|
142
|
+
<a
|
|
143
|
+
class="dropdown-item cursor_pointer d-flex align-items-center"
|
|
144
|
+
onclick="${gvc.event(() => {
|
|
141
145
|
SaasViewModel.openShopList(gvc);
|
|
142
146
|
})}"
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
147
|
+
>
|
|
148
|
+
<div
|
|
149
|
+
class="me-2 d-flex align-items-center justify-content-center fs-6"
|
|
150
|
+
style="width:24px;height: 24px;"
|
|
151
|
+
>
|
|
152
|
+
<i class="fa-duotone fa-solid fa-shop " style=""></i>
|
|
153
|
+
</div>
|
|
154
|
+
商店列表</a
|
|
155
|
+
>
|
|
156
|
+
<a
|
|
157
|
+
class="dropdown-item cursor_pointer d-flex align-items-center"
|
|
158
|
+
onclick="${gvc.event(() => {
|
|
152
159
|
SaasViewModel.accountSetting(gvc);
|
|
153
160
|
})}"
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
>
|
|
162
|
+
<div
|
|
163
|
+
class="me-2 d-flex align-items-center justify-content-center fs-6"
|
|
164
|
+
style="width:24px;height: 24px;"
|
|
165
|
+
>
|
|
166
|
+
<i class="fa-sharp-duotone fa-solid fa-gear"></i>
|
|
167
|
+
</div>
|
|
168
|
+
帳號設定</a
|
|
169
|
+
>
|
|
170
|
+
<a
|
|
171
|
+
class="dropdown-item cursor_pointer d-flex align-items-center"
|
|
172
|
+
onclick="${gvc.event(() => {
|
|
163
173
|
SaasViewModel.notifySetting(gvc);
|
|
164
174
|
})}"
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
175
|
+
>
|
|
176
|
+
<div
|
|
177
|
+
class="me-2 d-flex align-items-center justify-content-center fs-6"
|
|
178
|
+
style="width:24px;height: 24px;"
|
|
179
|
+
>
|
|
180
|
+
<i class="fa-regular fa-bell-ring"></i>
|
|
181
|
+
</div>
|
|
182
|
+
通知設定</a
|
|
183
|
+
>
|
|
184
|
+
<div class="dropdown-divider"></div>
|
|
185
|
+
<a
|
|
186
|
+
class="dropdown-item cursor_pointer"
|
|
187
|
+
onclick="${gvc.event(() => {
|
|
174
188
|
dialog.checkYesOrNot({
|
|
175
|
-
callback:
|
|
189
|
+
callback: bool => {
|
|
176
190
|
if (bool) {
|
|
177
191
|
GlobalUser.saas_token = '';
|
|
178
192
|
window.history.replaceState({}, document.title, gvc.glitter.root_path + 'login');
|
|
@@ -182,9 +196,9 @@ export class SaasViewModel {
|
|
|
182
196
|
text: '確定要登出嗎?',
|
|
183
197
|
});
|
|
184
198
|
})}"
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
199
|
+
>登出</a
|
|
200
|
+
>
|
|
201
|
+
</div>`);
|
|
188
202
|
}));
|
|
189
203
|
},
|
|
190
204
|
divCreate: {
|
|
@@ -210,26 +224,24 @@ export class SaasViewModel {
|
|
|
210
224
|
gvc: gvc,
|
|
211
225
|
title: '帳號設定',
|
|
212
226
|
innerHTML: (gvc) => {
|
|
213
|
-
return html `
|
|
214
|
-
|
|
215
|
-
${[
|
|
227
|
+
return html ` <div class="mt-n2">
|
|
228
|
+
${[
|
|
216
229
|
BgWidget.editeInput({
|
|
217
230
|
gvc: gvc,
|
|
218
231
|
title: '公司或單位名稱',
|
|
219
232
|
default: userData.userData.name,
|
|
220
|
-
callback:
|
|
233
|
+
callback: text => {
|
|
221
234
|
userData.userData.name = text;
|
|
222
235
|
},
|
|
223
236
|
placeHolder: '請輸入公司或單位名稱',
|
|
224
237
|
}),
|
|
225
238
|
BgWidget.editeInput({
|
|
226
239
|
gvc: gvc,
|
|
227
|
-
title: html `
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
</div>`,
|
|
240
|
+
title: html ` <div class="d-flex flex-column" style="gap:3px;">
|
|
241
|
+
電子信箱 ${BgWidget.grayNote('商店的所有訂單與用戶通知,將會發送至此信箱')}
|
|
242
|
+
</div>`,
|
|
231
243
|
default: userData.userData.email,
|
|
232
|
-
callback:
|
|
244
|
+
callback: text => {
|
|
233
245
|
userData.userData.email = text;
|
|
234
246
|
gvc.recreateView();
|
|
235
247
|
},
|
|
@@ -246,7 +258,9 @@ export class SaasViewModel {
|
|
|
246
258
|
bind: id,
|
|
247
259
|
view: () => {
|
|
248
260
|
return `信箱驗證碼
|
|
249
|
-
${BgWidget.blueNote(get_verify_timer
|
|
261
|
+
${BgWidget.blueNote(get_verify_timer
|
|
262
|
+
? `${get_verify_timer}秒後可再次發送驗證碼`
|
|
263
|
+
: '點我取得驗證碼', gvc.event(() => {
|
|
250
264
|
if (!get_verify_timer) {
|
|
251
265
|
const dialog = new ShareDialog(gvc.glitter);
|
|
252
266
|
dialog.dataLoading({ visible: true });
|
|
@@ -273,7 +287,7 @@ export class SaasViewModel {
|
|
|
273
287
|
};
|
|
274
288
|
}),
|
|
275
289
|
default: userData.userData.verify_code,
|
|
276
|
-
callback:
|
|
290
|
+
callback: text => {
|
|
277
291
|
userData.userData.verify_code = text;
|
|
278
292
|
},
|
|
279
293
|
placeHolder: '請輸入驗證碼',
|
|
@@ -288,19 +302,19 @@ export class SaasViewModel {
|
|
|
288
302
|
gvc.closeDialog();
|
|
289
303
|
let update_vm = {
|
|
290
304
|
verify_code: '',
|
|
291
|
-
pwd: ''
|
|
305
|
+
pwd: '',
|
|
292
306
|
};
|
|
293
307
|
let repeat_pwd = '';
|
|
294
308
|
BgWidget.settingDialog({
|
|
295
309
|
gvc: root_gvc,
|
|
296
310
|
title: '重設密碼',
|
|
297
|
-
innerHTML:
|
|
311
|
+
innerHTML: gvc => {
|
|
298
312
|
return [
|
|
299
313
|
BgWidget.editeInput({
|
|
300
314
|
gvc: gvc,
|
|
301
315
|
title: '密碼',
|
|
302
316
|
default: update_vm.pwd,
|
|
303
|
-
callback:
|
|
317
|
+
callback: text => {
|
|
304
318
|
update_vm.pwd = text;
|
|
305
319
|
},
|
|
306
320
|
type: 'password',
|
|
@@ -310,7 +324,7 @@ export class SaasViewModel {
|
|
|
310
324
|
gvc: gvc,
|
|
311
325
|
title: '確認密碼',
|
|
312
326
|
default: repeat_pwd,
|
|
313
|
-
callback:
|
|
327
|
+
callback: text => {
|
|
314
328
|
repeat_pwd = text;
|
|
315
329
|
},
|
|
316
330
|
type: 'password',
|
|
@@ -324,7 +338,7 @@ export class SaasViewModel {
|
|
|
324
338
|
bind: id,
|
|
325
339
|
view: () => {
|
|
326
340
|
return html `重設密碼驗證碼
|
|
327
|
-
|
|
341
|
+
${BgWidget.blueNote(get_verify_timer ? `驗證碼已發送至『${original.userData.email}』` : '點我取得驗證碼', gvc.event(() => {
|
|
328
342
|
if (!get_verify_timer) {
|
|
329
343
|
const dialog = new ShareDialog(gvc.glitter);
|
|
330
344
|
dialog.dataLoading({ visible: true });
|
|
@@ -351,18 +365,16 @@ export class SaasViewModel {
|
|
|
351
365
|
};
|
|
352
366
|
}),
|
|
353
367
|
default: update_vm.verify_code,
|
|
354
|
-
callback:
|
|
368
|
+
callback: text => {
|
|
355
369
|
update_vm.verify_code = text;
|
|
356
370
|
},
|
|
357
371
|
placeHolder: '請輸入驗證碼',
|
|
358
|
-
})
|
|
372
|
+
}),
|
|
359
373
|
].join('');
|
|
360
374
|
},
|
|
361
|
-
footer_html:
|
|
362
|
-
return html `
|
|
363
|
-
|
|
364
|
-
style="gap:10px;">
|
|
365
|
-
${[
|
|
375
|
+
footer_html: gvc => {
|
|
376
|
+
return html ` <div class="w-100 d-flex align-items-center justify-content-end" style="gap:10px;">
|
|
377
|
+
${[
|
|
366
378
|
BgWidget.cancel(gvc.event(() => {
|
|
367
379
|
gvc.closeDialog();
|
|
368
380
|
})),
|
|
@@ -378,7 +390,7 @@ export class SaasViewModel {
|
|
|
378
390
|
dialog.dataLoading({ visible: true });
|
|
379
391
|
ApiUser.setSaasUserData({
|
|
380
392
|
userData: update_vm,
|
|
381
|
-
}).then(
|
|
393
|
+
}).then(res => {
|
|
382
394
|
dialog.dataLoading({ visible: false });
|
|
383
395
|
if (!res.result && res.response.data.msg === 'email-verify-false') {
|
|
384
396
|
dialog.errorMessage({ text: '驗證碼輸入錯誤' });
|
|
@@ -394,36 +406,33 @@ export class SaasViewModel {
|
|
|
394
406
|
});
|
|
395
407
|
}), '確認重設'),
|
|
396
408
|
].join('')}
|
|
397
|
-
|
|
409
|
+
</div>`;
|
|
398
410
|
},
|
|
399
411
|
});
|
|
400
412
|
}))}</div>`,
|
|
401
413
|
BgWidget.editeInput({
|
|
402
414
|
gvc: gvc,
|
|
403
|
-
title: html `
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
</div>`,
|
|
415
|
+
title: html ` <div class="d-flex flex-column" style="gap:3px;">
|
|
416
|
+
簡訊通知 ${BgWidget.grayNote('將會自動發送系統通知至你所設定的電話號碼')}
|
|
417
|
+
</div>`,
|
|
407
418
|
default: userData.userData.phone,
|
|
408
|
-
callback:
|
|
419
|
+
callback: text => {
|
|
409
420
|
userData.userData.phone = text;
|
|
410
421
|
},
|
|
411
422
|
placeHolder: '請輸入聯絡電話',
|
|
412
|
-
})
|
|
413
|
-
].join(html `
|
|
414
|
-
|
|
415
|
-
</div>`;
|
|
423
|
+
}),
|
|
424
|
+
].join(html ` <div class="my-2"></div>`)}
|
|
425
|
+
</div>`;
|
|
416
426
|
},
|
|
417
427
|
footer_html: (gvc) => {
|
|
418
|
-
return html `
|
|
419
|
-
|
|
420
|
-
${[
|
|
428
|
+
return html ` <div class="w-100 d-flex align-items-center" style="gap:10px;">
|
|
429
|
+
${[
|
|
421
430
|
BgWidget.dangerNote('永久刪除帳號', gvc.event(() => {
|
|
422
431
|
gvc.closeDialog();
|
|
423
432
|
BgWidget.settingDialog({
|
|
424
433
|
gvc: root_gvc,
|
|
425
434
|
title: '是否刪除帳號?',
|
|
426
|
-
innerHTML:
|
|
435
|
+
innerHTML: gvc => {
|
|
427
436
|
return [
|
|
428
437
|
BgWidget.editeInput({
|
|
429
438
|
gvc: gvc,
|
|
@@ -433,7 +442,7 @@ export class SaasViewModel {
|
|
|
433
442
|
bind: id,
|
|
434
443
|
view: () => {
|
|
435
444
|
return html `刪除驗證碼
|
|
436
|
-
|
|
445
|
+
${BgWidget.blueNote(get_verify_timer ? `驗證碼已發送至『${original.userData.email}』` : '點我取得驗證碼', gvc.event(() => {
|
|
437
446
|
if (!get_verify_timer) {
|
|
438
447
|
const dialog = new ShareDialog(gvc.glitter);
|
|
439
448
|
dialog.dataLoading({ visible: true });
|
|
@@ -460,18 +469,16 @@ export class SaasViewModel {
|
|
|
460
469
|
};
|
|
461
470
|
}),
|
|
462
471
|
default: userData.userData.verify_code,
|
|
463
|
-
callback:
|
|
472
|
+
callback: text => {
|
|
464
473
|
userData.userData.verify_code = text;
|
|
465
474
|
},
|
|
466
475
|
placeHolder: '請輸入驗證碼',
|
|
467
476
|
}),
|
|
468
477
|
].join('');
|
|
469
478
|
},
|
|
470
|
-
footer_html:
|
|
471
|
-
return html `
|
|
472
|
-
|
|
473
|
-
style="gap:10px;">
|
|
474
|
-
${[
|
|
479
|
+
footer_html: gvc => {
|
|
480
|
+
return html ` <div class="w-100 d-flex align-items-center justify-content-end" style="gap:10px;">
|
|
481
|
+
${[
|
|
475
482
|
BgWidget.cancel(gvc.event(() => {
|
|
476
483
|
gvc.closeDialog();
|
|
477
484
|
})),
|
|
@@ -481,7 +488,7 @@ export class SaasViewModel {
|
|
|
481
488
|
email: original.userData.email,
|
|
482
489
|
code: userData.userData.verify_code,
|
|
483
490
|
app_name: window.glitterBase,
|
|
484
|
-
}).then(
|
|
491
|
+
}).then(res => {
|
|
485
492
|
if (res.result) {
|
|
486
493
|
location.href = gvc.glitter.root_path + 'shopnex/login';
|
|
487
494
|
}
|
|
@@ -492,12 +499,11 @@ export class SaasViewModel {
|
|
|
492
499
|
});
|
|
493
500
|
}), '確認刪除'),
|
|
494
501
|
].join('')}
|
|
495
|
-
|
|
502
|
+
</div>`;
|
|
496
503
|
},
|
|
497
504
|
});
|
|
498
505
|
})),
|
|
499
|
-
html `
|
|
500
|
-
<div class="flex-fill"></div>`,
|
|
506
|
+
html ` <div class="flex-fill"></div>`,
|
|
501
507
|
BgWidget.cancel(gvc.event(() => {
|
|
502
508
|
gvc.closeDialog();
|
|
503
509
|
})),
|
|
@@ -517,7 +523,7 @@ export class SaasViewModel {
|
|
|
517
523
|
dialog.dataLoading({ visible: true });
|
|
518
524
|
ApiUser.setSaasUserData({
|
|
519
525
|
userData: userData.userData,
|
|
520
|
-
}).then(
|
|
526
|
+
}).then(res => {
|
|
521
527
|
dialog.dataLoading({ visible: false });
|
|
522
528
|
if (!res.result && res.response.data.msg === 'email-verify-false') {
|
|
523
529
|
dialog.errorMessage({ text: '驗證碼輸入錯誤' });
|
|
@@ -533,7 +539,7 @@ export class SaasViewModel {
|
|
|
533
539
|
});
|
|
534
540
|
}))),
|
|
535
541
|
].join('')}
|
|
536
|
-
|
|
542
|
+
</div>`;
|
|
537
543
|
},
|
|
538
544
|
});
|
|
539
545
|
});
|
|
@@ -554,38 +560,34 @@ export class SaasViewModel {
|
|
|
554
560
|
gvc: gvc,
|
|
555
561
|
title: '填寫基本資料',
|
|
556
562
|
innerHTML: (gvc) => {
|
|
557
|
-
return html `
|
|
558
|
-
|
|
559
|
-
${[
|
|
563
|
+
return html ` <div class="mt-n2">
|
|
564
|
+
${[
|
|
560
565
|
BgWidget.editeInput({
|
|
561
566
|
gvc: gvc,
|
|
562
567
|
title: '公司或單位名稱',
|
|
563
568
|
default: userData.userData.name,
|
|
564
|
-
callback:
|
|
569
|
+
callback: text => {
|
|
565
570
|
userData.userData.name = text;
|
|
566
571
|
},
|
|
567
572
|
placeHolder: '請輸入公司或單位名稱',
|
|
568
573
|
}),
|
|
569
574
|
BgWidget.editeInput({
|
|
570
575
|
gvc: gvc,
|
|
571
|
-
title: html `
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
</div>`,
|
|
576
|
+
title: html ` <div class="d-flex flex-column" style="gap:3px;">
|
|
577
|
+
聯絡電話 ${BgWidget.grayNote('正確填寫重要資料,避免遺漏重要通知')}
|
|
578
|
+
</div>`,
|
|
575
579
|
default: userData.userData.contact_phone,
|
|
576
|
-
callback:
|
|
580
|
+
callback: text => {
|
|
577
581
|
userData.userData.contact_phone = text;
|
|
578
582
|
},
|
|
579
583
|
placeHolder: '請輸入聯絡電話',
|
|
580
|
-
})
|
|
581
|
-
].join(html `
|
|
582
|
-
|
|
583
|
-
</div>`;
|
|
584
|
+
}),
|
|
585
|
+
].join(html ` <div class="my-2"></div>`)}
|
|
586
|
+
</div>`;
|
|
584
587
|
},
|
|
585
588
|
footer_html: (gvc) => {
|
|
586
|
-
return html `
|
|
587
|
-
|
|
588
|
-
${[
|
|
589
|
+
return html ` <div class="w-100 d-flex align-items-center justify-content-end" style="gap:10px;">
|
|
590
|
+
${[
|
|
589
591
|
BgWidget.save(gvc.event(() => __awaiter(this, void 0, void 0, function* () {
|
|
590
592
|
if (!userData.userData.name) {
|
|
591
593
|
dialog.errorMessage({ text: '請輸入公司或單位名稱' });
|
|
@@ -598,7 +600,7 @@ export class SaasViewModel {
|
|
|
598
600
|
dialog.dataLoading({ visible: true });
|
|
599
601
|
ApiUser.setSaasUserData({
|
|
600
602
|
userData: userData.userData,
|
|
601
|
-
}).then(
|
|
603
|
+
}).then(res => {
|
|
602
604
|
dialog.dataLoading({ visible: false });
|
|
603
605
|
if (!res.result && res.response.data.msg === 'email-verify-false') {
|
|
604
606
|
dialog.errorMessage({ text: '驗證碼輸入錯誤' });
|
|
@@ -614,7 +616,7 @@ export class SaasViewModel {
|
|
|
614
616
|
});
|
|
615
617
|
}))),
|
|
616
618
|
].join('')}
|
|
617
|
-
|
|
619
|
+
</div>`;
|
|
618
620
|
},
|
|
619
621
|
});
|
|
620
622
|
});
|
|
@@ -630,25 +632,26 @@ export class SaasViewModel {
|
|
|
630
632
|
bind: id,
|
|
631
633
|
view: () => {
|
|
632
634
|
if (vm.type === 'list') {
|
|
633
|
-
return html `
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
635
|
+
return html ` <div
|
|
636
|
+
style="width: 600px; max-width: 95vw; overflow-y: auto;"
|
|
637
|
+
class="bg-white shadow rounded-3"
|
|
638
|
+
>
|
|
639
|
+
<div class="w-100 d-flex align-items-center p-3 border-bottom">
|
|
640
|
+
<div class="tx_700 me-3">所有商店</div>
|
|
641
|
+
${BgWidget.grayButton('新增商店', gvc.event(() => {
|
|
639
642
|
vm.type = 'replace';
|
|
640
643
|
gvc.notifyDataChange(id);
|
|
641
644
|
}), { icon: 'fa-regular fa-circle-plus' })}
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
645
|
+
<div class="flex-fill"></div>
|
|
646
|
+
<i
|
|
647
|
+
class="fa-regular fa-circle-xmark fs-5"
|
|
648
|
+
style="color:black; cursor:pointer;"
|
|
649
|
+
onclick="${gvc.event(() => {
|
|
647
650
|
gvc.closeDialog();
|
|
648
651
|
})}"
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
+
></i>
|
|
653
|
+
</div>
|
|
654
|
+
${gvc.bindView(() => {
|
|
652
655
|
const vm = {
|
|
653
656
|
loading: true,
|
|
654
657
|
data: [],
|
|
@@ -657,7 +660,7 @@ export class SaasViewModel {
|
|
|
657
660
|
function refresh() {
|
|
658
661
|
vm.loading = true;
|
|
659
662
|
gvc.notifyDataChange(id);
|
|
660
|
-
ApiPageConfig.getAppList().then(
|
|
663
|
+
ApiPageConfig.getAppList().then(res => {
|
|
661
664
|
vm.loading = false;
|
|
662
665
|
vm.data = res.response.result;
|
|
663
666
|
gvc.notifyDataChange(id);
|
|
@@ -682,18 +685,19 @@ export class SaasViewModel {
|
|
|
682
685
|
const storeList = [
|
|
683
686
|
BgWidget.validImageBox({
|
|
684
687
|
gvc,
|
|
685
|
-
image: dd.theme_config.preview_image ||
|
|
688
|
+
image: dd.theme_config.preview_image ||
|
|
689
|
+
(dd.config &&
|
|
690
|
+
dd.template_config &&
|
|
691
|
+
dd.template_config.image &&
|
|
692
|
+
dd.template_config.image[0]),
|
|
686
693
|
width: 120 / (document.body.clientWidth > 768 ? 1 : 1.5),
|
|
687
694
|
height: 90 / (document.body.clientWidth > 768 ? 1 : 1.5),
|
|
688
695
|
class: 'rounded-3 shadow',
|
|
689
696
|
}),
|
|
690
|
-
html `
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
style="text-wrap: wrap;">
|
|
695
|
-
<span class="tx_700"
|
|
696
|
-
>${gvc.bindView(() => {
|
|
697
|
+
html ` <div class="d-flex flex-column" style="margin-left: 15px; gap:1px;">
|
|
698
|
+
<div class="d-flex gap-2" style="text-wrap: wrap;">
|
|
699
|
+
<span class="tx_700"
|
|
700
|
+
>${gvc.bindView(() => {
|
|
697
701
|
return {
|
|
698
702
|
bind: gvc.glitter.getUUID(),
|
|
699
703
|
view: () => {
|
|
@@ -711,81 +715,83 @@ export class SaasViewModel {
|
|
|
711
715
|
divCreate: {},
|
|
712
716
|
};
|
|
713
717
|
})}</span
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
718
|
+
>
|
|
719
|
+
</div>
|
|
720
|
+
<div class="my-1">
|
|
721
|
+
${dd.store_permission_title === 'owner' ? BgWidget.infoInsignia('商店擁有人') : ''}
|
|
722
|
+
</div>
|
|
723
|
+
${(() => {
|
|
720
724
|
const config = dd;
|
|
721
|
-
let planText =
|
|
722
|
-
return html `
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
725
|
+
let planText = gvc.glitter.share.plan_text();
|
|
726
|
+
return html ` <div class="d-flex flex-column tx_normal_14">
|
|
727
|
+
當前方案 : ${planText}
|
|
728
|
+
<div
|
|
729
|
+
style="color: ${new Date(config.dead_line).getTime() < new Date().getTime()
|
|
730
|
+
? '#da1313'
|
|
731
|
+
: '#4d86db'};"
|
|
732
|
+
>
|
|
733
|
+
${new Date(config.dead_line).getTime() < new Date().getTime()
|
|
734
|
+
? '方案過期日'
|
|
735
|
+
: '方案到期日'}
|
|
736
|
+
:${gvc.glitter.ut.dateFormat(new Date(config.dead_line), 'yyyy-MM-dd hh:mm')}
|
|
737
|
+
</div>
|
|
738
|
+
</div>`;
|
|
730
739
|
})()}
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
740
|
+
<div class="tx_normal_14">
|
|
741
|
+
上次儲存時間:${gvc.glitter.ut.dateFormat(new Date(dd.update_time), 'yyyy-MM-dd hh:mm')}
|
|
742
|
+
</div>
|
|
743
|
+
</div>`,
|
|
735
744
|
dd.store_permission_title === 'owner'
|
|
736
|
-
? html `
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
class="dropdown-item cursor_pointer"
|
|
751
|
-
onclick="${gvc.event(() => {
|
|
745
|
+
? html ` <div class="p-0 me-1" style="width: 40px;">
|
|
746
|
+
<button
|
|
747
|
+
class="btn btn-size-sm btn-snow text-dark"
|
|
748
|
+
type="button"
|
|
749
|
+
data-bs-toggle="dropdown"
|
|
750
|
+
aria-haspopup="true"
|
|
751
|
+
aria-expanded="false"
|
|
752
|
+
>
|
|
753
|
+
<i class="fa-solid fa-ellipsis" aria-hidden="true"></i>
|
|
754
|
+
</button>
|
|
755
|
+
<div class="dropdown-menu">
|
|
756
|
+
<a
|
|
757
|
+
class="dropdown-item cursor_pointer"
|
|
758
|
+
onclick="${gvc.event(() => {
|
|
752
759
|
gvc.glitter.setUrlParameter('appName', dd.appName);
|
|
753
760
|
SaasViewModel.renew(gvc);
|
|
754
761
|
})}"
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
EditorElem.openEditorDialog(gvc,
|
|
762
|
+
>續費</a
|
|
763
|
+
>
|
|
764
|
+
<div class="dropdown-divider"></div>
|
|
765
|
+
<a
|
|
766
|
+
class="dropdown-item cursor_pointer"
|
|
767
|
+
onclick="${gvc.event(() => {
|
|
768
|
+
EditorElem.openEditorDialog(gvc, gvc => {
|
|
762
769
|
const appName = dd.theme_config.name || dd.appName;
|
|
763
770
|
let deleteText = '';
|
|
764
|
-
return html `
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
771
|
+
return html ` <div class="p-2">
|
|
772
|
+
${[
|
|
773
|
+
html ` <div
|
|
774
|
+
class="alert alert-danger p-2 fs-base"
|
|
775
|
+
style="white-space: normal;"
|
|
776
|
+
>
|
|
777
|
+
請確認是否刪除此商店,刪除之後將無法復原,請謹慎進行操作
|
|
778
|
+
</div>`,
|
|
772
779
|
EditorElem.editeInput({
|
|
773
780
|
gvc: gvc,
|
|
774
781
|
title: '刪除確認',
|
|
775
782
|
placeHolder: `請輸入「${appName}」`,
|
|
776
783
|
default: deleteText,
|
|
777
|
-
callback:
|
|
784
|
+
callback: text => {
|
|
778
785
|
deleteText = text;
|
|
779
786
|
},
|
|
780
787
|
}),
|
|
781
788
|
BgWidget.horizontalLine(),
|
|
782
|
-
html `
|
|
783
|
-
|
|
784
|
-
${BgWidget.redButton('確認刪除', gvc.event(() => {
|
|
789
|
+
html ` <div class="d-flex align-items-center justify-content-end mb-1">
|
|
790
|
+
${BgWidget.redButton('確認刪除', gvc.event(() => {
|
|
785
791
|
const dialog = new ShareDialog(gvc.glitter);
|
|
786
792
|
if (deleteText === appName) {
|
|
787
793
|
dialog.dataLoading({ visible: true });
|
|
788
|
-
ApiPageConfig.deleteApp(dd.appName).then(
|
|
794
|
+
ApiPageConfig.deleteApp(dd.appName).then(res => {
|
|
789
795
|
dialog.dataLoading({ visible: false });
|
|
790
796
|
if (dd.appName === window.appName) {
|
|
791
797
|
const url = new URL(location.href);
|
|
@@ -801,20 +807,18 @@ export class SaasViewModel {
|
|
|
801
807
|
dialog.errorMessage({ text: '輸入錯誤' });
|
|
802
808
|
}
|
|
803
809
|
}))}
|
|
804
|
-
|
|
810
|
+
</div>`,
|
|
805
811
|
].join('')}
|
|
806
|
-
|
|
807
|
-
}, () => {
|
|
808
|
-
}, 400, '刪除商店');
|
|
812
|
+
</div>`;
|
|
813
|
+
}, () => { }, 400, '刪除商店');
|
|
809
814
|
})}"
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
815
|
+
>刪除商店</a
|
|
816
|
+
>
|
|
817
|
+
</div>
|
|
818
|
+
</div>`
|
|
814
819
|
: '',
|
|
815
|
-
html `
|
|
816
|
-
|
|
817
|
-
${BgWidget.customButton({
|
|
820
|
+
html ` <div>
|
|
821
|
+
${BgWidget.customButton({
|
|
818
822
|
button: {
|
|
819
823
|
color: 'black',
|
|
820
824
|
size: 'sm',
|
|
@@ -830,31 +834,29 @@ export class SaasViewModel {
|
|
|
830
834
|
location.href = url.href;
|
|
831
835
|
}),
|
|
832
836
|
})}
|
|
833
|
-
|
|
837
|
+
</div>`,
|
|
834
838
|
];
|
|
835
839
|
if (document.body.clientWidth > 768) {
|
|
836
|
-
return html `
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
${storeList[2]}${storeList[3]}
|
|
842
|
-
</div>`;
|
|
840
|
+
return html ` <div class="p-4" style="display: flex; align-items: center;">
|
|
841
|
+
${storeList[0]}${storeList[1]}
|
|
842
|
+
<div class="flex-fill"></div>
|
|
843
|
+
${storeList[2]}${storeList[3]}
|
|
844
|
+
</div>`;
|
|
843
845
|
}
|
|
844
|
-
return html `
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
846
|
+
return html ` <div
|
|
847
|
+
class="p-4"
|
|
848
|
+
style="display: flex; align-items: center; justify-content: flex-start; gap: 16px;"
|
|
849
|
+
>
|
|
850
|
+
${storeList[0]}
|
|
851
|
+
<div style="width: 100%;">
|
|
852
|
+
${storeList[1]}
|
|
853
|
+
<div style="display: flex; justify-content: flex-end; margin-top: 12px;">
|
|
854
|
+
${storeList[2]}${storeList[3]}
|
|
855
|
+
</div>
|
|
856
|
+
</div>
|
|
857
|
+
</div>`;
|
|
855
858
|
})
|
|
856
|
-
.join(html `
|
|
857
|
-
<div class="w-100 border-bottom"></div>`);
|
|
859
|
+
.join(html ` <div class="w-100 border-bottom"></div>`);
|
|
858
860
|
}
|
|
859
861
|
},
|
|
860
862
|
divCreate: {
|
|
@@ -862,7 +864,7 @@ export class SaasViewModel {
|
|
|
862
864
|
},
|
|
863
865
|
};
|
|
864
866
|
})}
|
|
865
|
-
|
|
867
|
+
</div>`;
|
|
866
868
|
}
|
|
867
869
|
else {
|
|
868
870
|
return SaasViewModel.createShop(gvc, false);
|
|
@@ -888,35 +890,37 @@ export class SaasViewModel {
|
|
|
888
890
|
}
|
|
889
891
|
`);
|
|
890
892
|
gvc.glitter.addStyleLink(gvc.glitter.root_path + `/css/editor.css`);
|
|
891
|
-
const hr = html `
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
893
|
+
const hr = html ` <div
|
|
894
|
+
style="${document.body.clientWidth < 800
|
|
895
|
+
? `width: 100%;`
|
|
896
|
+
: `width: 600px;max-width: calc(100vw - 20px); overflow-y: auto;max-height: calc(100vh - 50px);`}"
|
|
897
|
+
class="bg-white shadow ${document.body.clientWidth > 800 ? `rounded-3` : ``}"
|
|
898
|
+
>
|
|
899
|
+
<div class="w-100 d-flex align-items-center p-3 border-bottom">
|
|
900
|
+
<div class="fw-500 color39" style="padding-top: ${gvc.glitter.share.top_inset}px;">建立您的商店</div>
|
|
901
|
+
<div class="flex-fill"></div>
|
|
902
|
+
<i
|
|
903
|
+
class="fa-regular fa-circle-xmark fs-5 color39 ${register ? `d-none` : ``}"
|
|
904
|
+
style="cursor:pointer;"
|
|
905
|
+
onclick="${gvc.event(() => {
|
|
901
906
|
gvc.closeDialog();
|
|
902
907
|
})}"
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
908
|
+
></i>
|
|
909
|
+
</div>
|
|
910
|
+
${gvc.bindView(() => {
|
|
906
911
|
const id = gvc.glitter.getUUID();
|
|
907
912
|
return {
|
|
908
913
|
bind: id,
|
|
909
914
|
view: () => {
|
|
910
|
-
return html `
|
|
911
|
-
|
|
912
|
-
${[
|
|
915
|
+
return html ` <div class="px-3 py-2">
|
|
916
|
+
${[
|
|
913
917
|
EditorElem.editeInput({
|
|
914
918
|
gvc: gvc,
|
|
915
919
|
title: '商店名稱',
|
|
916
920
|
style: 'color:#393939',
|
|
917
921
|
placeHolder: `請輸入商店名稱`,
|
|
918
922
|
default: postMD.name,
|
|
919
|
-
callback:
|
|
923
|
+
callback: text => {
|
|
920
924
|
postMD.name = text;
|
|
921
925
|
},
|
|
922
926
|
}),
|
|
@@ -928,18 +932,18 @@ export class SaasViewModel {
|
|
|
928
932
|
return EditorElem.editeInput({
|
|
929
933
|
gvc: gvc,
|
|
930
934
|
title: html `
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
935
|
+
<div class="my-2">
|
|
936
|
+
<div class="mb-1">免費商店網址</div>
|
|
937
|
+
<div class="d-flex flex-column" style="">
|
|
938
|
+
${BgWidget.grayNote('建議輸入與品牌相關的英文名稱')}
|
|
939
|
+
${BgWidget.greenNote(`https://${postMD.sub_domain || '尚未輸入'}.shopnex.tw`, '', 'margin-top: 0.5rem')}
|
|
940
|
+
</div>
|
|
941
|
+
</div>
|
|
942
|
+
`,
|
|
939
943
|
pattern: `A-Za-z0-9-`,
|
|
940
944
|
placeHolder: `請輸入商店網址`,
|
|
941
945
|
default: postMD.sub_domain,
|
|
942
|
-
callback:
|
|
946
|
+
callback: text => {
|
|
943
947
|
postMD.sub_domain = text;
|
|
944
948
|
gvc.notifyDataChange(id);
|
|
945
949
|
},
|
|
@@ -950,11 +954,11 @@ export class SaasViewModel {
|
|
|
950
954
|
EditorElem.h3(`<div class="d-flex flex-column" style="gap:3px;">
|
|
951
955
|
${['選擇初始模板', BgWidget.grayNote('請選擇初始模板,後續可在進行更換')].join('')}
|
|
952
956
|
</div>`),
|
|
953
|
-
SaasViewModel.initialTemplate(gvc,
|
|
957
|
+
SaasViewModel.initialTemplate(gvc, appName => {
|
|
954
958
|
postMD.refer_app = appName;
|
|
955
959
|
}),
|
|
956
960
|
].join('<div class="my-2"></div>')}
|
|
957
|
-
|
|
961
|
+
</div>`;
|
|
958
962
|
},
|
|
959
963
|
divCreate: {
|
|
960
964
|
style: `max-height:calc(${window.innerHeight - gvc.glitter.share.top_inset - gvc.glitter.share.bottom_inset}px - ${document.body.clientWidth > 1200 ? `165` : `115`}px);overflow-y:auto;`,
|
|
@@ -962,8 +966,8 @@ ${['選擇初始模板', BgWidget.grayNote('請選擇初始模板,後續可在
|
|
|
962
966
|
},
|
|
963
967
|
};
|
|
964
968
|
})}
|
|
965
|
-
|
|
966
|
-
|
|
969
|
+
<div class="w-100 d-flex align-items-center justify-content-end shadow p-3">
|
|
970
|
+
${BgWidget.save(gvc.event(() => {
|
|
967
971
|
const dialog = new ShareDialog(gvc.glitter);
|
|
968
972
|
if (!postMD.sub_domain) {
|
|
969
973
|
dialog.errorMessage({
|
|
@@ -984,24 +988,23 @@ ${['選擇初始模板', BgWidget.grayNote('請選擇初始模板,後續可在
|
|
|
984
988
|
SaasViewModel.createApp(gvc, postMD.appName, postMD.name, postMD.refer_app, postMD.sub_domain, register);
|
|
985
989
|
}
|
|
986
990
|
}), '確認建立')}
|
|
987
|
-
|
|
988
|
-
|
|
991
|
+
</div>
|
|
992
|
+
</div>`;
|
|
989
993
|
if (register) {
|
|
990
994
|
if (document.body.clientWidth < 800) {
|
|
991
995
|
return `<div class="position-fixed w-100 vh-100 bg-white" style="top:0px;left:0px;">
|
|
992
996
|
${hr}
|
|
993
997
|
</div>`;
|
|
994
998
|
}
|
|
995
|
-
return html `
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
style="left: 0px;top:0px;
|
|
999
|
+
return html ` <div
|
|
1000
|
+
class="position-fixed vw-100 vh-100 d-flex align-items-center justify-content-center bg-white"
|
|
1001
|
+
style="left: 0px;top:0px;
|
|
999
1002
|
background-image: url('https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/1711305933115-第一個背景橘色.png');
|
|
1000
1003
|
background-size: cover;
|
|
1001
1004
|
"
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
+
>
|
|
1006
|
+
${hr}
|
|
1007
|
+
</div>`;
|
|
1005
1008
|
}
|
|
1006
1009
|
else {
|
|
1007
1010
|
return hr;
|
|
@@ -1020,7 +1023,7 @@ ${hr}
|
|
|
1020
1023
|
return gvc.bindView(() => {
|
|
1021
1024
|
let data = undefined;
|
|
1022
1025
|
const id = gvc.glitter.getUUID();
|
|
1023
|
-
ApiPageConfig.getTemplateList().then(
|
|
1026
|
+
ApiPageConfig.getTemplateList().then(res => {
|
|
1024
1027
|
data = res;
|
|
1025
1028
|
data.response.result.reverse();
|
|
1026
1029
|
gvc.notifyDataChange(id);
|
|
@@ -1033,95 +1036,102 @@ ${hr}
|
|
|
1033
1036
|
if (data.response.result.length === 0) {
|
|
1034
1037
|
if (!vm.search) {
|
|
1035
1038
|
return html `
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1039
|
+
<div
|
|
1040
|
+
class="d-flex align-items-center justify-content-center flex-column w-100 py-4"
|
|
1041
|
+
style="width:700px;gap:10px;"
|
|
1042
|
+
>
|
|
1043
|
+
<img src="./img/box-open-solid.svg" />
|
|
1044
|
+
<span class="color39 text-center">尚未自製任何模塊<br />請前往開發者模式自製專屬模塊</span>
|
|
1045
|
+
</div>
|
|
1046
|
+
`;
|
|
1042
1047
|
}
|
|
1043
1048
|
else {
|
|
1044
1049
|
return html `
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1050
|
+
<div
|
|
1051
|
+
class="d-flex align-items-center justify-content-center flex-column w-100 py-4"
|
|
1052
|
+
style="width:700px;gap:10px;"
|
|
1053
|
+
>
|
|
1054
|
+
<img src="./img/box-open-solid.svg" />
|
|
1055
|
+
<span class="color39 text-center">查無相關模塊</span>
|
|
1056
|
+
</div>
|
|
1057
|
+
`;
|
|
1051
1058
|
}
|
|
1052
1059
|
}
|
|
1053
1060
|
else {
|
|
1054
1061
|
return html `
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1062
|
+
<div class="w-100" style=" overflow-y: auto;">
|
|
1063
|
+
<div class="row m-0 pt-2 mx-n2">
|
|
1064
|
+
${data.response.result
|
|
1058
1065
|
.map((dd, index) => {
|
|
1059
1066
|
var _a;
|
|
1060
1067
|
return html `
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1068
|
+
<div class="col-6 col-sm-4 mb-3 rounded-3">
|
|
1069
|
+
<div
|
|
1070
|
+
class="d-flex flex-column justify-content-center w-100 "
|
|
1071
|
+
style="gap:5px;cursor:pointer;${vm.select === dd.appName
|
|
1065
1072
|
? `overflow:hidden;background: #FFB400;border: 1px solid #FF6C02;padding:10px;border-radius: 5px;`
|
|
1066
1073
|
: ``}"
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1074
|
+
>
|
|
1075
|
+
<div
|
|
1076
|
+
class="card w-100 position-relative rounded hoverHidden bgf6 rounded-3"
|
|
1077
|
+
style="padding-bottom: 133%;"
|
|
1078
|
+
>
|
|
1079
|
+
<div
|
|
1080
|
+
class="position-absolute w-100 h-100 d-flex align-items-center justify-content-center rounded-3"
|
|
1081
|
+
style="overflow: hidden;"
|
|
1082
|
+
>
|
|
1083
|
+
<img
|
|
1084
|
+
class="w-100 "
|
|
1085
|
+
src="${(_a = dd.template_config.image[0]) !== null && _a !== void 0 ? _a : 'https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/1713445383494-未命名(1080x1080像素).jpg'}"
|
|
1086
|
+
/>
|
|
1087
|
+
</div>
|
|
1079
1088
|
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1089
|
+
<div
|
|
1090
|
+
class="position-absolute w-100 h-100 align-items-center justify-content-center rounded fs-6 flex-column"
|
|
1091
|
+
style="background: rgba(0,0,0,0.5);gap:5px;"
|
|
1092
|
+
>
|
|
1093
|
+
<button
|
|
1094
|
+
class="btn btn-secondary d-flex align-items-center "
|
|
1095
|
+
style="height: 28px;width: 75px;gap:5px;"
|
|
1096
|
+
onclick="${gvc.event(() => {
|
|
1088
1097
|
vm.select = dd.appName;
|
|
1089
1098
|
callback(dd.appName);
|
|
1090
1099
|
gvc.notifyDataChange(id);
|
|
1091
1100
|
})}"
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1101
|
+
>
|
|
1102
|
+
選擇
|
|
1103
|
+
</button>
|
|
1104
|
+
</div>
|
|
1105
|
+
</div>
|
|
1106
|
+
<h3 class="fs-6 mb-0 d-flex justify-content-between align-items-center">
|
|
1107
|
+
${dd.template_config.name}
|
|
1108
|
+
<i
|
|
1109
|
+
class="fa-solid fa-eye"
|
|
1110
|
+
style="cursor:pointer;"
|
|
1111
|
+
onclick="${gvc.event(() => {
|
|
1103
1112
|
gvc.glitter.openNewTab(`https://${dd.domain}/index`);
|
|
1104
1113
|
})}"
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1114
|
+
></i>
|
|
1115
|
+
</h3>
|
|
1116
|
+
</div>
|
|
1117
|
+
</div>
|
|
1118
|
+
`;
|
|
1110
1119
|
})
|
|
1111
1120
|
.join('')}
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1121
|
+
</div>
|
|
1122
|
+
</div>
|
|
1123
|
+
`;
|
|
1115
1124
|
}
|
|
1116
1125
|
})();
|
|
1117
1126
|
}
|
|
1118
1127
|
else {
|
|
1119
|
-
return html `
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1128
|
+
return html ` <div
|
|
1129
|
+
class="w-100 p-3 d-flex align-items-center justify-content-center flex-column"
|
|
1130
|
+
style="gap: 10px;"
|
|
1131
|
+
>
|
|
1132
|
+
<div class="spinner-border fs-5"></div>
|
|
1133
|
+
<div class="fs-6 fw-500">載入中...</div>
|
|
1134
|
+
</div>`;
|
|
1125
1135
|
}
|
|
1126
1136
|
},
|
|
1127
1137
|
divCreate: {
|
|
@@ -1181,7 +1191,7 @@ ${hr}
|
|
|
1181
1191
|
name: pick_name,
|
|
1182
1192
|
copyWith: ['checkout', 'user', 'public_config'],
|
|
1183
1193
|
}),
|
|
1184
|
-
}).then(
|
|
1194
|
+
}).then(d2 => {
|
|
1185
1195
|
shareDialog.dataLoading({ visible: false });
|
|
1186
1196
|
if (d2.result) {
|
|
1187
1197
|
const url = new URL(location.href);
|
|
@@ -1219,7 +1229,7 @@ ${hr}
|
|
|
1219
1229
|
{ title: 'LINE通知', key: 'line' },
|
|
1220
1230
|
{ title: '簡訊發送', key: 'sms' },
|
|
1221
1231
|
];
|
|
1222
|
-
const defaultData = notifyType.map(
|
|
1232
|
+
const defaultData = notifyType.map(item => {
|
|
1223
1233
|
return {
|
|
1224
1234
|
type: item.key,
|
|
1225
1235
|
list: [
|
|
@@ -1227,6 +1237,10 @@ ${hr}
|
|
|
1227
1237
|
key: 'auto-email-shipment',
|
|
1228
1238
|
status: true,
|
|
1229
1239
|
},
|
|
1240
|
+
{
|
|
1241
|
+
key: 'auto-email-in-stock',
|
|
1242
|
+
status: true,
|
|
1243
|
+
},
|
|
1230
1244
|
{
|
|
1231
1245
|
key: 'auto-email-shipment-arrival',
|
|
1232
1246
|
status: true,
|
|
@@ -1277,14 +1291,14 @@ ${hr}
|
|
|
1277
1291
|
}
|
|
1278
1292
|
else {
|
|
1279
1293
|
return [
|
|
1280
|
-
BgWidget.tab(notifyType, gvc, vm.select,
|
|
1294
|
+
BgWidget.tab(notifyType, gvc, vm.select, text => {
|
|
1281
1295
|
vm.select = text;
|
|
1282
|
-
vm.selectId = notifyType.findIndex(
|
|
1296
|
+
vm.selectId = notifyType.findIndex(item => item.key === vm.select);
|
|
1283
1297
|
gvc.notifyDataChange(ids.container);
|
|
1284
1298
|
}, 'margin: 0 !important; position: sticky; top: 0; background-color: #fff; z-index: 2;'),
|
|
1285
1299
|
BgWidget.tableV3({
|
|
1286
1300
|
gvc,
|
|
1287
|
-
getData:
|
|
1301
|
+
getData: vmi => {
|
|
1288
1302
|
vmi.pageSize = 1;
|
|
1289
1303
|
vmi.originalData = vm.dataList;
|
|
1290
1304
|
vmi.tableData = vm.dataList[vm.selectId].list.map((dd) => {
|
|
@@ -1295,6 +1309,8 @@ ${hr}
|
|
|
1295
1309
|
switch (dd.key) {
|
|
1296
1310
|
case 'auto-email-shipment':
|
|
1297
1311
|
return '商品出貨';
|
|
1312
|
+
case 'auto-email-in-stock':
|
|
1313
|
+
return '商品備貨';
|
|
1298
1314
|
case 'auto-email-shipment-arrival':
|
|
1299
1315
|
return '商品到貨';
|
|
1300
1316
|
case 'auto-email-order-create':
|
|
@@ -1316,7 +1332,7 @@ ${hr}
|
|
|
1316
1332
|
},
|
|
1317
1333
|
{
|
|
1318
1334
|
key: '狀態',
|
|
1319
|
-
value: BgWidget.switchButton(gvc, dd.status,
|
|
1335
|
+
value: BgWidget.switchButton(gvc, dd.status, bool => {
|
|
1320
1336
|
dd.status = bool;
|
|
1321
1337
|
}),
|
|
1322
1338
|
},
|
|
@@ -1325,8 +1341,7 @@ ${hr}
|
|
|
1325
1341
|
vmi.loading = false;
|
|
1326
1342
|
vmi.callback();
|
|
1327
1343
|
},
|
|
1328
|
-
rowClick: () => {
|
|
1329
|
-
},
|
|
1344
|
+
rowClick: () => { },
|
|
1330
1345
|
filter: [],
|
|
1331
1346
|
hiddenPageSplit: true,
|
|
1332
1347
|
}),
|
|
@@ -1341,14 +1356,14 @@ ${hr}
|
|
|
1341
1356
|
if (data.response.value) {
|
|
1342
1357
|
try {
|
|
1343
1358
|
const response = data.response.value.data;
|
|
1344
|
-
return defaultData.map(
|
|
1359
|
+
return defaultData.map(d => {
|
|
1345
1360
|
const findData = response.find((r) => {
|
|
1346
1361
|
return r.type === d.type;
|
|
1347
1362
|
});
|
|
1348
1363
|
if (!findData) {
|
|
1349
1364
|
return d;
|
|
1350
1365
|
}
|
|
1351
|
-
d.list = d.list.map(
|
|
1366
|
+
d.list = d.list.map(item => {
|
|
1352
1367
|
const findItem = findData.list.find((r) => {
|
|
1353
1368
|
return r.key === item.key;
|
|
1354
1369
|
});
|
|
@@ -1371,7 +1386,7 @@ ${hr}
|
|
|
1371
1386
|
};
|
|
1372
1387
|
})());
|
|
1373
1388
|
},
|
|
1374
|
-
footer_html:
|
|
1389
|
+
footer_html: gvc => {
|
|
1375
1390
|
return [
|
|
1376
1391
|
BgWidget.cancel(gvc.event(() => {
|
|
1377
1392
|
gvc.closeDialog();
|
|
@@ -1382,7 +1397,7 @@ ${hr}
|
|
|
1382
1397
|
key: 'notify_setting',
|
|
1383
1398
|
value: { data: vm.dataList },
|
|
1384
1399
|
user_id: 'manager',
|
|
1385
|
-
}).then(
|
|
1400
|
+
}).then(data => {
|
|
1386
1401
|
dialog.dataLoading({ visible: false });
|
|
1387
1402
|
if (data.result && data.response.result) {
|
|
1388
1403
|
dialog.successMessage({ text: '設定成功' });
|