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
|
@@ -13,49 +13,12 @@ import { PdClass } from './pd-class.js';
|
|
|
13
13
|
import { Language } from '../../glitter-base/global/language.js';
|
|
14
14
|
import { UmClass } from '../user-manager/um-class.js';
|
|
15
15
|
import { ShareDialog } from '../../glitterBundle/dialog/ShareDialog.js';
|
|
16
|
+
import { ProductModule } from '../modules/product-module.js';
|
|
16
17
|
const html = String.raw;
|
|
17
18
|
export class ProductDetail {
|
|
18
|
-
static tab(data, gvc, select, callback, style) {
|
|
19
|
-
return html ` <div
|
|
20
|
-
style="width: 100%; justify-content: center; align-items: flex-start; gap: 22px; display: inline-flex;cursor: pointer;margin-top: 24px;margin-bottom: 24px;font-size: 18px; ${style !== null && style !== void 0 ? style : ''};"
|
|
21
|
-
>
|
|
22
|
-
${data
|
|
23
|
-
.map((dd) => {
|
|
24
|
-
if (select === dd.key) {
|
|
25
|
-
return html ` <div style="flex-direction: column; justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex">
|
|
26
|
-
<div
|
|
27
|
-
style="align-self: stretch; text-align: center; color: ${ProductDetail.titleFontColor}; font-family: Noto Sans; font-weight: 700; line-height: 18px; word-wrap: break-word;white-space: nowrap;margin: 0 20px;"
|
|
28
|
-
onclick="${gvc.event(() => {
|
|
29
|
-
callback(dd.key);
|
|
30
|
-
})}"
|
|
31
|
-
>
|
|
32
|
-
${dd.title}
|
|
33
|
-
</div>
|
|
34
|
-
<div style="align-self: stretch; height: 0px; border: 1px ${ProductDetail.titleFontColor} solid"></div>
|
|
35
|
-
</div>`;
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
return html ` <div
|
|
39
|
-
style="flex-direction: column; justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex"
|
|
40
|
-
onclick="${gvc.event(() => {
|
|
41
|
-
callback(dd.key);
|
|
42
|
-
})}"
|
|
43
|
-
>
|
|
44
|
-
<div
|
|
45
|
-
style="align-self: stretch; text-align: center; color: #8D8D8D; font-family: Noto Sans; font-weight: 400; line-height: 18px; word-wrap: break-word;white-space: nowrap;margin: 0 20px;"
|
|
46
|
-
>
|
|
47
|
-
${dd.title}
|
|
48
|
-
</div>
|
|
49
|
-
<div style="align-self: stretch; height: 0px"></div>
|
|
50
|
-
</div>`;
|
|
51
|
-
}
|
|
52
|
-
})
|
|
53
|
-
.join('')}
|
|
54
|
-
</div>`;
|
|
55
|
-
}
|
|
56
19
|
static main(gvc, widget, subData) {
|
|
57
20
|
var _a;
|
|
58
|
-
|
|
21
|
+
ProductModule.titleFontColor = (_a = gvc.glitter.share.globalValue['theme_color.0.title']) !== null && _a !== void 0 ? _a : '#333333';
|
|
59
22
|
const css = String.raw;
|
|
60
23
|
const product_id = gvc.glitter.getUrlParameter('product_id');
|
|
61
24
|
const url = new URL(location.href);
|
|
@@ -86,9 +49,9 @@ export class ProductDetail {
|
|
|
86
49
|
};
|
|
87
50
|
function spinner() {
|
|
88
51
|
return html ` <div class="d-flex align-items-center justify-content-center flex-column w-100 mx-auto mt-5">
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
52
|
+
<div class="spinner-border" role="status"></div>
|
|
53
|
+
<span class="mt-3">${Language.text('loading')}</span>
|
|
54
|
+
</div>`;
|
|
92
55
|
}
|
|
93
56
|
return gvc.bindView({
|
|
94
57
|
bind: ids.page,
|
|
@@ -99,22 +62,22 @@ export class ProductDetail {
|
|
|
99
62
|
}
|
|
100
63
|
if (Object.keys(vm.data).length === 0) {
|
|
101
64
|
return html ` <div class="d-flex align-items-center justify-content-center flex-column w-100 mx-auto">
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
65
|
+
<lottie-player
|
|
66
|
+
style="max-width: 100%;width: 300px;"
|
|
67
|
+
src="https://assets10.lottiefiles.com/packages/lf20_rc6CDU.json"
|
|
68
|
+
speed="1"
|
|
69
|
+
loop="true"
|
|
70
|
+
background="transparent"
|
|
71
|
+
></lottie-player>
|
|
72
|
+
<span class="mb-5 fs-5">這個商品目前尚未上架喔!</span>
|
|
73
|
+
</div>`;
|
|
111
74
|
}
|
|
112
75
|
const prod = vm.data.content;
|
|
113
76
|
PdClass.addSpecStyle(gvc);
|
|
114
77
|
vm.specs =
|
|
115
78
|
vm.specs.length > 0
|
|
116
79
|
? vm.specs
|
|
117
|
-
: prod.specs.map(
|
|
80
|
+
: prod.specs.map(spec => {
|
|
118
81
|
return spec.option[0].title;
|
|
119
82
|
});
|
|
120
83
|
const book_mark = [
|
|
@@ -135,8 +98,16 @@ export class ProductDetail {
|
|
|
135
98
|
function loop(array) {
|
|
136
99
|
for (const b of array) {
|
|
137
100
|
if (b.title === title) {
|
|
138
|
-
domain =
|
|
139
|
-
|
|
101
|
+
domain =
|
|
102
|
+
(b.language_data &&
|
|
103
|
+
b.language_data[Language.getLanguage()] &&
|
|
104
|
+
b.language_data[Language.getLanguage()].seo.domain) ||
|
|
105
|
+
b.code;
|
|
106
|
+
title =
|
|
107
|
+
(b.language_data &&
|
|
108
|
+
b.language_data[Language.getLanguage()] &&
|
|
109
|
+
b.language_data[Language.getLanguage()].title) ||
|
|
110
|
+
title;
|
|
140
111
|
break;
|
|
141
112
|
}
|
|
142
113
|
else if (b.array) {
|
|
@@ -160,30 +131,30 @@ export class ProductDetail {
|
|
|
160
131
|
});
|
|
161
132
|
}
|
|
162
133
|
return html ` <div class="mx-auto pb-5" style="max-width:1100px;word-break: break-all;white-space: normal;">
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
.map(
|
|
134
|
+
<div class="breadcrumb mb-0 d-flex align-items-center py-3" style="cursor:pointer; gap:10px;">
|
|
135
|
+
${book_mark
|
|
136
|
+
.map(dd => {
|
|
166
137
|
return html ` <li
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
138
|
+
class="breadcrumb-item "
|
|
139
|
+
style="margin-top: 0px;color:${ProductModule.titleFontColor};"
|
|
140
|
+
onclick="${gvc.event(() => {
|
|
170
141
|
dd.event();
|
|
171
142
|
})}"
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
143
|
+
>
|
|
144
|
+
${dd.title}
|
|
145
|
+
</li>`;
|
|
175
146
|
})
|
|
176
147
|
.join('<i class="fa-solid fa-angle-right"></i>')}
|
|
177
|
-
|
|
178
|
-
|
|
148
|
+
</div>
|
|
149
|
+
${PdClass.selectSpec({
|
|
179
150
|
gvc,
|
|
180
|
-
titleFontColor:
|
|
151
|
+
titleFontColor: ProductModule.titleFontColor,
|
|
181
152
|
prod,
|
|
182
153
|
vm,
|
|
183
154
|
preview: true,
|
|
184
155
|
})}
|
|
185
|
-
|
|
186
|
-
|
|
156
|
+
<div class="d-flex flex-column align-items-center mt-2" style="width:100%;">
|
|
157
|
+
${gvc.bindView((() => {
|
|
187
158
|
var _a, _b;
|
|
188
159
|
const id = glitter.getUUID();
|
|
189
160
|
const commentCount = (_b = (_a = vm.data.content.comments) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
|
|
@@ -191,27 +162,29 @@ export class ProductDetail {
|
|
|
191
162
|
return {
|
|
192
163
|
bind: id,
|
|
193
164
|
view: () => {
|
|
194
|
-
return
|
|
165
|
+
return ProductModule.tab([
|
|
195
166
|
{
|
|
196
167
|
title: Language.text('product_description'),
|
|
197
168
|
key: 'default',
|
|
198
169
|
},
|
|
199
|
-
...(window.store_info.customer_comment
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
170
|
+
...(window.store_info.customer_comment
|
|
171
|
+
? [
|
|
172
|
+
{
|
|
173
|
+
title: `${Language.text('customer_reviews')} (${maxDisplayCount})`,
|
|
174
|
+
key: 'comment',
|
|
175
|
+
},
|
|
176
|
+
]
|
|
177
|
+
: []),
|
|
205
178
|
].concat(vm.content_manager
|
|
206
|
-
.filter(
|
|
179
|
+
.filter(cont => {
|
|
207
180
|
return prod.content_array.includes(cont.id);
|
|
208
181
|
})
|
|
209
|
-
.map(
|
|
182
|
+
.map(cont => {
|
|
210
183
|
return {
|
|
211
184
|
title: cont.title,
|
|
212
185
|
key: cont.id,
|
|
213
186
|
};
|
|
214
|
-
})), gvc, vm.content_tag,
|
|
187
|
+
})), gvc, vm.content_tag, text => {
|
|
215
188
|
vm.content_tag = text;
|
|
216
189
|
gvc.notifyDataChange(id);
|
|
217
190
|
gvc.notifyDataChange(ids.content);
|
|
@@ -222,7 +195,7 @@ export class ProductDetail {
|
|
|
222
195
|
},
|
|
223
196
|
};
|
|
224
197
|
})())}
|
|
225
|
-
|
|
198
|
+
${gvc.bindView({
|
|
226
199
|
bind: ids.content,
|
|
227
200
|
view: () => {
|
|
228
201
|
if (vm.content_tag === 'default') {
|
|
@@ -245,7 +218,7 @@ export class ProductDetail {
|
|
|
245
218
|
gvc,
|
|
246
219
|
tag: '',
|
|
247
220
|
title: '撰寫評論',
|
|
248
|
-
innerHTML:
|
|
221
|
+
innerHTML: gvcd => {
|
|
249
222
|
const postData = {
|
|
250
223
|
product_id: vm.data.id,
|
|
251
224
|
rate: 5,
|
|
@@ -253,9 +226,9 @@ export class ProductDetail {
|
|
|
253
226
|
comment: '',
|
|
254
227
|
};
|
|
255
228
|
return html `
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
229
|
+
<div class="mt-1">
|
|
230
|
+
<div class="tx_normal fw-normal mb-1">${Language.text('rating')}</div>
|
|
231
|
+
${gvcd.bindView((() => {
|
|
259
232
|
const id = glitter.getUUID();
|
|
260
233
|
function setRate(rate) {
|
|
261
234
|
postData.rate = rate;
|
|
@@ -268,22 +241,22 @@ export class ProductDetail {
|
|
|
268
241
|
.fill('')
|
|
269
242
|
.map((_, index) => {
|
|
270
243
|
return html ` <div class="rating-item">
|
|
271
|
-
|
|
244
|
+
${postData.rate > index
|
|
272
245
|
? html `<i
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
246
|
+
class="fa-solid fa-star fs-4"
|
|
247
|
+
style="cursor: pointer"
|
|
248
|
+
onclick="${gvcd.event(() => {
|
|
276
249
|
setRate(index + 1);
|
|
277
250
|
})}"
|
|
278
|
-
|
|
251
|
+
></i>`
|
|
279
252
|
: html `<i
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
253
|
+
class="fa-regular fa-star fs-4"
|
|
254
|
+
style="cursor: pointer"
|
|
255
|
+
onclick="${gvcd.event(() => {
|
|
283
256
|
setRate(index + 1);
|
|
284
257
|
})}"
|
|
285
|
-
|
|
286
|
-
|
|
258
|
+
></i>`}
|
|
259
|
+
</div>`;
|
|
287
260
|
})
|
|
288
261
|
.join('');
|
|
289
262
|
},
|
|
@@ -292,31 +265,31 @@ export class ProductDetail {
|
|
|
292
265
|
},
|
|
293
266
|
};
|
|
294
267
|
})())}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
268
|
+
</div>
|
|
269
|
+
<div class="mt-2">
|
|
270
|
+
<div class="tx_normal fw-normal mb-1">${Language.text('title')}</div>
|
|
271
|
+
<input
|
|
272
|
+
class="bgw-input"
|
|
273
|
+
type="text"
|
|
274
|
+
oninput="${gvcd.event(e => {
|
|
302
275
|
postData.title = e.value;
|
|
303
276
|
})}"
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
277
|
+
/>
|
|
278
|
+
</div>
|
|
279
|
+
<div class="mt-2">
|
|
280
|
+
<div class="tx_normal fw-normal mb-1">${Language.text('comment')}</div>
|
|
281
|
+
<textarea
|
|
282
|
+
class="bgw-input"
|
|
283
|
+
rows="3"
|
|
284
|
+
oninput="${gvcd.event(e => {
|
|
312
285
|
postData.comment = e.value;
|
|
313
286
|
})}"
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
287
|
+
></textarea>
|
|
288
|
+
</div>
|
|
289
|
+
<div class="d-flex justify-content-end mt-2 mb-1">
|
|
290
|
+
<div
|
|
291
|
+
class="um-solid-btn"
|
|
292
|
+
onclick="${gvcd.event(() => {
|
|
320
293
|
if (postData.title === '' || postData.comment === '') {
|
|
321
294
|
PdClass.jumpAlert({
|
|
322
295
|
gvc,
|
|
@@ -336,11 +309,11 @@ export class ProductDetail {
|
|
|
336
309
|
gvc.notifyDataChange(ids.page);
|
|
337
310
|
});
|
|
338
311
|
})}"
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
312
|
+
>
|
|
313
|
+
${Language.text('submit')}
|
|
314
|
+
</div>
|
|
315
|
+
</div>
|
|
316
|
+
`;
|
|
344
317
|
},
|
|
345
318
|
});
|
|
346
319
|
};
|
|
@@ -353,66 +326,74 @@ export class ProductDetail {
|
|
|
353
326
|
return a.date > b.date ? -1 : 1;
|
|
354
327
|
})
|
|
355
328
|
.slice(0, 15)
|
|
356
|
-
.map(
|
|
357
|
-
return html `<div
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
329
|
+
.map(item => {
|
|
330
|
+
return html `<div
|
|
331
|
+
style="padding: 20px; min-width: ${document.body.clientWidth > 768
|
|
332
|
+
? '780px'
|
|
333
|
+
: `calc(${document.body.clientWidth}px - 1.5rem)`};"
|
|
334
|
+
>
|
|
335
|
+
<div class="row">
|
|
336
|
+
<div class="col-12 col-md">
|
|
337
|
+
<div class="row mb-6">
|
|
338
|
+
<div class="col-12">
|
|
339
|
+
<!-- Rating -->
|
|
340
|
+
<div class="rating fs-sm text-dark d-flex">
|
|
341
|
+
${[...new Array(5)]
|
|
365
342
|
.fill('')
|
|
366
343
|
.map((_, index) => {
|
|
367
344
|
return html ` <div class="rating-item">
|
|
368
|
-
|
|
369
|
-
|
|
345
|
+
${item.rate > index
|
|
346
|
+
? html `<i class="fa-solid fa-star"></i>`
|
|
347
|
+
: html `<i class="fa-regular fa-star"></i>`}
|
|
348
|
+
</div>`;
|
|
370
349
|
})
|
|
371
350
|
.join('')}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
351
|
+
</div>
|
|
352
|
+
</div>
|
|
353
|
+
<div class="col-12">
|
|
354
|
+
<!-- Time -->
|
|
355
|
+
<span class="fs-xs text-muted">
|
|
356
|
+
${item.userName}, <time datetime="${item.date}">${item.date}</time>
|
|
357
|
+
</span>
|
|
358
|
+
</div>
|
|
359
|
+
</div>
|
|
360
|
+
<!-- Title -->
|
|
361
|
+
<p class="mb-2 fs-lg fw-bold">${item.title}</p>
|
|
362
|
+
<!-- Text -->
|
|
363
|
+
<p class="text-gray-500">${item.comment.replace(/\n/g, '<br/>')}</p>
|
|
364
|
+
</div>
|
|
365
|
+
</div>
|
|
366
|
+
</div>`;
|
|
386
367
|
})
|
|
387
368
|
.join('');
|
|
388
369
|
};
|
|
389
370
|
return html ` <div class="d-flex justify-content-center">
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
371
|
+
<div
|
|
372
|
+
class="um-solid-btn"
|
|
373
|
+
onclick="${gvc.event(() => {
|
|
393
374
|
addCommentDialog();
|
|
394
375
|
})}"
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
376
|
+
>
|
|
377
|
+
${Language.text('write_comment')}
|
|
378
|
+
</div>
|
|
379
|
+
</div>
|
|
380
|
+
<div class="d-flex flex-column gap-2">${commentList()}</div>`;
|
|
400
381
|
}
|
|
401
|
-
const template = vm.content_manager.find(
|
|
402
|
-
const jsonData = prod.content_json.find(
|
|
382
|
+
const template = vm.content_manager.find(cont => cont.id === vm.content_tag);
|
|
383
|
+
const jsonData = prod.content_json.find(data => data.id === vm.content_tag);
|
|
403
384
|
if (!template) {
|
|
404
385
|
return '';
|
|
405
386
|
}
|
|
406
387
|
let htmlString = template.data.content;
|
|
407
388
|
if (jsonData) {
|
|
408
|
-
jsonData.list.map(
|
|
389
|
+
jsonData.list.map(data => {
|
|
409
390
|
var _a, _b, _c;
|
|
410
|
-
const cssStyle = template.data.tags.find(
|
|
391
|
+
const cssStyle = template.data.tags.find(item => item.key === data.key);
|
|
411
392
|
const regex = new RegExp(`@{{${data.key}}}`, 'g');
|
|
412
393
|
htmlString = htmlString.replace(regex, html `<span
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
394
|
+
style="font-size: ${(_a = cssStyle === null || cssStyle === void 0 ? void 0 : cssStyle.font_size) !== null && _a !== void 0 ? _a : 16}px; color: ${(_b = cssStyle === null || cssStyle === void 0 ? void 0 : cssStyle.font_color) !== null && _b !== void 0 ? _b : '${titleFontColor}'}; background: ${(_c = cssStyle === null || cssStyle === void 0 ? void 0 : cssStyle.font_bgr) !== null && _c !== void 0 ? _c : '#fff'};"
|
|
395
|
+
>${data.value}</span
|
|
396
|
+
>`);
|
|
416
397
|
});
|
|
417
398
|
}
|
|
418
399
|
return htmlString.replace(/@{{[^}]+}}/g, '');
|
|
@@ -430,9 +411,9 @@ export class ProductDetail {
|
|
|
430
411
|
class: `pd_detail_content fr-view`,
|
|
431
412
|
},
|
|
432
413
|
})}
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
414
|
+
</div>
|
|
415
|
+
<div style="margin-top: 150px;"></div>
|
|
416
|
+
${((_c = prod.relative_product) !== null && _c !== void 0 ? _c : []).length
|
|
436
417
|
? gvc.bindView(() => {
|
|
437
418
|
const swipID = gvc.glitter.getUUID();
|
|
438
419
|
return {
|
|
@@ -460,31 +441,36 @@ export class ProductDetail {
|
|
|
460
441
|
return ``;
|
|
461
442
|
}
|
|
462
443
|
resolve(html `
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
444
|
+
<div class="w-100 d-flex align-items-center justify-content-center ">
|
|
445
|
+
<div
|
|
446
|
+
class="mx-auto"
|
|
447
|
+
style="flex-direction: column; justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex"
|
|
448
|
+
>
|
|
449
|
+
<div
|
|
450
|
+
style="font-size:18px;align-self: stretch; text-align: center; color: ${ProductModule.titleFontColor}; font-weight: 700; line-height: 18px; word-wrap: break-word;white-space: nowrap;margin: 0 20px;"
|
|
451
|
+
>
|
|
452
|
+
${Language.text('related_products')}
|
|
453
|
+
</div>
|
|
454
|
+
<div
|
|
455
|
+
style="align-self: stretch; height: 0px; border: 1px ${ProductModule.titleFontColor} solid"
|
|
456
|
+
></div>
|
|
457
|
+
</div>
|
|
458
|
+
</div>
|
|
459
|
+
<div class="w-100 row p-0 align-items-center justify-content-center mt-4 mt-lg-4 mx-0">
|
|
460
|
+
${product
|
|
475
461
|
.map((dd) => {
|
|
476
462
|
return html `<div class="col-6 col-sm-4 col-lg-3">
|
|
477
|
-
|
|
463
|
+
${glitter.htmlGenerate.renderComponent({
|
|
478
464
|
appName: window.appName,
|
|
479
465
|
tag: 'product_widget',
|
|
480
466
|
gvc: gvc,
|
|
481
467
|
subData: dd,
|
|
482
468
|
})}
|
|
483
|
-
|
|
469
|
+
</div>`;
|
|
484
470
|
})
|
|
485
471
|
.join('')}
|
|
486
|
-
|
|
487
|
-
|
|
472
|
+
</div>
|
|
473
|
+
`);
|
|
488
474
|
}));
|
|
489
475
|
}),
|
|
490
476
|
divCreate: {
|
|
@@ -494,11 +480,16 @@ export class ProductDetail {
|
|
|
494
480
|
};
|
|
495
481
|
})
|
|
496
482
|
: ''}
|
|
497
|
-
|
|
498
|
-
|
|
483
|
+
<div style="margin-top: 100px;"></div>
|
|
484
|
+
</div>`;
|
|
499
485
|
}),
|
|
500
486
|
divCreate: {
|
|
501
|
-
style: css `
|
|
487
|
+
style: css `
|
|
488
|
+
min-height: 1000px;
|
|
489
|
+
word-break: break-all;
|
|
490
|
+
white-space: normal;
|
|
491
|
+
`,
|
|
492
|
+
class: `container`,
|
|
502
493
|
},
|
|
503
494
|
onCreate: () => {
|
|
504
495
|
var _a;
|
|
@@ -517,7 +508,7 @@ export class ProductDetail {
|
|
|
517
508
|
ApiUser.getPublicConfig('text-manager', 'manager', window.appName),
|
|
518
509
|
ApiShop.getProduct(inputObj),
|
|
519
510
|
ApiShop.getWishList(),
|
|
520
|
-
]).then(
|
|
511
|
+
]).then(results => {
|
|
521
512
|
var _a, _b;
|
|
522
513
|
const [publicConfig, productData, wishListData] = results;
|
|
523
514
|
if (publicConfig.result && publicConfig.response.value) {
|
|
@@ -531,7 +522,11 @@ export class ProductDetail {
|
|
|
531
522
|
else {
|
|
532
523
|
vm.data = productData.response.data;
|
|
533
524
|
}
|
|
534
|
-
glitter.setUrlParameter('page', 'products/' + encodeURIComponent(vm.data.content.seo.domain || vm.data.content.title), [
|
|
525
|
+
glitter.setUrlParameter('page', 'products/' + encodeURIComponent(vm.data.content.seo.domain || vm.data.content.title), [
|
|
526
|
+
(_a = window.home_seo.title_prefix) !== null && _a !== void 0 ? _a : '',
|
|
527
|
+
vm.data.content.seo.domain || vm.data.content.title,
|
|
528
|
+
(_b = window.home_seo.title_suffix) !== null && _b !== void 0 ? _b : '',
|
|
529
|
+
].join(''));
|
|
535
530
|
}
|
|
536
531
|
catch (e) {
|
|
537
532
|
vm.data = {};
|
|
@@ -549,5 +544,4 @@ export class ProductDetail {
|
|
|
549
544
|
});
|
|
550
545
|
}
|
|
551
546
|
}
|
|
552
|
-
ProductDetail.titleFontColor = '';
|
|
553
547
|
window.glitter.setModule(import.meta.url, ProductDetail);
|