ts-glitter 21.0.3 → 21.0.5
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 +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/backend-manager/bg-blog.js +22 -37
- package/lowcode/backend-manager/bg-blog.ts +45 -34
- package/lowcode/backend-manager/bg-list-component.js +2 -2
- package/lowcode/backend-manager/bg-list-component.ts +2 -2
- package/lowcode/backend-manager/bg-widget.js +21 -0
- package/lowcode/backend-manager/bg-widget.ts +21 -0
- package/lowcode/cms-plugin/filter-options.js +3 -3
- package/lowcode/cms-plugin/filter-options.ts +1 -1
- package/lowcode/cms-plugin/shopping-finance-setting.js +251 -6
- package/lowcode/cms-plugin/shopping-finance-setting.ts +291 -6
- package/lowcode/cms-plugin/shopping-order-manager.js +56 -46
- package/lowcode/cms-plugin/shopping-order-manager.ts +59 -47
- package/lowcode/cms-plugin/shopping-product-setting.js +10 -5
- package/lowcode/cms-plugin/shopping-product-setting.ts +14 -6
- package/lowcode/cms-plugin/shopping-setting-advance.js +21 -72
- package/lowcode/cms-plugin/shopping-setting-advance.ts +31 -98
- package/lowcode/css/editor.css +48 -16
- package/lowcode/css/front-end.css +16 -17
- package/lowcode/glitter-base/global/language.js +2 -0
- package/lowcode/glitter-base/global/language.ts +3 -0
- package/lowcode/glitter-base/global/shipment-config.js +4 -4
- package/lowcode/glitter-base/global/shipment-config.ts +1 -1
- package/lowcode/glitter-base/route/shopping.js +11 -0
- package/lowcode/glitter-base/route/shopping.ts +12 -0
- package/lowcode/official_view_component/form-widget/input-custom.js +0 -1
- package/lowcode/official_view_component/form-widget/input-custom.ts +0 -1
- package/lowcode/public-components/checkout/index.js +578 -780
- package/lowcode/public-components/checkout/index.ts +2457 -2652
- package/lowcode/public-components/headers/header-class.js +252 -324
- package/lowcode/public-components/headers/header-class.ts +389 -480
- package/lowcode/public-components/modules/cart-module.js +433 -0
- package/lowcode/public-components/modules/cart-module.ts +491 -0
- package/lowcode/public-components/modules/product-module.js +45 -0
- package/lowcode/public-components/modules/product-module.ts +58 -0
- package/lowcode/public-components/product/product-detail.js +178 -184
- package/lowcode/public-components/product/product-detail.ts +564 -579
- package/lowcode/public-components/user-manager/um-order.js +162 -32
- package/lowcode/public-components/user-manager/um-order.ts +181 -46
- package/lowcode/public-models/product.ts +1 -0
- package/lowcode/view-model/saas-view-model.js +1 -1
- package/lowcode/view-model/saas-view-model.ts +1 -1
- package/package.json +1 -1
- package/src/Language.js +1 -0
- package/src/Language.js.map +1 -1
- package/src/Language.ts +3 -0
- package/src/api-public/controllers/article.js +33 -29
- package/src/api-public/controllers/article.js.map +1 -1
- package/src/api-public/controllers/article.ts +152 -146
- package/src/api-public/controllers/index.js +2 -0
- package/src/api-public/controllers/index.js.map +1 -1
- package/src/api-public/controllers/index.ts +2 -0
- package/src/api-public/controllers/shop.js +125 -47
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +148 -61
- package/src/api-public/controllers/user.js +51 -52
- package/src/api-public/controllers/user.js.map +1 -1
- package/src/api-public/controllers/user.ts +63 -52
- package/src/api-public/models/glitter-finance.js +2 -1
- package/src/api-public/models/glitter-finance.js.map +5 -1
- package/src/api-public/services/checkout-event.d.ts +1 -0
- package/src/api-public/services/checkout-event.js +18 -10
- package/src/api-public/services/checkout-event.js.map +1 -1
- package/src/api-public/services/checkout-event.ts +18 -7
- package/src/api-public/services/factories/payment-strategy-factory.d.ts +6 -0
- package/src/api-public/services/factories/payment-strategy-factory.js +49 -0
- package/src/api-public/services/factories/payment-strategy-factory.js.map +1 -0
- package/src/api-public/services/factories/payment-strategy-factory.ts +71 -0
- package/src/api-public/services/fb-service.js +4 -4
- package/src/api-public/services/fb-service.js.map +1 -1
- package/src/api-public/services/financial-service.d.ts +2 -1
- package/src/api-public/services/financial-service.js +48 -53
- package/src/api-public/services/financial-service.js.map +1 -1
- package/src/api-public/services/financial-service.ts +29 -38
- package/src/api-public/services/financial-serviceV2.d.ts +298 -0
- package/src/api-public/services/financial-serviceV2.js +1158 -0
- package/src/api-public/services/financial-serviceV2.js.map +1 -0
- package/src/api-public/services/financial-serviceV2.ts +1518 -0
- package/src/api-public/services/interface/payment-keys-interface.d.ts +37 -0
- package/src/api-public/services/interface/payment-keys-interface.js +3 -0
- package/src/api-public/services/interface/payment-keys-interface.js.map +1 -0
- package/src/api-public/services/interface/payment-keys-interface.ts +46 -0
- package/src/api-public/services/interface/payment-strategy-interface.d.ts +17 -0
- package/src/api-public/services/interface/payment-strategy-interface.js +3 -0
- package/src/api-public/services/interface/payment-strategy-interface.js.map +1 -0
- package/src/api-public/services/interface/payment-strategy-interface.ts +48 -0
- package/src/api-public/services/migrate-event/public-user-config.d.ts +5 -0
- package/src/api-public/services/migrate-event/public-user-config.js +81 -0
- package/src/api-public/services/migrate-event/public-user-config.js.map +1 -0
- package/src/api-public/services/migrate-event/public-user-config.ts +106 -0
- package/src/api-public/services/model/handlePaymentTransaction.js +0 -68
- package/src/api-public/services/model/handlePaymentTransaction.js.map +1 -1
- package/src/api-public/services/model/handlePaymentTransaction.ts +62 -54
- package/src/api-public/services/monitor.d.ts +1 -0
- package/src/api-public/services/payment-service.d.ts +12 -0
- package/src/api-public/services/payment-service.js +83 -0
- package/src/api-public/services/payment-service.js.map +1 -0
- package/src/api-public/services/payment-service.ts +112 -0
- package/src/api-public/services/shopping.d.ts +2 -1
- package/src/api-public/services/shopping.js +60 -23
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +88 -16
- package/src/api-public/services/strategies/ecpay-strategy.d.ts +8 -0
- package/src/api-public/services/strategies/ecpay-strategy.js +26 -0
- package/src/api-public/services/strategies/ecpay-strategy.js.map +1 -0
- package/src/api-public/services/strategies/ecpay-strategy.ts +30 -0
- package/src/api-public/services/strategies/ezpay-strategy.d.ts +8 -0
- package/src/api-public/services/strategies/ezpay-strategy.js +26 -0
- package/src/api-public/services/strategies/ezpay-strategy.js.map +1 -0
- package/src/api-public/services/strategies/ezpay-strategy.ts +31 -0
- package/src/api-public/services/strategies/jkopay-strategy.d.ts +8 -0
- package/src/api-public/services/strategies/jkopay-strategy.js +32 -0
- package/src/api-public/services/strategies/jkopay-strategy.js.map +1 -0
- package/src/api-public/services/strategies/jkopay-strategy.ts +36 -0
- package/src/api-public/services/strategies/linepay-strategy.d.ts +8 -0
- package/src/api-public/services/strategies/linepay-strategy.js +32 -0
- package/src/api-public/services/strategies/linepay-strategy.js.map +1 -0
- package/src/api-public/services/strategies/linepay-strategy.ts +35 -0
- package/src/api-public/services/strategies/paynow-strategy.d.ts +8 -0
- package/src/api-public/services/strategies/paynow-strategy.js +26 -0
- package/src/api-public/services/strategies/paynow-strategy.js.map +1 -0
- package/src/api-public/services/strategies/paynow-strategy.ts +29 -0
- package/src/api-public/services/strategies/paypal-strategy.d.ts +8 -0
- package/src/api-public/services/strategies/paypal-strategy.js +28 -0
- package/src/api-public/services/strategies/paypal-strategy.js.map +1 -0
- package/src/api-public/services/strategies/paypal-strategy.ts +31 -0
- package/src/api-public/services/updated-table-checked.d.ts +1 -0
- package/src/api-public/services/updated-table-checked.js +37 -15
- package/src/api-public/services/updated-table-checked.js.map +1 -1
- package/src/api-public/services/updated-table-checked.ts +56 -36
- package/src/api-public/utils/ut-permission.d.ts +1 -0
- package/src/app-project/serverless/src/index.js +17 -7
- package/src/app-project/serverless/src/index.js.map +1 -1
- package/src/app-project/serverless/src/modules/CryptoJS.js +17 -7
- package/src/app-project/serverless/src/modules/CryptoJS.js.map +1 -1
- package/src/app-project/serverless/src/modules/ssh.js +17 -7
- package/src/app-project/serverless/src/modules/ssh.js.map +1 -1
- package/src/config.d.ts +1 -1
- package/src/modules/AWSLib.js +3 -2
- package/src/modules/AWSLib.js.map +1 -1
- package/src/modules/CryptoJS.js +17 -7
- package/src/modules/CryptoJS.js.map +1 -1
- package/src/modules/database.d.ts +1 -1
- package/src/modules/redis.d.ts +1 -1
- package/src/modules/ssh.js +17 -7
- package/src/modules/ssh.js.map +1 -1
- package/src/modules/tool.d.ts +4 -4
- package/src/modules/tool.js +2 -1
- package/src/modules/tool.js.map +1 -1
- package/src/run.js +2 -1
- package/src/run.js.map +1 -1
- package/src/services/create-instance.js +4 -3
- package/src/services/create-instance.js.map +1 -1
- package/src/services/saas-table-check.js +2 -2
- package/src/services/saas-table-check.js.map +5 -1
- package/src/services/tool.js +3 -2
- package/src/services/tool.js.map +1 -1
- package/vp00rqhw1r.json +1 -0
- package/src/api-public/services/product-migrate.d.ts +0 -8
- package/src/api-public/services/product-migrate.js.map +0 -1
|
@@ -27,13 +27,15 @@ import { ShipmentConfig } from '../../glitter-base/global/shipment-config.js';
|
|
|
27
27
|
import { Animation } from '../../glitterBundle/module/Animation.js';
|
|
28
28
|
import { ApiLiveInteraction } from '../../glitter-base/route/live-purchase-interactions.js';
|
|
29
29
|
import { ApplicationConfig } from '../../application-config.js';
|
|
30
|
+
import { CartModule } from '../modules/cart-module.js';
|
|
31
|
+
import { ProductModule } from '../modules/product-module.js';
|
|
30
32
|
const html = String.raw;
|
|
31
33
|
export class CheckoutIndex {
|
|
32
34
|
static main(gvc, widget, subData) {
|
|
33
35
|
var _a;
|
|
34
36
|
const glitter = gvc.glitter;
|
|
35
37
|
if (glitter.share.is_application && glitter.getUrlParameter('page') !== 'checkout') {
|
|
36
|
-
return
|
|
38
|
+
return '';
|
|
37
39
|
}
|
|
38
40
|
let onlineData = {};
|
|
39
41
|
let apiCart = (() => {
|
|
@@ -56,11 +58,13 @@ export class CheckoutIndex {
|
|
|
56
58
|
};
|
|
57
59
|
const vm = {
|
|
58
60
|
cartData: {},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
},
|
|
61
|
+
cartDataList: [],
|
|
62
|
+
logisticsGroup: [],
|
|
63
|
+
rebateConfig: { title: '購物金' },
|
|
64
|
+
quantity: '',
|
|
65
|
+
hasFullLengthCart: false,
|
|
62
66
|
};
|
|
63
|
-
const classPrefix = '
|
|
67
|
+
const classPrefix = 'cart-prefix';
|
|
64
68
|
PdClass.addSpecStyle(gvc);
|
|
65
69
|
function spinner(obj) {
|
|
66
70
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
@@ -88,7 +92,7 @@ export class CheckoutIndex {
|
|
|
88
92
|
role="status"
|
|
89
93
|
></div>
|
|
90
94
|
<span class="mt-3 ${textAttr.visible ? '' : 'd-none'}" style="font-size: ${textAttr.fontSize}px;"
|
|
91
|
-
|
|
95
|
+
>${textAttr.value}</span
|
|
92
96
|
>
|
|
93
97
|
</div>`;
|
|
94
98
|
}
|
|
@@ -112,300 +116,15 @@ export class CheckoutIndex {
|
|
|
112
116
|
return html ` <div class="${gClass('add-item-badge')}" style="background: #EAEAEA;color:white !important;">
|
|
113
117
|
<div class="${gClass('add-item-text')}">${Language.text('hidden_goods')}</div>
|
|
114
118
|
</div>`;
|
|
115
|
-
}
|
|
116
|
-
function addStyle() {
|
|
117
|
-
gvc.addStyle(`
|
|
118
|
-
.${classPrefix}-container {
|
|
119
|
-
max-width: 1200px !important;
|
|
120
|
-
margin: 2.5rem auto !important;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.${classPrefix}-null-container {
|
|
124
|
-
display: flex;
|
|
125
|
-
flex-direction: column;
|
|
126
|
-
align-items: center;
|
|
127
|
-
height: 100vh !important;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.${classPrefix}-header {
|
|
131
|
-
color: #393939;
|
|
132
|
-
font-size: 24px;
|
|
133
|
-
font-weight: 700;
|
|
134
|
-
letter-spacing: 12px;
|
|
135
|
-
text-align: center;
|
|
136
|
-
margin-bottom: 24px;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.${classPrefix}-banner-bgr {
|
|
140
|
-
padding: 1rem;
|
|
141
|
-
border-radius: 10px;
|
|
142
|
-
background: #f6f6f6;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.${classPrefix}-banner-text {
|
|
146
|
-
color: #393939;
|
|
147
|
-
font-size: 18px;
|
|
148
|
-
font-weight: 700;
|
|
149
|
-
letter-spacing: 2px;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.${classPrefix}-text-1 {
|
|
153
|
-
color: #393939;
|
|
154
|
-
font-size: 20px;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
.${classPrefix}-text-2 {
|
|
158
|
-
color: #393939;
|
|
159
|
-
font-size: 16px;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.${classPrefix}-text-3 {
|
|
163
|
-
color: #393939;
|
|
164
|
-
font-size: 14px;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
.${classPrefix}-label {
|
|
168
|
-
color: #393939;
|
|
169
|
-
font-size: 16px;
|
|
170
|
-
margin-bottom: 8px;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.${classPrefix}-bold {
|
|
174
|
-
font-weight: 700;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
.${classPrefix}-button-bgr {
|
|
178
|
-
width: 100%;
|
|
179
|
-
border: 0;
|
|
180
|
-
border-radius: 0.375rem;
|
|
181
|
-
height: 40px;
|
|
182
|
-
background: #393939;
|
|
183
|
-
padding: 0 24px;
|
|
184
|
-
margin: 18px 0;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
.${classPrefix}-button-bgr-disable {
|
|
188
|
-
width: 100%;
|
|
189
|
-
border: 0;
|
|
190
|
-
border-radius: 0.375rem;
|
|
191
|
-
height: 40px;
|
|
192
|
-
background: #dddddd;
|
|
193
|
-
padding: 0 24px;
|
|
194
|
-
margin: 18px 0;
|
|
195
|
-
cursor: not-allowed !important;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.${classPrefix}-button-text {
|
|
199
|
-
color: #fff;
|
|
200
|
-
font-size: 16px;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.${classPrefix}-input {
|
|
204
|
-
width: 100%;
|
|
205
|
-
border-radius: 10px;
|
|
206
|
-
border: 1px solid #ddd;
|
|
207
|
-
height: 40px;
|
|
208
|
-
padding: 0px 18px;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
.${classPrefix}-select {
|
|
212
|
-
display: flex;
|
|
213
|
-
padding: 7px 30px 7px 18px;
|
|
214
|
-
max-height: 40px;
|
|
215
|
-
align-items: center;
|
|
216
|
-
gap: 6px;
|
|
217
|
-
border-radius: 10px;
|
|
218
|
-
border: 1px solid #ddd;
|
|
219
|
-
background: transparent
|
|
220
|
-
url('https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1718100926212-Vector 89.png') no-repeat;
|
|
221
|
-
background-position-x: calc(100% - 12px);
|
|
222
|
-
background-position-y: 16px;
|
|
223
|
-
appearance: none;
|
|
224
|
-
-webkit-appearance: none;
|
|
225
|
-
-moz-appearance: none;
|
|
226
|
-
color: #393939;
|
|
227
|
-
background-color: white;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
.${classPrefix}-select:focus {
|
|
231
|
-
outline: 0;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
.${classPrefix}-group-input {
|
|
235
|
-
border: none;
|
|
236
|
-
background: none;
|
|
237
|
-
text-align: start;
|
|
238
|
-
color: #393939;
|
|
239
|
-
font-size: 16px;
|
|
240
|
-
font-weight: 400;
|
|
241
|
-
word-wrap: break-word;
|
|
242
|
-
padding-left: 12px;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
.${classPrefix}-first-td {
|
|
246
|
-
display: flex;
|
|
247
|
-
align-items: center;
|
|
248
|
-
justify-content: center;
|
|
249
|
-
width: 30%;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
.${classPrefix}-group-input:focus {
|
|
253
|
-
outline: 0;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
.${classPrefix}-group-button {
|
|
257
|
-
padding: 9px 18px;
|
|
258
|
-
background: #393939;
|
|
259
|
-
align-items: center;
|
|
260
|
-
gap: 5px;
|
|
261
|
-
display: flex;
|
|
262
|
-
font-size: 16px;
|
|
263
|
-
justify-content: center;
|
|
264
|
-
cursor: pointer;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
.${classPrefix}-td {
|
|
268
|
-
display: flex;
|
|
269
|
-
align-items: center;
|
|
270
|
-
justify-content: start;
|
|
271
|
-
width: 15%;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
.${classPrefix}-first-td {
|
|
275
|
-
display: flex;
|
|
276
|
-
align-items: center;
|
|
277
|
-
justify-content: center;
|
|
278
|
-
width: 40%;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
.${classPrefix}-price-container {
|
|
282
|
-
display: flex;
|
|
283
|
-
flex-direction: column;
|
|
284
|
-
width: 400px;
|
|
285
|
-
align-items: center;
|
|
286
|
-
padding: 0;
|
|
287
|
-
gap: 12px;
|
|
288
|
-
margin: 24px 0;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
.${classPrefix}-price-row {
|
|
292
|
-
display: flex;
|
|
293
|
-
width: 100%;
|
|
294
|
-
align-items: center;
|
|
295
|
-
justify-content: space-between;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
.${classPrefix}-origin-price {
|
|
299
|
-
text-align: end;
|
|
300
|
-
font-weight: 400;
|
|
301
|
-
word-wrap: break-word;
|
|
302
|
-
text-decoration: line-through;
|
|
303
|
-
color: #636363;
|
|
304
|
-
font-style: italic;
|
|
305
|
-
margin-top: auto;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
.${classPrefix}-add-item-badge {
|
|
309
|
-
height: 22px;
|
|
310
|
-
padding-left: 6px;
|
|
311
|
-
padding-right: 6px;
|
|
312
|
-
padding-top: 4px;
|
|
313
|
-
padding-bottom: 4px;
|
|
314
|
-
background: #ffe9b2;
|
|
315
|
-
border-radius: 7px;
|
|
316
|
-
justify-content: center;
|
|
317
|
-
align-items: center;
|
|
318
|
-
gap: 10px;
|
|
319
|
-
display: inline-flex;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
.${classPrefix}-add-item-text {
|
|
323
|
-
color: #393939;
|
|
324
|
-
font-size: 14px;
|
|
325
|
-
font-weight: 400;
|
|
326
|
-
word-wrap: break-word;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
.${classPrefix}-shipping-hint {
|
|
330
|
-
white-space: normal;
|
|
331
|
-
word-break: break-all;
|
|
332
|
-
color: #8d8d8d;
|
|
333
|
-
font-size: 14px;
|
|
334
|
-
font-weight: 400;
|
|
335
|
-
margin: 4px 0;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
.${classPrefix}-price-text {
|
|
339
|
-
color: #ff5353ff;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
.img-106px {
|
|
343
|
-
width: 106px;
|
|
344
|
-
min-width: 106px;
|
|
345
|
-
height: 106px;
|
|
346
|
-
border-radius: 3px;
|
|
347
|
-
background-position: center;
|
|
348
|
-
background-size: cover;
|
|
349
|
-
background-repeat: no-repeat;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
.banner-font-15 {
|
|
353
|
-
font-size: 15px;
|
|
354
|
-
font-style: normal;
|
|
355
|
-
font-weight: 400;
|
|
356
|
-
white-space: nowrap;
|
|
357
|
-
overflow: hidden;
|
|
358
|
-
max-width: 130px;
|
|
359
|
-
text-overflow: ellipsis;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
.ntd-font-14 {
|
|
363
|
-
font-size: 14px;
|
|
364
|
-
font-style: normal;
|
|
365
|
-
font-weight: 700;
|
|
366
|
-
line-height: 140%;
|
|
367
|
-
}
|
|
368
|
-
`);
|
|
369
|
-
gvc.addStyle(`
|
|
370
|
-
@media (max-width: 768px) {
|
|
371
|
-
.${classPrefix}-container {
|
|
372
|
-
max-width: 100% !important;
|
|
373
|
-
margin: 2.5rem auto !important;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
.${classPrefix}-td {
|
|
377
|
-
display: flex;
|
|
378
|
-
align-items: center;
|
|
379
|
-
justify-content: start;
|
|
380
|
-
width: 100%;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
.${classPrefix}-66text {
|
|
384
|
-
color: #666666;
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
.${classPrefix}-price-container {
|
|
388
|
-
display: flex;
|
|
389
|
-
flex-direction: column;
|
|
390
|
-
width: 100% !important;
|
|
391
|
-
align-items: center;
|
|
392
|
-
padding: 0;
|
|
393
|
-
gap: 12px;
|
|
394
|
-
margin: 24px 0;
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
`);
|
|
398
119
|
}
|
|
399
120
|
function refreshCartData() {
|
|
400
121
|
const dialog = new ShareDialog(gvc.glitter);
|
|
401
122
|
dialog.dataLoading({ visible: true });
|
|
402
123
|
const beta = false;
|
|
403
124
|
if (!beta) {
|
|
404
|
-
new Promise((resolve
|
|
405
|
-
new Promise(
|
|
406
|
-
setTimeout(() =>
|
|
407
|
-
resolve(apiCart.cart);
|
|
408
|
-
});
|
|
125
|
+
new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
|
|
126
|
+
new Promise(resolve => {
|
|
127
|
+
setTimeout(() => resolve(apiCart.cart), 50);
|
|
409
128
|
}).then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
410
129
|
var _a;
|
|
411
130
|
const cartData = {
|
|
@@ -415,6 +134,44 @@ export class CheckoutIndex {
|
|
|
415
134
|
shipment: localStorage.getItem('shipment-select'),
|
|
416
135
|
},
|
|
417
136
|
};
|
|
137
|
+
const cartObject = yield CartModule.getLineItemAndShipmentCart();
|
|
138
|
+
vm.cartDataList = cartObject.dataList;
|
|
139
|
+
vm.logisticsGroup = cartObject.logisticsGroup;
|
|
140
|
+
vm.hasFullLengthCart = cartObject.hasFullLengthCart;
|
|
141
|
+
if (!localStorage.getItem('logistics-group')) {
|
|
142
|
+
localStorage.setItem('logistics-group', (() => {
|
|
143
|
+
try {
|
|
144
|
+
return vm.cartDataList[0].group[0];
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
return '';
|
|
148
|
+
}
|
|
149
|
+
})());
|
|
150
|
+
}
|
|
151
|
+
function resetShipmentSelected() {
|
|
152
|
+
const findGroup = vm.logisticsGroup.find(item => item.key === localStorage.getItem('logistics-group'));
|
|
153
|
+
if (findGroup) {
|
|
154
|
+
const list = findGroup.list;
|
|
155
|
+
const def = localStorage.getItem('shipment-select');
|
|
156
|
+
if (!def || !list.includes(def)) {
|
|
157
|
+
localStorage.setItem('shipment-select', list[0]);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
const defaultShipmentCart = vm.cartDataList.find(data => {
|
|
162
|
+
const findGroup = vm.logisticsGroup.find(item => item.key === localStorage.getItem('logistics-group'));
|
|
163
|
+
return findGroup === null || findGroup === void 0 ? void 0 : findGroup.list.includes(data.logistic);
|
|
164
|
+
});
|
|
165
|
+
if (defaultShipmentCart) {
|
|
166
|
+
res.line_items = defaultShipmentCart.cart;
|
|
167
|
+
resetShipmentSelected();
|
|
168
|
+
}
|
|
169
|
+
else if (vm.cartDataList[0]) {
|
|
170
|
+
res.line_items = vm.cartDataList[0].cart;
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
res.line_items = [];
|
|
174
|
+
}
|
|
418
175
|
if (res.line_items) {
|
|
419
176
|
res.user_info = {
|
|
420
177
|
payment: localStorage.getItem('checkout-payment'),
|
|
@@ -497,7 +254,7 @@ export class CheckoutIndex {
|
|
|
497
254
|
src: `${gvc.glitter.root_path}/jslib/lottie-player.js`,
|
|
498
255
|
},
|
|
499
256
|
{
|
|
500
|
-
src: `https://js.paynow.com.tw/sdk/v2/index.js`,
|
|
257
|
+
src: `https://js.paynow.com.tw/sdk/v2/index.js?v=20250430`,
|
|
501
258
|
},
|
|
502
259
|
], () => { }, () => { });
|
|
503
260
|
loadings.page = false;
|
|
@@ -525,7 +282,7 @@ export class CheckoutIndex {
|
|
|
525
282
|
src: `${gvc.glitter.root_path}/jslib/lottie-player.js`,
|
|
526
283
|
},
|
|
527
284
|
{
|
|
528
|
-
src: `https://js.paynow.com.tw/sdk/
|
|
285
|
+
src: `https://js.paynow.com.tw/sdk/v2/index.js`,
|
|
529
286
|
},
|
|
530
287
|
], () => { }, () => { });
|
|
531
288
|
loadings.page = false;
|
|
@@ -628,6 +385,7 @@ export class CheckoutIndex {
|
|
|
628
385
|
<div>${Language.text('discount_coupon')}</div>
|
|
629
386
|
<div>- ${Currency.convertCurrencyText(vm.cartData.discount)}</div>
|
|
630
387
|
</div>
|
|
388
|
+
<!-- 可使用的優惠券 -->
|
|
631
389
|
<div class="${gClass(['price-row', 'text-2'])}">
|
|
632
390
|
<div>${Language.text('promo_code')}</div>
|
|
633
391
|
<div
|
|
@@ -679,28 +437,28 @@ export class CheckoutIndex {
|
|
|
679
437
|
})(),
|
|
680
438
|
item.usePass
|
|
681
439
|
? html ` <button
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
440
|
+
class="${gClass('button-bgr')} my-2"
|
|
441
|
+
style="max-width: 150px;"
|
|
442
|
+
onclick="${gvc.event(() => {
|
|
685
443
|
apiCart.setCart(cartItem => {
|
|
686
444
|
cartItem.code = item.code;
|
|
687
445
|
refreshCartData();
|
|
688
446
|
gvc.closeDialog();
|
|
689
447
|
});
|
|
690
448
|
})}"
|
|
691
|
-
|
|
449
|
+
>
|
|
692
450
|
<span class="${gClass('button-text')}"
|
|
693
|
-
|
|
451
|
+
>${Language.text('select_to_use')}</span
|
|
694
452
|
>
|
|
695
|
-
|
|
453
|
+
</button>`
|
|
696
454
|
: html ` <button
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
455
|
+
class="${gClass('button-bgr-disable')} my-2"
|
|
456
|
+
style="max-width: 150px; cursor: not-allowed"
|
|
457
|
+
>
|
|
700
458
|
<span class="${gClass('button-text')}"
|
|
701
|
-
|
|
459
|
+
>${Language.text('not_meet_usage_criteria')}</span
|
|
702
460
|
>
|
|
703
|
-
|
|
461
|
+
</button>`,
|
|
704
462
|
];
|
|
705
463
|
}
|
|
706
464
|
const dialog = new ShareDialog(gvc.glitter);
|
|
@@ -735,7 +493,7 @@ export class CheckoutIndex {
|
|
|
735
493
|
<div>
|
|
736
494
|
<div class="d-flex align-items-center mb-2">
|
|
737
495
|
<label class="${gClass('label')} mb-0 me-2" style="min-width: 80px;"
|
|
738
|
-
|
|
496
|
+
>${Language.text('enter_code')}</label
|
|
739
497
|
>
|
|
740
498
|
<input
|
|
741
499
|
class="${gClass('input')}"
|
|
@@ -791,7 +549,7 @@ export class CheckoutIndex {
|
|
|
791
549
|
})}"
|
|
792
550
|
>
|
|
793
551
|
<span class="${gClass('button-text')}"
|
|
794
|
-
|
|
552
|
+
>${Language.text('confirm')}</span
|
|
795
553
|
>
|
|
796
554
|
</button>
|
|
797
555
|
</div>
|
|
@@ -818,10 +576,9 @@ export class CheckoutIndex {
|
|
|
818
576
|
}
|
|
819
577
|
}
|
|
820
578
|
catch (e) {
|
|
821
|
-
return
|
|
579
|
+
return '';
|
|
822
580
|
}
|
|
823
581
|
},
|
|
824
|
-
divCreate: {},
|
|
825
582
|
onCreate: () => {
|
|
826
583
|
if (loading) {
|
|
827
584
|
function isNowBetweenDates(startIso, endIso) {
|
|
@@ -895,52 +652,52 @@ export class CheckoutIndex {
|
|
|
895
652
|
>
|
|
896
653
|
${vm.cartData.code
|
|
897
654
|
? html `${vm.cartData.code}<i
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
655
|
+
class="fa-solid fa-xmark-large ms-2"
|
|
656
|
+
style="cursor: pointer;"
|
|
657
|
+
onclick="${gvc.event((e, event) => {
|
|
901
658
|
event.stopPropagation();
|
|
902
659
|
apiCart.setCart(cartItem => {
|
|
903
660
|
cartItem.code = '';
|
|
904
661
|
refreshCartData();
|
|
905
662
|
});
|
|
906
663
|
})}"
|
|
907
|
-
|
|
664
|
+
></i>`
|
|
908
665
|
: Language.text('add')}
|
|
909
666
|
</div>
|
|
910
667
|
</div>
|
|
911
668
|
${(() => {
|
|
912
669
|
if (!GlobalUser.token || !vm.cartData.useRebateInfo.status) {
|
|
913
|
-
return
|
|
670
|
+
return '';
|
|
914
671
|
}
|
|
915
672
|
else {
|
|
916
673
|
return html ` ${(() => {
|
|
917
674
|
let tempRebate = 0;
|
|
918
675
|
const dialog = new ShareDialog(gvc.glitter);
|
|
919
676
|
return html ` <div class="${gClass(['price-row', 'text-2'])}">
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
677
|
+
<div>${vm.rebateConfig.title}${Language.text('discount')}</div>
|
|
678
|
+
<div>- ${Currency.convertCurrencyText(vm.cartData.use_rebate)}</div>
|
|
679
|
+
</div>
|
|
680
|
+
<div class="${gClass(['price-row', 'text-2'])}">
|
|
681
|
+
<div>${vm.rebateConfig.title}${Language.text('reback_text')}</div>
|
|
682
|
+
<div>+ ${vm.cartData.rebate.toLocaleString()}</div>
|
|
683
|
+
</div>
|
|
927
684
|
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
685
|
+
<div class="${gClass(['price-row', 'text-2'])}">
|
|
686
|
+
<div
|
|
687
|
+
style=" justify-content: flex-start; align-items: center; display: inline-flex;border:1px solid #EAEAEA;border-radius: 10px;overflow: hidden; ${document
|
|
931
688
|
.body.clientWidth > 768
|
|
932
689
|
? 'gap: 18px;'
|
|
933
690
|
: 'gap: 0px;'}"
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
691
|
+
class="w-100"
|
|
692
|
+
>
|
|
693
|
+
<input
|
|
694
|
+
class="flex-fill ${gClass('group-input')}"
|
|
695
|
+
placeholder="${Language.text('please_enter')}${vm.rebateConfig.title}"
|
|
696
|
+
style="${document.body.clientWidth < 800
|
|
940
697
|
? `width:calc(100% - 150px) !important;`
|
|
941
|
-
:
|
|
942
|
-
|
|
943
|
-
|
|
698
|
+
: ''}"
|
|
699
|
+
value="${vm.cartData.use_rebate || ''}"
|
|
700
|
+
onchange="${gvc.event((e, event) => {
|
|
944
701
|
if (CheckInput.isNumberString(e.value)) {
|
|
945
702
|
tempRebate = parseInt(e.value, 10);
|
|
946
703
|
}
|
|
@@ -949,11 +706,11 @@ export class CheckoutIndex {
|
|
|
949
706
|
gvc.notifyDataChange(ids.page);
|
|
950
707
|
}
|
|
951
708
|
})}"
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
709
|
+
/>
|
|
710
|
+
<div class="${gClass('group-button')}">
|
|
711
|
+
<div
|
|
712
|
+
class="${gClass('button-text')}"
|
|
713
|
+
onclick="${gvc.event(() => __awaiter(this, void 0, void 0, function* () {
|
|
957
714
|
const sum = yield new Promise((resolve, reject) => {
|
|
958
715
|
ApiShop.getRebate({}).then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
959
716
|
if (res.result && res.response.sum) {
|
|
@@ -982,15 +739,15 @@ export class CheckoutIndex {
|
|
|
982
739
|
refreshCartData();
|
|
983
740
|
});
|
|
984
741
|
}))}"
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
</div>
|
|
988
|
-
</div>
|
|
742
|
+
>
|
|
743
|
+
${Language.text('apply')}
|
|
989
744
|
</div>
|
|
990
|
-
</div
|
|
745
|
+
</div>
|
|
746
|
+
</div>
|
|
747
|
+
</div>`;
|
|
991
748
|
})()}
|
|
992
|
-
|
|
993
|
-
|
|
749
|
+
<div class="${gClass(['price-row', 'text-2'])}">
|
|
750
|
+
${(() => {
|
|
994
751
|
return gvc.bindView(() => {
|
|
995
752
|
return {
|
|
996
753
|
bind: gvc.glitter.getUUID(),
|
|
@@ -1011,13 +768,13 @@ export class CheckoutIndex {
|
|
|
1011
768
|
const info = vm.cartData.useRebateInfo;
|
|
1012
769
|
if (info.condition) {
|
|
1013
770
|
return html `${Language.text('distance_from_target_amount')}$
|
|
1014
|
-
|
|
1015
|
-
|
|
771
|
+
${info.condition.toLocaleString()} ${Language.text('can_use_now')}
|
|
772
|
+
${vm.rebateConfig.title} ${Language.text('discount')}`;
|
|
1016
773
|
}
|
|
1017
774
|
if (info.limit) {
|
|
1018
775
|
return html `${Language.text('remaining_balance')} ${sum || 0}
|
|
1019
|
-
|
|
1020
|
-
|
|
776
|
+
${Language.text('point')} ${vm.rebateConfig.title} <br />${Language.text('max_discount_order')}
|
|
777
|
+
${info.limit.toLocaleString()} ${Language.text('point')} ${vm.rebateConfig.title}`;
|
|
1021
778
|
}
|
|
1022
779
|
else {
|
|
1023
780
|
return `${Language.text('remaining_balance')} ${sum || 0} ${Language.text('point')} ${vm.rebateConfig.title}`;
|
|
@@ -1026,9 +783,13 @@ export class CheckoutIndex {
|
|
|
1026
783
|
};
|
|
1027
784
|
});
|
|
1028
785
|
})()}
|
|
1029
|
-
|
|
786
|
+
</div>`;
|
|
1030
787
|
}
|
|
1031
788
|
})()}
|
|
789
|
+
<div class="${gClass(['price-row', 'text-2', 'bold'])}">
|
|
790
|
+
<div>${Language.text('total_amount')}</div>
|
|
791
|
+
<div class="${gClass('total_amount')}">${Currency.convertCurrencyText(vm.cartData.total)}</div>
|
|
792
|
+
</div>
|
|
1032
793
|
</div>`;
|
|
1033
794
|
if (!widget.share.receipt_form) {
|
|
1034
795
|
const res = yield ApiUser.getPublicConfig('custom_form_checkout_recipient', 'manager');
|
|
@@ -1047,7 +808,7 @@ export class CheckoutIndex {
|
|
|
1047
808
|
});
|
|
1048
809
|
}
|
|
1049
810
|
this.initial(vm.cartData);
|
|
1050
|
-
addStyle();
|
|
811
|
+
CartModule.addStyle(gvc, classPrefix);
|
|
1051
812
|
if (vm.cartData.lineItems.length === 0) {
|
|
1052
813
|
return html `
|
|
1053
814
|
<div class="container ${gClass(['container', 'null-container'])}">
|
|
@@ -1074,11 +835,7 @@ export class CheckoutIndex {
|
|
|
1074
835
|
padding = 0;
|
|
1075
836
|
}
|
|
1076
837
|
const shipmentSupportSet = new Set(vm.cartData.shipment_support);
|
|
1077
|
-
console.log(`shipmentSupportSet==>`, shipmentSupportSet);
|
|
1078
838
|
const shipmentList = this.getShipmentMethod(vm.cartData).filter((dd) => shipmentSupportSet.has(dd.value));
|
|
1079
|
-
console.log(`cartData.shipment_selector=>`, vm.cartData.shipment_selector);
|
|
1080
|
-
console.log(`shipmentSupportSet=>`, shipmentSupportSet);
|
|
1081
|
-
console.log(`shipmentList==>`, shipmentList);
|
|
1082
839
|
const localShip = shipmentSupportSet.has(localStorage.getItem('shipment-select'));
|
|
1083
840
|
if (shipmentList.length === 0) {
|
|
1084
841
|
vm.cartData.user_info.shipment = 'none';
|
|
@@ -1109,12 +866,37 @@ export class CheckoutIndex {
|
|
|
1109
866
|
<div
|
|
1110
867
|
style="padding-top:20px;"
|
|
1111
868
|
class="${gClass('banner-text')} fs-4 mb-3 pt-3 ${gvc.glitter.getUrlParameter('page') === 'checkout'
|
|
1112
|
-
?
|
|
869
|
+
? ''
|
|
1113
870
|
: `d-none`}"
|
|
1114
871
|
>
|
|
1115
872
|
${Language.text(ApiCart.checkoutCart === ApiCart.buyItNow ? 'buy_it_now' : 'your_shopping_cart')}
|
|
1116
873
|
</div>
|
|
1117
|
-
|
|
874
|
+
|
|
875
|
+
${(() => {
|
|
876
|
+
var _a;
|
|
877
|
+
const cartGroupSet = new Set(vm.cartDataList.map(cart => cart.group).flat());
|
|
878
|
+
const filterLogiGroup = vm.logisticsGroup.filter(item => {
|
|
879
|
+
return cartGroupSet.has(item.key);
|
|
880
|
+
});
|
|
881
|
+
if (filterLogiGroup.length < 2 || vm.hasFullLengthCart) {
|
|
882
|
+
return '';
|
|
883
|
+
}
|
|
884
|
+
return html `<div
|
|
885
|
+
class="rounded-3 bg-white w-100 ps-4"
|
|
886
|
+
style="height: 68px; overflow: auto hidden;"
|
|
887
|
+
>
|
|
888
|
+
${ProductModule.tab(filterLogiGroup.map(item => {
|
|
889
|
+
return {
|
|
890
|
+
title: item.name,
|
|
891
|
+
key: item.key,
|
|
892
|
+
};
|
|
893
|
+
}), gvc, (_a = localStorage.getItem('logistics-group')) !== null && _a !== void 0 ? _a : filterLogiGroup[0].key, text => {
|
|
894
|
+
localStorage.setItem('logistics-group', text);
|
|
895
|
+
refreshCartData();
|
|
896
|
+
}, 'justify-content: flex-start;')}
|
|
897
|
+
</div>`;
|
|
898
|
+
})()}
|
|
899
|
+
<div class="rounded-3 bg-white w-100 mt-3">
|
|
1118
900
|
${gvc.bindView({
|
|
1119
901
|
bind: glitter.getUUID(),
|
|
1120
902
|
view: () => {
|
|
@@ -1132,7 +914,7 @@ export class CheckoutIndex {
|
|
|
1132
914
|
return hiddenBadge();
|
|
1133
915
|
}
|
|
1134
916
|
else {
|
|
1135
|
-
return
|
|
917
|
+
return '';
|
|
1136
918
|
}
|
|
1137
919
|
}
|
|
1138
920
|
const title = (item.language_data &&
|
|
@@ -1152,7 +934,7 @@ export class CheckoutIndex {
|
|
|
1152
934
|
});
|
|
1153
935
|
}
|
|
1154
936
|
else {
|
|
1155
|
-
return
|
|
937
|
+
return '';
|
|
1156
938
|
}
|
|
1157
939
|
})();
|
|
1158
940
|
if (vm.cartData.lineItems.length === index + 1) {
|
|
@@ -1246,7 +1028,7 @@ export class CheckoutIndex {
|
|
|
1246
1028
|
refreshCartData();
|
|
1247
1029
|
});
|
|
1248
1030
|
})}"
|
|
1249
|
-
${item.is_gift ? `disabled` :
|
|
1031
|
+
${item.is_gift ? `disabled` : ''}
|
|
1250
1032
|
>
|
|
1251
1033
|
${[
|
|
1252
1034
|
...new Array((() => {
|
|
@@ -1259,7 +1041,7 @@ export class CheckoutIndex {
|
|
|
1259
1041
|
.map((_, index) => {
|
|
1260
1042
|
return html ` <option
|
|
1261
1043
|
value="${index + 1}"
|
|
1262
|
-
${index + 1 === item.count ? `selected` :
|
|
1044
|
+
${index + 1 === item.count ? `selected` : ''}
|
|
1263
1045
|
>
|
|
1264
1046
|
${index + 1}
|
|
1265
1047
|
</option>`;
|
|
@@ -1319,7 +1101,14 @@ export class CheckoutIndex {
|
|
|
1319
1101
|
dd.reBackType !== 'add_on_items');
|
|
1320
1102
|
})
|
|
1321
1103
|
.map((dd) => {
|
|
1322
|
-
return `<div
|
|
1104
|
+
return html `<div
|
|
1105
|
+
class="w-100"
|
|
1106
|
+
style="${document.body.clientWidth < 800
|
|
1107
|
+
? `font-size:12px;`
|
|
1108
|
+
: `font-size:14px;`}"
|
|
1109
|
+
>
|
|
1110
|
+
<i class="fa-solid fa-tickets-perforated me-2"></i>${dd.title}
|
|
1111
|
+
</div>`;
|
|
1323
1112
|
})
|
|
1324
1113
|
.join('<div class="my-1"></div>')}
|
|
1325
1114
|
${(() => {
|
|
@@ -1334,7 +1123,7 @@ export class CheckoutIndex {
|
|
|
1334
1123
|
return `<div class="text-danger">${Language.text('min_p_count').replace('_c_', min)}</div>`;
|
|
1335
1124
|
}
|
|
1336
1125
|
else {
|
|
1337
|
-
return
|
|
1126
|
+
return '';
|
|
1338
1127
|
}
|
|
1339
1128
|
})()}
|
|
1340
1129
|
${(() => {
|
|
@@ -1346,17 +1135,19 @@ export class CheckoutIndex {
|
|
|
1346
1135
|
}
|
|
1347
1136
|
}
|
|
1348
1137
|
if (count > max_qty) {
|
|
1349
|
-
return `<div class="text-danger"
|
|
1138
|
+
return html `<div class="text-danger">
|
|
1139
|
+
${Language.text('max_p_count').replace('_c_', max_qty)}
|
|
1140
|
+
</div>`;
|
|
1350
1141
|
}
|
|
1351
1142
|
else {
|
|
1352
|
-
return
|
|
1143
|
+
return '';
|
|
1353
1144
|
}
|
|
1354
1145
|
})()}
|
|
1355
1146
|
</div>
|
|
1356
1147
|
</div>
|
|
1357
1148
|
`;
|
|
1358
1149
|
})
|
|
1359
|
-
.join(`<div class="border-bottom w-100"></div>`);
|
|
1150
|
+
.join(html `<div class="border-bottom w-100"></div>`);
|
|
1360
1151
|
}
|
|
1361
1152
|
catch (e) {
|
|
1362
1153
|
console.error(`error 1 =>`, e);
|
|
@@ -1365,189 +1156,6 @@ export class CheckoutIndex {
|
|
|
1365
1156
|
},
|
|
1366
1157
|
})}
|
|
1367
1158
|
</div>
|
|
1368
|
-
<!--加購品-->
|
|
1369
|
-
${(() => {
|
|
1370
|
-
let add_on = [];
|
|
1371
|
-
vm.cartData.voucherList.filter((dd) => {
|
|
1372
|
-
if (dd.reBackType === 'add_on_items') {
|
|
1373
|
-
add_on = add_on.concat(dd.add_on_products);
|
|
1374
|
-
}
|
|
1375
|
-
});
|
|
1376
|
-
if (add_on.length) {
|
|
1377
|
-
return gvc.bindView(() => {
|
|
1378
|
-
const id = gvc.glitter.getUUID();
|
|
1379
|
-
return {
|
|
1380
|
-
bind: id,
|
|
1381
|
-
view: () => __awaiter(this, void 0, void 0, function* () {
|
|
1382
|
-
const add_products = yield ApiShop.getProduct({
|
|
1383
|
-
page: 0,
|
|
1384
|
-
limit: 100,
|
|
1385
|
-
productType: 'addProduct',
|
|
1386
|
-
id_list: add_on.join(','),
|
|
1387
|
-
});
|
|
1388
|
-
if (!add_products.response.data.length) {
|
|
1389
|
-
return ``;
|
|
1390
|
-
}
|
|
1391
|
-
return html `
|
|
1392
|
-
<div class="rounded-3 mt-3 p-3 bg-white">
|
|
1393
|
-
<span class="${gClass('banner-text')}"
|
|
1394
|
-
>${Language.text('additional_purchase_items')}</span
|
|
1395
|
-
>
|
|
1396
|
-
<div
|
|
1397
|
-
class="d-flex align-items-center w-100"
|
|
1398
|
-
style="overflow-x:auto;gap:10px;"
|
|
1399
|
-
>
|
|
1400
|
-
${add_products.response.data
|
|
1401
|
-
.map((dd) => {
|
|
1402
|
-
return html ` <div
|
|
1403
|
-
class="d-flex py-3 align-items-center"
|
|
1404
|
-
style="gap:10px;"
|
|
1405
|
-
>
|
|
1406
|
-
<div
|
|
1407
|
-
class="img-fluid img-106px"
|
|
1408
|
-
style="background-image: url('${dd.content.preview_image[0]}');"
|
|
1409
|
-
></div>
|
|
1410
|
-
<div class="d-flex flex-column" style="gap:5px;">
|
|
1411
|
-
<div class="${gClass('banner-text')} banner-font-15">
|
|
1412
|
-
${dd.content.title}
|
|
1413
|
-
</div>
|
|
1414
|
-
<div class="ntd-font-14">
|
|
1415
|
-
${Currency.convertCurrencyText(dd.content.min_price)}
|
|
1416
|
-
</div>
|
|
1417
|
-
<button
|
|
1418
|
-
class="${gClass('button-bgr')} mb-0 mt-2"
|
|
1419
|
-
onclick="${gvc.event(() => {
|
|
1420
|
-
var _a;
|
|
1421
|
-
const titleFontColor = (_a = glitter.share.globalValue['theme_color.0.title']) !== null && _a !== void 0 ? _a : '#333333';
|
|
1422
|
-
gvc.glitter.innerDialog((gvc) => {
|
|
1423
|
-
var _a, _b;
|
|
1424
|
-
return html ` <div
|
|
1425
|
-
class=" bg-white shadow ${document.body.clientWidth >
|
|
1426
|
-
768
|
|
1427
|
-
? `rounded-3`
|
|
1428
|
-
: ` position-absolute bottom-0`}"
|
|
1429
|
-
style=" ${document.body.clientWidth > 768
|
|
1430
|
-
? `min-width: 400px; width: 1000px;max-height:calc(100% - 150px);overflow-y: auto;`
|
|
1431
|
-
: 'width:calc(100vw);height:100%;'}"
|
|
1432
|
-
>
|
|
1433
|
-
<div
|
|
1434
|
-
class="bg-white shadow ${document.body
|
|
1435
|
-
.clientWidth > 768
|
|
1436
|
-
? `rounded-3`
|
|
1437
|
-
: `h-100`}"
|
|
1438
|
-
style="width: 100%; position: relative;${document
|
|
1439
|
-
.body.clientWidth > 768
|
|
1440
|
-
? ``
|
|
1441
|
-
: `overflow-y: auto;`}"
|
|
1442
|
-
>
|
|
1443
|
-
<div
|
|
1444
|
-
class="w-100 d-flex align-items-center p-3 border-bottom"
|
|
1445
|
-
style="position: sticky; top: 0; background: #fff;z-index:12;"
|
|
1446
|
-
>
|
|
1447
|
-
<div
|
|
1448
|
-
class="fw-bold fs-5"
|
|
1449
|
-
style="color:${titleFontColor}; white-space: nowrap;text-overflow: ellipsis;max-width: calc(100% - 40px); overflow: hidden;"
|
|
1450
|
-
>
|
|
1451
|
-
${dd.content.title}
|
|
1452
|
-
</div>
|
|
1453
|
-
<div class="flex-fill"></div>
|
|
1454
|
-
<i
|
|
1455
|
-
class="fa-regular fa-circle-xmark fs-5 text-dark"
|
|
1456
|
-
style="cursor: pointer"
|
|
1457
|
-
onclick="${gvc.event(() => {
|
|
1458
|
-
gvc.closeDialog();
|
|
1459
|
-
})}"
|
|
1460
|
-
></i>
|
|
1461
|
-
</div>
|
|
1462
|
-
<div
|
|
1463
|
-
class="c_dialog_main"
|
|
1464
|
-
style="gap: 24px; max-height: calc(100% - 100px); ${document
|
|
1465
|
-
.body.clientWidth < 800
|
|
1466
|
-
? `padding: 12px 20px;`
|
|
1467
|
-
: `padding: 30px;`}"
|
|
1468
|
-
>
|
|
1469
|
-
${PdClass.selectSpec({
|
|
1470
|
-
gvc,
|
|
1471
|
-
titleFontColor: (_a = glitter.share.globalValue['theme_color.0.title']) !== null && _a !== void 0 ? _a : '#333333',
|
|
1472
|
-
prod: dd.content,
|
|
1473
|
-
vm: {
|
|
1474
|
-
specs: dd.content.specs.map((spec) => {
|
|
1475
|
-
return spec.option[0].title;
|
|
1476
|
-
}),
|
|
1477
|
-
quantity: '1',
|
|
1478
|
-
wishStatus: ((_b = glitter.share.wishList) !== null && _b !== void 0 ? _b : []).some((item) => {
|
|
1479
|
-
return item.id === dd.id;
|
|
1480
|
-
}),
|
|
1481
|
-
},
|
|
1482
|
-
preview: true,
|
|
1483
|
-
with_qty: false,
|
|
1484
|
-
is_gift: true,
|
|
1485
|
-
callback: () => {
|
|
1486
|
-
gvc.closeDialog();
|
|
1487
|
-
console.log(`vm.cartData=>`, vm.cartData);
|
|
1488
|
-
let find = vm.cartData.lineItems.find((d1) => {
|
|
1489
|
-
return dd.add_on_products.find((d2) => {
|
|
1490
|
-
return d2.id === d1.id;
|
|
1491
|
-
});
|
|
1492
|
-
});
|
|
1493
|
-
console.log(`find=>`, find);
|
|
1494
|
-
if (find) {
|
|
1495
|
-
apiCart.setCart(cartItem => {
|
|
1496
|
-
cartItem.line_items.map(dd => {
|
|
1497
|
-
if (dd.id === find.id) {
|
|
1498
|
-
dd.count--;
|
|
1499
|
-
}
|
|
1500
|
-
});
|
|
1501
|
-
cartItem.line_items =
|
|
1502
|
-
cartItem.line_items.filter(dd => {
|
|
1503
|
-
return dd.count > 0;
|
|
1504
|
-
});
|
|
1505
|
-
refreshCartData();
|
|
1506
|
-
gvc.closeDialog();
|
|
1507
|
-
});
|
|
1508
|
-
}
|
|
1509
|
-
else {
|
|
1510
|
-
refreshCartData();
|
|
1511
|
-
gvc.closeDialog();
|
|
1512
|
-
}
|
|
1513
|
-
},
|
|
1514
|
-
})}
|
|
1515
|
-
<div
|
|
1516
|
-
class="d-sm-none"
|
|
1517
|
-
style="height:100px;"
|
|
1518
|
-
></div>
|
|
1519
|
-
</div>
|
|
1520
|
-
</div>
|
|
1521
|
-
</div>`;
|
|
1522
|
-
}, Tool.randomString(7), {
|
|
1523
|
-
animation: document.body.clientWidth < 768
|
|
1524
|
-
? Animation.popup
|
|
1525
|
-
: Animation.fade,
|
|
1526
|
-
});
|
|
1527
|
-
})}"
|
|
1528
|
-
>
|
|
1529
|
-
<span class="${gClass('button-text')}"
|
|
1530
|
-
>${Language.text('add_to_cart')}</span
|
|
1531
|
-
>
|
|
1532
|
-
</button>
|
|
1533
|
-
</div>
|
|
1534
|
-
</div>`;
|
|
1535
|
-
})
|
|
1536
|
-
.join('')}
|
|
1537
|
-
</div>
|
|
1538
|
-
</div>
|
|
1539
|
-
`;
|
|
1540
|
-
}),
|
|
1541
|
-
divCreate: {
|
|
1542
|
-
class: `w-100`,
|
|
1543
|
-
},
|
|
1544
|
-
};
|
|
1545
|
-
});
|
|
1546
|
-
}
|
|
1547
|
-
else {
|
|
1548
|
-
return '';
|
|
1549
|
-
}
|
|
1550
|
-
})()}
|
|
1551
1159
|
<!--贈品-->
|
|
1552
1160
|
${(() => {
|
|
1553
1161
|
let already_add = vm.cartData.lineItems.filter((dd) => {
|
|
@@ -1570,6 +1178,7 @@ export class CheckoutIndex {
|
|
|
1570
1178
|
<span class="${gClass('banner-text')}">${dd.title}</span>
|
|
1571
1179
|
<div class="d-flex align-items-center w-100" style="overflow-x:auto;gap:10px;">
|
|
1572
1180
|
${dd.add_on_products
|
|
1181
|
+
.filter(Boolean)
|
|
1573
1182
|
.map((pd) => {
|
|
1574
1183
|
try {
|
|
1575
1184
|
return html ` <div
|
|
@@ -1580,20 +1189,27 @@ export class CheckoutIndex {
|
|
|
1580
1189
|
class="img-fluid img-106px"
|
|
1581
1190
|
style="background-image: url('${pd.preview_image[0]}');"
|
|
1582
1191
|
></div>
|
|
1583
|
-
<div class="d-flex flex-column" style="
|
|
1192
|
+
<div class="d-flex flex-column" style="width: 130px;">
|
|
1584
1193
|
<div class="${gClass('banner-text')} banner-font-15">
|
|
1585
1194
|
${pd.title}
|
|
1586
1195
|
</div>
|
|
1587
|
-
<div class="text-
|
|
1588
|
-
${Currency.convertCurrencyText(
|
|
1196
|
+
<div class="text-danger ntd-font-14">
|
|
1197
|
+
${Currency.convertCurrencyText(0)}
|
|
1198
|
+
</div>
|
|
1199
|
+
<div
|
|
1200
|
+
style="text-decoration: line-through; font-size: 12px; height: 20px;"
|
|
1201
|
+
>
|
|
1202
|
+
${pd.min_price > 0
|
|
1203
|
+
? Currency.convertCurrencyText(pd.min_price)
|
|
1204
|
+
: ''}
|
|
1589
1205
|
</div>
|
|
1590
1206
|
<button
|
|
1591
1207
|
class="${gClass('button-bgr')} mb-0 mt-2"
|
|
1592
1208
|
style="${isSelected
|
|
1593
1209
|
? isSelected.id === pd.id
|
|
1594
1210
|
? `background: gray !important;`
|
|
1595
|
-
:
|
|
1596
|
-
:
|
|
1211
|
+
: ''
|
|
1212
|
+
: ''}"
|
|
1597
1213
|
onclick="${gvc.event(() => {
|
|
1598
1214
|
var _a;
|
|
1599
1215
|
if (isSelected && isSelected.id === pd.id) {
|
|
@@ -1617,7 +1233,7 @@ export class CheckoutIndex {
|
|
|
1617
1233
|
: `h-100`}"
|
|
1618
1234
|
style="width: 100%; position: relative;${document.body
|
|
1619
1235
|
.clientWidth > 768
|
|
1620
|
-
?
|
|
1236
|
+
? ''
|
|
1621
1237
|
: `overflow-y: auto;`}"
|
|
1622
1238
|
>
|
|
1623
1239
|
<div
|
|
@@ -1663,13 +1279,11 @@ export class CheckoutIndex {
|
|
|
1663
1279
|
with_qty: false,
|
|
1664
1280
|
is_gift: true,
|
|
1665
1281
|
callback: () => {
|
|
1666
|
-
console.log(`vm.cartData=>`, vm.cartData);
|
|
1667
1282
|
let find = vm.cartData.lineItems.find((d1) => {
|
|
1668
1283
|
return dd.add_on_products.find((d2) => {
|
|
1669
1284
|
return d2.id === d1.id;
|
|
1670
1285
|
});
|
|
1671
1286
|
});
|
|
1672
|
-
console.log(`find=>`, find);
|
|
1673
1287
|
if (find) {
|
|
1674
1288
|
apiCart.setCart(cartItem => {
|
|
1675
1289
|
cartItem.line_items.map(dd => {
|
|
@@ -1677,52 +1291,233 @@ export class CheckoutIndex {
|
|
|
1677
1291
|
dd.count--;
|
|
1678
1292
|
}
|
|
1679
1293
|
});
|
|
1680
|
-
cartItem.line_items =
|
|
1681
|
-
cartItem.line_items.filter(dd => {
|
|
1682
|
-
return dd.count > 0;
|
|
1294
|
+
cartItem.line_items =
|
|
1295
|
+
cartItem.line_items.filter(dd => {
|
|
1296
|
+
return dd.count > 0;
|
|
1297
|
+
});
|
|
1298
|
+
refreshCartData();
|
|
1299
|
+
gvc.closeDialog();
|
|
1300
|
+
});
|
|
1301
|
+
}
|
|
1302
|
+
else {
|
|
1303
|
+
refreshCartData();
|
|
1304
|
+
gvc.closeDialog();
|
|
1305
|
+
}
|
|
1306
|
+
},
|
|
1307
|
+
})}
|
|
1308
|
+
<div class="d-sm-none" style="height:100px;"></div>
|
|
1309
|
+
</div>
|
|
1310
|
+
</div>
|
|
1311
|
+
</div>`;
|
|
1312
|
+
}, Tool.randomString(7), {
|
|
1313
|
+
animation: document.body.clientWidth < 768
|
|
1314
|
+
? Animation.popup
|
|
1315
|
+
: Animation.fade,
|
|
1316
|
+
});
|
|
1317
|
+
})}"
|
|
1318
|
+
>
|
|
1319
|
+
<span class="${gClass('button-text')}"
|
|
1320
|
+
>${isSelected
|
|
1321
|
+
? isSelected.id === pd.id
|
|
1322
|
+
? Language.text('selected')
|
|
1323
|
+
: Language.text('change_gift')
|
|
1324
|
+
: Language.text('select_gift')}</span
|
|
1325
|
+
>
|
|
1326
|
+
</button>
|
|
1327
|
+
</div>
|
|
1328
|
+
</div>`;
|
|
1329
|
+
}
|
|
1330
|
+
catch (e) {
|
|
1331
|
+
console.error(`error 2 =>`, e);
|
|
1332
|
+
}
|
|
1333
|
+
})
|
|
1334
|
+
.join('')}
|
|
1335
|
+
</div>
|
|
1336
|
+
`;
|
|
1337
|
+
})
|
|
1338
|
+
.join('');
|
|
1339
|
+
return giftHtml && `<div class="rounded-3 bg-white p-3 mt-3">${giftHtml}</div>`;
|
|
1340
|
+
})()}
|
|
1341
|
+
<!--加購品-->
|
|
1342
|
+
${(() => {
|
|
1343
|
+
let add_on = [];
|
|
1344
|
+
vm.cartData.voucherList.filter((dd) => {
|
|
1345
|
+
if (dd.reBackType === 'add_on_items') {
|
|
1346
|
+
add_on = add_on.concat(dd.add_on_products);
|
|
1347
|
+
}
|
|
1348
|
+
});
|
|
1349
|
+
if (add_on.length) {
|
|
1350
|
+
return gvc.bindView(() => {
|
|
1351
|
+
const id = gvc.glitter.getUUID();
|
|
1352
|
+
return {
|
|
1353
|
+
bind: id,
|
|
1354
|
+
view: () => __awaiter(this, void 0, void 0, function* () {
|
|
1355
|
+
const add_products = yield ApiShop.getProduct({
|
|
1356
|
+
page: 0,
|
|
1357
|
+
limit: 100,
|
|
1358
|
+
productType: 'addProduct',
|
|
1359
|
+
id_list: add_on.join(','),
|
|
1360
|
+
});
|
|
1361
|
+
if (!add_products.response.data.length) {
|
|
1362
|
+
return '';
|
|
1363
|
+
}
|
|
1364
|
+
return html `
|
|
1365
|
+
<div class="rounded-3 mt-3 p-3 bg-white">
|
|
1366
|
+
<span class="${gClass('banner-text')}"
|
|
1367
|
+
>${Language.text('additional_purchase_items')}</span
|
|
1368
|
+
>
|
|
1369
|
+
<div
|
|
1370
|
+
class="d-flex align-items-center w-100"
|
|
1371
|
+
style="overflow-x:auto;gap:10px;"
|
|
1372
|
+
>
|
|
1373
|
+
${add_products.response.data
|
|
1374
|
+
.map((dd) => {
|
|
1375
|
+
return html ` <div
|
|
1376
|
+
class="d-flex py-3 align-items-center"
|
|
1377
|
+
style="gap:10px;"
|
|
1378
|
+
>
|
|
1379
|
+
<div
|
|
1380
|
+
class="img-fluid img-106px"
|
|
1381
|
+
style="background-image: url('${dd.content.preview_image[0]}');"
|
|
1382
|
+
></div>
|
|
1383
|
+
<div class="d-flex flex-column" style="gap:5px;">
|
|
1384
|
+
<div class="${gClass('banner-text')} banner-font-15">
|
|
1385
|
+
${dd.content.title}
|
|
1386
|
+
</div>
|
|
1387
|
+
<div class="ntd-font-14">
|
|
1388
|
+
${Currency.convertCurrencyText(dd.content.min_price)}
|
|
1389
|
+
</div>
|
|
1390
|
+
<button
|
|
1391
|
+
class="${gClass('button-bgr')} mb-0 mt-2"
|
|
1392
|
+
onclick="${gvc.event(() => {
|
|
1393
|
+
var _a;
|
|
1394
|
+
const titleFontColor = (_a = glitter.share.globalValue['theme_color.0.title']) !== null && _a !== void 0 ? _a : '#333333';
|
|
1395
|
+
gvc.glitter.innerDialog((gvc) => {
|
|
1396
|
+
var _a, _b;
|
|
1397
|
+
return html ` <div
|
|
1398
|
+
class=" bg-white shadow ${document.body.clientWidth >
|
|
1399
|
+
768
|
|
1400
|
+
? `rounded-3`
|
|
1401
|
+
: ` position-absolute bottom-0`}"
|
|
1402
|
+
style=" ${document.body.clientWidth > 768
|
|
1403
|
+
? `min-width: 400px; width: 1000px;max-height:calc(100% - 150px);overflow-y: auto;`
|
|
1404
|
+
: 'width:calc(100vw);height:100%;'}"
|
|
1405
|
+
>
|
|
1406
|
+
<div
|
|
1407
|
+
class="bg-white shadow ${document.body
|
|
1408
|
+
.clientWidth > 768
|
|
1409
|
+
? `rounded-3`
|
|
1410
|
+
: `h-100`}"
|
|
1411
|
+
style="width: 100%; position: relative;${document
|
|
1412
|
+
.body.clientWidth > 768
|
|
1413
|
+
? ''
|
|
1414
|
+
: `overflow-y: auto;`}"
|
|
1415
|
+
>
|
|
1416
|
+
<div
|
|
1417
|
+
class="w-100 d-flex align-items-center p-3 border-bottom"
|
|
1418
|
+
style="position: sticky; top: 0; background: #fff;z-index:12;"
|
|
1419
|
+
>
|
|
1420
|
+
<div
|
|
1421
|
+
class="fw-bold fs-5"
|
|
1422
|
+
style="color:${titleFontColor}; white-space: nowrap;text-overflow: ellipsis;max-width: calc(100% - 40px); overflow: hidden;"
|
|
1423
|
+
>
|
|
1424
|
+
${dd.content.title}
|
|
1425
|
+
</div>
|
|
1426
|
+
<div class="flex-fill"></div>
|
|
1427
|
+
<i
|
|
1428
|
+
class="fa-regular fa-circle-xmark fs-5 text-dark"
|
|
1429
|
+
style="cursor: pointer"
|
|
1430
|
+
onclick="${gvc.event(() => {
|
|
1431
|
+
gvc.closeDialog();
|
|
1432
|
+
})}"
|
|
1433
|
+
></i>
|
|
1434
|
+
</div>
|
|
1435
|
+
<div
|
|
1436
|
+
class="c_dialog_main"
|
|
1437
|
+
style="gap: 24px; max-height: calc(100% - 100px); ${document
|
|
1438
|
+
.body.clientWidth < 800
|
|
1439
|
+
? `padding: 12px 20px;`
|
|
1440
|
+
: `padding: 30px;`}"
|
|
1441
|
+
>
|
|
1442
|
+
${PdClass.selectSpec({
|
|
1443
|
+
gvc,
|
|
1444
|
+
titleFontColor: (_a = glitter.share.globalValue['theme_color.0.title']) !== null && _a !== void 0 ? _a : '#333333',
|
|
1445
|
+
prod: dd.content,
|
|
1446
|
+
vm: {
|
|
1447
|
+
specs: dd.content.specs.map((spec) => {
|
|
1448
|
+
return spec.option[0].title;
|
|
1449
|
+
}),
|
|
1450
|
+
quantity: '1',
|
|
1451
|
+
wishStatus: ((_b = glitter.share.wishList) !== null && _b !== void 0 ? _b : []).some((item) => {
|
|
1452
|
+
return item.id === dd.id;
|
|
1453
|
+
}),
|
|
1454
|
+
},
|
|
1455
|
+
preview: true,
|
|
1456
|
+
with_qty: false,
|
|
1457
|
+
is_gift: true,
|
|
1458
|
+
callback: () => {
|
|
1459
|
+
gvc.closeDialog();
|
|
1460
|
+
let find = vm.cartData.lineItems.find((d1) => {
|
|
1461
|
+
return dd.add_on_products.find((d2) => {
|
|
1462
|
+
return d2.id === d1.id;
|
|
1463
|
+
});
|
|
1464
|
+
});
|
|
1465
|
+
if (find) {
|
|
1466
|
+
apiCart.setCart(cartItem => {
|
|
1467
|
+
cartItem.line_items.map(dd => {
|
|
1468
|
+
if (dd.id === find.id) {
|
|
1469
|
+
dd.count--;
|
|
1470
|
+
}
|
|
1471
|
+
});
|
|
1472
|
+
cartItem.line_items =
|
|
1473
|
+
cartItem.line_items.filter(dd => {
|
|
1474
|
+
return dd.count > 0;
|
|
1475
|
+
});
|
|
1476
|
+
refreshCartData();
|
|
1477
|
+
gvc.closeDialog();
|
|
1683
1478
|
});
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1479
|
+
}
|
|
1480
|
+
else {
|
|
1481
|
+
refreshCartData();
|
|
1482
|
+
gvc.closeDialog();
|
|
1483
|
+
}
|
|
1484
|
+
},
|
|
1485
|
+
})}
|
|
1486
|
+
<div
|
|
1487
|
+
class="d-sm-none"
|
|
1488
|
+
style="height:100px;"
|
|
1489
|
+
></div>
|
|
1490
|
+
</div>
|
|
1491
|
+
</div>
|
|
1492
|
+
</div>`;
|
|
1493
|
+
}, Tool.randomString(7), {
|
|
1494
|
+
animation: document.body.clientWidth < 768
|
|
1495
|
+
? Animation.popup
|
|
1496
|
+
: Animation.fade,
|
|
1497
|
+
});
|
|
1498
|
+
})}"
|
|
1499
|
+
>
|
|
1500
|
+
<span class="${gClass('button-text')}"
|
|
1501
|
+
>${Language.text('add_to_cart')}</span
|
|
1502
|
+
>
|
|
1503
|
+
</button>
|
|
1504
|
+
</div>
|
|
1505
|
+
</div>`;
|
|
1506
|
+
})
|
|
1507
|
+
.join('')}
|
|
1508
|
+
</div>
|
|
1509
|
+
</div>
|
|
1510
|
+
`;
|
|
1511
|
+
}),
|
|
1512
|
+
divCreate: {
|
|
1513
|
+
class: `w-100`,
|
|
1514
|
+
},
|
|
1515
|
+
};
|
|
1516
|
+
});
|
|
1517
|
+
}
|
|
1518
|
+
else {
|
|
1519
|
+
return '';
|
|
1520
|
+
}
|
|
1726
1521
|
})()}
|
|
1727
1522
|
<!--配送資訊-->
|
|
1728
1523
|
<div class="rounded-3 bg-white w-100 p-1 mt-3">
|
|
@@ -1752,7 +1547,7 @@ export class CheckoutIndex {
|
|
|
1752
1547
|
value="${dd.value}"
|
|
1753
1548
|
${localStorage.getItem('checkout-payment') === dd.value
|
|
1754
1549
|
? `selected`
|
|
1755
|
-
:
|
|
1550
|
+
: ''}
|
|
1756
1551
|
>
|
|
1757
1552
|
${Language.getLanguageCustomText(dd.name) ||
|
|
1758
1553
|
Language.text(dd.value)}
|
|
@@ -1793,14 +1588,14 @@ export class CheckoutIndex {
|
|
|
1793
1588
|
? shipmentList
|
|
1794
1589
|
.map((dd) => {
|
|
1795
1590
|
return html ` <option
|
|
1796
|
-
|
|
1797
|
-
|
|
1591
|
+
value="${dd.value}"
|
|
1592
|
+
${vm.cartData.user_info.shipment === dd.value
|
|
1798
1593
|
? `selected`
|
|
1799
|
-
:
|
|
1800
|
-
|
|
1801
|
-
|
|
1594
|
+
: ''}
|
|
1595
|
+
>
|
|
1596
|
+
${Language.text(`ship_${dd.value}`) ||
|
|
1802
1597
|
Language.getLanguageCustomText(dd.name)}
|
|
1803
|
-
|
|
1598
|
+
</option>`;
|
|
1804
1599
|
})
|
|
1805
1600
|
.join('')
|
|
1806
1601
|
: html ` <option selected>(${Language.text('disable_ship')})</option>`}
|
|
@@ -1817,11 +1612,11 @@ export class CheckoutIndex {
|
|
|
1817
1612
|
const log_config = (yield ApiUser.getPublicConfig('shipment_config_' + vm.cartData.user_info.shipment, 'manager')).response.value;
|
|
1818
1613
|
if (log_config.content) {
|
|
1819
1614
|
return html ` <label class="${gClass('label')}"
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1615
|
+
>${Language.text('shipping_instructions')}</label
|
|
1616
|
+
>
|
|
1617
|
+
<div class="border rounded-3 p-2">${log_config.content}</div>`;
|
|
1823
1618
|
}
|
|
1824
|
-
return
|
|
1619
|
+
return '';
|
|
1825
1620
|
}),
|
|
1826
1621
|
};
|
|
1827
1622
|
})}
|
|
@@ -1861,13 +1656,13 @@ export class CheckoutIndex {
|
|
|
1861
1656
|
view: () => {
|
|
1862
1657
|
select_id = gvc.glitter.getUUID();
|
|
1863
1658
|
return html `<label
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1659
|
+
class="${gClass('label')} w-100 d-flex align-items-center"
|
|
1660
|
+
>${Language.text('shipping_address')}
|
|
1661
|
+
<div class="flex-fill"></div>
|
|
1662
|
+
<div
|
|
1663
|
+
class="fs-sm fw-500 ${!GlobalUser.token ? `d-none` : ''}"
|
|
1664
|
+
style="cursor: pointer; color: #3366bb;"
|
|
1665
|
+
onclick="${gvc.event(() => {
|
|
1871
1666
|
ApiUser.getUserData(GlobalUser.token, 'me').then(res => {
|
|
1872
1667
|
vm.cartData.user_info.address =
|
|
1873
1668
|
res.response.userData.consignee_address;
|
|
@@ -1875,32 +1670,32 @@ export class CheckoutIndex {
|
|
|
1875
1670
|
gvc.notifyDataChange(id);
|
|
1876
1671
|
});
|
|
1877
1672
|
})}"
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1673
|
+
>
|
|
1674
|
+
${Language.text('quick_input')}
|
|
1675
|
+
</div>
|
|
1676
|
+
</label>
|
|
1677
|
+
<div class="row">
|
|
1678
|
+
<div class="col-12 mb-3">
|
|
1679
|
+
<div
|
|
1680
|
+
role="tw-city-selector"
|
|
1681
|
+
id="select_id_${id}"
|
|
1682
|
+
class="w-100 city-selector d-flex d_${select_id}"
|
|
1683
|
+
style="gap:15px;"
|
|
1684
|
+
></div>
|
|
1685
|
+
</div>
|
|
1686
|
+
<div class="col-12">
|
|
1687
|
+
<input
|
|
1688
|
+
class="${gClass('input')}"
|
|
1689
|
+
type="address"
|
|
1690
|
+
placeholder="${Language.text('please_enter_street_location')}"
|
|
1691
|
+
value="${vm.cartData.user_info.address || ''}"
|
|
1692
|
+
onchange="${gvc.event(e => {
|
|
1898
1693
|
vm.cartData.user_info.address = e.value;
|
|
1899
1694
|
this.storeLocalData(vm.cartData);
|
|
1900
1695
|
})}"
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1696
|
+
/>
|
|
1697
|
+
</div>
|
|
1698
|
+
</div> `;
|
|
1904
1699
|
},
|
|
1905
1700
|
divCreate: {
|
|
1906
1701
|
class: `col-12 mb-2`,
|
|
@@ -1919,14 +1714,12 @@ export class CheckoutIndex {
|
|
|
1919
1714
|
clearInterval(interVal);
|
|
1920
1715
|
document.querySelector(`#select_id_${id} .county`).addEventListener('change', (event) => {
|
|
1921
1716
|
const selectedValue = event.target.value;
|
|
1922
|
-
console.log(`選中的值是: ${selectedValue}`);
|
|
1923
1717
|
vm.cartData.user_info.city = selectedValue;
|
|
1924
1718
|
vm.cartData.user_info.area = undefined;
|
|
1925
1719
|
this.storeLocalData(vm.cartData);
|
|
1926
1720
|
});
|
|
1927
1721
|
document.querySelector(`#select_id_${id} .district`).addEventListener('change', (event) => {
|
|
1928
1722
|
const selectedValue = event.target.value;
|
|
1929
|
-
console.log(`選中的值是: ${selectedValue}`);
|
|
1930
1723
|
vm.cartData.user_info.area = selectedValue;
|
|
1931
1724
|
this.storeLocalData(vm.cartData);
|
|
1932
1725
|
});
|
|
@@ -1943,18 +1736,18 @@ export class CheckoutIndex {
|
|
|
1943
1736
|
},
|
|
1944
1737
|
};
|
|
1945
1738
|
})
|
|
1946
|
-
:
|
|
1739
|
+
: ''}
|
|
1947
1740
|
<!-- 選取超商 -->
|
|
1948
1741
|
${ShipmentConfig.supermarketList.includes(vm.cartData.user_info.shipment)
|
|
1949
1742
|
? html ` <div class="col-12">
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1743
|
+
<button
|
|
1744
|
+
class="${gClass('button-bgr')}"
|
|
1745
|
+
onclick="${gvc.event(() => {
|
|
1953
1746
|
ApiDelivery.storeMaps({
|
|
1954
1747
|
returnURL: (() => {
|
|
1955
1748
|
if (ApplicationConfig.device_type === 'ios') {
|
|
1956
1749
|
const url = new URL(location.href);
|
|
1957
|
-
url.searchParams.set(
|
|
1750
|
+
url.searchParams.set('select_map_finish', 'true');
|
|
1958
1751
|
return url.href;
|
|
1959
1752
|
}
|
|
1960
1753
|
else {
|
|
@@ -1975,9 +1768,9 @@ export class CheckoutIndex {
|
|
|
1975
1768
|
}
|
|
1976
1769
|
}));
|
|
1977
1770
|
})}"
|
|
1978
|
-
|
|
1771
|
+
>
|
|
1979
1772
|
<span class="${gClass('button-text')}"
|
|
1980
|
-
|
|
1773
|
+
>${(() => {
|
|
1981
1774
|
let cvs = glitter.getUrlParameter('CVSStoreName') || '';
|
|
1982
1775
|
if (decodeURIComponent(cvs)) {
|
|
1983
1776
|
return `${decodeURIComponent(cvs)} 『 ${Language.text('click_to_reselct_store')} 』`;
|
|
@@ -1987,8 +1780,8 @@ export class CheckoutIndex {
|
|
|
1987
1780
|
}
|
|
1988
1781
|
})()}</span
|
|
1989
1782
|
>
|
|
1990
|
-
|
|
1991
|
-
|
|
1783
|
+
</button>
|
|
1784
|
+
</div>`
|
|
1992
1785
|
: ''}
|
|
1993
1786
|
${(() => {
|
|
1994
1787
|
var _a;
|
|
@@ -2005,7 +1798,7 @@ export class CheckoutIndex {
|
|
|
2005
1798
|
})()
|
|
2006
1799
|
? [
|
|
2007
1800
|
html `<label class="${gClass('label')}">${Language.text('country')}</label>
|
|
2008
|
-
|
|
1801
|
+
${gvc.bindView(() => {
|
|
2009
1802
|
const id = gvc.glitter.getUUID();
|
|
2010
1803
|
return {
|
|
2011
1804
|
bind: id,
|
|
@@ -2030,90 +1823,89 @@ export class CheckoutIndex {
|
|
|
2030
1823
|
});
|
|
2031
1824
|
});
|
|
2032
1825
|
return html `<select
|
|
2033
|
-
|
|
2034
|
-
|
|
1826
|
+
class="w-100 ${gClass('select')}"
|
|
1827
|
+
onchange="${gvc.event((e, event) => {
|
|
2035
1828
|
vm.cartData.user_info.country = e.value;
|
|
2036
1829
|
this.storeLocalData(vm.cartData);
|
|
2037
1830
|
refreshCartData();
|
|
2038
1831
|
})}"
|
|
2039
|
-
|
|
2040
|
-
|
|
1832
|
+
>
|
|
1833
|
+
${(() => {
|
|
2041
1834
|
let map = country_select.map((dd) => {
|
|
2042
1835
|
return html `
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
1836
|
+
<option
|
|
1837
|
+
value="${dd.countryCode}"
|
|
1838
|
+
${vm.cartData.user_info.country === dd.countryCode
|
|
2046
1839
|
? `selected`
|
|
2047
|
-
:
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
1840
|
+
: ''}
|
|
1841
|
+
>
|
|
1842
|
+
${dd.countryName}
|
|
1843
|
+
</option>
|
|
1844
|
+
`;
|
|
2052
1845
|
});
|
|
2053
1846
|
if (!country_select.find((dd) => {
|
|
2054
1847
|
return dd.countryCode === vm.cartData.user_info.country;
|
|
2055
1848
|
})) {
|
|
2056
1849
|
delete vm.cartData.user_info.country;
|
|
2057
1850
|
map.push(html ` <option class="d-none" selected>
|
|
2058
|
-
|
|
2059
|
-
|
|
1851
|
+
${Language.text('select_country')}
|
|
1852
|
+
</option>`);
|
|
2060
1853
|
}
|
|
2061
1854
|
return map.join('');
|
|
2062
1855
|
})()}
|
|
2063
|
-
|
|
1856
|
+
</select>`;
|
|
2064
1857
|
}),
|
|
2065
|
-
divCreate: {},
|
|
2066
1858
|
};
|
|
2067
1859
|
})}`,
|
|
2068
1860
|
html ` <label class="${gClass('label')}"
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
1861
|
+
>${Language.text('shipping_address')}</label
|
|
1862
|
+
>
|
|
1863
|
+
<input
|
|
1864
|
+
class="${gClass('input')}"
|
|
1865
|
+
type="address"
|
|
1866
|
+
placeholder="${Language.text('please_enter_delivery_address')}"
|
|
1867
|
+
value="${vm.cartData.user_info.address || ''}"
|
|
1868
|
+
onchange="${gvc.event(e => {
|
|
2077
1869
|
vm.cartData.user_info.address = e.value;
|
|
2078
1870
|
this.storeLocalData(vm.cartData);
|
|
2079
1871
|
})}"
|
|
2080
|
-
|
|
1872
|
+
/>`,
|
|
2081
1873
|
html ` <label class="${gClass('label')}">${Language.text('city')}</label>
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
1874
|
+
<input
|
|
1875
|
+
class="${gClass('input')}"
|
|
1876
|
+
type="city"
|
|
1877
|
+
placeholder="${Language.text('city')}"
|
|
1878
|
+
value="${vm.cartData.user_info.city || ''}"
|
|
1879
|
+
onchange="${gvc.event(e => {
|
|
2088
1880
|
vm.cartData.user_info.city = e.value;
|
|
2089
1881
|
this.storeLocalData(vm.cartData);
|
|
2090
1882
|
})}"
|
|
2091
|
-
|
|
1883
|
+
/>`,
|
|
2092
1884
|
html ` <label class="${gClass('label')}">${Language.text('state')}</label>
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
1885
|
+
<input
|
|
1886
|
+
class="${gClass('input')}"
|
|
1887
|
+
class="${gClass('input')}"
|
|
1888
|
+
type="state"
|
|
1889
|
+
placeholder="${Language.text('state')}"
|
|
1890
|
+
value="${vm.cartData.user_info.state || ''}"
|
|
1891
|
+
onchange="${gvc.event(e => {
|
|
2100
1892
|
vm.cartData.user_info.state = e.value;
|
|
2101
1893
|
this.storeLocalData(vm.cartData);
|
|
2102
1894
|
})}"
|
|
2103
|
-
|
|
1895
|
+
/>`,
|
|
2104
1896
|
html ` <label class="${gClass('label')}"
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
1897
|
+
>${Language.text('postal_code')}</label
|
|
1898
|
+
>
|
|
1899
|
+
<input
|
|
1900
|
+
class="${gClass('input')}"
|
|
1901
|
+
type=""
|
|
1902
|
+
placeholder="${Language.text('postal_code')}"
|
|
1903
|
+
value="${vm.cartData.user_info.postal_code || ''}"
|
|
1904
|
+
onchange="${gvc.event(e => {
|
|
2113
1905
|
vm.cartData.user_info.postal_code = e.value;
|
|
2114
1906
|
this.storeLocalData(vm.cartData);
|
|
2115
1907
|
})}"
|
|
2116
|
-
|
|
1908
|
+
/>`,
|
|
2117
1909
|
]
|
|
2118
1910
|
.map(dd => {
|
|
2119
1911
|
return html ` <div class="col-12 col-md-6 mb-2">${dd}</div>`;
|
|
@@ -2148,7 +1940,7 @@ export class CheckoutIndex {
|
|
|
2148
1940
|
}
|
|
2149
1941
|
catch (e) {
|
|
2150
1942
|
console.error(`error 3 =>`, e);
|
|
2151
|
-
return
|
|
1943
|
+
return '';
|
|
2152
1944
|
}
|
|
2153
1945
|
})()}
|
|
2154
1946
|
</div>
|
|
@@ -2160,11 +1952,10 @@ export class CheckoutIndex {
|
|
|
2160
1952
|
${Language.text('customer_info')}
|
|
2161
1953
|
<div class="flex-fill"></div>
|
|
2162
1954
|
<div
|
|
2163
|
-
class="fs-sm fw-500 ${!GlobalUser.token ? `d-none` :
|
|
1955
|
+
class="fs-sm fw-500 ${!GlobalUser.token ? `d-none` : ''}"
|
|
2164
1956
|
style="cursor: pointer; color: #3366bb;"
|
|
2165
1957
|
onclick="${gvc.event(() => {
|
|
2166
1958
|
ApiUser.getUserData(GlobalUser.token, 'me').then(res => {
|
|
2167
|
-
console.log(`res.response.userData=>`, res.response.userData);
|
|
2168
1959
|
['name', 'phone', 'email'].map(dd => {
|
|
2169
1960
|
vm.cartData.customer_info[dd] =
|
|
2170
1961
|
res.response.userData[dd] || vm.cartData.customer_info[dd];
|
|
@@ -2303,11 +2094,10 @@ export class CheckoutIndex {
|
|
|
2303
2094
|
${Language.text('recipient_info')}
|
|
2304
2095
|
<div class="flex-fill"></div>
|
|
2305
2096
|
<div
|
|
2306
|
-
class="fs-sm fw-500 ${!GlobalUser.token ? `d-none` :
|
|
2097
|
+
class="fs-sm fw-500 ${!GlobalUser.token ? `d-none` : ''}"
|
|
2307
2098
|
style="cursor: pointer; color: #3366bb;"
|
|
2308
2099
|
onclick="${gvc.event(() => {
|
|
2309
2100
|
ApiUser.getUserData(GlobalUser.token, 'me').then(res => {
|
|
2310
|
-
console.log(`res.response.userData=>`, res.response.userData);
|
|
2311
2101
|
['name', 'phone', 'email'].map(dd => {
|
|
2312
2102
|
vm.cartData.user_info[dd] =
|
|
2313
2103
|
res.response.userData[dd] || vm.cartData.user_info[dd];
|
|
@@ -2372,7 +2162,7 @@ export class CheckoutIndex {
|
|
|
2372
2162
|
view: () => __awaiter(this, void 0, void 0, function* () {
|
|
2373
2163
|
try {
|
|
2374
2164
|
if (vm_info.loading) {
|
|
2375
|
-
return
|
|
2165
|
+
return '';
|
|
2376
2166
|
}
|
|
2377
2167
|
const receipt_form = JSON.parse(JSON.stringify(widget.share.receipt_form)).map((dd) => {
|
|
2378
2168
|
switch (dd.key) {
|
|
@@ -2853,28 +2643,28 @@ export class CheckoutIndex {
|
|
|
2853
2643
|
.join('');
|
|
2854
2644
|
}
|
|
2855
2645
|
else {
|
|
2856
|
-
return ` <div
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
>
|
|
2860
|
-
<div class="d-flex align-items-end fs-base" style="gap:5px;">
|
|
2861
|
-
<span style="white-space:nowrap;" class="fw-bold fs-sm">
|
|
2862
|
-
${Language.text('total_amount')}</span
|
|
2646
|
+
return html ` <div
|
|
2647
|
+
class="d-flex align-items-center justify-content-end"
|
|
2648
|
+
style="width:1180px;max-width: 100%;gap:24px;"
|
|
2863
2649
|
>
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2650
|
+
<div class="d-flex align-items-end fs-base" style="gap:5px;">
|
|
2651
|
+
<span style="white-space:nowrap;" class="fw-bold fs-sm">
|
|
2652
|
+
${Language.text('total_amount')}</span
|
|
2653
|
+
>
|
|
2654
|
+
<div class="${gClass(['price-row', 'text-1', 'bold'])}">
|
|
2655
|
+
<div class="fs-5 fw-bold ${gClass('price-text')}">
|
|
2656
|
+
${Currency.convertCurrencyText(vm.cartData.total)}
|
|
2657
|
+
</div>
|
|
2658
|
+
</div>
|
|
2867
2659
|
</div>
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
class="${gClass(verify.length > 0 ? 'button-bgr-disable' : 'button-bgr')}"
|
|
2874
|
-
style="${document.body.clientWidth < 800
|
|
2660
|
+
<div class="flex-fill d-block d-sm-none"></div>
|
|
2661
|
+
<div>
|
|
2662
|
+
<button
|
|
2663
|
+
class="${gClass(verify.length > 0 ? 'button-bgr-disable' : 'button-bgr')}"
|
|
2664
|
+
style="${document.body.clientWidth < 800
|
|
2875
2665
|
? `min-width:100px;`
|
|
2876
2666
|
: `min-width:380px;`}"
|
|
2877
|
-
|
|
2667
|
+
onclick="${gvc.event(() => {
|
|
2878
2668
|
var _a;
|
|
2879
2669
|
const that = this;
|
|
2880
2670
|
if (((_a = onlineData === null || onlineData === void 0 ? void 0 : onlineData.interaction) === null || _a === void 0 ? void 0 : _a.status) == 3) {
|
|
@@ -2973,7 +2763,8 @@ export class CheckoutIndex {
|
|
|
2973
2763
|
const urlObject = new URL(originalUrl);
|
|
2974
2764
|
urlObject.searchParams.set('EndCheckout', '1');
|
|
2975
2765
|
const newUrl = urlObject.toString();
|
|
2976
|
-
if (
|
|
2766
|
+
if (ApplicationConfig.device_type !== 'web' &&
|
|
2767
|
+
['jkopay', 'line_pay'].includes(vm.cartData.customer_info.payment_select)) {
|
|
2977
2768
|
return `${ApplicationConfig.bundle_id}://?path=${encodeURIComponent(newUrl)}`;
|
|
2978
2769
|
}
|
|
2979
2770
|
else {
|
|
@@ -2991,6 +2782,12 @@ export class CheckoutIndex {
|
|
|
2991
2782
|
}).then(res => {
|
|
2992
2783
|
var _a, _b, _c;
|
|
2993
2784
|
dialog.dataLoading({ visible: false });
|
|
2785
|
+
if (!res.result) {
|
|
2786
|
+
dialog.infoMessage({
|
|
2787
|
+
text: '系統處理您的付款時遇到一些問題,導致交易未能完成。請聯繫我們的客服團隊以取得進一步的協助'
|
|
2788
|
+
});
|
|
2789
|
+
return;
|
|
2790
|
+
}
|
|
2994
2791
|
if (vm.cartData.customer_info.payment_select == 'paynow') {
|
|
2995
2792
|
if (!((_c = (_b = (_a = res.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.result) === null || _c === void 0 ? void 0 : _c.secret)) {
|
|
2996
2793
|
return 'paynow API失敗';
|
|
@@ -3001,38 +2798,39 @@ export class CheckoutIndex {
|
|
|
3001
2798
|
bind: `paynow`,
|
|
3002
2799
|
view: () => {
|
|
3003
2800
|
return html ` <div
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
2801
|
+
class="w-100 h-100 d-flex align-items-center justify-content-center"
|
|
2802
|
+
>
|
|
2803
|
+
${document.body.clientWidth < 800
|
|
3007
2804
|
? `
|
|
3008
2805
|
<div class="bg-white position-relative vw-100" style="height: ${window.innerHeight}px;overflow-y: auto;
|
|
3009
2806
|
padding-top:${50 + glitter.share.top_inset}px;
|
|
3010
2807
|
">
|
|
3011
2808
|
`
|
|
3012
2809
|
: `<div class="p-3 bg-white position-relative" style="max-height: calc(100vh - 90px);overflow-y:auto;">`}
|
|
3013
|
-
|
|
3014
|
-
|
|
2810
|
+
<div
|
|
2811
|
+
style="position: absolute; right: 15px;top:${15 +
|
|
3015
2812
|
glitter.share.top_inset}px;z-index:1;"
|
|
3016
|
-
|
|
2813
|
+
onclick="${gvc.event(() => {
|
|
2814
|
+
location.href = res.response.returnUrl;
|
|
3017
2815
|
gvc.closeDialog();
|
|
3018
2816
|
})}"
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
2817
|
+
>
|
|
2818
|
+
<i
|
|
2819
|
+
class="fa-regular fa-circle-xmark fs-5 text-dark cursor_pointer"
|
|
2820
|
+
></i>
|
|
2821
|
+
</div>
|
|
2822
|
+
<div id="paynow-container">
|
|
2823
|
+
<div style="width:200px;height:200px;">
|
|
2824
|
+
loading...
|
|
2825
|
+
</div>
|
|
2826
|
+
</div>
|
|
2827
|
+
<div class="px-3 px-sm-0 w-100">
|
|
2828
|
+
<button
|
|
2829
|
+
class="${gClass(verify.length > 0
|
|
3032
2830
|
? 'button-bgr-disable'
|
|
3033
2831
|
: 'button-bgr')} "
|
|
3034
|
-
|
|
3035
|
-
|
|
2832
|
+
id="checkoutButton"
|
|
2833
|
+
onclick="${gvc.event(() => {
|
|
3036
2834
|
const PayNow = window.PayNow;
|
|
3037
2835
|
const dialog = new ShareDialog(gvc.glitter);
|
|
3038
2836
|
dialog.dataLoading({ visible: true });
|
|
@@ -3045,13 +2843,13 @@ export class CheckoutIndex {
|
|
|
3045
2843
|
}
|
|
3046
2844
|
});
|
|
3047
2845
|
})}"
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
2846
|
+
>
|
|
2847
|
+
<span class="${gClass('button-text')}"
|
|
2848
|
+
>確認結帳</span
|
|
2849
|
+
>
|
|
2850
|
+
</button>
|
|
2851
|
+
</div>
|
|
2852
|
+
</div>`;
|
|
3055
2853
|
},
|
|
3056
2854
|
divCreate: {
|
|
3057
2855
|
class: ` h-100 d-flex align-items-center justify-content-center`,
|
|
@@ -3060,7 +2858,9 @@ export class CheckoutIndex {
|
|
|
3060
2858
|
onCreate: () => {
|
|
3061
2859
|
const publicKey = res.response.publicKey;
|
|
3062
2860
|
const secret = res.response.data.result.secret;
|
|
3063
|
-
const env = res.response.BETA == 'true'
|
|
2861
|
+
const env = res.response.BETA == 'true'
|
|
2862
|
+
? 'sandbox'
|
|
2863
|
+
: 'production';
|
|
3064
2864
|
const PayNow = window.PayNow;
|
|
3065
2865
|
PayNow.createPayment({
|
|
3066
2866
|
publicKey: publicKey,
|
|
@@ -3124,8 +2924,8 @@ export class CheckoutIndex {
|
|
|
3124
2924
|
else {
|
|
3125
2925
|
const id = gvc.glitter.getUUID();
|
|
3126
2926
|
$('body').append(html ` <div id="${id}" style="display: none;">
|
|
3127
|
-
|
|
3128
|
-
|
|
2927
|
+
${res.response.form}
|
|
2928
|
+
</div>`);
|
|
3129
2929
|
document.querySelector(`#${id} #submit`).click();
|
|
3130
2930
|
}
|
|
3131
2931
|
}
|
|
@@ -3155,20 +2955,21 @@ export class CheckoutIndex {
|
|
|
3155
2955
|
});
|
|
3156
2956
|
}
|
|
3157
2957
|
})}"
|
|
3158
|
-
>
|
|
3159
|
-
<span class="${gClass('button-text')} "
|
|
3160
|
-
style="${verify.length > 0 ? `font-size:13px;` : ``}"
|
|
3161
2958
|
>
|
|
3162
|
-
|
|
2959
|
+
<span
|
|
2960
|
+
class="${gClass('button-text')} "
|
|
2961
|
+
style="${verify.length > 0 ? `font-size:13px;` : ''}"
|
|
2962
|
+
>
|
|
2963
|
+
${verify.length > 0
|
|
3163
2964
|
? verify.join('<br/>')
|
|
3164
2965
|
: window.login_config.login_in_to_order &&
|
|
3165
2966
|
!GlobalUser.token
|
|
3166
2967
|
? Language.text('login_in_to_checkout')
|
|
3167
2968
|
: Language.text('next')}
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
2969
|
+
</span>
|
|
2970
|
+
</button>
|
|
2971
|
+
</div>
|
|
2972
|
+
</div>`;
|
|
3172
2973
|
}
|
|
3173
2974
|
})()}
|
|
3174
2975
|
</div>
|
|
@@ -3183,7 +2984,7 @@ export class CheckoutIndex {
|
|
|
3183
2984
|
: `width:calc(100%);`}"
|
|
3184
2985
|
>
|
|
3185
2986
|
<!--明細-->
|
|
3186
|
-
<div
|
|
2987
|
+
<div class="rounded-3 bg-white w-100 p-3">${detail_info}</div>
|
|
3187
2988
|
<div class="d-sm-none" style="height:120px;"></div>
|
|
3188
2989
|
</div>
|
|
3189
2990
|
</div>
|
|
@@ -3239,12 +3040,10 @@ export class CheckoutIndex {
|
|
|
3239
3040
|
};
|
|
3240
3041
|
})()) +
|
|
3241
3042
|
(gvc.glitter.getUrlParameter('page') === 'checkout'
|
|
3242
|
-
? `
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
: `
|
|
3246
|
-
<div style="background:#f0f0f0;z-index:-1;" class="position-absolute start-0 top-0 w-100"></div>
|
|
3247
|
-
`));
|
|
3043
|
+
? html `
|
|
3044
|
+
<div style="background:#f0f0f0;z-index:-1;" class="position-absolute start-0 top-0 vw-100 vh-100"></div>
|
|
3045
|
+
`
|
|
3046
|
+
: html ` <div style="background:#f0f0f0;z-index:-1;" class="position-absolute start-0 top-0 w-100"></div> `));
|
|
3248
3047
|
}
|
|
3249
3048
|
static checkFormData(gvc, cartData, widget) {
|
|
3250
3049
|
var _a;
|
|
@@ -3303,13 +3102,13 @@ export class CheckoutIndex {
|
|
|
3303
3102
|
});
|
|
3304
3103
|
return false;
|
|
3305
3104
|
}
|
|
3306
|
-
else if ((!subData['area'] || subData['area'] === '') &&
|
|
3105
|
+
else if ((!subData['area'] || subData['area'] === '') && subData['shipment'] !== 'global_express') {
|
|
3307
3106
|
dialog.errorMessage({
|
|
3308
3107
|
text: `${Language.text('please_enter')}「${Language.text('area')}」`,
|
|
3309
3108
|
});
|
|
3310
3109
|
return false;
|
|
3311
3110
|
}
|
|
3312
|
-
else if ((!subData['state'] || subData['state'] === '') &&
|
|
3111
|
+
else if ((!subData['state'] || subData['state'] === '') && subData['shipment'] === 'global_express') {
|
|
3313
3112
|
dialog.errorMessage({
|
|
3314
3113
|
text: `${Language.text('please_enter')}「${Language.text('state')}」`,
|
|
3315
3114
|
});
|
|
@@ -3501,7 +3300,6 @@ export class CheckoutIndex {
|
|
|
3501
3300
|
}
|
|
3502
3301
|
});
|
|
3503
3302
|
cartData.off_line_support = (_a = cartData.off_line_support) !== null && _a !== void 0 ? _a : {};
|
|
3504
|
-
console.log(cartData.off_line_support);
|
|
3505
3303
|
cartData.off_line_support.atm &&
|
|
3506
3304
|
array.push({
|
|
3507
3305
|
name: '銀行轉帳',
|