ts-glitter 21.2.4 → 21.2.6
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 +19 -21
- package/lowcode/backend-manager/bg-blog.ts +20 -21
- package/lowcode/backend-manager/bg-product.js +94 -99
- package/lowcode/backend-manager/bg-product.ts +104 -109
- package/lowcode/cms-plugin/filter-options.js +1 -0
- package/lowcode/cms-plugin/filter-options.ts +1 -0
- package/lowcode/cms-plugin/pos-pages/payment-page.js +16 -6
- package/lowcode/cms-plugin/pos-pages/payment-page.ts +15 -2
- package/lowcode/cms-plugin/pos-pages/pos-function.js +102 -55
- package/lowcode/cms-plugin/pos-pages/pos-function.ts +111 -61
- package/lowcode/cms-plugin/pos-pages/pos-summary.js +4 -4
- package/lowcode/cms-plugin/pos-pages/pos-summary.ts +4 -1
- package/lowcode/cms-plugin/shopping-order-manager.js +10 -7
- package/lowcode/cms-plugin/shopping-order-manager.ts +10 -7
- package/lowcode/cms-plugin/shopping-product-setting.js +9 -6
- package/lowcode/cms-plugin/shopping-product-setting.ts +13 -6
- package/lowcode/cms-plugin/shopping-setting-basic.js +411 -405
- package/lowcode/cms-plugin/shopping-setting-basic.ts +497 -486
- package/lowcode/public-components/checkout/index.js +5 -3
- package/lowcode/public-components/checkout/index.ts +8 -3
- package/package.json +1 -1
- package/src/api-public/controllers/shop.js +6 -5
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +12 -13
- package/src/api-public/controllers/user.js +2 -1
- package/src/api-public/controllers/user.js.map +1 -1
- package/src/api-public/controllers/user.ts +2 -1
- package/src/api-public/services/checkout-event.js +17 -7
- package/src/api-public/services/checkout-event.js.map +1 -1
- package/src/api-public/services/data-analyze.d.ts +1 -1
- package/src/api-public/services/fb-api.js +3 -2
- package/src/api-public/services/fb-api.js.map +1 -1
- package/src/api-public/services/fb-api.ts +3 -2
- package/src/api-public/services/financial-serviceV2.js +17 -7
- package/src/api-public/services/financial-serviceV2.js.map +1 -1
- package/src/api-public/services/mail.js +3 -3
- package/src/api-public/services/mail.js.map +1 -1
- package/src/api-public/services/mail.ts +144 -134
- package/src/api-public/services/monitor.d.ts +1 -0
- package/src/api-public/services/monitor.js +5 -2
- package/src/api-public/services/monitor.js.map +1 -1
- package/src/api-public/services/monitor.ts +5 -2
- package/src/api-public/services/shopping.js +5 -4
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +15 -14
- package/src/api-public/services/user.js +17 -7
- package/src/api-public/services/user.js.map +1 -1
- package/src/index.js +17 -7
- package/src/index.js.map +1 -1
- package/src/seo-config.js +1 -1
- package/src/seo-config.js.map +1 -1
- package/src/seo-config.ts +1 -1
- package/src/services/app.js +17 -7
- package/src/services/app.js.map +1 -1
- package/src/services/ses.js.map +1 -1
- package/src/services/ses.ts +41 -35
package/lowcode/Entry.js
CHANGED
|
@@ -146,7 +146,7 @@ export class Entry {
|
|
|
146
146
|
}
|
|
147
147
|
window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : createClock();
|
|
148
148
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
149
|
-
glitter.share.editerVersion = 'V_21.2.
|
|
149
|
+
glitter.share.editerVersion = 'V_21.2.6';
|
|
150
150
|
glitter.share.start = new Date();
|
|
151
151
|
const vm = { appConfig: [] };
|
|
152
152
|
window.saasConfig = {
|
package/lowcode/Entry.ts
CHANGED
|
@@ -150,7 +150,7 @@ export class Entry {
|
|
|
150
150
|
}
|
|
151
151
|
(window as any).renderClock = (window as any).renderClock ?? createClock();
|
|
152
152
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
153
|
-
glitter.share.editerVersion = 'V_21.2.
|
|
153
|
+
glitter.share.editerVersion = 'V_21.2.6';
|
|
154
154
|
glitter.share.start = new Date();
|
|
155
155
|
const vm = { appConfig: [] };
|
|
156
156
|
(window as any).saasConfig = {
|
|
@@ -1598,13 +1598,17 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1598
1598
|
return {
|
|
1599
1599
|
bind: subVM.id,
|
|
1600
1600
|
view: () => {
|
|
1601
|
+
var _a;
|
|
1602
|
+
var _b;
|
|
1601
1603
|
if (subVM.loading) {
|
|
1602
1604
|
return BgWidget.spinner();
|
|
1603
1605
|
}
|
|
1606
|
+
(_a = (_b = vm.data.content).relative_data) !== null && _a !== void 0 ? _a : (_b.relative_data = []);
|
|
1607
|
+
const relativeCloneData = structuredClone(vm.data.content.relative_data);
|
|
1604
1608
|
return html `
|
|
1605
1609
|
<div class="d-flex flex-column p-2" style="gap: 18px;">
|
|
1606
1610
|
<div
|
|
1607
|
-
class="d-flex align-items-center gray-bottom-line-18
|
|
1611
|
+
class="d-flex align-items-center gray-bottom-line-18"
|
|
1608
1612
|
style="gap: 24px; justify-content: space-between;"
|
|
1609
1613
|
>
|
|
1610
1614
|
<div class="form-check-label c_updown_label">
|
|
@@ -1613,29 +1617,23 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1613
1617
|
${BgWidget.grayButton('選擇商品', gvc.event(() => {
|
|
1614
1618
|
BgProduct.productsDialog({
|
|
1615
1619
|
gvc: gvc,
|
|
1616
|
-
default:
|
|
1617
|
-
return `${dd.product_id}-${dd.variant.spec.join('-')}`;
|
|
1618
|
-
}),
|
|
1620
|
+
default: relativeCloneData.map((dd) => `${dd.product_id}-${dd.variant.spec.join('-')}`),
|
|
1619
1621
|
with_variants: true,
|
|
1620
1622
|
filter_visible: page_tab === 'hidden' ? 'false' : 'true',
|
|
1621
|
-
callback:
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
},
|
|
1633
|
-
product_id: dd.split('-')[0],
|
|
1634
|
-
};
|
|
1635
|
-
}));
|
|
1623
|
+
callback: specArray => {
|
|
1624
|
+
vm.data.content.relative_data = specArray.map((spec) => {
|
|
1625
|
+
return {
|
|
1626
|
+
variant: {
|
|
1627
|
+
spec: spec
|
|
1628
|
+
.split('-')
|
|
1629
|
+
.filter((_, index) => index > 0),
|
|
1630
|
+
},
|
|
1631
|
+
product_id: spec.split('-')[0],
|
|
1632
|
+
};
|
|
1633
|
+
});
|
|
1636
1634
|
subVM.loading = true;
|
|
1637
1635
|
gvc.notifyDataChange(subVM.id);
|
|
1638
|
-
}
|
|
1636
|
+
},
|
|
1639
1637
|
});
|
|
1640
1638
|
}), { textStyle: 'font-weight: 400;' })}
|
|
1641
1639
|
</div>
|
|
@@ -1646,7 +1644,7 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1646
1644
|
class="d-flex align-items-center form-check-label c_updown_label gap-3"
|
|
1647
1645
|
>
|
|
1648
1646
|
<span class="tx_normal" style="min-width: 20px;"
|
|
1649
|
-
>${index + 1}
|
|
1647
|
+
>${index + 1}.</span
|
|
1650
1648
|
>
|
|
1651
1649
|
${BgWidget.validImageBox({
|
|
1652
1650
|
gvc: gvc,
|
|
@@ -1801,10 +1801,14 @@ function detail(gvc: GVC, cf: any, vm: any, cVm: any, page_tab: 'page' | 'hidden
|
|
|
1801
1801
|
if (subVM.loading) {
|
|
1802
1802
|
return BgWidget.spinner();
|
|
1803
1803
|
}
|
|
1804
|
+
|
|
1805
|
+
vm.data.content.relative_data ??= [];
|
|
1806
|
+
const relativeCloneData = structuredClone(vm.data.content.relative_data);
|
|
1807
|
+
|
|
1804
1808
|
return html`
|
|
1805
1809
|
<div class="d-flex flex-column p-2" style="gap: 18px;">
|
|
1806
1810
|
<div
|
|
1807
|
-
class="d-flex align-items-center gray-bottom-line-18
|
|
1811
|
+
class="d-flex align-items-center gray-bottom-line-18"
|
|
1808
1812
|
style="gap: 24px; justify-content: space-between;"
|
|
1809
1813
|
>
|
|
1810
1814
|
<div class="form-check-label c_updown_label">
|
|
@@ -1815,27 +1819,22 @@ function detail(gvc: GVC, cf: any, vm: any, cVm: any, page_tab: 'page' | 'hidden
|
|
|
1815
1819
|
gvc.event(() => {
|
|
1816
1820
|
BgProduct.productsDialog({
|
|
1817
1821
|
gvc: gvc,
|
|
1818
|
-
default:
|
|
1819
|
-
|
|
1820
|
-
|
|
1822
|
+
default: relativeCloneData.map(
|
|
1823
|
+
(dd: any) => `${dd.product_id}-${dd.variant.spec.join('-')}`
|
|
1824
|
+
),
|
|
1821
1825
|
with_variants: true,
|
|
1822
1826
|
filter_visible: page_tab === 'hidden' ? 'false' : 'true',
|
|
1823
|
-
callback:
|
|
1824
|
-
vm.data.content.relative_data =
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
},
|
|
1835
|
-
product_id: dd.split('-')[0],
|
|
1836
|
-
};
|
|
1837
|
-
})
|
|
1838
|
-
);
|
|
1827
|
+
callback: specArray => {
|
|
1828
|
+
vm.data.content.relative_data = specArray.map((spec: any) => {
|
|
1829
|
+
return {
|
|
1830
|
+
variant: {
|
|
1831
|
+
spec: spec
|
|
1832
|
+
.split('-')
|
|
1833
|
+
.filter((_: any, index: number) => index > 0),
|
|
1834
|
+
},
|
|
1835
|
+
product_id: spec.split('-')[0],
|
|
1836
|
+
};
|
|
1837
|
+
});
|
|
1839
1838
|
|
|
1840
1839
|
subVM.loading = true;
|
|
1841
1840
|
gvc.notifyDataChange(subVM.id);
|
|
@@ -1852,7 +1851,7 @@ function detail(gvc: GVC, cf: any, vm: any, cVm: any, page_tab: 'page' | 'hidden
|
|
|
1852
1851
|
class="d-flex align-items-center form-check-label c_updown_label gap-3"
|
|
1853
1852
|
>
|
|
1854
1853
|
<span class="tx_normal" style="min-width: 20px;"
|
|
1855
|
-
>${index + 1}
|
|
1854
|
+
>${index + 1}.</span
|
|
1856
1855
|
>
|
|
1857
1856
|
${BgWidget.validImageBox({
|
|
1858
1857
|
gvc: gvc,
|
|
@@ -20,7 +20,7 @@ export class BgProduct {
|
|
|
20
20
|
return window.parent.glitter.innerDialog((gvc) => {
|
|
21
21
|
return html `
|
|
22
22
|
<div class="bg-white shadow rounded-3">
|
|
23
|
-
<div class="px-3" style="max-height: calc(100vh - 100px);overflow-y: auto;">
|
|
23
|
+
<div class="px-3" style="max-height: calc(100vh - 100px); overflow-y: auto;">
|
|
24
24
|
${StockList.main(gvc, {
|
|
25
25
|
title: '選擇商品',
|
|
26
26
|
select_data: add_items,
|
|
@@ -82,7 +82,7 @@ export class BgProduct {
|
|
|
82
82
|
</div>
|
|
83
83
|
<div class="c_dialog">
|
|
84
84
|
<div class="c_dialog_body">
|
|
85
|
-
<div class="c_dialog_main p-3" style="gap: 12px; min-height: 480px; max-height:
|
|
85
|
+
<div class="c_dialog_main p-3" style="gap: 12px; min-height: 480px; max-height: 500px;">
|
|
86
86
|
<div class="d-flex mb-2" style="gap: 6px;">
|
|
87
87
|
${BgWidget.selectFilter({
|
|
88
88
|
gvc,
|
|
@@ -116,11 +116,8 @@ export class BgProduct {
|
|
|
116
116
|
return !obj.filter || obj.filter(dd);
|
|
117
117
|
})
|
|
118
118
|
.map((opt, index) => {
|
|
119
|
-
const id =
|
|
120
|
-
vm.ids.push({
|
|
121
|
-
key: opt.key,
|
|
122
|
-
id: id,
|
|
123
|
-
});
|
|
119
|
+
const id = `ProductsDialog${index}`;
|
|
120
|
+
vm.ids.push({ key: opt.key, id: id });
|
|
124
121
|
function call() {
|
|
125
122
|
if (obj.single) {
|
|
126
123
|
const tempArray = JSON.parse(JSON.stringify(obj.default));
|
|
@@ -147,102 +144,100 @@ export class BgProduct {
|
|
|
147
144
|
}
|
|
148
145
|
gvc.notifyDataChange(id);
|
|
149
146
|
}
|
|
150
|
-
return (gvc.bindView(
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
<div
|
|
163
|
-
<div
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
<div
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
${opt.value}
|
|
187
|
-
</div>
|
|
188
|
-
${opt.sub_title
|
|
189
|
-
? html `
|
|
190
|
-
<div class="fw-500" style="color: grey; font-size: 13px;">
|
|
191
|
-
${opt.sub_title}
|
|
192
|
-
</div>
|
|
193
|
-
`
|
|
194
|
-
: ''}
|
|
147
|
+
return (gvc.bindView({
|
|
148
|
+
bind: id,
|
|
149
|
+
view: () => {
|
|
150
|
+
return html `<input
|
|
151
|
+
class="form-check-input mt-0 ${vm.checkClass} cursor_pointer"
|
|
152
|
+
type="checkbox"
|
|
153
|
+
id="${opt.key}"
|
|
154
|
+
name="radio_${vm.id}_${index}"
|
|
155
|
+
onclick="${gvc.event(() => call())}"
|
|
156
|
+
${obj.default.includes(opt.key) ? 'checked' : ''}
|
|
157
|
+
/>
|
|
158
|
+
<div class="d-flex align-items-center justify-content-between w-100">
|
|
159
|
+
<div>
|
|
160
|
+
<div
|
|
161
|
+
class="d-flex align-items-center form-check-label c_updown_label gap-3"
|
|
162
|
+
style="max-width: ${document.body.clientWidth > 768 ? 500 : 220}px;"
|
|
163
|
+
>
|
|
164
|
+
${BgWidget.validImageBox({
|
|
165
|
+
gvc: gvc,
|
|
166
|
+
image: opt.image,
|
|
167
|
+
width: 40,
|
|
168
|
+
class: 'cursor_pointer',
|
|
169
|
+
events: [
|
|
170
|
+
{
|
|
171
|
+
key: 'onclick',
|
|
172
|
+
value: gvc.event(() => call()),
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
})}
|
|
176
|
+
<div class="d-flex flex-column">
|
|
177
|
+
<div
|
|
178
|
+
class="tx_normal ${opt.note ? 'mb-1' : ''} d-flex gap-2 cursor_pointer"
|
|
179
|
+
style="text-wrap: auto;"
|
|
180
|
+
onclick="${gvc.event(() => call())}"
|
|
181
|
+
>
|
|
182
|
+
${opt.value}
|
|
195
183
|
</div>
|
|
184
|
+
${opt.sub_title
|
|
185
|
+
? html `
|
|
186
|
+
<div class="fw-500" style="color: grey; font-size: 13px;">
|
|
187
|
+
${opt.sub_title}
|
|
188
|
+
</div>
|
|
189
|
+
`
|
|
190
|
+
: ''}
|
|
196
191
|
</div>
|
|
197
|
-
${(() => {
|
|
198
|
-
var _a, _b;
|
|
199
|
-
const isVisibleProduct = opt.content.visible === 'false' && !obj.show_product_type
|
|
200
|
-
? BgWidget.warningInsignia('隱形商品', { size: 'sm' })
|
|
201
|
-
: '';
|
|
202
|
-
const productCategory = obj.show_product_type
|
|
203
|
-
? BgWidget.infoInsignia(ProductConfig.getName(opt.content), {
|
|
204
|
-
size: 'sm',
|
|
205
|
-
})
|
|
206
|
-
: '';
|
|
207
|
-
const collections = (_b = (_a = opt.content) === null || _a === void 0 ? void 0 : _a.collection) === null || _b === void 0 ? void 0 : _b.filter(Boolean).map((col) => BgWidget.normalInsignia(col, { size: 'sm' })).join('');
|
|
208
|
-
const renderString = `${isVisibleProduct}${productCategory}${collections}`;
|
|
209
|
-
return renderString
|
|
210
|
-
? html `<div class="d-flex flex-wrap gap-1 mt-2">${renderString}</div>`
|
|
211
|
-
: '';
|
|
212
|
-
})()}
|
|
213
192
|
</div>
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
193
|
+
${(() => {
|
|
194
|
+
var _a, _b;
|
|
195
|
+
const isVisibleProduct = opt.content.visible === 'false' && !obj.show_product_type
|
|
196
|
+
? BgWidget.warningInsignia('隱形商品', { size: 'sm' })
|
|
197
|
+
: '';
|
|
198
|
+
const productCategory = obj.show_product_type
|
|
199
|
+
? BgWidget.infoInsignia(ProductConfig.getName(opt.content), {
|
|
200
|
+
size: 'sm',
|
|
201
|
+
})
|
|
202
|
+
: '';
|
|
203
|
+
const collections = (_b = (_a = opt.content) === null || _a === void 0 ? void 0 : _a.collection) === null || _b === void 0 ? void 0 : _b.filter(Boolean).map((col) => BgWidget.normalInsignia(col, { size: 'sm' })).join('');
|
|
204
|
+
const renderString = `${isVisibleProduct}${productCategory}${collections}`;
|
|
205
|
+
return renderString
|
|
206
|
+
? html `<div class="d-flex flex-wrap gap-1 mt-2">${renderString}</div>`
|
|
207
|
+
: '';
|
|
208
|
+
})()}
|
|
209
|
+
</div>
|
|
210
|
+
<div class="text-end">
|
|
211
|
+
<div class="tx_normal_14">
|
|
212
|
+
${(() => {
|
|
213
|
+
const contentMap = {
|
|
214
|
+
price: () => {
|
|
215
|
+
var _a, _b;
|
|
216
|
+
return html `$${parseInt(`${(_a = opt.content[vm.orderString || 'min_price']) !== null && _a !== void 0 ? _a : opt.content.variants[(_b = opt.variant_index) !== null && _b !== void 0 ? _b : 0].sale_price}`, 10).toLocaleString()}`;
|
|
217
|
+
},
|
|
218
|
+
stock: () => {
|
|
219
|
+
var _a, _b;
|
|
220
|
+
const variant = opt.content.variants[(_a = opt.variant_index) !== null && _a !== void 0 ? _a : 0];
|
|
221
|
+
if (variant.show_understocking === 'false') {
|
|
222
|
+
return '不追蹤庫存';
|
|
223
|
+
}
|
|
224
|
+
const n = Number(opt.content.variants[(_b = opt.variant_index) !== null && _b !== void 0 ? _b : 0].stock);
|
|
225
|
+
return html `庫存 ${(isNaN(n) ? 0 : n).toLocaleString()} 個`;
|
|
226
|
+
},
|
|
227
|
+
};
|
|
228
|
+
return (obj.right_element_type
|
|
229
|
+
? contentMap[obj.right_element_type]
|
|
230
|
+
: contentMap.price)();
|
|
231
|
+
})()}
|
|
238
232
|
</div>
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
233
|
+
${opt.note ? html ` <div class="tx_gray_12">${opt.note}</div> ` : ''}
|
|
234
|
+
</div>
|
|
235
|
+
</div>`;
|
|
236
|
+
},
|
|
237
|
+
divCreate: {
|
|
238
|
+
class: 'd-flex align-items-center',
|
|
239
|
+
style: `gap: ${document.body.clientWidth > 800 ? 24 : 12}px`,
|
|
240
|
+
},
|
|
246
241
|
}) + BgWidget.horizontalLine({ margin: 0.15 }));
|
|
247
242
|
}))
|
|
248
243
|
.trim() ||
|