ts-glitter 20.6.8 → 20.6.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lowcode/Entry.js +2 -2
- package/lowcode/Entry.ts +2 -2
- package/lowcode/backend-manager/bg-blog.js +617 -621
- package/lowcode/backend-manager/bg-blog.ts +2323 -2325
- package/lowcode/backend-manager/bg-line.js +5 -4
- package/lowcode/backend-manager/bg-line.ts +5 -4
- package/lowcode/backend-manager/bg-list-component.js +9 -0
- package/lowcode/backend-manager/bg-list-component.ts +15 -1
- package/lowcode/backend-manager/bg-notify.js +6 -4
- package/lowcode/backend-manager/bg-notify.ts +6 -4
- package/lowcode/backend-manager/bg-product.js +145 -0
- package/lowcode/backend-manager/bg-product.ts +153 -0
- package/lowcode/backend-manager/bg-sns.js +5 -3
- package/lowcode/backend-manager/bg-sns.ts +5 -3
- package/lowcode/backend-manager/bg-widget.js +92 -4
- package/lowcode/backend-manager/bg-widget.ts +122 -6
- package/lowcode/backend-manager/splitPage.js +0 -39
- package/lowcode/backend-manager/splitPage.ts +0 -40
- package/lowcode/cms-plugin/auto-fcm-advertise.js +17 -5
- package/lowcode/cms-plugin/auto-fcm-advertise.ts +19 -6
- package/lowcode/cms-plugin/auto-fcm-history.js +2732 -0
- package/lowcode/cms-plugin/auto-fcm-history.ts +2995 -0
- package/lowcode/cms-plugin/cms-router.js +5 -0
- package/lowcode/cms-plugin/cms-router.ts +6 -0
- package/lowcode/cms-plugin/filter-options.js +80 -27
- package/lowcode/cms-plugin/filter-options.ts +83 -27
- package/lowcode/cms-plugin/language-backend.js +50 -39
- package/lowcode/cms-plugin/language-backend.ts +109 -95
- package/lowcode/cms-plugin/menus-setting.js +175 -151
- package/lowcode/cms-plugin/menus-setting.ts +620 -591
- package/lowcode/cms-plugin/model/order.d.ts +1 -0
- package/lowcode/cms-plugin/module/data.js +7 -7
- package/lowcode/cms-plugin/module/data.ts +262 -233
- package/lowcode/cms-plugin/module/delivery-html.js +18 -10
- package/lowcode/cms-plugin/module/delivery-html.ts +26 -10
- package/lowcode/cms-plugin/module/order-setting.js +458 -328
- package/lowcode/cms-plugin/module/order-setting.ts +622 -351
- package/lowcode/cms-plugin/module/product-excel.js +1 -1
- package/lowcode/cms-plugin/module/product-excel.ts +2 -1
- package/lowcode/cms-plugin/order/order-module.js +90 -1
- package/lowcode/cms-plugin/order/order-module.ts +106 -1
- package/lowcode/cms-plugin/pos-pages/payment-page.js +11 -8
- package/lowcode/cms-plugin/pos-pages/payment-page.ts +28 -15
- package/lowcode/cms-plugin/pos-pages/products-page.js +0 -39
- package/lowcode/cms-plugin/pos-pages/products-page.ts +0 -40
- package/lowcode/cms-plugin/shopping-collections.ts +1 -3
- package/lowcode/cms-plugin/shopping-finance-setting.js +19 -80
- package/lowcode/cms-plugin/shopping-finance-setting.ts +19 -87
- package/lowcode/cms-plugin/shopping-order-manager.js +122 -38
- package/lowcode/cms-plugin/shopping-order-manager.ts +160 -58
- package/lowcode/cms-plugin/shopping-product-setting.js +364 -376
- package/lowcode/cms-plugin/shopping-product-setting.ts +406 -415
- package/lowcode/cms-plugin/shopping-setting-advance.js +57 -16
- package/lowcode/cms-plugin/shopping-setting-advance.ts +69 -18
- package/lowcode/cms-plugin/user/user-module.js +2 -43
- package/lowcode/cms-plugin/user/user-module.ts +2 -46
- package/lowcode/cms-plugin/user-list.js +4 -6
- package/lowcode/cms-plugin/user-list.ts +35 -38
- package/lowcode/css/editor.css +42 -3
- package/lowcode/glitter-base/global/language.js +6 -1
- package/lowcode/glitter-base/global/language.ts +10 -4
- package/lowcode/glitter-base/global/payment-config.js +19 -16
- package/lowcode/glitter-base/global/payment-config.ts +22 -16
- package/lowcode/glitter-base/global/shipment-config.js +6 -5
- package/lowcode/glitter-base/global/shipment-config.ts +12 -10
- package/lowcode/glitter-base/route/fcm.js +21 -1
- package/lowcode/glitter-base/route/fcm.ts +22 -2
- package/lowcode/glitter-base/route/shopping.js +8 -32
- package/lowcode/glitter-base/route/shopping.ts +10 -33
- package/lowcode/glitter-base/route/user.js +11 -2
- package/lowcode/glitter-base/route/user.ts +23 -12
- package/lowcode/jspage/function-page/setting_editor.js +9 -0
- package/lowcode/jspage/function-page/setting_editor.ts +9 -0
- package/lowcode/public-components/blogs/list.js +223 -195
- package/lowcode/public-components/blogs/list.ts +383 -352
- package/lowcode/public-components/product/product-list.js +8 -4
- package/lowcode/public-components/product/product-list.ts +9 -4
- package/lowcode/public-components/terms-related/index.js +1 -1
- package/lowcode/public-components/terms-related/index.ts +1 -1
- package/lowcode/public-components/user-manager/um-login.js +1 -1
- package/lowcode/public-components/user-manager/um-login.ts +2 -2
- package/lowcode/public-components/user-manager/um-order.js +41 -5
- package/lowcode/public-components/user-manager/um-order.ts +58 -20
- package/lowcode/public-components/user-manager/um-voucher.ts +2 -2
- package/nhi4veq3gk.json +1 -0
- package/package.json +1 -1
- package/src/Language.d.ts +2 -0
- package/src/Language.js +66 -65
- package/src/Language.js.map +1 -1
- package/src/Language.ts +719 -715
- package/src/api-public/config/shipment-config.js +3 -2
- package/src/api-public/config/shipment-config.js.map +1 -1
- package/src/api-public/config/shipment-config.ts +3 -2
- package/src/api-public/controllers/ai-chat.js.map +1 -1
- package/src/api-public/controllers/ai-chat.ts +1 -2
- package/src/api-public/controllers/fcm.js +23 -58
- package/src/api-public/controllers/fcm.js.map +1 -1
- package/src/api-public/controllers/fcm.ts +28 -56
- package/src/api-public/controllers/shop.js +7 -1
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +17 -10
- package/src/api-public/controllers/user.js +1 -0
- package/src/api-public/controllers/user.js.map +1 -1
- package/src/api-public/controllers/user.ts +2 -0
- package/src/api-public/services/auto-send-email.js +247 -187
- package/src/api-public/services/auto-send-email.js.map +1 -1
- package/src/api-public/services/auto-send-email.ts +568 -505
- package/src/api-public/services/delivery.js +1 -1
- package/src/api-public/services/delivery.js.map +1 -1
- package/src/api-public/services/delivery.ts +6 -5
- package/src/api-public/services/financial-service.js +1 -2
- package/src/api-public/services/financial-service.js.map +1 -1
- package/src/api-public/services/financial-service.ts +4 -6
- package/src/api-public/services/manager.d.ts +4 -3
- package/src/api-public/services/manager.js +8 -12
- package/src/api-public/services/manager.js.map +1 -1
- package/src/api-public/services/manager.ts +57 -59
- package/src/api-public/services/model/handlePaymentTransaction.d.ts +1 -1
- package/src/api-public/services/model/handlePaymentTransaction.js +23 -3
- package/src/api-public/services/model/handlePaymentTransaction.js.map +1 -1
- package/src/api-public/services/model/handlePaymentTransaction.ts +25 -36
- package/src/api-public/services/schedule.d.ts +1 -0
- package/src/api-public/services/schedule.js +27 -0
- package/src/api-public/services/schedule.js.map +1 -1
- package/src/api-public/services/schedule.ts +30 -0
- package/src/api-public/services/shopping.d.ts +22 -2
- package/src/api-public/services/shopping.js +362 -90
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +481 -134
- package/src/api-public/services/user.d.ts +1 -0
- package/src/api-public/services/user.js +32 -12
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +38 -19
- package/src/api-public/services/workers.js +3 -3
- package/src/api-public/services/workers.js.map +1 -1
- package/src/api-public/services/workers.ts +103 -103
- package/src/app-project/serverless/src/modules/database.js +1 -1
- package/src/app-project/serverless/src/modules/database.js.map +1 -1
- package/src/app-project/serverless/src/modules/database.ts +171 -171
- package/src/controllers/template.d.ts +1 -1
- package/src/controllers/template.js +16 -16
- package/src/controllers/template.js.map +1 -1
- package/src/controllers/template.ts +98 -84
- package/src/modules/database.js +3 -1
- package/src/modules/database.js.map +1 -1
- package/src/modules/database.ts +185 -181
- package/src/modules/firebase.d.ts +17 -0
- package/src/modules/firebase.js +126 -0
- package/src/modules/firebase.js.map +1 -1
- package/src/modules/firebase.ts +169 -0
- package/src/public-config-initial/auto-fcm.js +8 -2
- package/src/public-config-initial/auto-fcm.js.map +1 -1
- package/src/public-config-initial/auto-fcm.ts +15 -6
- package/src/services/app.d.ts +2 -1
- package/src/services/app.js.map +1 -1
- package/src/services/app.ts +2 -1
- package/src/services/template.d.ts +3 -2
- package/src/services/template.js +2 -1
- package/src/services/template.js.map +1 -1
- package/src/services/template.ts +13 -20
|
@@ -18,11 +18,11 @@ import { BaseApi } from '../glitterBundle/api/base.js';
|
|
|
18
18
|
import { BgProduct } from './bg-product.js';
|
|
19
19
|
import { CheckInput } from '../modules/checkInput.js';
|
|
20
20
|
import { Template_refer } from '../cms-plugin/template_refer.js';
|
|
21
|
-
import { LanguageBackend } from
|
|
22
|
-
import { ProductAi } from
|
|
23
|
-
import { Tool } from
|
|
24
|
-
import { imageLibrary } from
|
|
25
|
-
import { Language } from
|
|
21
|
+
import { LanguageBackend } from '../cms-plugin/language-backend.js';
|
|
22
|
+
import { ProductAi } from '../cms-plugin/ai-generator/product-ai.js';
|
|
23
|
+
import { Tool } from '../modules/tool.js';
|
|
24
|
+
import { imageLibrary } from '../modules/image-library.js';
|
|
25
|
+
import { Language } from '../glitter-base/global/language.js';
|
|
26
26
|
const html = String.raw;
|
|
27
27
|
export class BgBlog {
|
|
28
28
|
static setCollection(cf) {
|
|
@@ -38,10 +38,8 @@ export class BgBlog {
|
|
|
38
38
|
vm.link = data.response.value;
|
|
39
39
|
if (cf.select_module) {
|
|
40
40
|
function setCheck(link) {
|
|
41
|
-
link.map(
|
|
42
|
-
if (cf.select_module.def.find(
|
|
43
|
-
return d1 === dd.link;
|
|
44
|
-
})) {
|
|
41
|
+
link.map(dd => {
|
|
42
|
+
if (cf.select_module.def.find(d1 => d1 === dd.link)) {
|
|
45
43
|
dd.selected = true;
|
|
46
44
|
}
|
|
47
45
|
setCheck(dd.items);
|
|
@@ -53,7 +51,7 @@ export class BgBlog {
|
|
|
53
51
|
}
|
|
54
52
|
});
|
|
55
53
|
function clearNoNeedData(items) {
|
|
56
|
-
items.map(
|
|
54
|
+
items.map(dd => {
|
|
57
55
|
dd.selected = undefined;
|
|
58
56
|
clearNoNeedData(dd.items || []);
|
|
59
57
|
});
|
|
@@ -61,7 +59,7 @@ export class BgBlog {
|
|
|
61
59
|
function save() {
|
|
62
60
|
let select_list = [];
|
|
63
61
|
function check_select(items) {
|
|
64
|
-
items.map(
|
|
62
|
+
items.map(dd => {
|
|
65
63
|
if (dd.selected) {
|
|
66
64
|
select_list.push(dd.link);
|
|
67
65
|
}
|
|
@@ -74,7 +72,7 @@ export class BgBlog {
|
|
|
74
72
|
key: cf.key,
|
|
75
73
|
value: vm.link,
|
|
76
74
|
user_id: 'manager',
|
|
77
|
-
}).then(
|
|
75
|
+
}).then(data => {
|
|
78
76
|
setTimeout(() => {
|
|
79
77
|
dialog.dataLoading({ visible: false });
|
|
80
78
|
if (cf.select_module) {
|
|
@@ -88,14 +86,14 @@ export class BgBlog {
|
|
|
88
86
|
}
|
|
89
87
|
function selectAll(array) {
|
|
90
88
|
array.selected = true;
|
|
91
|
-
array.items.map(
|
|
89
|
+
array.items.map(dd => {
|
|
92
90
|
dd.selected = true;
|
|
93
91
|
selectAll(dd);
|
|
94
92
|
});
|
|
95
93
|
}
|
|
96
94
|
function clearAll(array) {
|
|
97
95
|
array.selected = false;
|
|
98
|
-
array.items.map(
|
|
96
|
+
array.items.map(dd => {
|
|
99
97
|
dd.selected = false;
|
|
100
98
|
clearAll(dd);
|
|
101
99
|
});
|
|
@@ -116,7 +114,7 @@ export class BgBlog {
|
|
|
116
114
|
return count;
|
|
117
115
|
}
|
|
118
116
|
function deleteSelect(items) {
|
|
119
|
-
return items.filter(
|
|
117
|
+
return items.filter(d1 => {
|
|
120
118
|
d1.items = deleteSelect(d1.items || []);
|
|
121
119
|
return !d1.selected;
|
|
122
120
|
});
|
|
@@ -125,7 +123,7 @@ export class BgBlog {
|
|
|
125
123
|
let exists_count = -1;
|
|
126
124
|
let title_exists_count = -1;
|
|
127
125
|
function check(it, items) {
|
|
128
|
-
items.map(
|
|
126
|
+
items.map(d1 => {
|
|
129
127
|
if (d1.link === it.link) {
|
|
130
128
|
exists_count++;
|
|
131
129
|
}
|
|
@@ -158,81 +156,83 @@ export class BgBlog {
|
|
|
158
156
|
return {
|
|
159
157
|
bind: vm.id,
|
|
160
158
|
view: () => {
|
|
161
|
-
return html `
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
159
|
+
return html ` <div class="title-container">
|
|
160
|
+
${cf.goBack
|
|
161
|
+
? BgWidget.goBack(cf.gvc.event(() => {
|
|
162
|
+
cf.goBack();
|
|
163
|
+
}))
|
|
164
|
+
: ''}
|
|
165
|
+
${BgWidget.title('分類設定')}
|
|
166
|
+
</div>
|
|
167
|
+
${BgWidget.container(html ` <div
|
|
168
|
+
style="width:100%; padding: 20px; background: white; box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.08); border-radius: 10px; overflow: hidden; justify-content: center; align-items: center; display: inline-flex"
|
|
169
|
+
>
|
|
170
|
+
<div style="width: 100%; position: relative">
|
|
171
|
+
<div
|
|
172
|
+
style="width: 100%; left: 0px; top: 0px; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 20px; display: inline-flex"
|
|
173
|
+
>
|
|
174
|
+
<div
|
|
175
|
+
class="w-100 ${getSelectCount({
|
|
176
176
|
items: vm.link,
|
|
177
177
|
}) > 0
|
|
178
|
-
?
|
|
178
|
+
? ''
|
|
179
179
|
: `d-none`}"
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
180
|
+
style="height: 40px; padding: 12px 18px;background: #F7F7F7; border-radius: 10px; justify-content: flex-end; align-items: center; gap: 8px; display: inline-flex"
|
|
181
|
+
>
|
|
182
|
+
<div
|
|
183
|
+
style="flex: 1 1 0; color: #393939; font-size: 14px; font-family: Noto Sans; font-weight: 700; word-wrap: break-word"
|
|
184
|
+
>
|
|
185
|
+
已選取${getSelectCount({
|
|
184
186
|
items: vm.link,
|
|
185
187
|
})}項
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
188
|
+
</div>
|
|
189
|
+
<div
|
|
190
|
+
style="cursor:pointer;padding: 4px 14px;background: white; box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.10); border-radius: 20px; border: 1px #DDDDDD solid; justify-content: flex-start; align-items: flex-start; gap: 10px; display: flex"
|
|
191
|
+
>
|
|
192
|
+
<div
|
|
193
|
+
style="color: #393939; font-size: 14px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word"
|
|
194
|
+
onclick="${gvc.event(() => {
|
|
193
195
|
vm.link = deleteSelect(vm.link);
|
|
194
196
|
gvc.notifyDataChange(vm.id);
|
|
195
197
|
})}"
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
198
|
+
>
|
|
199
|
+
刪除
|
|
200
|
+
</div>
|
|
201
|
+
</div>
|
|
202
|
+
</div>
|
|
203
|
+
<div
|
|
204
|
+
class="d-flex align-items-center"
|
|
205
|
+
style="width: 100%; height: 22px; position: relative;gap:29px;"
|
|
206
|
+
>
|
|
207
|
+
<div
|
|
208
|
+
class="${allSelect({
|
|
205
209
|
items: vm.link,
|
|
206
|
-
selected: !vm.link.find(
|
|
207
|
-
return !dd.selected;
|
|
208
|
-
}),
|
|
210
|
+
selected: !vm.link.find(dd => !dd.selected),
|
|
209
211
|
})
|
|
210
212
|
? `fa-solid fa-square-check`
|
|
211
213
|
: `fa-regular fa-square`}"
|
|
212
|
-
|
|
213
|
-
|
|
214
|
+
style="color:#393939;width: 16px; height: 16px;cursor: pointer;"
|
|
215
|
+
onclick="${cf.gvc.event((e, event) => {
|
|
214
216
|
event.stopPropagation();
|
|
215
|
-
if (vm.link.find(
|
|
216
|
-
|
|
217
|
-
})) {
|
|
218
|
-
selectAll({
|
|
219
|
-
items: vm.link,
|
|
220
|
-
});
|
|
217
|
+
if (vm.link.find(dd => !dd.selected)) {
|
|
218
|
+
selectAll({ items: vm.link });
|
|
221
219
|
}
|
|
222
220
|
else {
|
|
223
|
-
clearAll({
|
|
224
|
-
items: vm.link,
|
|
225
|
-
});
|
|
221
|
+
clearAll({ items: vm.link });
|
|
226
222
|
}
|
|
227
223
|
gvc.notifyDataChange(vm.id);
|
|
228
224
|
})}"
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
225
|
+
></div>
|
|
226
|
+
<div
|
|
227
|
+
style="left: 61px; top: 0px; color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 700; word-wrap: break-word"
|
|
228
|
+
>
|
|
229
|
+
分類名稱
|
|
230
|
+
</div>
|
|
231
|
+
</div>
|
|
232
|
+
<div
|
|
233
|
+
style="align-self: stretch; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 18px; display: flex"
|
|
234
|
+
>
|
|
235
|
+
${(() => {
|
|
236
236
|
function renderItems(array) {
|
|
237
237
|
const id = gvc.glitter.getUUID();
|
|
238
238
|
return (gvc.bindView(() => {
|
|
@@ -243,20 +243,22 @@ export class BgBlog {
|
|
|
243
243
|
.map((dd, index) => {
|
|
244
244
|
dd.items;
|
|
245
245
|
const list = html `
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
246
|
+
<div
|
|
247
|
+
class=" w-100 "
|
|
248
|
+
style="width: 100%; justify-content: flex-start; align-items: center; gap: 5px; display: inline-flex;cursor: pointer;"
|
|
249
|
+
onclick="${cf.gvc.event(() => {
|
|
250
250
|
if (dd.items && dd.items.length > 0) {
|
|
251
251
|
dd.toggle = !dd.toggle;
|
|
252
252
|
gvc.notifyDataChange(vm.id);
|
|
253
253
|
}
|
|
254
254
|
})}"
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
255
|
+
>
|
|
256
|
+
<div
|
|
257
|
+
class="${allSelect(dd)
|
|
258
|
+
? `fa-solid fa-square-check`
|
|
259
|
+
: `fa-regular fa-square`}"
|
|
260
|
+
style="color:#393939;width: 16px; height: 16px;"
|
|
261
|
+
onclick="${cf.gvc.event((_, event) => {
|
|
260
262
|
event.stopPropagation();
|
|
261
263
|
dd.selected = !dd.selected;
|
|
262
264
|
if (dd.selected) {
|
|
@@ -267,45 +269,57 @@ export class BgBlog {
|
|
|
267
269
|
}
|
|
268
270
|
gvc.notifyDataChange(vm.id);
|
|
269
271
|
})}"
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
272
|
+
></div>
|
|
273
|
+
<div
|
|
274
|
+
class="hoverF2 pe-2"
|
|
275
|
+
style="width: 100%; justify-content: flex-start; align-items: center; gap: 8px; display: flex"
|
|
276
|
+
>
|
|
277
|
+
<i
|
|
278
|
+
class="ms-2 fa-solid fa-grip-dots-vertical color39 dragItem hoverBtn d-flex align-items-center justify-content-center"
|
|
279
|
+
style="cursor: pointer;width:25px;height: 25px;"
|
|
280
|
+
></i>
|
|
281
|
+
<div
|
|
282
|
+
style="flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px; display: inline-flex"
|
|
283
|
+
>
|
|
284
|
+
<div
|
|
285
|
+
style="justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex"
|
|
286
|
+
>
|
|
287
|
+
<div
|
|
288
|
+
style="color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word"
|
|
289
|
+
>
|
|
290
|
+
${dd.title}
|
|
291
|
+
</div>
|
|
292
|
+
${dd.items && dd.items.length > 0
|
|
283
293
|
? !dd.toggle
|
|
284
294
|
? `<i class="fa-solid fa-angle-down color39"></i>`
|
|
285
295
|
: `<i class="fa-solid fa-angle-up color39"></i>`
|
|
286
|
-
:
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
296
|
+
: ''}
|
|
297
|
+
</div>
|
|
298
|
+
<div
|
|
299
|
+
style="justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex"
|
|
300
|
+
>
|
|
301
|
+
<div
|
|
302
|
+
style="color: #3366BB; font-size: 14px; font-family: Noto Sans; font-weight: 400; line-height: 14px; word-wrap: break-word"
|
|
303
|
+
>
|
|
304
|
+
${dd.title}
|
|
305
|
+
</div>
|
|
306
|
+
<div
|
|
307
|
+
style="color: #159240; font-size: 14px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word"
|
|
308
|
+
>
|
|
309
|
+
${dd.link}
|
|
310
|
+
</div>
|
|
311
|
+
</div>
|
|
312
|
+
</div>
|
|
313
|
+
<div class="flex-fill"></div>
|
|
314
|
+
<div
|
|
315
|
+
class="child me-2"
|
|
316
|
+
onclick="${cf.gvc.event((_, event) => {
|
|
303
317
|
event.stopPropagation();
|
|
304
318
|
MenusSetting.collectionEvent({
|
|
305
319
|
link: '',
|
|
306
320
|
title: '',
|
|
307
321
|
items: [],
|
|
308
|
-
},
|
|
322
|
+
}, data => {
|
|
309
323
|
dd.items = dd.items || [];
|
|
310
324
|
dd.items.push(data);
|
|
311
325
|
if (checkLinkExists(data, vm.link)) {
|
|
@@ -318,16 +332,15 @@ export class BgBlog {
|
|
|
318
332
|
}
|
|
319
333
|
});
|
|
320
334
|
})}"
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
onclick="${cf.gvc.event((e, event) => {
|
|
335
|
+
>
|
|
336
|
+
<i class="fa-solid fa-plus d-none" style="color:#393939;"></i>
|
|
337
|
+
</div>
|
|
338
|
+
<div
|
|
339
|
+
class="child"
|
|
340
|
+
onclick="${cf.gvc.event((_, event) => {
|
|
328
341
|
event.stopPropagation();
|
|
329
342
|
const og = JSON.parse(JSON.stringify(dd));
|
|
330
|
-
MenusSetting.collectionEvent(dd,
|
|
343
|
+
MenusSetting.collectionEvent(dd, data => {
|
|
331
344
|
if (checkLinkExists(data, vm.link)) {
|
|
332
345
|
array[index] = data;
|
|
333
346
|
gvc.notifyDataChange(vm.id);
|
|
@@ -340,23 +353,23 @@ export class BgBlog {
|
|
|
340
353
|
}
|
|
341
354
|
});
|
|
342
355
|
})}"
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
${dd.items && dd.items.length > 0
|
|
356
|
+
>
|
|
357
|
+
<i class="fa-solid fa-pencil" style="color:#393939;"></i>
|
|
358
|
+
</div>
|
|
359
|
+
</div>
|
|
360
|
+
</div>
|
|
361
|
+
${dd.items && dd.items.length > 0
|
|
350
362
|
? html `
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
363
|
+
<div
|
|
364
|
+
class=" w-100 ${dd.toggle ? '' : `d-none`}"
|
|
365
|
+
style="padding-left: 35px;"
|
|
366
|
+
>
|
|
367
|
+
${renderItems(dd.items)}
|
|
368
|
+
</div>
|
|
369
|
+
`
|
|
370
|
+
: ''}
|
|
371
|
+
`;
|
|
372
|
+
return html ` <li class="w-100 ">${list}</li>`;
|
|
360
373
|
})
|
|
361
374
|
.join('');
|
|
362
375
|
},
|
|
@@ -370,18 +383,16 @@ export class BgBlog {
|
|
|
370
383
|
{
|
|
371
384
|
src: `https://raw.githack.com/SortableJS/Sortable/master/Sortable.js`,
|
|
372
385
|
},
|
|
373
|
-
], () => {
|
|
374
|
-
}, () => {
|
|
375
|
-
});
|
|
386
|
+
], () => { }, () => { });
|
|
376
387
|
const interval = setInterval(() => {
|
|
377
388
|
if (window.Sortable) {
|
|
378
389
|
try {
|
|
379
390
|
gvc.addStyle(`
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
391
|
+
ul {
|
|
392
|
+
list-style: none;
|
|
393
|
+
padding: 0;
|
|
394
|
+
}
|
|
395
|
+
`);
|
|
385
396
|
function swapArr(arr, index1, index2) {
|
|
386
397
|
const data = arr[index1];
|
|
387
398
|
arr.splice(index1, 1);
|
|
@@ -392,8 +403,7 @@ export class BgBlog {
|
|
|
392
403
|
group: id,
|
|
393
404
|
animation: 100,
|
|
394
405
|
handle: '.dragItem',
|
|
395
|
-
onChange: function (evt) {
|
|
396
|
-
},
|
|
406
|
+
onChange: function (evt) { },
|
|
397
407
|
onEnd: (evt) => {
|
|
398
408
|
swapArr(array, startIndex, evt.newIndex);
|
|
399
409
|
gvc.notifyDataChange(id);
|
|
@@ -403,24 +413,21 @@ export class BgBlog {
|
|
|
403
413
|
},
|
|
404
414
|
});
|
|
405
415
|
}
|
|
406
|
-
catch (e) {
|
|
407
|
-
}
|
|
416
|
+
catch (e) { }
|
|
408
417
|
clearInterval(interval);
|
|
409
418
|
}
|
|
410
419
|
}, 100);
|
|
411
420
|
},
|
|
412
421
|
};
|
|
413
422
|
}) +
|
|
414
|
-
html `
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
style="cursor:pointer;align-self: stretch; height: 50px; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 10px; display: flex"
|
|
418
|
-
onclick="${cf.gvc.event(() => {
|
|
423
|
+
html ` <div
|
|
424
|
+
style="cursor:pointer;align-self: stretch; height: 50px; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 10px; display: flex"
|
|
425
|
+
onclick="${cf.gvc.event(() => {
|
|
419
426
|
MenusSetting.collectionEvent({
|
|
420
427
|
link: '',
|
|
421
428
|
title: '',
|
|
422
429
|
items: [],
|
|
423
|
-
},
|
|
430
|
+
}, data => {
|
|
424
431
|
array.push(data);
|
|
425
432
|
if (checkLinkExists(data, vm.link)) {
|
|
426
433
|
gvc.notifyDataChange(vm.id);
|
|
@@ -432,32 +439,35 @@ export class BgBlog {
|
|
|
432
439
|
}
|
|
433
440
|
});
|
|
434
441
|
})}"
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
442
|
+
>
|
|
443
|
+
<div
|
|
444
|
+
style="align-self: stretch; height: 54px; border-radius: 10px; border: 1px #DDDDDD solid; justify-content: center; align-items: center; gap: 6px; display: inline-flex"
|
|
445
|
+
>
|
|
446
|
+
<i class="fa-solid fa-plus" style="color: #3366BB;font-size: 16px; "></i>
|
|
447
|
+
<div
|
|
448
|
+
style="color: #3366BB; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word"
|
|
449
|
+
>
|
|
450
|
+
新增分類
|
|
451
|
+
</div>
|
|
452
|
+
</div>
|
|
453
|
+
</div>`);
|
|
446
454
|
}
|
|
447
455
|
return renderItems(vm.link);
|
|
448
456
|
})()}
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
457
|
+
</div>
|
|
458
|
+
</div>
|
|
459
|
+
</div>
|
|
460
|
+
</div>`)}
|
|
461
|
+
<div class="update-bar-container">
|
|
462
|
+
${cf.goBack
|
|
463
|
+
? BgWidget.cancel(gvc.event(() => {
|
|
464
|
+
cf.goBack();
|
|
465
|
+
}))
|
|
466
|
+
: ''}
|
|
467
|
+
${BgWidget.save(gvc.event(() => {
|
|
458
468
|
save();
|
|
459
469
|
}), cf.goBack ? '確認' : `儲存`)}
|
|
460
|
-
|
|
470
|
+
</div>`;
|
|
461
471
|
},
|
|
462
472
|
divCreate: {
|
|
463
473
|
style: `padding-bottom:60px;`,
|
|
@@ -465,8 +475,7 @@ export class BgBlog {
|
|
|
465
475
|
};
|
|
466
476
|
});
|
|
467
477
|
}
|
|
468
|
-
static contentManager(gvc, type = 'list', callback = () => {
|
|
469
|
-
}, is_page, widget, page_tab) {
|
|
478
|
+
static contentManager(gvc, type = 'list', callback = () => { }, is_page, widget, page_tab) {
|
|
470
479
|
const html = String.raw;
|
|
471
480
|
const glitter = gvc.glitter;
|
|
472
481
|
const vm = {
|
|
@@ -490,16 +499,15 @@ export class BgBlog {
|
|
|
490
499
|
},
|
|
491
500
|
{
|
|
492
501
|
key: '發布時間',
|
|
493
|
-
value: html `<span
|
|
494
|
-
class="fs-7">${glitter.ut.dateFormat(new Date(dd.created_time), 'yyyy-MM-dd')}</span>`,
|
|
502
|
+
value: html `<span class="fs-7">${glitter.ut.dateFormat(new Date(dd.created_time), 'yyyy-MM-dd')}</span>`,
|
|
495
503
|
},
|
|
496
504
|
{
|
|
497
505
|
key: '預覽',
|
|
498
506
|
value: html `
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
507
|
+
<div
|
|
508
|
+
class="d-flex align-items-center justify-content-center hoverBtn me-2 border"
|
|
509
|
+
style="height:28px;width:28px;border-radius:5px;cursor:pointer;color:#151515;"
|
|
510
|
+
onclick="${gvc.event((e, event) => {
|
|
503
511
|
const href = (() => {
|
|
504
512
|
return `https://${window.parent.glitter.share.editorViewModel.domain}/${is_page
|
|
505
513
|
? (() => {
|
|
@@ -517,10 +525,10 @@ export class BgBlog {
|
|
|
517
525
|
window.parent.glitter.openNewTab(href);
|
|
518
526
|
event.stopPropagation();
|
|
519
527
|
})}"
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
528
|
+
>
|
|
529
|
+
<i class="fa-regular fa-eye" aria-hidden="true"></i>
|
|
530
|
+
</div>
|
|
531
|
+
`,
|
|
524
532
|
},
|
|
525
533
|
];
|
|
526
534
|
});
|
|
@@ -542,25 +550,20 @@ export class BgBlog {
|
|
|
542
550
|
dataList: [{ obj: vm, key: 'type' }],
|
|
543
551
|
view: () => {
|
|
544
552
|
if (window.parent.glitter.getUrlParameter('page-id') && vm.type !== 'replace') {
|
|
545
|
-
return
|
|
553
|
+
return '';
|
|
546
554
|
}
|
|
555
|
+
const pageTabMap = {
|
|
556
|
+
hidden: '隱形賣場',
|
|
557
|
+
page: '自訂頁面',
|
|
558
|
+
shopping: '一頁商店',
|
|
559
|
+
blog: '網誌文章',
|
|
560
|
+
};
|
|
547
561
|
if (vm.type === 'list') {
|
|
548
562
|
return BgWidget.container(html `
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
switch (page_tab) {
|
|
554
|
-
case 'hidden':
|
|
555
|
-
return '隱形賣場';
|
|
556
|
-
case 'page':
|
|
557
|
-
return '自訂頁面';
|
|
558
|
-
case 'shopping':
|
|
559
|
-
return '一頁商店';
|
|
560
|
-
}
|
|
561
|
-
})()
|
|
562
|
-
: '網誌文章')}
|
|
563
|
-
${BgWidget.grayNote(is_page
|
|
563
|
+
<div class="title-container flex-column flex-sm-row w-100 ${type === 'select' ? `d-none` : ''}">
|
|
564
|
+
<div class="d-flex flex-column w-100" style="gap:5px;">
|
|
565
|
+
${BgWidget.title(is_page ? pageTabMap[page_tab] : pageTabMap.blog)}
|
|
566
|
+
${BgWidget.grayNote(is_page
|
|
564
567
|
? (() => {
|
|
565
568
|
switch (page_tab) {
|
|
566
569
|
case 'hidden':
|
|
@@ -572,31 +575,30 @@ export class BgBlog {
|
|
|
572
575
|
}
|
|
573
576
|
})()
|
|
574
577
|
: '快速分享商店最新資訊的好功能')}
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
${is_page
|
|
578
|
+
</div>
|
|
579
|
+
<div class="flex-fill my-2 my-sm-0"></div>
|
|
580
|
+
<div class=" ${document.body.clientWidth < 800 ? `w-100` : ''}" style="display: flex; gap: 12px;">
|
|
581
|
+
<div class="flex-fill d-flex d-sm-none"></div>
|
|
582
|
+
${is_page
|
|
581
583
|
? ''
|
|
582
584
|
: BgWidget.grayButton('網誌分類', gvc.event(() => {
|
|
583
585
|
vm.type = 'collection';
|
|
584
586
|
gvc.notifyDataChange(id);
|
|
585
587
|
}))}
|
|
586
|
-
|
|
588
|
+
${BgWidget.darkButton(`新增${is_page ? `頁面` : `網誌`}`, gvc.event(() => {
|
|
587
589
|
vm.data = { content: {} };
|
|
588
590
|
vm.type = 'add';
|
|
589
591
|
}))}
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
BgWidget.searchPlace(gvc.event(
|
|
592
|
+
</div>
|
|
593
|
+
</div>
|
|
594
|
+
${BgWidget.container(BgWidget.mainCard([
|
|
595
|
+
BgWidget.searchPlace(gvc.event(e => {
|
|
594
596
|
vm.query = e.value;
|
|
595
597
|
gvc.notifyDataChange(id);
|
|
596
598
|
}), vm.query || '', '搜尋所有文章'),
|
|
597
599
|
BgWidget.tableV3({
|
|
598
600
|
gvc: gvc,
|
|
599
|
-
getData:
|
|
601
|
+
getData: vd => {
|
|
600
602
|
vmi = vd;
|
|
601
603
|
const limit = 20;
|
|
602
604
|
Article.get({
|
|
@@ -606,7 +608,7 @@ export class BgBlog {
|
|
|
606
608
|
for_index: is_page ? `false` : `true`,
|
|
607
609
|
status: '0,1',
|
|
608
610
|
page_type: page_tab,
|
|
609
|
-
}).then(
|
|
611
|
+
}).then(data => {
|
|
610
612
|
vm.dataList = data.response.data;
|
|
611
613
|
vmi.pageSize = Math.ceil(data.response.total / limit);
|
|
612
614
|
vmi.originalData = vm.dataList;
|
|
@@ -620,9 +622,7 @@ export class BgBlog {
|
|
|
620
622
|
vm.dataList[index].checked = !vm.dataList[index].checked;
|
|
621
623
|
vmi.data = getDatalist();
|
|
622
624
|
vmi.callback();
|
|
623
|
-
callback(vm.dataList.filter((dd) =>
|
|
624
|
-
return dd.checked;
|
|
625
|
-
}));
|
|
625
|
+
callback(vm.dataList.filter((dd) => dd.checked));
|
|
626
626
|
}
|
|
627
627
|
else {
|
|
628
628
|
vm.data = vm.dataList[index];
|
|
@@ -632,20 +632,16 @@ export class BgBlog {
|
|
|
632
632
|
filter: [
|
|
633
633
|
{
|
|
634
634
|
name: '批量移除',
|
|
635
|
-
event:
|
|
635
|
+
event: checkedData => {
|
|
636
636
|
const dialog = new ShareDialog(glitter);
|
|
637
637
|
dialog.checkYesOrNot({
|
|
638
638
|
text: '是否確認刪除所選項目?',
|
|
639
|
-
callback:
|
|
639
|
+
callback: response => {
|
|
640
640
|
if (response) {
|
|
641
641
|
dialog.dataLoading({ visible: true });
|
|
642
642
|
Article.deleteV2({
|
|
643
|
-
id: checkedData
|
|
644
|
-
|
|
645
|
-
return dd.id;
|
|
646
|
-
})
|
|
647
|
-
.join(`,`),
|
|
648
|
-
}).then((res) => {
|
|
643
|
+
id: checkedData.map((dd) => dd.id).join(`,`),
|
|
644
|
+
}).then(res => {
|
|
649
645
|
dialog.dataLoading({ visible: false });
|
|
650
646
|
if (res.result) {
|
|
651
647
|
vm.dataList = undefined;
|
|
@@ -663,7 +659,7 @@ export class BgBlog {
|
|
|
663
659
|
],
|
|
664
660
|
}),
|
|
665
661
|
].join('')))}
|
|
666
|
-
|
|
662
|
+
`);
|
|
667
663
|
}
|
|
668
664
|
else if (vm.type == 'replace') {
|
|
669
665
|
window.parent.glitter.setUrlParameter('page-id', vm.data.id);
|
|
@@ -703,27 +699,25 @@ export class BgBlog {
|
|
|
703
699
|
search: '',
|
|
704
700
|
};
|
|
705
701
|
gvc.addStyle(`
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
const containerID = gvc.glitter.getUUID();
|
|
702
|
+
.hoverHidden div {
|
|
703
|
+
display: none;
|
|
704
|
+
}
|
|
705
|
+
.hoverHidden:hover div {
|
|
706
|
+
display: flex;
|
|
707
|
+
}
|
|
708
|
+
`);
|
|
714
709
|
return html `
|
|
715
|
-
|
|
716
|
-
|
|
710
|
+
<div class="title-container">
|
|
711
|
+
${BgWidget.goBack(gvc.event(() => {
|
|
717
712
|
callback(undefined);
|
|
718
713
|
}))}
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
html `
|
|
723
|
-
<div class="my-3"></div>`,
|
|
714
|
+
<div>${[BgWidget.title('選擇模板'), BgWidget.grayNote('請選擇一個符合您需求的模板')].join('')}</div>
|
|
715
|
+
</div>
|
|
716
|
+
${[
|
|
717
|
+
html ` <div class="my-3"></div>`,
|
|
724
718
|
BgWidget.mainCard(gvc.bindView(() => {
|
|
725
719
|
return {
|
|
726
|
-
bind:
|
|
720
|
+
bind: gvc.glitter.getUUID(),
|
|
727
721
|
view: () => {
|
|
728
722
|
return gvc.bindView(() => {
|
|
729
723
|
let data = undefined;
|
|
@@ -732,12 +726,12 @@ export class BgBlog {
|
|
|
732
726
|
Article.get({
|
|
733
727
|
page: 0,
|
|
734
728
|
limit: 20,
|
|
735
|
-
search:
|
|
729
|
+
search: '',
|
|
736
730
|
for_index: `false`,
|
|
737
731
|
status: '0,1',
|
|
738
732
|
page_type: page_tab,
|
|
739
733
|
app_name: 't_1726217714800',
|
|
740
|
-
}).then(
|
|
734
|
+
}).then(dd => {
|
|
741
735
|
data = {
|
|
742
736
|
response: {
|
|
743
737
|
result: {
|
|
@@ -755,7 +749,9 @@ export class BgBlog {
|
|
|
755
749
|
tag: ['頁面範例'],
|
|
756
750
|
desc: '',
|
|
757
751
|
name: '空白內容',
|
|
758
|
-
image: [
|
|
752
|
+
image: [
|
|
753
|
+
'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1709282671899-BLANK PAGE.jpg',
|
|
754
|
+
],
|
|
759
755
|
status: 'wait',
|
|
760
756
|
post_to: 'all',
|
|
761
757
|
version: '1.0',
|
|
@@ -794,7 +790,7 @@ export class BgBlog {
|
|
|
794
790
|
});
|
|
795
791
|
}
|
|
796
792
|
else {
|
|
797
|
-
ApiPageConfig.getTemplateList().then(
|
|
793
|
+
ApiPageConfig.getTemplateList().then(res => {
|
|
798
794
|
data = {
|
|
799
795
|
response: {
|
|
800
796
|
result: {
|
|
@@ -812,7 +808,9 @@ export class BgBlog {
|
|
|
812
808
|
tag: ['頁面範例'],
|
|
813
809
|
desc: '',
|
|
814
810
|
name: '極簡模板',
|
|
815
|
-
image: [
|
|
811
|
+
image: [
|
|
812
|
+
'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1709282671899-BLANK PAGE.jpg',
|
|
813
|
+
],
|
|
816
814
|
status: 'wait',
|
|
817
815
|
post_to: 'all',
|
|
818
816
|
version: '1.0',
|
|
@@ -860,28 +858,34 @@ export class BgBlog {
|
|
|
860
858
|
if (data.response.result.data.length === 0) {
|
|
861
859
|
if (!vm.search) {
|
|
862
860
|
return html `
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
861
|
+
<div
|
|
862
|
+
class="d-flex align-items-center justify-content-center flex-column w-100 py-4"
|
|
863
|
+
style="width:700px;gap:10px;"
|
|
864
|
+
>
|
|
865
|
+
<img src="./img/box-open-solid.svg" />
|
|
866
|
+
<span class="color39 text-center"
|
|
867
|
+
>尚未自製任何模塊<br />請前往開發者模式自製專屬模塊</span
|
|
868
|
+
>
|
|
869
|
+
</div>
|
|
870
|
+
`;
|
|
869
871
|
}
|
|
870
872
|
else {
|
|
871
873
|
return html `
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
874
|
+
<div
|
|
875
|
+
class="d-flex align-items-center justify-content-center flex-column w-100 py-4"
|
|
876
|
+
style="width:700px;gap:10px;"
|
|
877
|
+
>
|
|
878
|
+
<img src="./img/box-open-solid.svg" />
|
|
879
|
+
<span class="color39 text-center">查無相關模塊</span>
|
|
880
|
+
</div>
|
|
881
|
+
`;
|
|
878
882
|
}
|
|
879
883
|
}
|
|
880
884
|
else {
|
|
881
885
|
return html `
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
886
|
+
<div class="w-100" style="overflow-y: auto;">
|
|
887
|
+
<div class="row m-0 pt-2 w-100">
|
|
888
|
+
${data.response.result.data
|
|
885
889
|
.sort((a, b) => {
|
|
886
890
|
if (a.tag === 'empty' || b.tag === 'empty') {
|
|
887
891
|
return b.tag === 'empty' ? 1 : -1;
|
|
@@ -897,32 +901,33 @@ export class BgBlog {
|
|
|
897
901
|
})
|
|
898
902
|
.map((dd, index) => {
|
|
899
903
|
var _a;
|
|
900
|
-
return html `
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
904
|
+
return html ` <div class="col-6 col-sm-3 mb-3 rounded-3">
|
|
905
|
+
<div
|
|
906
|
+
class="d-flex flex-column justify-content-center w-100 "
|
|
907
|
+
style="gap:5px;cursor:pointer;"
|
|
908
|
+
>
|
|
909
|
+
<div
|
|
910
|
+
class="card w-100 position-relative rounded hoverHidden bgf6 rounded-3"
|
|
911
|
+
style="padding-bottom: ${(800 / 600) * 100}%;"
|
|
912
|
+
>
|
|
913
|
+
<div
|
|
914
|
+
class="position-absolute w-100 h-100 d-flex align-items-center justify-content-center rounded-3"
|
|
915
|
+
style="overflow: hidden;"
|
|
916
|
+
>
|
|
917
|
+
<img
|
|
918
|
+
class="w-100 "
|
|
919
|
+
src="${(_a = dd.template_config.image[0]) !== null && _a !== void 0 ? _a : 'https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/1713445383494-未命名(1080x1080像素).jpg'}"
|
|
920
|
+
/>
|
|
921
|
+
</div>
|
|
917
922
|
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
923
|
+
<div
|
|
924
|
+
class="position-absolute w-100 h-100 align-items-center justify-content-center rounded fs-6 flex-column"
|
|
925
|
+
style="background: rgba(0,0,0,0.5);gap:5px;"
|
|
926
|
+
>
|
|
927
|
+
<button
|
|
928
|
+
class="btn btn-secondary d-flex align-items-center "
|
|
929
|
+
style="height: 28px;width: 75px;gap:5px;"
|
|
930
|
+
onclick="${gvc.event(() => {
|
|
926
931
|
if (dd.tag === 'empty') {
|
|
927
932
|
if (['hidden', 'shopping'].includes(page_tab)) {
|
|
928
933
|
const a = [
|
|
@@ -948,7 +953,7 @@ export class BgBlog {
|
|
|
948
953
|
BaseApi.create({
|
|
949
954
|
url: `${window.glitterBackend}/api/v1/template?appName=${dd.appName}&tag=${dd.tag}`,
|
|
950
955
|
type: 'get',
|
|
951
|
-
}).then(
|
|
956
|
+
}).then(res => {
|
|
952
957
|
res.response.result[0].config.name = dd.template_config.name;
|
|
953
958
|
res.response.result[0].config.splice(0, 1);
|
|
954
959
|
res.response.result[0].config.splice(res.response.result[0].config.length - 1, 1);
|
|
@@ -958,17 +963,19 @@ export class BgBlog {
|
|
|
958
963
|
}
|
|
959
964
|
}
|
|
960
965
|
})}"
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
966
|
+
>
|
|
967
|
+
選擇
|
|
968
|
+
</button>
|
|
969
|
+
</div>
|
|
970
|
+
</div>
|
|
971
|
+
<h3
|
|
972
|
+
class="fs-6 mb-0 d-flex justify-content-between align-items-center fw-500 mt-1"
|
|
973
|
+
>
|
|
974
|
+
${dd.template_config.name}
|
|
975
|
+
<i
|
|
976
|
+
class="fa-solid fa-eye ${dd.tag === 'empty' ? `d-none` : ''}"
|
|
977
|
+
style="cursor:pointer;"
|
|
978
|
+
onclick="${gvc.event(() => {
|
|
972
979
|
if (page_tab !== 'page') {
|
|
973
980
|
window.parent.glitter.openNewTab(`https://${dd.domain}/index`);
|
|
974
981
|
}
|
|
@@ -976,40 +983,38 @@ export class BgBlog {
|
|
|
976
983
|
window.parent.glitter.openNewTab(`${gvc.glitter.root_path}pages/${dd.tag}?appName=${dd.appName}`);
|
|
977
984
|
}
|
|
978
985
|
})}"
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
986
|
+
></i>
|
|
987
|
+
</h3>
|
|
988
|
+
</div>
|
|
989
|
+
</div>`;
|
|
983
990
|
})
|
|
984
991
|
.join('')}
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
992
|
+
</div>
|
|
993
|
+
</div>
|
|
994
|
+
`;
|
|
988
995
|
}
|
|
989
996
|
})();
|
|
990
997
|
}
|
|
991
998
|
else {
|
|
992
|
-
return html `
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
999
|
+
return html ` <div
|
|
1000
|
+
class="w-100 p-3 d-flex align-items-center justify-content-center flex-column"
|
|
1001
|
+
style="gap: 10px;"
|
|
1002
|
+
>
|
|
1003
|
+
<div class="spinner-border fs-5"></div>
|
|
1004
|
+
<div class="fs-6 fw-500">載入中...</div>
|
|
1005
|
+
</div>`;
|
|
998
1006
|
}
|
|
999
1007
|
},
|
|
1000
|
-
divCreate: {
|
|
1001
|
-
style: '',
|
|
1002
|
-
},
|
|
1003
1008
|
};
|
|
1004
1009
|
});
|
|
1005
1010
|
},
|
|
1006
|
-
divCreate: {},
|
|
1007
1011
|
};
|
|
1008
1012
|
})),
|
|
1009
1013
|
].join('')}
|
|
1010
|
-
|
|
1014
|
+
`;
|
|
1011
1015
|
}
|
|
1012
1016
|
}
|
|
1017
|
+
let language = window.parent.store_info.language_setting.def;
|
|
1013
1018
|
function editor(cf) {
|
|
1014
1019
|
var _a;
|
|
1015
1020
|
const vm = cf.vm;
|
|
@@ -1044,7 +1049,7 @@ function editor(cf) {
|
|
|
1044
1049
|
gvc.notifyDataChange(cVm.id);
|
|
1045
1050
|
},
|
|
1046
1051
|
select_module: {
|
|
1047
|
-
callback:
|
|
1052
|
+
callback: data => {
|
|
1048
1053
|
vm.data.content.collection = data;
|
|
1049
1054
|
cVm.type = 'detail';
|
|
1050
1055
|
gvc.notifyDataChange(cVm.id);
|
|
@@ -1057,28 +1062,27 @@ function editor(cf) {
|
|
|
1057
1062
|
case 'template':
|
|
1058
1063
|
return template_select(gvc, cf, vm, cVm, cf.page_tab);
|
|
1059
1064
|
default:
|
|
1060
|
-
return
|
|
1065
|
+
return '';
|
|
1061
1066
|
}
|
|
1062
1067
|
},
|
|
1063
|
-
divCreate: {},
|
|
1064
1068
|
};
|
|
1065
1069
|
}));
|
|
1066
1070
|
}
|
|
1067
1071
|
function initialData(content) {
|
|
1072
|
+
function empty() {
|
|
1073
|
+
return {
|
|
1074
|
+
name: '',
|
|
1075
|
+
seo: {
|
|
1076
|
+
domain: '',
|
|
1077
|
+
title: '',
|
|
1078
|
+
content: '',
|
|
1079
|
+
keywords: '',
|
|
1080
|
+
},
|
|
1081
|
+
text: '',
|
|
1082
|
+
config: '',
|
|
1083
|
+
};
|
|
1084
|
+
}
|
|
1068
1085
|
if (!content.language_data) {
|
|
1069
|
-
function empty() {
|
|
1070
|
-
return {
|
|
1071
|
-
name: '',
|
|
1072
|
-
seo: {
|
|
1073
|
-
domain: '',
|
|
1074
|
-
title: '',
|
|
1075
|
-
content: '',
|
|
1076
|
-
keywords: '',
|
|
1077
|
-
},
|
|
1078
|
-
text: '',
|
|
1079
|
-
config: ''
|
|
1080
|
-
};
|
|
1081
|
-
}
|
|
1082
1086
|
content.language_data = {
|
|
1083
1087
|
'en-US': empty(),
|
|
1084
1088
|
'zh-CN': empty(),
|
|
@@ -1086,12 +1090,11 @@ function initialData(content) {
|
|
|
1086
1090
|
name: content.name,
|
|
1087
1091
|
seo: content.seo,
|
|
1088
1092
|
text: content.text,
|
|
1089
|
-
config: content.config
|
|
1090
|
-
}
|
|
1093
|
+
config: content.config,
|
|
1094
|
+
},
|
|
1091
1095
|
};
|
|
1092
1096
|
}
|
|
1093
1097
|
}
|
|
1094
|
-
let language = window.parent.store_info.language_setting.def;
|
|
1095
1098
|
function detail(gvc, cf, vm, cVm, page_tab) {
|
|
1096
1099
|
vm.data.content.tag = vm.data.content.tag || `${new Date().getTime()}`;
|
|
1097
1100
|
if (!vm.data.id && cf.is_page) {
|
|
@@ -1100,7 +1103,7 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1100
1103
|
vm.data.content.template = 'article';
|
|
1101
1104
|
gvc.notifyDataChange(cVm.id);
|
|
1102
1105
|
}, 100);
|
|
1103
|
-
return
|
|
1106
|
+
return '';
|
|
1104
1107
|
}
|
|
1105
1108
|
initialData(vm.data.content);
|
|
1106
1109
|
const domainPrefix = `${cf.is_page
|
|
@@ -1122,9 +1125,9 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1122
1125
|
function refreshProductPage() {
|
|
1123
1126
|
gvc.notifyDataChange(id);
|
|
1124
1127
|
}
|
|
1125
|
-
let origin =
|
|
1128
|
+
let origin = JSON.stringify(vm.data);
|
|
1126
1129
|
setTimeout(() => {
|
|
1127
|
-
origin =
|
|
1130
|
+
origin = JSON.stringify(vm.data);
|
|
1128
1131
|
}, 400);
|
|
1129
1132
|
function checkSwitchToUiEditor() {
|
|
1130
1133
|
function next() {
|
|
@@ -1137,9 +1140,9 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1137
1140
|
const dialog = new ShareDialog(gvc.glitter);
|
|
1138
1141
|
dialog.checkYesOrNot({
|
|
1139
1142
|
text: '偵測到內容變更,是否保留更改?',
|
|
1140
|
-
callback:
|
|
1143
|
+
callback: response => {
|
|
1141
1144
|
if (response) {
|
|
1142
|
-
saveData(gvc, cf, vm, cVm, false).then(
|
|
1145
|
+
saveData(gvc, cf, vm, cVm, false).then(res => {
|
|
1143
1146
|
if (res) {
|
|
1144
1147
|
next();
|
|
1145
1148
|
}
|
|
@@ -1151,7 +1154,7 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1151
1154
|
else {
|
|
1152
1155
|
next();
|
|
1153
1156
|
}
|
|
1154
|
-
}
|
|
1157
|
+
},
|
|
1155
1158
|
});
|
|
1156
1159
|
}
|
|
1157
1160
|
else {
|
|
@@ -1162,58 +1165,58 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1162
1165
|
bind: id,
|
|
1163
1166
|
view: () => {
|
|
1164
1167
|
const language_data = vm.data.content.language_data[language];
|
|
1168
|
+
const pageTabMap = {
|
|
1169
|
+
hidden: '隱形賣場',
|
|
1170
|
+
page: '自訂頁面',
|
|
1171
|
+
shopping: '一頁商店',
|
|
1172
|
+
blog: '編輯網誌',
|
|
1173
|
+
};
|
|
1165
1174
|
return html `
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1175
|
+
<div class="title-container d-flex flex-column flex-sm-row w-100 align-items-start align-items-sm-center">
|
|
1176
|
+
<div class="d-flex align-items-center w-100">
|
|
1177
|
+
${BgWidget.goBack(gvc.event(() => {
|
|
1169
1178
|
window.parent.glitter.setUrlParameter('page-id', undefined);
|
|
1170
1179
|
vm.type = 'list';
|
|
1171
1180
|
}))}
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
return '一頁商店';
|
|
1181
|
-
}
|
|
1182
|
-
})()
|
|
1183
|
-
: '編輯網誌')}
|
|
1184
|
-
<div class="flex-fill"></div>
|
|
1185
|
-
<div class="${cf.is_page ? `d-none` : ``}"> ${LanguageBackend.switchBtn({
|
|
1181
|
+
<div class="d-flex align-items-center gap-2">
|
|
1182
|
+
${BgWidget.title(language_data.name)}
|
|
1183
|
+
<div class="mt-1">${BgWidget.successInsignia(cf.is_page ? pageTabMap[page_tab] : pageTabMap.blog)}</div>
|
|
1184
|
+
</div>
|
|
1185
|
+
|
|
1186
|
+
<div class="flex-fill"></div>
|
|
1187
|
+
<div class="${cf.is_page ? `d-none` : ''}">
|
|
1188
|
+
${LanguageBackend.switchBtn({
|
|
1186
1189
|
gvc: gvc,
|
|
1187
1190
|
language: language,
|
|
1188
|
-
callback:
|
|
1191
|
+
callback: lan => {
|
|
1189
1192
|
language = lan;
|
|
1190
1193
|
refreshProductPage();
|
|
1191
|
-
}
|
|
1194
|
+
},
|
|
1192
1195
|
})}
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1196
|
+
</div>
|
|
1197
|
+
</div>
|
|
1198
|
+
<div class="flex-fill my-2 ${cf.is_page ? '' : `d-none`}"></div>
|
|
1199
|
+
<div class="d-flex ${cf.is_page ? '' : `d-none`} ${document.body.clientWidth < 800 ? `w-100` : ''}">
|
|
1200
|
+
${LanguageBackend.switchBtn({
|
|
1198
1201
|
gvc: gvc,
|
|
1199
1202
|
language: language,
|
|
1200
|
-
callback:
|
|
1203
|
+
callback: lan => {
|
|
1201
1204
|
language = lan;
|
|
1202
1205
|
refreshProductPage();
|
|
1203
|
-
}
|
|
1206
|
+
},
|
|
1204
1207
|
})}
|
|
1205
|
-
|
|
1206
|
-
|
|
1208
|
+
<div class="mx-1"></div>
|
|
1209
|
+
${BgWidget.grayButton('套用模板', gvc.event(() => {
|
|
1207
1210
|
cVm.type = 'template';
|
|
1208
1211
|
gvc.notifyDataChange(cVm.id);
|
|
1209
1212
|
}))}
|
|
1210
|
-
|
|
1211
|
-
|
|
1213
|
+
<div class="mx-1"></div>
|
|
1214
|
+
${BgWidget.grayButton('前往設計', gvc.event(() => {
|
|
1212
1215
|
checkSwitchToUiEditor();
|
|
1213
1216
|
}))}
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
+
</div>
|
|
1218
|
+
</div>
|
|
1219
|
+
${BgWidget.container1x2({
|
|
1217
1220
|
html: [
|
|
1218
1221
|
gvc.bindView(() => {
|
|
1219
1222
|
var _a;
|
|
@@ -1241,48 +1244,48 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1241
1244
|
: 'blogs'}/`;
|
|
1242
1245
|
return [
|
|
1243
1246
|
BgWidget.title('基本設定', 'font-size: 16px;'),
|
|
1244
|
-
html `
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
${BgWidget.switchButton(gvc, vm.data.status, (bool) => {
|
|
1247
|
+
html ` <div style="display: flex; align-items: center; gap: 4px; margin: 18px 0;">
|
|
1248
|
+
<div class="tx_normal">網頁啟用</div>
|
|
1249
|
+
${BgWidget.switchButton(gvc, vm.data.status, bool => {
|
|
1248
1250
|
vm.data.status = bool ? 1 : 0;
|
|
1249
1251
|
gvc.notifyDataChange(id);
|
|
1250
1252
|
})}
|
|
1251
|
-
|
|
1253
|
+
</div>`,
|
|
1252
1254
|
BgWidget.editeInput({
|
|
1253
1255
|
gvc: gvc,
|
|
1254
1256
|
title: '網頁名稱' + BgWidget.languageInsignia(language, 'margin-left:5px;'),
|
|
1255
1257
|
default: language_data.name || '',
|
|
1256
1258
|
placeHolder: '請輸入網頁名稱',
|
|
1257
|
-
callback:
|
|
1259
|
+
callback: text => {
|
|
1258
1260
|
language_data.name = text;
|
|
1259
1261
|
},
|
|
1260
1262
|
}),
|
|
1261
|
-
html `
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
</div>
|
|
1266
|
-
<div
|
|
1267
|
-
style="justify-content: flex-start; align-items: center; display: inline-flex;border:1px solid #EAEAEA;border-radius: 10px;overflow: hidden; ${document
|
|
1263
|
+
html ` <div>
|
|
1264
|
+
<div class="tx_normal fw-normal mb-2">自訂網址</div>
|
|
1265
|
+
<div
|
|
1266
|
+
style="justify-content: flex-start; align-items: center; display: inline-flex;border:1px solid #EAEAEA;border-radius: 10px;overflow: hidden; ${document
|
|
1268
1267
|
.body.clientWidth > 768
|
|
1269
1268
|
? 'gap: 18px; '
|
|
1270
1269
|
: 'flex-direction: column; gap: 0px; '}"
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1270
|
+
class="w-100"
|
|
1271
|
+
>
|
|
1272
|
+
<div
|
|
1273
|
+
style="width:100%;padding: 9px 18px;background: #EAEAEA; justify-content: flex-start; align-items: center; gap: 5px; display: flex"
|
|
1274
|
+
>
|
|
1275
|
+
<div
|
|
1276
|
+
style="text-align: right; color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word"
|
|
1277
|
+
>
|
|
1278
|
+
${prefixURL}
|
|
1279
|
+
</div>
|
|
1280
|
+
</div>
|
|
1281
|
+
<input
|
|
1282
|
+
class="flex-fill"
|
|
1283
|
+
style="width:100%;border:none;background:none;text-align: start; color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word; ${document
|
|
1281
1284
|
.body.clientWidth > 768
|
|
1282
1285
|
? ''
|
|
1283
1286
|
: 'padding: 9px 18px;'}"
|
|
1284
|
-
|
|
1285
|
-
|
|
1287
|
+
value="${vm.data.content.tag || ''}"
|
|
1288
|
+
onchange="${gvc.event(e => {
|
|
1286
1289
|
let text = e.value;
|
|
1287
1290
|
if (!CheckInput.isEnglishNumberHyphen(text)) {
|
|
1288
1291
|
const dialog = new ShareDialog(gvc.glitter);
|
|
@@ -1294,16 +1297,15 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1294
1297
|
gvc.notifyDataChange(id);
|
|
1295
1298
|
}
|
|
1296
1299
|
})}"
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
html `
|
|
1301
|
-
|
|
1302
|
-
<span class="tx_normal me-2">網址預覽</span>${BgWidget.greenNote(prefixURL + ((_a = vm.data.content.tag) !== null && _a !== void 0 ? _a : ''), gvc.event(() => {
|
|
1300
|
+
/>
|
|
1301
|
+
</div>
|
|
1302
|
+
</div>`,
|
|
1303
|
+
html ` <div class="mt-2 mb-1">
|
|
1304
|
+
<span class="tx_normal me-2">網址預覽</span>${BgWidget.greenNote(prefixURL + ((_a = vm.data.content.tag) !== null && _a !== void 0 ? _a : ''), gvc.event(() => {
|
|
1303
1305
|
var _a;
|
|
1304
1306
|
gvc.glitter.openNewTab(prefixURL + ((_a = vm.data.content.tag) !== null && _a !== void 0 ? _a : ''));
|
|
1305
1307
|
}))}
|
|
1306
|
-
|
|
1308
|
+
</div>`,
|
|
1307
1309
|
...(() => {
|
|
1308
1310
|
return [
|
|
1309
1311
|
BgWidget.editeInput({
|
|
@@ -1311,7 +1313,7 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1311
1313
|
title: 'SEO標題' + BgWidget.languageInsignia(language, 'margin-left:5px;'),
|
|
1312
1314
|
default: language_data.seo.title,
|
|
1313
1315
|
placeHolder: `請輸入SEO標題`,
|
|
1314
|
-
callback:
|
|
1316
|
+
callback: text => {
|
|
1315
1317
|
language_data.title = text;
|
|
1316
1318
|
language_data.seo.title = text;
|
|
1317
1319
|
gvc.notifyDataChange(id);
|
|
@@ -1322,25 +1324,22 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1322
1324
|
title: 'SEO描述' + BgWidget.languageInsignia(language, 'margin-left:5px;'),
|
|
1323
1325
|
default: language_data.seo.content,
|
|
1324
1326
|
placeHolder: `請輸入中繼描述`,
|
|
1325
|
-
callback:
|
|
1327
|
+
callback: text => {
|
|
1326
1328
|
language_data.description = text;
|
|
1327
1329
|
language_data.seo.content = text;
|
|
1328
1330
|
gvc.notifyDataChange(id);
|
|
1329
1331
|
},
|
|
1330
1332
|
}),
|
|
1331
|
-
html `
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
${BgWidget.grayNote('建議尺寸為 200px * 200px 以上')}
|
|
1338
|
-
</div>
|
|
1339
|
-
${BgWidget.imageSelector(gvc, language_data.seo.image || '', (text) => {
|
|
1333
|
+
html ` <div>
|
|
1334
|
+
<div class="tx_normal">
|
|
1335
|
+
社群分享縮圖${BgWidget.languageInsignia(language, 'margin-left:5px;')}
|
|
1336
|
+
</div>
|
|
1337
|
+
<div class="mt-1 mb-2">${BgWidget.grayNote('建議尺寸為 200px * 200px 以上')}</div>
|
|
1338
|
+
${BgWidget.imageSelector(gvc, language_data.seo.image || '', text => {
|
|
1340
1339
|
language_data.seo.image = text;
|
|
1341
1340
|
gvc.notifyDataChange(id);
|
|
1342
1341
|
})}
|
|
1343
|
-
|
|
1342
|
+
</div>`,
|
|
1344
1343
|
,
|
|
1345
1344
|
];
|
|
1346
1345
|
})(),
|
|
@@ -1348,79 +1347,81 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1348
1347
|
if (`${vm.data.content.for_index}` === 'true') {
|
|
1349
1348
|
return [
|
|
1350
1349
|
[
|
|
1351
|
-
html `
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1350
|
+
html ` <div
|
|
1351
|
+
class="d-flex w-100 align-items-center justify-content-between p-0 my-2"
|
|
1352
|
+
>
|
|
1353
|
+
<div class="tx_normal fw-normal">
|
|
1354
|
+
網誌內文${BgWidget.languageInsignia(language, 'margin-left:5px;')}
|
|
1355
|
+
</div>
|
|
1356
|
+
</div>`,
|
|
1357
1357
|
gvc.bindView((() => {
|
|
1358
1358
|
const id = gvc.glitter.getUUID();
|
|
1359
1359
|
return {
|
|
1360
1360
|
bind: id,
|
|
1361
1361
|
view: () => {
|
|
1362
1362
|
try {
|
|
1363
|
-
return html `
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
onclick="${gvc.event(() => {
|
|
1363
|
+
return html ` <div
|
|
1364
|
+
class="d-flex justify-content-between align-items-center gap-3 mb-1"
|
|
1365
|
+
style="cursor: pointer;"
|
|
1366
|
+
onclick="${gvc.event(() => {
|
|
1368
1367
|
const originContent = `${language_data.text}`;
|
|
1369
1368
|
BgWidget.fullDialog({
|
|
1370
1369
|
gvc: gvc,
|
|
1371
|
-
title:
|
|
1372
|
-
return `<div
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1370
|
+
title: gvc2 => {
|
|
1371
|
+
return html `<div
|
|
1372
|
+
class="d-flex align-items-center"
|
|
1373
|
+
style="gap:10px;"
|
|
1374
|
+
>
|
|
1375
|
+
${'網誌內文' +
|
|
1376
|
+
BgWidget.aiChatButton({
|
|
1377
|
+
gvc: gvc2,
|
|
1378
|
+
select: 'writer',
|
|
1379
|
+
click: () => {
|
|
1380
|
+
ProductAi.generateRichText(gvc, text => {
|
|
1381
|
+
language_data.text += text;
|
|
1382
|
+
gvc.notifyDataChange(vm.id);
|
|
1383
|
+
gvc2.recreateView();
|
|
1384
|
+
});
|
|
1385
|
+
},
|
|
1386
|
+
})}
|
|
1387
|
+
</div>`;
|
|
1383
1388
|
},
|
|
1384
|
-
innerHTML:
|
|
1385
|
-
return html `
|
|
1386
|
-
|
|
1387
|
-
${EditorElem.richText({
|
|
1389
|
+
innerHTML: gvc2 => {
|
|
1390
|
+
return html ` <div>
|
|
1391
|
+
${EditorElem.richText({
|
|
1388
1392
|
gvc: gvc2,
|
|
1389
1393
|
def: language_data.text,
|
|
1390
1394
|
setHeight: '100vh',
|
|
1391
1395
|
hiddenBorder: true,
|
|
1392
|
-
insertImageEvent:
|
|
1396
|
+
insertImageEvent: editor => {
|
|
1393
1397
|
const mark = `{{${Tool.randomString(8)}}}`;
|
|
1394
1398
|
editor.selection.setAtEnd(editor.$el.get(0));
|
|
1395
1399
|
editor.html.insert(mark);
|
|
1396
1400
|
editor.undo.saveStep();
|
|
1397
|
-
imageLibrary.selectImageLibrary(gvc,
|
|
1401
|
+
imageLibrary.selectImageLibrary(gvc, urlArray => {
|
|
1398
1402
|
if (urlArray.length > 0) {
|
|
1399
1403
|
const imgHTML = urlArray
|
|
1400
|
-
.map(
|
|
1401
|
-
return html `
|
|
1402
|
-
<img src="${url.data}"/>`;
|
|
1404
|
+
.map(url => {
|
|
1405
|
+
return html ` <img src="${url.data}" />`;
|
|
1403
1406
|
})
|
|
1404
1407
|
.join('');
|
|
1405
1408
|
editor.html.set(editor.html
|
|
1406
1409
|
.get(0)
|
|
1407
|
-
.replace(mark, html `
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
</div>`));
|
|
1410
|
+
.replace(mark, html ` <div class="d-flex flex-column">
|
|
1411
|
+
${imgHTML}
|
|
1412
|
+
</div>`));
|
|
1411
1413
|
editor.undo.saveStep();
|
|
1412
1414
|
}
|
|
1413
1415
|
else {
|
|
1414
1416
|
const dialog = new ShareDialog(gvc.glitter);
|
|
1415
1417
|
dialog.errorMessage({ text: '請選擇至少一張圖片' });
|
|
1416
1418
|
}
|
|
1417
|
-
}, html `
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
</div>`, {
|
|
1419
|
+
}, html ` <div
|
|
1420
|
+
class="d-flex flex-column"
|
|
1421
|
+
style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;"
|
|
1422
|
+
>
|
|
1423
|
+
圖片庫
|
|
1424
|
+
</div>`, {
|
|
1424
1425
|
mul: true,
|
|
1425
1426
|
cancelEvent: () => {
|
|
1426
1427
|
editor.html.set(editor.html.get(0).replace(mark, ''));
|
|
@@ -1428,12 +1429,12 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1428
1429
|
},
|
|
1429
1430
|
});
|
|
1430
1431
|
},
|
|
1431
|
-
callback:
|
|
1432
|
+
callback: text => {
|
|
1432
1433
|
language_data.text = text;
|
|
1433
1434
|
},
|
|
1434
1435
|
rich_height: `calc(${window.parent.innerHeight}px - 70px - 58px - 49px - 64px - 40px + ${document.body.clientWidth < 800 ? `70` : `0`}px)`,
|
|
1435
1436
|
})}
|
|
1436
|
-
|
|
1437
|
+
</div>`;
|
|
1437
1438
|
},
|
|
1438
1439
|
footer_html: (gvc2) => {
|
|
1439
1440
|
return [
|
|
@@ -1452,20 +1453,19 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1452
1453
|
},
|
|
1453
1454
|
});
|
|
1454
1455
|
})}"
|
|
1455
|
-
|
|
1456
|
-
|
|
1456
|
+
>
|
|
1457
|
+
${(() => {
|
|
1457
1458
|
language_data.text = language_data.text || '';
|
|
1458
1459
|
const text = gvc.glitter.utText.removeTag(language_data.text);
|
|
1459
1460
|
return BgWidget.richTextView(Tool.truncateString(text, 100));
|
|
1460
1461
|
})()}
|
|
1461
|
-
|
|
1462
|
+
</div>`;
|
|
1462
1463
|
}
|
|
1463
1464
|
catch (e) {
|
|
1464
1465
|
console.log(`error=>`, e);
|
|
1465
|
-
return
|
|
1466
|
+
return '';
|
|
1466
1467
|
}
|
|
1467
1468
|
},
|
|
1468
|
-
divCreate: {},
|
|
1469
1469
|
};
|
|
1470
1470
|
})()),
|
|
1471
1471
|
].join(BgWidget.mbContainer(12)),
|
|
@@ -1507,8 +1507,7 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1507
1507
|
.map((d1, index) => {
|
|
1508
1508
|
return BgWidget.mainCard([
|
|
1509
1509
|
BgWidget.title(html `商品顯示區塊 ${index + 1}`, 'font-size: 16px;'),
|
|
1510
|
-
html `
|
|
1511
|
-
<div class="my-2"></div>`,
|
|
1510
|
+
html ` <div class="my-2"></div>`,
|
|
1512
1511
|
[
|
|
1513
1512
|
html `${(() => {
|
|
1514
1513
|
return gvc.bindView(() => {
|
|
@@ -1534,16 +1533,15 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1534
1533
|
return BgWidget.spinner();
|
|
1535
1534
|
}
|
|
1536
1535
|
return html `
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
${BgWidget.grayButton('搜尋商品', gvc.event(() => {
|
|
1536
|
+
<div class="d-flex flex-column p-2" style="gap: 18px;">
|
|
1537
|
+
<div
|
|
1538
|
+
class="d-flex align-items-center gray-bottom-line-18 "
|
|
1539
|
+
style="gap: 24px; justify-content: space-between;"
|
|
1540
|
+
>
|
|
1541
|
+
<div class="form-check-label c_updown_label">
|
|
1542
|
+
<div class="tx_normal">產品列表</div>
|
|
1543
|
+
</div>
|
|
1544
|
+
${BgWidget.grayButton('搜尋商品', gvc.event(() => {
|
|
1547
1545
|
BgProduct.productsDialog({
|
|
1548
1546
|
default: d1.value,
|
|
1549
1547
|
gvc: gvc,
|
|
@@ -1554,40 +1552,40 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1554
1552
|
filter_visible: page_tab === 'hidden' ? 'false' : 'true',
|
|
1555
1553
|
});
|
|
1556
1554
|
}), { textStyle: 'font-weight: 400;' })}
|
|
1557
|
-
|
|
1558
|
-
|
|
1555
|
+
</div>
|
|
1556
|
+
${dataList
|
|
1559
1557
|
.map((opt, index) => {
|
|
1560
|
-
return `<div
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1558
|
+
return html `<div
|
|
1559
|
+
class="d-flex align-items-center form-check-label c_updown_label px-1"
|
|
1560
|
+
style="justify-content: space-between"
|
|
1561
|
+
data-index="${opt.key}"
|
|
1562
|
+
>
|
|
1563
|
+
<div class="d-flex align-items-center gap-3 cursor_move">
|
|
1564
|
+
<i class="fa-solid fa-grip-dots-vertical dragItem"></i>
|
|
1565
|
+
${BgWidget.validImageBox({
|
|
1566
1566
|
gvc,
|
|
1567
1567
|
image: opt.image,
|
|
1568
1568
|
width: 40,
|
|
1569
1569
|
})}
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1570
|
+
<div class="tx_normal ${opt.note ? 'mb-1' : ''}">
|
|
1571
|
+
${opt.value}
|
|
1572
|
+
</div>
|
|
1573
|
+
</div>
|
|
1574
|
+
<i
|
|
1575
|
+
class="fa-regular fa-trash cursor_pointer"
|
|
1576
|
+
onclick="${gvc.event(() => {
|
|
1577
1577
|
d1.value = d1.value.filter((id) => {
|
|
1578
1578
|
return id !== opt.key;
|
|
1579
1579
|
});
|
|
1580
1580
|
dataList.splice(index, 1);
|
|
1581
1581
|
gvc.notifyDataChange(subVM.id);
|
|
1582
1582
|
})}"
|
|
1583
|
-
|
|
1584
|
-
|
|
1583
|
+
></i>
|
|
1584
|
+
</div>`;
|
|
1585
1585
|
})
|
|
1586
1586
|
.join('')}
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
},
|
|
1590
|
-
onCreate: () => {
|
|
1587
|
+
</div>
|
|
1588
|
+
`;
|
|
1591
1589
|
},
|
|
1592
1590
|
};
|
|
1593
1591
|
});
|
|
@@ -1599,12 +1597,10 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1599
1597
|
BgWidget.mbContainer(24),
|
|
1600
1598
|
BgWidget.mainCard([
|
|
1601
1599
|
BgWidget.title(html `預設加入購物車
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
html `
|
|
1607
|
-
<div class="my-2"></div>`,
|
|
1600
|
+
<div class="badge ms-2" style="background:#eaeaea;color:#393939;">
|
|
1601
|
+
以下設定的商品與規格會自動加入購物車
|
|
1602
|
+
</div>`, 'font-size: 16px;'),
|
|
1603
|
+
html ` <div class="my-2"></div>`,
|
|
1608
1604
|
[
|
|
1609
1605
|
html `${(() => {
|
|
1610
1606
|
return gvc.bindView(() => {
|
|
@@ -1620,16 +1616,15 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1620
1616
|
return BgWidget.spinner();
|
|
1621
1617
|
}
|
|
1622
1618
|
return html `
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
${BgWidget.grayButton('搜尋商品', gvc.event(() => {
|
|
1619
|
+
<div class="d-flex flex-column p-2" style="gap: 18px;">
|
|
1620
|
+
<div
|
|
1621
|
+
class="d-flex align-items-center gray-bottom-line-18 "
|
|
1622
|
+
style="gap: 24px; justify-content: space-between;"
|
|
1623
|
+
>
|
|
1624
|
+
<div class="form-check-label c_updown_label">
|
|
1625
|
+
<div class="tx_normal">產品列表</div>
|
|
1626
|
+
</div>
|
|
1627
|
+
${BgWidget.grayButton('搜尋商品', gvc.event(() => {
|
|
1633
1628
|
BgProduct.productsDialog({
|
|
1634
1629
|
gvc: gvc,
|
|
1635
1630
|
default: vm.data.content.relative_data.map((dd) => {
|
|
@@ -1638,53 +1633,64 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1638
1633
|
with_variants: true,
|
|
1639
1634
|
callback: (value) => __awaiter(this, void 0, void 0, function* () {
|
|
1640
1635
|
var _a;
|
|
1641
|
-
vm.data.content.relative_data =
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1636
|
+
vm.data.content.relative_data =
|
|
1637
|
+
(_a = vm.data.content.relative_data) !== null && _a !== void 0 ? _a : [];
|
|
1638
|
+
vm.data.content.relative_data =
|
|
1639
|
+
vm.data.content.relative_data.concat(value.map((dd) => {
|
|
1640
|
+
return {
|
|
1641
|
+
variant: {
|
|
1642
|
+
spec: dd
|
|
1643
|
+
.split('-')
|
|
1644
|
+
.filter((_, index) => index > 0),
|
|
1645
|
+
},
|
|
1646
|
+
product_id: dd.split('-')[0],
|
|
1647
|
+
};
|
|
1648
|
+
}));
|
|
1652
1649
|
subVM.loading = true;
|
|
1653
1650
|
gvc.notifyDataChange(subVM.id);
|
|
1654
1651
|
}),
|
|
1655
1652
|
});
|
|
1656
1653
|
}), { textStyle: 'font-weight: 400;' })}
|
|
1657
|
-
|
|
1658
|
-
|
|
1654
|
+
</div>
|
|
1655
|
+
${subVM.dataList
|
|
1659
1656
|
.map((opt, index) => {
|
|
1660
1657
|
return html `
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1658
|
+
<div
|
|
1659
|
+
class="d-flex align-items-center form-check-label c_updown_label gap-3"
|
|
1660
|
+
>
|
|
1661
|
+
<span class="tx_normal" style="min-width: 20px;"
|
|
1662
|
+
>${index + 1} .</span
|
|
1663
|
+
>
|
|
1664
|
+
${BgWidget.validImageBox({
|
|
1665
1665
|
gvc: gvc,
|
|
1666
1666
|
image: opt.image,
|
|
1667
1667
|
width: 40,
|
|
1668
1668
|
})}
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1669
|
+
<div
|
|
1670
|
+
class="tx_normal ${opt.note ? 'mb-1' : ''} d-flex flex-column"
|
|
1671
|
+
>
|
|
1672
|
+
${opt.value}
|
|
1673
|
+
${opt.note
|
|
1674
|
+
? html ` <div class="tx_gray_12">${opt.note}</div> `
|
|
1675
|
+
: ''}
|
|
1676
|
+
</div>
|
|
1677
|
+
<div class="flex-fill"></div>
|
|
1678
|
+
${BgWidget.cancel(gvc.event(() => {
|
|
1678
1679
|
vm.data.content.relative_data.splice(index, 1);
|
|
1679
1680
|
subVM.dataList.splice(index, 1);
|
|
1680
1681
|
gvc.notifyDataChange(subVM.id);
|
|
1681
1682
|
}), '移除')}
|
|
1682
|
-
|
|
1683
|
-
|
|
1683
|
+
</div>
|
|
1684
|
+
`;
|
|
1684
1685
|
})
|
|
1685
|
-
.join('') ||
|
|
1686
|
-
|
|
1687
|
-
|
|
1686
|
+
.join('') ||
|
|
1687
|
+
html `<div
|
|
1688
|
+
class="w-100 d-flex align-content-center justify-content-center"
|
|
1689
|
+
>
|
|
1690
|
+
尚未加入任何賣場商品
|
|
1691
|
+
</div>`}
|
|
1692
|
+
</div>
|
|
1693
|
+
`;
|
|
1688
1694
|
},
|
|
1689
1695
|
onCreate: () => {
|
|
1690
1696
|
if (subVM.loading) {
|
|
@@ -1701,19 +1707,19 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1701
1707
|
return dd.product_id;
|
|
1702
1708
|
}));
|
|
1703
1709
|
vm.data.content.relative_data = vm.data.content.relative_data.filter((dd) => {
|
|
1704
|
-
return products_data.find(
|
|
1710
|
+
return products_data.find(d1 => {
|
|
1705
1711
|
return `${dd.product_id}` === `${d1.key}`;
|
|
1706
1712
|
});
|
|
1707
1713
|
});
|
|
1708
1714
|
subVM.dataList = vm.data.content.relative_data.map((dd) => {
|
|
1709
|
-
const product = JSON.parse(JSON.stringify(products_data.find(
|
|
1715
|
+
const product = JSON.parse(JSON.stringify(products_data.find(d1 => {
|
|
1710
1716
|
return `${dd.product_id}` === `${d1.key}`;
|
|
1711
1717
|
})));
|
|
1712
1718
|
product.note = dd.variant.spec.join(' / ');
|
|
1713
1719
|
return product;
|
|
1714
1720
|
});
|
|
1715
1721
|
resolve(subVM.dataList);
|
|
1716
|
-
})).then(
|
|
1722
|
+
})).then(data => {
|
|
1717
1723
|
subVM.dataList = data;
|
|
1718
1724
|
subVM.loading = false;
|
|
1719
1725
|
gvc.notifyDataChange(subVM.id);
|
|
@@ -1728,9 +1734,7 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1728
1734
|
].join('')),
|
|
1729
1735
|
].join('');
|
|
1730
1736
|
}
|
|
1731
|
-
|
|
1732
|
-
return [].join('');
|
|
1733
|
-
}
|
|
1737
|
+
return '';
|
|
1734
1738
|
}
|
|
1735
1739
|
catch (e) {
|
|
1736
1740
|
console.log(e);
|
|
@@ -1754,7 +1758,7 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1754
1758
|
var _a;
|
|
1755
1759
|
return [
|
|
1756
1760
|
cf.is_page
|
|
1757
|
-
?
|
|
1761
|
+
? ''
|
|
1758
1762
|
: EditorElem.select({
|
|
1759
1763
|
title: '啟用狀態',
|
|
1760
1764
|
gvc: gvc,
|
|
@@ -1774,10 +1778,12 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1774
1778
|
gvc.notifyDataChange(id);
|
|
1775
1779
|
},
|
|
1776
1780
|
}),
|
|
1777
|
-
EditorElem.pageSelect(gvc, '選擇佈景主題', (_a = vm.data.content.template) !== null && _a !== void 0 ? _a : '',
|
|
1781
|
+
EditorElem.pageSelect(gvc, '選擇佈景主題', (_a = vm.data.content.template) !== null && _a !== void 0 ? _a : '', data => {
|
|
1778
1782
|
vm.data.content.template = data;
|
|
1779
|
-
},
|
|
1780
|
-
const filter_result = dd.group !== 'glitter-article' &&
|
|
1783
|
+
}, dd => {
|
|
1784
|
+
const filter_result = dd.group !== 'glitter-article' &&
|
|
1785
|
+
dd.page_type === 'article' &&
|
|
1786
|
+
dd.page_config.template_type === 'blog';
|
|
1781
1787
|
if (filter_result && !vm.data.content.template) {
|
|
1782
1788
|
vm.data.content.template = dd.tag;
|
|
1783
1789
|
gvc.notifyDataChange(id);
|
|
@@ -1793,13 +1799,10 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1793
1799
|
bind: id,
|
|
1794
1800
|
view: () => {
|
|
1795
1801
|
let array = [
|
|
1796
|
-
html `
|
|
1797
|
-
<div class="tx_normal fw-normal mt-2">
|
|
1798
|
-
檢視權限
|
|
1799
|
-
</div>`,
|
|
1802
|
+
html ` <div class="tx_normal fw-normal mt-2">檢視權限</div>`,
|
|
1800
1803
|
BgWidget.select({
|
|
1801
1804
|
gvc: gvc,
|
|
1802
|
-
callback:
|
|
1805
|
+
callback: text => {
|
|
1803
1806
|
vm.data.content.show_auth.auth = text;
|
|
1804
1807
|
if (vm.data.content.show_auth.auth === 'member_type') {
|
|
1805
1808
|
vm.data.content.show_auth.value = [];
|
|
@@ -1812,15 +1815,15 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1812
1815
|
options: [
|
|
1813
1816
|
{
|
|
1814
1817
|
key: 'all',
|
|
1815
|
-
value: '知道鏈結的所有人'
|
|
1818
|
+
value: '知道鏈結的所有人',
|
|
1816
1819
|
},
|
|
1817
1820
|
{
|
|
1818
1821
|
key: 'member_type',
|
|
1819
|
-
value: '會員等級'
|
|
1822
|
+
value: '會員等級',
|
|
1820
1823
|
},
|
|
1821
1824
|
{
|
|
1822
1825
|
key: 'password',
|
|
1823
|
-
value: '輸入密碼'
|
|
1826
|
+
value: '輸入密碼',
|
|
1824
1827
|
},
|
|
1825
1828
|
],
|
|
1826
1829
|
default: vm.data.content.show_auth.auth,
|
|
@@ -1832,7 +1835,7 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1832
1835
|
title: '設定瀏覽密碼',
|
|
1833
1836
|
placeHolder: `請輸入瀏覽密碼`,
|
|
1834
1837
|
default: vm.data.content.show_auth.value,
|
|
1835
|
-
callback:
|
|
1838
|
+
callback: text => {
|
|
1836
1839
|
vm.data.content.show_auth.value = text;
|
|
1837
1840
|
},
|
|
1838
1841
|
}));
|
|
@@ -1899,7 +1902,7 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1899
1902
|
title: '作者名稱',
|
|
1900
1903
|
default: vm.data.content.author,
|
|
1901
1904
|
placeHolder: '請輸入作者名稱',
|
|
1902
|
-
callback:
|
|
1905
|
+
callback: text => {
|
|
1903
1906
|
vm.data.content.author = text;
|
|
1904
1907
|
},
|
|
1905
1908
|
}),
|
|
@@ -1913,43 +1916,41 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1913
1916
|
view: () => {
|
|
1914
1917
|
var _a;
|
|
1915
1918
|
if (cf.is_page) {
|
|
1916
|
-
return
|
|
1919
|
+
return '';
|
|
1917
1920
|
}
|
|
1918
1921
|
vm.data.content.collection = (_a = vm.data.content.collection) !== null && _a !== void 0 ? _a : [];
|
|
1919
1922
|
return [
|
|
1920
|
-
html `
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
${EditorElem.h3('預覽圖')}
|
|
1924
|
-
${BgWidget.grayButton('添加檔案', gvc.event(() => {
|
|
1923
|
+
html ` <div class="d-flex align-items-center my-3" style="gap: 10px;">
|
|
1924
|
+
${EditorElem.h3('預覽圖')}
|
|
1925
|
+
${BgWidget.grayButton('添加檔案', gvc.event(() => {
|
|
1925
1926
|
EditorElem.uploadFileFunction({
|
|
1926
1927
|
gvc: gvc,
|
|
1927
|
-
callback:
|
|
1928
|
+
callback: text => {
|
|
1928
1929
|
vm.data.content.preview_image = text;
|
|
1929
1930
|
gvc.notifyDataChange(id);
|
|
1930
1931
|
},
|
|
1931
1932
|
type: `image/*, video/*`,
|
|
1932
1933
|
});
|
|
1933
1934
|
}))}
|
|
1934
|
-
|
|
1935
|
+
</div>`,
|
|
1935
1936
|
EditorElem.flexMediaManager({
|
|
1936
1937
|
gvc: gvc,
|
|
1937
1938
|
data: vm.data.content.preview_image ? [vm.data.content.preview_image] : [],
|
|
1938
1939
|
}),
|
|
1939
1940
|
(() => {
|
|
1940
1941
|
if (cf.is_page) {
|
|
1941
|
-
return
|
|
1942
|
+
return '';
|
|
1942
1943
|
}
|
|
1943
1944
|
return html `
|
|
1944
|
-
|
|
1945
|
-
|
|
1945
|
+
${EditorElem.h3('文章分類')}
|
|
1946
|
+
${gvc.bindView(() => {
|
|
1946
1947
|
const tagID = gvc.glitter.getUUID();
|
|
1947
1948
|
let listTag = [];
|
|
1948
1949
|
ApiUser.getPublicConfig('blog_collection', 'manager').then((data) => {
|
|
1949
1950
|
if (data.response.value) {
|
|
1950
1951
|
vm.link = data.response.value;
|
|
1951
1952
|
function setCheck(link) {
|
|
1952
|
-
link.map(
|
|
1953
|
+
link.map(dd => {
|
|
1953
1954
|
const it = vm.data.content.collection.find((d1) => {
|
|
1954
1955
|
return d1 === dd.link;
|
|
1955
1956
|
});
|
|
@@ -1966,10 +1967,7 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1966
1967
|
view: () => {
|
|
1967
1968
|
return listTag
|
|
1968
1969
|
.map((dd) => {
|
|
1969
|
-
return html `
|
|
1970
|
-
<div class="badge bg_orange mt-2 me-2 fs-sm">
|
|
1971
|
-
${dd}
|
|
1972
|
-
</div>`;
|
|
1970
|
+
return html ` <div class="badge bg_orange mt-2 me-2 fs-sm">${dd}</div>`;
|
|
1973
1971
|
})
|
|
1974
1972
|
.join('');
|
|
1975
1973
|
},
|
|
@@ -1978,22 +1976,20 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1978
1976
|
},
|
|
1979
1977
|
};
|
|
1980
1978
|
})}
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1979
|
+
<div
|
|
1980
|
+
class="cursor_pointer bt_c39 ms-2 p-1 mt-3"
|
|
1981
|
+
onclick="${gvc.event(() => {
|
|
1984
1982
|
cVm.type = 'collection';
|
|
1985
1983
|
gvc.notifyDataChange(cVm.id);
|
|
1986
1984
|
})}"
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
`;
|
|
1985
|
+
>
|
|
1986
|
+
<i class="fa-solid fa-plus me-2" aria-hidden="true"></i>
|
|
1987
|
+
添加與編輯分類
|
|
1988
|
+
</div>
|
|
1989
|
+
`;
|
|
1993
1990
|
})(),
|
|
1994
1991
|
].join(`<div class="my-2"></div>`);
|
|
1995
1992
|
},
|
|
1996
|
-
divCreate: {},
|
|
1997
1993
|
};
|
|
1998
1994
|
}),
|
|
1999
1995
|
].join('');
|
|
@@ -2002,9 +1998,9 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
2002
1998
|
})),
|
|
2003
1999
|
ratio: 25,
|
|
2004
2000
|
})}
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2001
|
+
${BgWidget.mbContainer(240)}
|
|
2002
|
+
<div class="update-bar-container">
|
|
2003
|
+
${vm.data.id
|
|
2008
2004
|
? BgWidget.redButton(`刪除${cf.is_page ? '頁面' : '網誌'}`, gvc.event(() => {
|
|
2009
2005
|
const dialog = new ShareDialog(gvc.glitter);
|
|
2010
2006
|
dialog.checkYesOrNot({
|
|
@@ -2037,7 +2033,7 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
2037
2033
|
});
|
|
2038
2034
|
}))
|
|
2039
2035
|
: ''}
|
|
2040
|
-
|
|
2036
|
+
${BgWidget.cancel(gvc.event(() => {
|
|
2041
2037
|
if (!vm.data.id) {
|
|
2042
2038
|
cf.widget.event('error', {
|
|
2043
2039
|
title: '請先儲存',
|
|
@@ -2055,7 +2051,7 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
2055
2051
|
case 'page':
|
|
2056
2052
|
return 'pages';
|
|
2057
2053
|
}
|
|
2058
|
-
return
|
|
2054
|
+
return '';
|
|
2059
2055
|
})()
|
|
2060
2056
|
: `blogs`}/${vm.data.content.tag}?preview=true&appName=${window.parent.appName}`;
|
|
2061
2057
|
})();
|
|
@@ -2064,41 +2060,41 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
2064
2060
|
window.parent.glitter.openNewTab(href);
|
|
2065
2061
|
}
|
|
2066
2062
|
}), '預覽')}
|
|
2067
|
-
|
|
2063
|
+
${BgWidget.cancel(gvc.event(() => {
|
|
2068
2064
|
vm.type = 'list';
|
|
2069
2065
|
}), '取消')}
|
|
2070
|
-
|
|
2071
|
-
saveData(gvc, cf, vm, cVm, false).then(
|
|
2066
|
+
${BgWidget.save(gvc.event(() => __awaiter(this, void 0, void 0, function* () {
|
|
2067
|
+
saveData(gvc, cf, vm, cVm, false).then(res => {
|
|
2072
2068
|
if (!res) {
|
|
2073
2069
|
gvc.notifyDataChange(id);
|
|
2074
2070
|
}
|
|
2075
2071
|
});
|
|
2076
2072
|
})))}
|
|
2077
|
-
|
|
2078
|
-
|
|
2073
|
+
</div>
|
|
2074
|
+
`;
|
|
2079
2075
|
},
|
|
2080
|
-
divCreate: {}
|
|
2081
2076
|
};
|
|
2082
2077
|
});
|
|
2083
2078
|
}
|
|
2084
2079
|
function saveData(gvc, cf, vm, cVm, silence, pass_check = false) {
|
|
2085
|
-
return new Promise((
|
|
2080
|
+
return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
|
|
2086
2081
|
if (!vm.data.content.tag) {
|
|
2087
2082
|
yield cf.widget.event('error', {
|
|
2088
2083
|
title: '請設定連結',
|
|
2089
2084
|
});
|
|
2090
|
-
|
|
2085
|
+
resolve(false);
|
|
2091
2086
|
}
|
|
2092
2087
|
else if (window.parent.store_info.language_setting.support.find((d1) => {
|
|
2093
|
-
return !
|
|
2094
|
-
}) &&
|
|
2088
|
+
return !vm.data.content.language_data[d1].name;
|
|
2089
|
+
}) &&
|
|
2090
|
+
!pass_check) {
|
|
2095
2091
|
language = window.parent.store_info.language_setting.support.find((d1) => {
|
|
2096
|
-
return !
|
|
2092
|
+
return !vm.data.content.language_data[d1].name;
|
|
2097
2093
|
});
|
|
2098
2094
|
yield cf.widget.event('error', {
|
|
2099
2095
|
title: '請設定名稱',
|
|
2100
2096
|
});
|
|
2101
|
-
|
|
2097
|
+
resolve(false);
|
|
2102
2098
|
}
|
|
2103
2099
|
else {
|
|
2104
2100
|
if (!silence) {
|
|
@@ -2116,13 +2112,13 @@ function saveData(gvc, cf, vm, cVm, silence, pass_check = false) {
|
|
|
2116
2112
|
yield cf.widget.event('success', {
|
|
2117
2113
|
title: '設定成功',
|
|
2118
2114
|
});
|
|
2119
|
-
|
|
2115
|
+
resolve(true);
|
|
2120
2116
|
}
|
|
2121
2117
|
else {
|
|
2122
2118
|
yield cf.widget.event('error', {
|
|
2123
2119
|
title: '此連結已被使用',
|
|
2124
2120
|
});
|
|
2125
|
-
|
|
2121
|
+
resolve(false);
|
|
2126
2122
|
}
|
|
2127
2123
|
}));
|
|
2128
2124
|
}
|
|
@@ -2144,13 +2140,13 @@ function saveData(gvc, cf, vm, cVm, silence, pass_check = false) {
|
|
|
2144
2140
|
}
|
|
2145
2141
|
cVm.type = 'detail';
|
|
2146
2142
|
gvc.notifyDataChange(cVm.id);
|
|
2147
|
-
|
|
2143
|
+
resolve(true);
|
|
2148
2144
|
}
|
|
2149
2145
|
else {
|
|
2150
2146
|
yield cf.widget.event('error', {
|
|
2151
2147
|
title: '此連結已被使用',
|
|
2152
2148
|
});
|
|
2153
|
-
|
|
2149
|
+
resolve(false);
|
|
2154
2150
|
}
|
|
2155
2151
|
}));
|
|
2156
2152
|
}
|
|
@@ -2158,7 +2154,7 @@ function saveData(gvc, cf, vm, cVm, silence, pass_check = false) {
|
|
|
2158
2154
|
}));
|
|
2159
2155
|
}
|
|
2160
2156
|
function template_select(gvc, cf, vm, cVm, page_type) {
|
|
2161
|
-
return BgBlog.template_select(gvc,
|
|
2157
|
+
return BgBlog.template_select(gvc, c2 => {
|
|
2162
2158
|
if (c2) {
|
|
2163
2159
|
vm.data.content.config = c2;
|
|
2164
2160
|
vm.data.content.name = c2.name;
|
|
@@ -2180,7 +2176,7 @@ function template_select(gvc, cf, vm, cVm, page_type) {
|
|
|
2180
2176
|
function loopFindProducts(config) {
|
|
2181
2177
|
let product_select = [];
|
|
2182
2178
|
function loop(array, container_cf) {
|
|
2183
|
-
array.map((dd
|
|
2179
|
+
array.map((dd) => {
|
|
2184
2180
|
if (dd.type === 'component' && dd.data.tag === 'SY00-normal-products') {
|
|
2185
2181
|
if (dd.data.refer_form_data.product_select.select !== 'product') {
|
|
2186
2182
|
dd.data.refer_form_data.product_select.select = 'product';
|