ts-glitter 17.2.0 → 17.2.2
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/ed8x60j4nn.json +1 -0
- package/gkh2p2jhta.json +1 -0
- package/lowcode/Entry.js +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/cms-plugin/pos-pages/models.js +18 -15
- package/lowcode/cms-plugin/pos-pages/models.ts +30 -25
- package/lowcode/cms-plugin/pos-pages/payment-function.js +53 -57
- package/lowcode/cms-plugin/pos-pages/payment-function.ts +92 -100
- package/lowcode/form-view/editor/image-selector.js +7 -3
- package/lowcode/form-view/editor/image-selector.ts +75 -69
- package/lowcode/glitter-base/route/shopping.js +2 -0
- package/lowcode/glitter-base/route/shopping.ts +6 -4
- package/lowcode/official_view_component/official/component.js +1 -3
- package/lowcode/official_view_component/official/component.ts +3 -4
- package/lowcode/public-components/footer/footer-01.js +1 -1
- package/lowcode/public-components/footer/footer-01.ts +1 -1
- package/lowcode/public-components/footer/footer-02.js +1 -1
- package/lowcode/public-components/footer/footer-02.ts +1 -1
- package/lowcode/public-components/footer/footer-03.js +1 -1
- package/lowcode/public-components/footer/footer-03.ts +1 -1
- package/lowcode/public-components/product/pd-card-01.js +22 -11
- package/lowcode/public-components/product/pd-card-01.ts +23 -11
- package/lowcode/public-components/product/pd-card-02.js +22 -11
- package/lowcode/public-components/product/pd-card-02.ts +22 -11
- package/lowcode/public-components/product/pd-card-03.js +22 -11
- package/lowcode/public-components/product/pd-card-03.ts +23 -11
- package/lowcode/public-components/product/product-detail.js +7 -0
- package/lowcode/public-components/product/product-detail.ts +5 -1
- package/lowcode/public-components/user-manager/um-voucher.ts +1 -0
- package/package.json +1 -1
- package/src/api-public/controllers/shop.js +44 -33
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +54 -35
- package/src/api-public/services/shopping.d.ts +2 -1
- package/src/api-public/services/shopping.js +110 -109
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +174 -117
- package/src/index.js +1 -0
- package/src/index.js.map +1 -1
- package/src/index.ts +1 -0
- package/src/seo-config.d.ts +1 -0
- package/src/seo-config.js +40 -1
- package/src/seo-config.js.map +1 -1
- package/src/seo-config.ts +46 -3
- package/src/services/page.ts +0 -1
|
@@ -1,91 +1,86 @@
|
|
|
1
|
-
import {GVC} from
|
|
2
|
-
import {ShareDialog} from
|
|
3
|
-
import {PayConfig} from
|
|
4
|
-
import {ConnectionMode} from
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {OrderDetail} from "./models.js";
|
|
1
|
+
import { GVC } from '../../glitterBundle/GVController.js';
|
|
2
|
+
import { ShareDialog } from '../../glitterBundle/dialog/ShareDialog.js';
|
|
3
|
+
import { PayConfig } from './pay-config.js';
|
|
4
|
+
import { ConnectionMode } from './connection-mode.js';
|
|
5
|
+
import { ApiShop } from '../../glitter-base/route/shopping.js';
|
|
6
|
+
import { OrderDetail } from './models.js';
|
|
8
7
|
|
|
9
|
-
const html = String.raw
|
|
8
|
+
const html = String.raw;
|
|
10
9
|
|
|
11
10
|
export class PaymentFunction {
|
|
12
|
-
|
|
13
11
|
public static cashFinish(gvc: GVC, total: number, callback: (result: boolean) => void) {
|
|
14
12
|
gvc.addStyle(`
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
.dialog-box {
|
|
14
|
+
width: 100vw;
|
|
15
|
+
height: 100vh;
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
20
|
+
z-index: 10000;
|
|
21
|
+
}
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
23
|
+
.dialog-absolute {
|
|
24
|
+
width: 100%;
|
|
25
|
+
border-top: 1px solid #e2e5f1;
|
|
26
|
+
position: absolute;
|
|
27
|
+
left: 0px;
|
|
28
|
+
bottom: 0px;
|
|
29
|
+
height: 40px;
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
}
|
|
37
35
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
.hover-cancel {
|
|
37
|
+
background-color: #fff;
|
|
38
|
+
border-radius: 0 0 0 0.5rem;
|
|
39
|
+
}
|
|
42
40
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
.hover-cancel:hover {
|
|
42
|
+
background-color: #e6e6e6;
|
|
43
|
+
}
|
|
46
44
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
.hover-save {
|
|
46
|
+
background-color: #393939;
|
|
47
|
+
border-radius: 0 0 0.5rem;
|
|
48
|
+
}
|
|
51
49
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
.hover-save:hover {
|
|
51
|
+
background-color: #646464;
|
|
52
|
+
}
|
|
53
|
+
`);
|
|
56
54
|
const dialog = new ShareDialog(gvc.glitter);
|
|
57
55
|
gvc.glitter.innerDialog(
|
|
58
56
|
(gvc: GVC) => {
|
|
59
57
|
return html`
|
|
60
58
|
<div class="dialog-box">
|
|
61
|
-
<div class="dialog-content position-relative pb-5"
|
|
62
|
-
style="width: 452px;max-width: calc(100% - 20px);">
|
|
59
|
+
<div class="dialog-content position-relative pb-5" style="width: 452px;max-width: calc(100% - 20px);">
|
|
63
60
|
<div
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
class="my-3 fs-6 fw-500 text-center"
|
|
62
|
+
style="white-space: normal; overflow-wrap: anywhere;font-size: 28px;font-style: normal;font-weight: 700;line-height: normal;letter-spacing: 2.8px;"
|
|
66
63
|
>
|
|
67
64
|
請先收取現金後進行結帳
|
|
68
65
|
</div>
|
|
69
66
|
<div style="font-size: 18px;font-style: normal;font-weight: 400;line-height: 160%;letter-spacing: 0.72px;">
|
|
70
|
-
本次結帳金額為 <span
|
|
71
|
-
style="font-size: 28px;font-style: normal;font-weight: 700;line-height: 160%;">$${total.toLocaleString()}</span>
|
|
67
|
+
本次結帳金額為 <span style="font-size: 28px;font-style: normal;font-weight: 700;line-height: 160%;">$${total.toLocaleString()}</span>
|
|
72
68
|
</div>
|
|
73
|
-
<div class="d-flex align-items-center justify-content-center"
|
|
74
|
-
style="margin-top: 24px;font-size: 16px;font-weight: 700;letter-spacing: 0.64px;">
|
|
69
|
+
<div class="d-flex align-items-center justify-content-center" style="margin-top: 24px;font-size: 16px;font-weight: 700;letter-spacing: 0.64px;">
|
|
75
70
|
<div
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
71
|
+
style="border-radius: 10px;border: 1px solid #DDD;background: #FFF;padding: 12px 24px;color: #393939;width:120px;text-align:center;"
|
|
72
|
+
onclick="${gvc.event(() => {
|
|
73
|
+
gvc.glitter.closeDiaLog();
|
|
74
|
+
})}"
|
|
80
75
|
>
|
|
81
76
|
取消
|
|
82
77
|
</div>
|
|
83
78
|
<div
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
79
|
+
style="border-radius: 10px;background: #393939;padding: 12px 24px;color: #FFF;margin-left: 24px;width:120px;text-align:center;"
|
|
80
|
+
onclick="${gvc.event(() => {
|
|
81
|
+
gvc.closeDialog();
|
|
82
|
+
callback(true);
|
|
83
|
+
})}"
|
|
89
84
|
>
|
|
90
85
|
確認
|
|
91
86
|
</div>
|
|
@@ -103,13 +98,12 @@ export class PaymentFunction {
|
|
|
103
98
|
);
|
|
104
99
|
}
|
|
105
100
|
|
|
106
|
-
public static creditFinish(gvc: GVC, total:number,orderDetail: any, callback: (result: boolean) => void) {
|
|
101
|
+
public static creditFinish(gvc: GVC, total: number, orderDetail: any, callback: (result: boolean) => void) {
|
|
107
102
|
const dialog = new ShareDialog(gvc.glitter);
|
|
108
103
|
|
|
109
|
-
|
|
110
104
|
const pwd = orderDetail.payment_setting.find((dd: any) => {
|
|
111
|
-
return dd.key === 'ut_credit_card'
|
|
112
|
-
}).pwd
|
|
105
|
+
return dd.key === 'ut_credit_card';
|
|
106
|
+
}).pwd;
|
|
113
107
|
gvc.glitter.innerDialog(
|
|
114
108
|
(gvc: GVC) => {
|
|
115
109
|
if (PayConfig.deviceType === 'pos') {
|
|
@@ -118,16 +112,16 @@ export class PaymentFunction {
|
|
|
118
112
|
{
|
|
119
113
|
amount: `${total}`,
|
|
120
114
|
memo: `訂單ID:${orderDetail.orderID}`,
|
|
121
|
-
pwd: pwd
|
|
115
|
+
pwd: pwd,
|
|
122
116
|
},
|
|
123
117
|
(res: any) => {
|
|
124
118
|
if (res.result) {
|
|
125
119
|
gvc.closeDialog();
|
|
126
|
-
callback(true)
|
|
120
|
+
callback(true);
|
|
127
121
|
} else {
|
|
128
122
|
gvc.closeDialog();
|
|
129
|
-
callback(false)
|
|
130
|
-
dialog.errorMessage({text: '交易失敗'});
|
|
123
|
+
callback(false);
|
|
124
|
+
dialog.errorMessage({ text: '交易失敗' });
|
|
131
125
|
}
|
|
132
126
|
}
|
|
133
127
|
);
|
|
@@ -135,27 +129,26 @@ export class PaymentFunction {
|
|
|
135
129
|
gvc.glitter.share.credit_card_callback = (res: any) => {
|
|
136
130
|
if (res.result) {
|
|
137
131
|
gvc.closeDialog();
|
|
138
|
-
callback(true)
|
|
132
|
+
callback(true);
|
|
139
133
|
} else {
|
|
140
134
|
gvc.closeDialog();
|
|
141
|
-
callback(false)
|
|
142
|
-
dialog.errorMessage({text: '交易失敗'});
|
|
135
|
+
callback(false);
|
|
136
|
+
dialog.errorMessage({ text: '交易失敗' });
|
|
143
137
|
}
|
|
144
|
-
}
|
|
138
|
+
};
|
|
145
139
|
ConnectionMode.sendCommand({
|
|
146
140
|
cmd: 'credit_card',
|
|
147
141
|
amount: `${total}`,
|
|
148
142
|
memo: `訂單ID:${orderDetail.orderID}`,
|
|
149
|
-
pwd: pwd
|
|
150
|
-
})
|
|
143
|
+
pwd: pwd,
|
|
144
|
+
});
|
|
151
145
|
} else {
|
|
152
146
|
setTimeout(() => {
|
|
153
147
|
gvc.closeDialog();
|
|
154
|
-
dialog.errorMessage({text: '尚未連線至刷卡機'});
|
|
155
|
-
}, 100)
|
|
148
|
+
dialog.errorMessage({ text: '尚未連線至刷卡機' });
|
|
149
|
+
}, 100);
|
|
156
150
|
}
|
|
157
151
|
|
|
158
|
-
|
|
159
152
|
return html`
|
|
160
153
|
<div class="dialog-box">
|
|
161
154
|
<div class="dialog-content position-relative "
|
|
@@ -189,20 +182,20 @@ export class PaymentFunction {
|
|
|
189
182
|
);
|
|
190
183
|
}
|
|
191
184
|
|
|
192
|
-
public static lineFinish(gvc: GVC, total:number,prefix:number,orderDetail: OrderDetail, callback: (result: boolean) => void) {
|
|
185
|
+
public static lineFinish(gvc: GVC, total: number, prefix: number, orderDetail: OrderDetail, callback: (result: boolean) => void) {
|
|
193
186
|
const dialog = new ShareDialog(gvc.glitter);
|
|
194
187
|
gvc.glitter.innerDialog(
|
|
195
188
|
(gvc: GVC) => {
|
|
196
|
-
let block = false
|
|
189
|
+
let block = false;
|
|
197
190
|
PayConfig.onPayment = (scanText) => {
|
|
198
191
|
if (block) {
|
|
199
|
-
return
|
|
192
|
+
return;
|
|
200
193
|
}
|
|
201
|
-
dialog.dataLoading({visible: true});
|
|
194
|
+
dialog.dataLoading({ visible: true });
|
|
202
195
|
ApiShop.toPOSLinePay({
|
|
203
196
|
amount: total,
|
|
204
197
|
currency: 'TWD',
|
|
205
|
-
orderId: `${orderDetail.orderID}-${
|
|
198
|
+
orderId: `${orderDetail.orderID}-${orderDetail.line_prefix || 0}`,
|
|
206
199
|
productName: orderDetail.lineItems
|
|
207
200
|
.map((data: any) => {
|
|
208
201
|
return `${data.title} * ${data.count}`;
|
|
@@ -210,18 +203,18 @@ export class PaymentFunction {
|
|
|
210
203
|
.join(','),
|
|
211
204
|
oneTimeKey: scanText,
|
|
212
205
|
}).then((res) => {
|
|
213
|
-
dialog.dataLoading({visible: false});
|
|
206
|
+
dialog.dataLoading({ visible: false });
|
|
214
207
|
if (!res.result || !res.response.result) {
|
|
215
|
-
dialog.errorMessage({text: '交易失敗'});
|
|
208
|
+
dialog.errorMessage({ text: '交易失敗' });
|
|
216
209
|
callback(false);
|
|
217
210
|
} else {
|
|
218
211
|
gvc.closeDialog();
|
|
219
|
-
PayConfig.onPayment = undefined
|
|
212
|
+
PayConfig.onPayment = undefined;
|
|
220
213
|
callback(true);
|
|
221
214
|
}
|
|
222
215
|
});
|
|
223
|
-
}
|
|
224
|
-
let m_text = ''
|
|
216
|
+
};
|
|
217
|
+
let m_text = '';
|
|
225
218
|
return html`
|
|
226
219
|
<div class="dialog-box">
|
|
227
220
|
<div class="dialog-content position-relative "
|
|
@@ -239,14 +232,14 @@ export class PaymentFunction {
|
|
|
239
232
|
style="border: none;"
|
|
240
233
|
placeholder="請輸入或掃描付款代碼"
|
|
241
234
|
onchange="${gvc.event((e, event) => {
|
|
242
|
-
m_text = e.value
|
|
235
|
+
m_text = e.value;
|
|
243
236
|
})}"
|
|
244
237
|
value="${m_text || ''}"
|
|
245
238
|
onfocus="${gvc.event(() => {
|
|
246
|
-
block = true
|
|
239
|
+
block = true;
|
|
247
240
|
})}"
|
|
248
241
|
onblur="${gvc.event(() => {
|
|
249
|
-
block = false
|
|
242
|
+
block = false;
|
|
250
243
|
})}"
|
|
251
244
|
/>
|
|
252
245
|
<div class="flex-fill"></div>
|
|
@@ -268,7 +261,7 @@ export class PaymentFunction {
|
|
|
268
261
|
class="flex-fill"
|
|
269
262
|
style="border-radius: 10px;border: 1px solid #DDD;background: #FFF;padding: 12px 24px;color: #393939;text-align:center;"
|
|
270
263
|
onclick="${gvc.event(() => {
|
|
271
|
-
PayConfig.onPayment = undefined
|
|
264
|
+
PayConfig.onPayment = undefined;
|
|
272
265
|
gvc.glitter.closeDiaLog();
|
|
273
266
|
})}"
|
|
274
267
|
>
|
|
@@ -280,11 +273,11 @@ export class PaymentFunction {
|
|
|
280
273
|
style="border-radius: 10px;background: #393939;padding: 12px 24px;color: #FFF;text-align:center;"
|
|
281
274
|
onclick="${gvc.event(async () => {
|
|
282
275
|
if (!m_text) {
|
|
283
|
-
dialog.errorMessage({text: '請輸入交易條碼'})
|
|
284
|
-
return
|
|
276
|
+
dialog.errorMessage({ text: '請輸入交易條碼' });
|
|
277
|
+
return;
|
|
285
278
|
}
|
|
286
|
-
block = false
|
|
287
|
-
PayConfig.onPayment!(m_text)
|
|
279
|
+
block = false;
|
|
280
|
+
PayConfig.onPayment!(m_text);
|
|
288
281
|
})}"
|
|
289
282
|
>
|
|
290
283
|
確定
|
|
@@ -298,10 +291,9 @@ export class PaymentFunction {
|
|
|
298
291
|
{
|
|
299
292
|
dismiss: () => {
|
|
300
293
|
// vm.type = "list";
|
|
301
|
-
gvc.glitter.share.scan_back = () => {
|
|
302
|
-
};
|
|
294
|
+
gvc.glitter.share.scan_back = () => {};
|
|
303
295
|
},
|
|
304
296
|
}
|
|
305
297
|
);
|
|
306
298
|
}
|
|
307
|
-
}
|
|
299
|
+
}
|
|
@@ -29,10 +29,14 @@ export class ImageSelector {
|
|
|
29
29
|
widget.bundle.form_data[widget.bundle.form_key] = urlArray[0].data;
|
|
30
30
|
widget.bundle.refresh && widget.bundle.refresh();
|
|
31
31
|
gvc.notifyDataChange(id);
|
|
32
|
-
}, html `
|
|
32
|
+
}, html `
|
|
33
|
+
<div class="d-flex flex-column"
|
|
34
|
+
style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;">圖片庫
|
|
35
|
+
</div>`, { mul: false });
|
|
33
36
|
}
|
|
34
37
|
return html `
|
|
35
|
-
<div class="fw-normal mt-2 fs-6 d-flex align-items-center" style="gap:8px;"
|
|
38
|
+
<div class="fw-normal mt-2 fs-6 d-flex align-items-center" style="gap:8px;">
|
|
39
|
+
${widget.bundle.form_title}
|
|
36
40
|
<button
|
|
37
41
|
class="btn-size-sm btn-gray "
|
|
38
42
|
style=""
|
|
@@ -55,7 +59,7 @@ background-image: url('${src || BgWidget.noImageURL}');background-size: cover;ba
|
|
|
55
59
|
class="w-100 h-100 d-flex align-items-center justify-content-center rounded-3 p-hover-image position-relative"
|
|
56
60
|
style="opacity:0;background: rgba(0,0,0,0.5);gap:20px;color:white;font-size:22px;"
|
|
57
61
|
>
|
|
58
|
-
|
|
62
|
+
${(src && (src !== BgWidget.noImageURL)) ? ` <button
|
|
59
63
|
class="btn-size-sm btn-gray position-absolute"
|
|
60
64
|
style="top:5px;right:5px;"
|
|
61
65
|
type="button"
|
|
@@ -14,24 +14,30 @@ export class ImageSelector {
|
|
|
14
14
|
return {
|
|
15
15
|
bind: id,
|
|
16
16
|
view: () => {
|
|
17
|
-
if(typeof widget.bundle.form_data[widget.bundle.form_key]==='object'){
|
|
18
|
-
widget.bundle.form_data[widget.bundle.form_key]=widget.bundle.form_data[widget.bundle.form_key].value
|
|
17
|
+
if (typeof widget.bundle.form_data[widget.bundle.form_key] === 'object') {
|
|
18
|
+
widget.bundle.form_data[widget.bundle.form_key] = widget.bundle.form_data[widget.bundle.form_key].value
|
|
19
19
|
}
|
|
20
20
|
const src = widget.bundle.form_data[widget.bundle.form_key];
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
|
|
22
|
+
function selectImage() {
|
|
23
|
+
imageLibrary.selectImageLibrary(
|
|
24
|
+
gvc,
|
|
25
|
+
(urlArray) => {
|
|
26
|
+
widget.bundle.form_data[widget.bundle.form_key] = urlArray[0].data;
|
|
27
|
+
widget.bundle.refresh && widget.bundle.refresh();
|
|
28
|
+
gvc.notifyDataChange(id)
|
|
29
|
+
},
|
|
30
|
+
html`
|
|
31
|
+
<div class="d-flex flex-column"
|
|
32
|
+
style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;">圖片庫
|
|
33
|
+
</div>`,
|
|
34
|
+
{mul: false}
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
|
|
33
38
|
return html`
|
|
34
|
-
<div class="fw-normal mt-2 fs-6 d-flex align-items-center" style="gap:8px;"
|
|
39
|
+
<div class="fw-normal mt-2 fs-6 d-flex align-items-center" style="gap:8px;">
|
|
40
|
+
${widget.bundle.form_title}
|
|
35
41
|
<button
|
|
36
42
|
class="btn-size-sm btn-gray "
|
|
37
43
|
style=""
|
|
@@ -54,81 +60,81 @@ background-image: url('${src || BgWidget.noImageURL}');background-size: cover;ba
|
|
|
54
60
|
class="w-100 h-100 d-flex align-items-center justify-content-center rounded-3 p-hover-image position-relative"
|
|
55
61
|
style="opacity:0;background: rgba(0,0,0,0.5);gap:20px;color:white;font-size:22px;"
|
|
56
62
|
>
|
|
57
|
-
|
|
63
|
+
${(src && (src !== BgWidget.noImageURL)) ? ` <button
|
|
58
64
|
class="btn-size-sm btn-gray position-absolute"
|
|
59
65
|
style="top:5px;right:5px;"
|
|
60
66
|
type="button"
|
|
61
67
|
onclick="${gvc.event(() => {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
68
|
+
(window as any).glitter.getModule(gvc.glitter.root_path + `backend-manager/bg-widget.js`, async (BgWidget: any) => {
|
|
69
|
+
const tag = gvc.glitter.generateCheckSum(src, 9);
|
|
70
|
+
let alt = (await ApiUser.getPublicConfig(`alt_` + tag, 'manager')).response.value || {alt: ''};
|
|
65
71
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
async function set_alt() {
|
|
73
|
+
ApiUser.setPublicConfig({
|
|
74
|
+
key: `alt_` + tag,
|
|
75
|
+
value: alt,
|
|
76
|
+
user_id: 'manager',
|
|
77
|
+
});
|
|
78
|
+
}
|
|
73
79
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
80
|
+
BgWidget.settingDialog({
|
|
81
|
+
gvc: gvc,
|
|
82
|
+
title: '設定圖片描述',
|
|
83
|
+
innerHTML: (gvc: GVC) => {
|
|
84
|
+
return `<div>${BgWidget.textArea({
|
|
85
|
+
gvc: gvc,
|
|
86
|
+
title: `ALT描述`,
|
|
87
|
+
default: alt.alt,
|
|
88
|
+
placeHolder: `請輸入ALT描述`,
|
|
89
|
+
callback: (text: string) => {
|
|
90
|
+
alt.alt = text;
|
|
91
|
+
},
|
|
92
|
+
})}</div>`;
|
|
93
|
+
},
|
|
94
|
+
footer_html: (gvc: GVC) => {
|
|
95
|
+
let array = [
|
|
96
|
+
BgWidget.cancel(
|
|
97
|
+
gvc.event(() => {
|
|
98
|
+
gvc.closeDialog();
|
|
99
|
+
})
|
|
100
|
+
),
|
|
101
|
+
BgWidget.save(
|
|
102
|
+
gvc.event(() => {
|
|
103
|
+
set_alt();
|
|
104
|
+
gvc.closeDialog();
|
|
105
|
+
})
|
|
106
|
+
),
|
|
107
|
+
];
|
|
108
|
+
return array.join('');
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
})}"
|
|
107
113
|
>
|
|
108
114
|
<span class="tx_700" style="">ALT</span>
|
|
109
115
|
</button>
|
|
110
116
|
<i
|
|
111
117
|
class="fa-regular fa-eye"
|
|
112
118
|
onclick="${gvc.event(() => {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
119
|
+
(window.parent as any).glitter.openDiaLog(new URL('../../dialog/image-preview.js', import.meta.url).href, 'preview', src);
|
|
120
|
+
// gvc.glitter.openDiaLog(new URL('../../dialog/image-preview.js', import.meta.url).href, 'preview', dd);
|
|
121
|
+
})}"
|
|
116
122
|
></i>
|
|
117
123
|
<i
|
|
118
124
|
class="fa-regular fa-trash"
|
|
119
125
|
onclick="${gvc.event(() => {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
></i
|
|
126
|
+
widget.bundle.form_data[widget.bundle.form_key] = BgWidget.noImageURL;
|
|
127
|
+
widget.bundle.refresh && widget.bundle.refresh();
|
|
128
|
+
gvc.notifyDataChange(id);
|
|
129
|
+
})}"
|
|
130
|
+
></i>` : `
|
|
125
131
|
<button
|
|
126
132
|
class="btn-size-sm btn-gray "
|
|
127
133
|
style=""
|
|
128
134
|
type="button"
|
|
129
135
|
onclick="${gvc.event(() => {
|
|
130
|
-
|
|
131
|
-
|
|
136
|
+
selectImage()
|
|
137
|
+
})}"
|
|
132
138
|
>
|
|
133
139
|
<span class="tx_700" style="">選擇圖片</span>
|
|
134
140
|
</button>
|
|
@@ -541,6 +541,8 @@ export class ApiShop {
|
|
|
541
541
|
let par = [`limit=${json.limit}`, `page=${json.page}`];
|
|
542
542
|
json.search && par.push(`search=${json.search}`);
|
|
543
543
|
json.id && par.push(`id=${json.id}`);
|
|
544
|
+
json.date_confirm && par.push(`date_confirm=${json.date_confirm}`);
|
|
545
|
+
json.user_email && par.push(`user_email=${json.user_email}`);
|
|
544
546
|
json.voucher_type && par.push(`voucher_type=${json.voucher_type}`);
|
|
545
547
|
return par.join('&');
|
|
546
548
|
})()}`,
|
|
@@ -612,6 +612,8 @@ export class ApiShop {
|
|
|
612
612
|
page: number;
|
|
613
613
|
search?: string;
|
|
614
614
|
id?: string;
|
|
615
|
+
date_confirm?: boolean;
|
|
616
|
+
user_email?: string;
|
|
615
617
|
data_from?: 'user' | 'manager';
|
|
616
618
|
voucher_type?: 'rebate' | 'discount' | 'shipment_free' | 'add_on_items' | 'giveaway';
|
|
617
619
|
}) {
|
|
@@ -622,6 +624,8 @@ export class ApiShop {
|
|
|
622
624
|
let par = [`limit=${json.limit}`, `page=${json.page}`];
|
|
623
625
|
json.search && par.push(`search=${json.search}`);
|
|
624
626
|
json.id && par.push(`id=${json.id}`);
|
|
627
|
+
json.date_confirm && par.push(`date_confirm=${json.date_confirm}`);
|
|
628
|
+
json.user_email && par.push(`user_email=${json.user_email}`);
|
|
625
629
|
json.voucher_type && par.push(`voucher_type=${json.voucher_type}`);
|
|
626
630
|
return par.join('&');
|
|
627
631
|
})()}`,
|
|
@@ -877,10 +881,8 @@ export class ApiShop {
|
|
|
877
881
|
count: number;
|
|
878
882
|
}[];
|
|
879
883
|
code?: string;
|
|
880
|
-
//結帳類型
|
|
881
|
-
|
|
882
|
-
//POS的門市
|
|
883
|
-
pos_store?: string;
|
|
884
|
+
checkOutType?: 'manual' | 'auto' | 'POS'; //結帳類型
|
|
885
|
+
pos_store?: string; //POS的門市
|
|
884
886
|
use_rebate?: number;
|
|
885
887
|
distribution_code?: string;
|
|
886
888
|
user_info?: any;
|
|
@@ -160,8 +160,8 @@ export const component = Plugin.createComponent(import.meta.url, (glitter, editM
|
|
|
160
160
|
function updatePageConfig(formData, type, oWidget) {
|
|
161
161
|
oWidget && (widget = oWidget);
|
|
162
162
|
const ref = (widget.data.refer_app) ? (widget.data.refer_form_data || data.page_config.formData) : data.page_config.formData;
|
|
163
|
-
viewConfig.formData = getFormData(ref);
|
|
164
163
|
window.parent.glitter.share.updated_form_data[`${page_request_config.appName}_${tag}`] = ref;
|
|
164
|
+
viewConfig.formData = getFormData(ref);
|
|
165
165
|
const view = getView();
|
|
166
166
|
window.parent.glitter.share.loading_dialog.dataLoading({ visible: true });
|
|
167
167
|
setTimeout(() => {
|
|
@@ -840,7 +840,6 @@ export const component = Plugin.createComponent(import.meta.url, (glitter, editM
|
|
|
840
840
|
}));
|
|
841
841
|
});
|
|
842
842
|
try {
|
|
843
|
-
console.log(`getPageData-${parent_array.tag}`, parent_array);
|
|
844
843
|
window.glitterInitialHelper.share[`getPageData-${window.appName}-${parent_array.tag}`].data.response.result[0].config = parent_array;
|
|
845
844
|
}
|
|
846
845
|
catch (error) {
|
|
@@ -1311,7 +1310,6 @@ font-weight: 700;" onclick="${gvc.event(() => {
|
|
|
1311
1310
|
if (!pageData.template_config || !pageData.template_config.tag || (!pageData.template_config.tag.find((dd) => {
|
|
1312
1311
|
return dd === "商品卡片";
|
|
1313
1312
|
}))) {
|
|
1314
|
-
console.log(`pageData.template_config.tag`, pageData.template_config.tag);
|
|
1315
1313
|
if ((gvc.glitter.getUrlParameter('device') === 'mobile') && pageData.template_config.tag.includes('標頭元件')) {
|
|
1316
1314
|
}
|
|
1317
1315
|
else if ((gvc.glitter.getUrlParameter('device') !== 'mobile') && pageData.template_config.tag.includes('APP-Header')) {
|