ts-glitter 13.4.7 → 13.5.0
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 -2
- package/lowcode/backend-manager/bg-blog.js +573 -590
- package/lowcode/backend-manager/bg-blog.ts +884 -915
- package/lowcode/backend-manager/bg-graph-api.js +3 -3
- package/lowcode/backend-manager/bg-graph-api.ts +3 -5
- package/lowcode/backend-manager/bg-guide.js +69 -24
- package/lowcode/backend-manager/bg-guide.ts +82 -27
- package/lowcode/backend-manager/bg-line.js +18 -18
- package/lowcode/backend-manager/bg-line.ts +18 -35
- package/lowcode/backend-manager/bg-notify.js +18 -18
- package/lowcode/backend-manager/bg-notify.ts +18 -34
- package/lowcode/backend-manager/bg-project.js +11 -11
- package/lowcode/backend-manager/bg-project.ts +11 -20
- package/lowcode/backend-manager/bg-recommend.js +656 -652
- package/lowcode/backend-manager/bg-recommend.ts +31 -40
- package/lowcode/backend-manager/bg-seo.js +25 -20
- package/lowcode/backend-manager/bg-seo.ts +121 -105
- package/lowcode/backend-manager/bg-shopping.js +14 -14
- package/lowcode/backend-manager/bg-shopping.ts +14 -25
- package/lowcode/backend-manager/bg-sns.js +18 -18
- package/lowcode/backend-manager/bg-sns.ts +18 -34
- package/lowcode/backend-manager/bg-wallet.js +5 -5
- package/lowcode/backend-manager/bg-wallet.ts +5 -7
- package/lowcode/backend-manager/bg-widget.js +25 -14
- package/lowcode/backend-manager/bg-widget.ts +43 -17
- package/lowcode/cms-plugin/ai-points-list.js +54 -57
- package/lowcode/cms-plugin/ai-points-list.ts +55 -63
- package/lowcode/cms-plugin/ai-points.js +2 -2
- package/lowcode/cms-plugin/ai-points.ts +2 -4
- package/lowcode/cms-plugin/app-release.js +45 -46
- package/lowcode/cms-plugin/app-release.ts +221 -209
- package/lowcode/cms-plugin/auto-reply.js +3 -3
- package/lowcode/cms-plugin/auto-reply.ts +3 -5
- package/lowcode/cms-plugin/form-setting.js +6 -6
- package/lowcode/cms-plugin/form-setting.ts +6 -10
- package/lowcode/cms-plugin/line-auto-reply.js +3 -3
- package/lowcode/cms-plugin/line-auto-reply.ts +3 -5
- package/lowcode/cms-plugin/member-group-list.js +2 -2
- package/lowcode/cms-plugin/member-group-list.ts +2 -3
- package/lowcode/cms-plugin/member-setting.js +75 -88
- package/lowcode/cms-plugin/member-setting.ts +143 -157
- package/lowcode/cms-plugin/member-type-list.js +243 -240
- package/lowcode/cms-plugin/member-type-list.ts +14 -19
- package/lowcode/cms-plugin/menus-setting.js +2 -2
- package/lowcode/cms-plugin/menus-setting.ts +2 -4
- package/lowcode/cms-plugin/permission-setting.js +17 -18
- package/lowcode/cms-plugin/permission-setting.ts +145 -147
- package/lowcode/cms-plugin/pos-checkout-setting.js +7 -10
- package/lowcode/cms-plugin/pos-checkout-setting.ts +174 -179
- package/lowcode/cms-plugin/shopping-collections.js +224 -218
- package/lowcode/cms-plugin/shopping-collections.ts +152 -153
- package/lowcode/cms-plugin/shopping-discount-setting.js +855 -852
- package/lowcode/cms-plugin/shopping-discount-setting.ts +14 -18
- package/lowcode/cms-plugin/shopping-finance-setting.js +259 -265
- package/lowcode/cms-plugin/shopping-finance-setting.ts +273 -284
- package/lowcode/cms-plugin/shopping-order-manager.js +520 -497
- package/lowcode/cms-plugin/shopping-order-manager.ts +347 -325
- package/lowcode/cms-plugin/shopping-order-return.js +10 -9
- package/lowcode/cms-plugin/shopping-order-return.ts +23 -27
- package/lowcode/cms-plugin/shopping-product-setting.js +1079 -1055
- package/lowcode/cms-plugin/shopping-product-setting.ts +348 -337
- package/lowcode/cms-plugin/shopping-product-stock.js +2 -2
- package/lowcode/cms-plugin/shopping-product-stock.ts +2 -3
- package/lowcode/cms-plugin/shopping-product-text.js +32 -36
- package/lowcode/cms-plugin/shopping-product-text.ts +78 -81
- package/lowcode/cms-plugin/shopping-rebate-setting.js +321 -316
- package/lowcode/cms-plugin/shopping-rebate-setting.ts +15 -17
- package/lowcode/cms-plugin/shopping-rebate.js +102 -59
- package/lowcode/cms-plugin/shopping-rebate.ts +110 -71
- package/lowcode/cms-plugin/shopping-shipment-setting.js +382 -426
- package/lowcode/cms-plugin/shopping-shipment-setting.ts +489 -531
- package/lowcode/cms-plugin/sms-points.js +2 -2
- package/lowcode/cms-plugin/sms-points.ts +2 -4
- package/lowcode/cms-plugin/sns-auto-reply.js +3 -3
- package/lowcode/cms-plugin/sns-auto-reply.ts +3 -5
- package/lowcode/cms-plugin/third-party-apple.js +22 -28
- package/lowcode/cms-plugin/third-party-apple.ts +189 -191
- package/lowcode/cms-plugin/third-party-facebook.js +31 -32
- package/lowcode/cms-plugin/third-party-facebook.ts +240 -234
- package/lowcode/cms-plugin/third-party-google.js +33 -29
- package/lowcode/cms-plugin/third-party-google.ts +216 -202
- package/lowcode/cms-plugin/third-party-line.js +19 -22
- package/lowcode/cms-plugin/third-party-line.ts +166 -162
- package/lowcode/cms-plugin/user-list.js +449 -441
- package/lowcode/cms-plugin/user-list.ts +63 -65
- package/lowcode/cms-plugin/user-login-setting.js +2 -2
- package/lowcode/cms-plugin/user-login-setting.ts +2 -5
- package/lowcode/cms-plugin/wallet-list.js +5 -5
- package/lowcode/cms-plugin/wallet-list.ts +5 -7
- package/lowcode/cms-plugin/web-config-setting.js +5 -5
- package/lowcode/cms-plugin/web-config-setting.ts +5 -8
- package/lowcode/cms-plugin/widget-manager.js +1 -1
- package/lowcode/cms-plugin/widget-manager.ts +1 -2
- package/lowcode/css/editor.css +12 -1
- package/lowcode/form-view/editor/array-items.js +1 -1
- package/lowcode/form-view/editor/array-items.ts +1 -1
- package/lowcode/form-view/editor/color-selector.ts +1 -1
- package/lowcode/glitter-base/route/shopping.js +17 -0
- package/lowcode/glitter-base/route/shopping.ts +17 -0
- package/lowcode/glitter-base/route/user.js +2 -2
- package/lowcode/glitter-base/route/user.ts +26 -27
- package/lowcode/glitterBundle/Glitter.js +10 -3
- package/lowcode/glitterBundle/Glitter.ts +10 -3
- package/lowcode/jspage/editor.js +16 -10
- package/lowcode/jspage/editor.ts +17 -11
- package/lowcode/jspage/function-page/server-editor/router/api-manager.js +4 -4
- package/lowcode/jspage/function-page/server-editor/router/api-manager.ts +4 -6
- package/lowcode/jspage/function-page/server-editor/router/database.js +8 -8
- package/lowcode/jspage/function-page/server-editor/router/database.ts +53 -48
- package/lowcode/jspage/function-page/server-editor/router/domain-manager.js +2 -2
- package/lowcode/jspage/function-page/server-editor/router/domain-manager.ts +2 -3
- package/lowcode/jspage/function-page/server-editor/router/server-status.js +50 -38
- package/lowcode/jspage/function-page/server-editor/router/server-status.ts +93 -76
- package/lowcode/jspage/main.js +61 -29
- package/lowcode/jspage/main.ts +99 -56
- package/lowcode/official_view_component/official/form.js +110 -78
- package/lowcode/official_view_component/official/form.ts +238 -192
- package/lowcode/view-model/saas-view-model.js +454 -285
- package/lowcode/view-model/saas-view-model.ts +917 -722
- package/package.json +1 -1
- package/src/api-public/controllers/ai-points.js.map +1 -1
- package/src/api-public/controllers/article.js +3 -0
- package/src/api-public/controllers/article.js.map +1 -1
- package/src/api-public/controllers/article.ts +3 -0
- package/src/api-public/controllers/chat.js.map +1 -1
- package/src/api-public/controllers/delivery.js.map +1 -1
- package/src/api-public/controllers/fb-message.js.map +1 -1
- package/src/api-public/controllers/index.js.map +1 -1
- package/src/api-public/controllers/invoice.js.map +1 -1
- package/src/api-public/controllers/line-message.js.map +1 -1
- package/src/api-public/controllers/oauth.js.map +1 -1
- package/src/api-public/controllers/rebate.js.map +1 -1
- package/src/api-public/controllers/recommend.js.map +1 -1
- package/src/api-public/controllers/sms-points.js.map +1 -1
- package/src/api-public/controllers/wallet.js.map +1 -1
- package/src/api-public/services/EcInvoice.js.map +1 -1
- package/src/api-public/services/ai-pointes.js.map +1 -1
- package/src/api-public/services/article.js.map +1 -1
- package/src/api-public/services/auto-send-email.js.map +1 -1
- package/src/api-public/services/delivery.js.map +1 -1
- package/src/api-public/services/ezpay/tool.d.ts +0 -1
- package/src/api-public/services/ezpay/tool.js.map +1 -1
- package/src/api-public/services/fake-data-model/fake-product.js.map +1 -1
- package/src/api-public/services/fb-message.js.map +1 -5
- package/src/api-public/services/filter-protect-data.js.map +1 -1
- package/src/api-public/services/financial-service.js.map +1 -1
- package/src/api-public/services/graph-api.js.map +1 -1
- package/src/api-public/services/invoice.js.map +1 -1
- package/src/api-public/services/monitor.d.ts +0 -1
- package/src/api-public/services/monitor.js.map +1 -1
- package/src/api-public/services/public-table-check.js.map +1 -1
- package/src/api-public/services/rebate.js.map +1 -1
- package/src/api-public/services/recommend.js.map +1 -1
- package/src/api-public/services/share-permission.js.map +1 -1
- package/src/api-public/services/shopping.d.ts +1 -1
- package/src/api-public/services/shopping.js +44 -36
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +184 -183
- package/src/api-public/services/sms-pointes.js.map +1 -1
- package/src/api-public/services/sms.js.map +1 -1
- package/src/api-public/services/wallet.js.map +1 -1
- package/src/api-public/services/workers.d.ts +1 -1
- package/src/api-public/utils/ut-database.js.map +1 -1
- package/src/app-project/serverless/src/controllers/index.js.map +1 -1
- package/src/app-project/serverless/src/controllers/sample.js.map +1 -1
- package/src/app-project/serverless/src/modules/database.d.ts +1 -2
- package/src/app-project/serverless/src/modules/database.js.map +1 -1
- package/src/app-project/serverless/src/modules/exception.js.map +1 -1
- package/src/app-project/serverless/src/modules/hooks.js.map +1 -1
- package/src/app-project/serverless/src/modules/logger.js.map +1 -1
- package/src/app-project/serverless/src/modules/redis.d.ts +1 -1
- package/src/app-project/serverless/src/modules/redis.js.map +1 -1
- package/src/app-project/serverless/src/modules/response.js.map +1 -1
- package/src/app-project/serverless/src/modules/ssh.js.map +1 -1
- package/src/config.js.map +1 -5
- package/src/controllers/ai.js.map +1 -1
- package/src/controllers/global-event.js.map +1 -1
- package/src/controllers/page.js.map +1 -1
- package/src/controllers/private_config.js.map +1 -1
- package/src/export/export-test.js.map +1 -1
- package/src/firebase/message.js +1 -2
- package/src/firebase/message.js.map +1 -1
- package/src/helper/app_creater.js +1 -2
- package/src/helper/app_creater.js.map +1 -1
- package/src/helper/glitter-util.d.ts +0 -1
- package/src/helper/glitter-util.js.map +1 -1
- package/src/lambda/interface.d.ts +1 -1
- package/src/lambda/interface.js +2 -2
- package/src/lambda/interface.js.map +1 -1
- package/src/modules/exception.js.map +1 -1
- package/src/modules/hooks.js.map +1 -1
- package/src/modules/response.js.map +1 -1
- package/src/modules/ssh.js.map +1 -1
- package/src/services/ses.js +1 -2
- package/src/services/ses.js.map +1 -1
- package/src/services/system-schedule.js.map +1 -1
- package/g1b90plcfb.csv +0 -1289
|
@@ -61,28 +61,28 @@ export class BgBlog {
|
|
|
61
61
|
key: '預覽',
|
|
62
62
|
value: html`
|
|
63
63
|
<div
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
64
|
+
class="d-flex align-items-center justify-content-center hoverBtn me-2 border"
|
|
65
|
+
style="height:28px;width:28px;border-radius:5px;cursor:pointer;color:#151515;"
|
|
66
|
+
onclick="${gvc.event((e, event) => {
|
|
67
|
+
const href = (() => {
|
|
68
|
+
return `https://${(window.parent as any).glitter.share.editorViewModel.domain}/${
|
|
69
|
+
is_page
|
|
70
|
+
? (() => {
|
|
71
|
+
switch (page_tab) {
|
|
72
|
+
case 'shopping':
|
|
73
|
+
return 'shop';
|
|
74
|
+
case 'hidden':
|
|
75
|
+
return 'hidden';
|
|
76
|
+
case 'page':
|
|
77
|
+
return 'pages';
|
|
78
|
+
}
|
|
79
|
+
})()
|
|
80
|
+
: `blogs`
|
|
81
|
+
}/${dd.content.tag}`;
|
|
82
|
+
})();
|
|
83
|
+
(window.parent as any).glitter.openNewTab(href);
|
|
84
|
+
event.stopPropagation();
|
|
85
|
+
})}"
|
|
86
86
|
>
|
|
87
87
|
<i class="fa-regular fa-eye" aria-hidden="true"></i>
|
|
88
88
|
</div>
|
|
@@ -91,68 +91,81 @@ export class BgBlog {
|
|
|
91
91
|
];
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
|
-
|
|
94
|
+
if ((window.parent as any).glitter.getUrlParameter('page-id')) {
|
|
95
|
+
Article.get({
|
|
96
|
+
page: 0,
|
|
97
|
+
limit: 1,
|
|
98
|
+
id: (window.parent as any).glitter.getUrlParameter('page-id')
|
|
99
|
+
}).then(async (data) => {
|
|
100
|
+
vm.data = data.response.data[0];
|
|
101
|
+
vm.type = 'replace';
|
|
102
|
+
})
|
|
103
|
+
}
|
|
95
104
|
return gvc.bindView(() => {
|
|
96
105
|
const id = glitter.getUUID();
|
|
97
106
|
return {
|
|
98
107
|
bind: id,
|
|
99
108
|
dataList: [{ obj: vm, key: 'type' }],
|
|
100
109
|
view: () => {
|
|
110
|
+
if ((window.parent as any).glitter.getUrlParameter('page-id') && vm.type!=='replace') {
|
|
111
|
+
return ``
|
|
112
|
+
}
|
|
101
113
|
if (vm.type === 'list') {
|
|
102
114
|
return BgWidget.container(
|
|
103
115
|
html`
|
|
104
|
-
<div class="
|
|
116
|
+
<div class="title-container gap-4 ${type === 'select' ? `d-none` : ``}">
|
|
105
117
|
<div class="d-flex flex-column" style="gap:5px;">
|
|
106
118
|
${BgWidget.title(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
is_page
|
|
120
|
+
? (() => {
|
|
121
|
+
switch (page_tab) {
|
|
122
|
+
case 'hidden':
|
|
123
|
+
return '隱形賣場';
|
|
124
|
+
case 'page':
|
|
125
|
+
return '自訂頁面';
|
|
126
|
+
case 'shopping':
|
|
127
|
+
return '一頁商店';
|
|
128
|
+
}
|
|
129
|
+
})()
|
|
130
|
+
: '網誌文章'
|
|
131
|
+
)}
|
|
120
132
|
${BgWidget.grayNote(
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
133
|
+
is_page
|
|
134
|
+
? (() => {
|
|
135
|
+
switch (page_tab) {
|
|
136
|
+
case 'hidden':
|
|
137
|
+
return '隱形賣場僅能透過連結分享,無法顯示於 Google 搜尋列表';
|
|
138
|
+
case 'page':
|
|
139
|
+
return '打造自訂頁面,顯示品牌官網的獨特內容';
|
|
140
|
+
case 'shopping':
|
|
141
|
+
return '放大特定商品重點,打造專屬爆品產品,一頁下單快速購物';
|
|
142
|
+
}
|
|
143
|
+
})()
|
|
144
|
+
: '快速分享商店最新資訊的好功能'
|
|
145
|
+
)}
|
|
134
146
|
</div>
|
|
135
147
|
<div class="flex-fill"></div>
|
|
136
148
|
<div style="display: flex; gap: 12px;">
|
|
137
149
|
${is_page
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
150
|
+
? ''
|
|
151
|
+
: BgWidget.grayButton(
|
|
152
|
+
'網誌分類',
|
|
153
|
+
gvc.event(() => {
|
|
154
|
+
vm.type = 'collection';
|
|
155
|
+
gvc.notifyDataChange(id);
|
|
156
|
+
})
|
|
157
|
+
)}
|
|
146
158
|
${BgWidget.darkButton(
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
159
|
+
`新增${is_page ? `頁面` : `網誌`}`,
|
|
160
|
+
gvc.event(() => {
|
|
161
|
+
vm.data = { content: {} };
|
|
162
|
+
vm.type = 'add';
|
|
163
|
+
})
|
|
164
|
+
)}
|
|
153
165
|
</div>
|
|
154
166
|
</div>
|
|
155
|
-
${BgWidget.
|
|
167
|
+
${BgWidget.container(
|
|
168
|
+
BgWidget.mainCard(
|
|
156
169
|
[
|
|
157
170
|
BgWidget.searchPlace(
|
|
158
171
|
gvc.event((e) => {
|
|
@@ -231,11 +244,12 @@ export class BgBlog {
|
|
|
231
244
|
],
|
|
232
245
|
}),
|
|
233
246
|
].join('')
|
|
234
|
-
)
|
|
235
|
-
|
|
236
|
-
|
|
247
|
+
)
|
|
248
|
+
)}
|
|
249
|
+
`
|
|
237
250
|
);
|
|
238
251
|
} else if (vm.type == 'replace') {
|
|
252
|
+
(window.parent as any).glitter.setUrlParameter('page-id', vm.data.id)
|
|
239
253
|
return editor({
|
|
240
254
|
gvc: gvc,
|
|
241
255
|
vm: vm,
|
|
@@ -253,8 +267,7 @@ export class BgBlog {
|
|
|
253
267
|
vm.type = 'list';
|
|
254
268
|
gvc.notifyDataChange(id);
|
|
255
269
|
},
|
|
256
|
-
})
|
|
257
|
-
BgWidget.getContainerWidth()
|
|
270
|
+
})
|
|
258
271
|
);
|
|
259
272
|
} else {
|
|
260
273
|
return editor({
|
|
@@ -283,260 +296,262 @@ export class BgBlog {
|
|
|
283
296
|
}
|
|
284
297
|
`);
|
|
285
298
|
const containerID = gvc.glitter.getUUID();
|
|
286
|
-
return html
|
|
299
|
+
return html`
|
|
300
|
+
<div class="title-container">
|
|
287
301
|
${BgWidget.goBack(
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
302
|
+
gvc.event(() => {
|
|
303
|
+
callback(undefined);
|
|
304
|
+
})
|
|
291
305
|
)}
|
|
292
306
|
<div>${[BgWidget.title('選擇模板'), BgWidget.grayNote('請選擇一個符合您需求的模板')].join('')}</div>
|
|
293
307
|
</div>
|
|
294
308
|
${[
|
|
295
309
|
html`<div class="my-3"></div>`,
|
|
296
310
|
BgWidget.card(
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
name: '空白內容',
|
|
328
|
-
page_type: 'page',
|
|
329
|
-
preview_image: null,
|
|
330
|
-
appName: 'shop_template_black_style',
|
|
331
|
-
template_type: 2,
|
|
332
|
-
template_config: {
|
|
333
|
-
tag: ['頁面範例'],
|
|
334
|
-
desc: '',
|
|
311
|
+
gvc.bindView(() => {
|
|
312
|
+
return {
|
|
313
|
+
bind: containerID,
|
|
314
|
+
view: () => {
|
|
315
|
+
return gvc.bindView(() => {
|
|
316
|
+
let data: any = undefined;
|
|
317
|
+
const id = gvc.glitter.getUUID();
|
|
318
|
+
if (page_tab !== 'page') {
|
|
319
|
+
ApiPageConfig.getPageTemplate({
|
|
320
|
+
template_from: 'all',
|
|
321
|
+
page: '0',
|
|
322
|
+
limit: '3000',
|
|
323
|
+
type: 'page',
|
|
324
|
+
tag: (() => {
|
|
325
|
+
switch (page_tab) {
|
|
326
|
+
case 'shopping':
|
|
327
|
+
case 'hidden':
|
|
328
|
+
return `一頁購物`;
|
|
329
|
+
default:
|
|
330
|
+
return ``;
|
|
331
|
+
}
|
|
332
|
+
})(),
|
|
333
|
+
search: vm.search,
|
|
334
|
+
}).then((res) => {
|
|
335
|
+
data = res;
|
|
336
|
+
data.response.result.data = [
|
|
337
|
+
{
|
|
338
|
+
id: 20739,
|
|
339
|
+
userID: '234285319',
|
|
340
|
+
tag: 'empty',
|
|
335
341
|
name: '空白內容',
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
+
page_type: 'page',
|
|
343
|
+
preview_image: null,
|
|
344
|
+
appName: 'shop_template_black_style',
|
|
345
|
+
template_type: 2,
|
|
346
|
+
template_config: {
|
|
347
|
+
tag: ['頁面範例'],
|
|
348
|
+
desc: '',
|
|
349
|
+
name: '空白內容',
|
|
350
|
+
image: ['https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1709282671899-BLANK PAGE.jpg'],
|
|
351
|
+
status: 'wait',
|
|
352
|
+
post_to: 'all',
|
|
353
|
+
version: '1.0',
|
|
354
|
+
created_by: 'liondesign.io',
|
|
355
|
+
preview_img: '',
|
|
356
|
+
},
|
|
342
357
|
},
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
{
|
|
362
|
-
id: 20739,
|
|
363
|
-
userID: '234285319',
|
|
364
|
-
tag: 'empty',
|
|
365
|
-
name: '空白內容',
|
|
366
|
-
page_type: 'page',
|
|
367
|
-
preview_image: null,
|
|
368
|
-
appName: 'shop_template_black_style',
|
|
369
|
-
template_type: 2,
|
|
370
|
-
template_config: {
|
|
371
|
-
tag: ['頁面範例'],
|
|
372
|
-
desc: '',
|
|
373
|
-
name: '空白內容',
|
|
374
|
-
image: ['https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1709282671899-BLANK PAGE.jpg'],
|
|
375
|
-
status: 'wait',
|
|
376
|
-
post_to: 'all',
|
|
377
|
-
version: '1.0',
|
|
378
|
-
created_by: 'liondesign.io',
|
|
379
|
-
preview_img: '',
|
|
380
|
-
},
|
|
381
|
-
},
|
|
382
|
-
].concat(
|
|
383
|
-
dd.response.data.map((dd: any) => {
|
|
384
|
-
return {
|
|
358
|
+
].concat(data.response.result.data);
|
|
359
|
+
gvc.notifyDataChange(id);
|
|
360
|
+
});
|
|
361
|
+
} else {
|
|
362
|
+
Article.get({
|
|
363
|
+
page: 0,
|
|
364
|
+
limit: 20,
|
|
365
|
+
search: ``,
|
|
366
|
+
for_index: `false`,
|
|
367
|
+
status: '0,1',
|
|
368
|
+
page_type: page_tab,
|
|
369
|
+
app_name: 't_1726217714800',
|
|
370
|
+
}).then((dd) => {
|
|
371
|
+
data = {
|
|
372
|
+
response: {
|
|
373
|
+
result: {
|
|
374
|
+
data: [
|
|
375
|
+
{
|
|
385
376
|
id: 20739,
|
|
386
377
|
userID: '234285319',
|
|
387
|
-
tag:
|
|
388
|
-
name:
|
|
378
|
+
tag: 'empty',
|
|
379
|
+
name: '空白內容',
|
|
389
380
|
page_type: 'page',
|
|
390
381
|
preview_image: null,
|
|
391
|
-
|
|
392
|
-
appName: 't_1726217714800',
|
|
382
|
+
appName: 'shop_template_black_style',
|
|
393
383
|
template_type: 2,
|
|
394
384
|
template_config: {
|
|
395
|
-
tag: [],
|
|
385
|
+
tag: ['頁面範例'],
|
|
396
386
|
desc: '',
|
|
397
|
-
name:
|
|
398
|
-
image: [
|
|
387
|
+
name: '空白內容',
|
|
388
|
+
image: ['https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1709282671899-BLANK PAGE.jpg'],
|
|
399
389
|
status: 'wait',
|
|
400
390
|
post_to: 'all',
|
|
401
391
|
version: '1.0',
|
|
402
392
|
created_by: 'liondesign.io',
|
|
403
393
|
preview_img: '',
|
|
404
394
|
},
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
|
|
395
|
+
},
|
|
396
|
+
].concat(
|
|
397
|
+
dd.response.data.map((dd: any) => {
|
|
398
|
+
return {
|
|
399
|
+
id: 20739,
|
|
400
|
+
userID: '234285319',
|
|
401
|
+
tag: dd.content.tag,
|
|
402
|
+
name: dd.content.name,
|
|
403
|
+
page_type: 'page',
|
|
404
|
+
preview_image: null,
|
|
405
|
+
_config: dd.content.config,
|
|
406
|
+
appName: 't_1726217714800',
|
|
407
|
+
template_type: 2,
|
|
408
|
+
template_config: {
|
|
409
|
+
tag: [],
|
|
410
|
+
desc: '',
|
|
411
|
+
name: dd.content.name,
|
|
412
|
+
image: [dd.content.seo.image],
|
|
413
|
+
status: 'wait',
|
|
414
|
+
post_to: 'all',
|
|
415
|
+
version: '1.0',
|
|
416
|
+
created_by: 'liondesign.io',
|
|
417
|
+
preview_img: '',
|
|
418
|
+
},
|
|
419
|
+
};
|
|
420
|
+
})
|
|
421
|
+
),
|
|
422
|
+
},
|
|
408
423
|
},
|
|
409
|
-
}
|
|
410
|
-
};
|
|
424
|
+
};
|
|
411
425
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
426
|
+
gvc.notifyDataChange(id);
|
|
427
|
+
});
|
|
428
|
+
}
|
|
415
429
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
430
|
+
return {
|
|
431
|
+
bind: id,
|
|
432
|
+
view: () => {
|
|
433
|
+
if (data) {
|
|
434
|
+
return (() => {
|
|
435
|
+
if (data.response.result.data.length === 0) {
|
|
436
|
+
if (!vm.search) {
|
|
437
|
+
return html`
|
|
438
|
+
<div class="d-flex align-items-center justify-content-center flex-column w-100 py-4" style="width:700px;gap:10px;">
|
|
439
|
+
<img src="./img/box-open-solid.svg" />
|
|
440
|
+
<span class="color39 text-center">尚未自製任何模塊<br />請前往開發者模式自製專屬模塊</span>
|
|
441
|
+
</div>
|
|
442
|
+
`;
|
|
443
|
+
} else {
|
|
444
|
+
return html`
|
|
445
|
+
<div class="d-flex align-items-center justify-content-center flex-column w-100 py-4" style="width:700px;gap:10px;">
|
|
446
|
+
<img src="./img/box-open-solid.svg" />
|
|
447
|
+
<span class="color39 text-center">查無相關模塊</span>
|
|
448
|
+
</div>
|
|
449
|
+
`;
|
|
450
|
+
}
|
|
429
451
|
} else {
|
|
430
452
|
return html`
|
|
431
|
-
<div class="
|
|
432
|
-
<
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
}
|
|
448
|
-
})
|
|
449
|
-
.map((dd: any, index: number) => {
|
|
450
|
-
return html`<div class="col-6 col-sm-3 mb-3 rounded-3">
|
|
451
|
-
<div class="d-flex flex-column justify-content-center w-100 " style="gap:5px;cursor:pointer;">
|
|
452
|
-
<div
|
|
453
|
-
class="card w-100 position-relative rounded hoverHidden bgf6 rounded-3"
|
|
454
|
-
style="padding-bottom: ${(800 / 600) * 100}%;"
|
|
455
|
-
>
|
|
456
|
-
<div
|
|
457
|
-
class="position-absolute w-100 h-100 d-flex align-items-center justify-content-center rounded-3"
|
|
458
|
-
style="overflow: hidden;"
|
|
459
|
-
>
|
|
460
|
-
<img
|
|
461
|
-
class="w-100 "
|
|
462
|
-
src="${dd.template_config.image[0] ??
|
|
463
|
-
'https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/1713445383494-未命名(1080x1080像素).jpg'}"
|
|
464
|
-
/>
|
|
465
|
-
</div>
|
|
466
|
-
|
|
467
|
-
<div
|
|
468
|
-
class="position-absolute w-100 h-100 align-items-center justify-content-center rounded fs-6 flex-column"
|
|
469
|
-
style="background: rgba(0,0,0,0.5);gap:5px;"
|
|
470
|
-
>
|
|
471
|
-
<button
|
|
472
|
-
class="btn btn-secondary d-flex align-items-center "
|
|
473
|
-
style="height: 28px;width: 75px;gap:5px;"
|
|
474
|
-
onclick="${gvc.event(() => {
|
|
475
|
-
if (dd.tag === 'empty') {
|
|
476
|
-
const a: any = [];
|
|
477
|
-
(a as any).name = '空白頁面';
|
|
478
|
-
callback(a);
|
|
479
|
-
} else {
|
|
480
|
-
if (dd._config) {
|
|
481
|
-
dd._config.name = dd.template_config.name;
|
|
482
|
-
callback(dd._config);
|
|
483
|
-
} else {
|
|
484
|
-
BaseApi.create({
|
|
485
|
-
url: `${(window as any).glitterBackend}/api/v1/template?appName=${dd.appName}&tag=${
|
|
486
|
-
dd.tag
|
|
487
|
-
}`,
|
|
488
|
-
type: 'get',
|
|
489
|
-
}).then((res) => {
|
|
490
|
-
res.response.result[0].config.name = dd.template_config.name;
|
|
491
|
-
callback(res.response.result[0].config);
|
|
492
|
-
});
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
})}"
|
|
453
|
+
<div class="w-100" style="overflow-y: auto;">
|
|
454
|
+
<div class="row m-0 pt-2 w-100">
|
|
455
|
+
${data.response.result.data
|
|
456
|
+
.sort((a: any, b: any) => {
|
|
457
|
+
if (a.tag === 'empty' || b.tag === 'empty') {
|
|
458
|
+
return b.tag === 'empty' ? 1 : -1;
|
|
459
|
+
} else {
|
|
460
|
+
return a.template_config.name.localeCompare(b.template_config.name);
|
|
461
|
+
}
|
|
462
|
+
})
|
|
463
|
+
.map((dd: any, index: number) => {
|
|
464
|
+
return html`<div class="col-6 col-sm-3 mb-3 rounded-3">
|
|
465
|
+
<div class="d-flex flex-column justify-content-center w-100 " style="gap:5px;cursor:pointer;">
|
|
466
|
+
<div
|
|
467
|
+
class="card w-100 position-relative rounded hoverHidden bgf6 rounded-3"
|
|
468
|
+
style="padding-bottom: ${(800 / 600) * 100}%;"
|
|
496
469
|
>
|
|
497
|
-
|
|
498
|
-
|
|
470
|
+
<div
|
|
471
|
+
class="position-absolute w-100 h-100 d-flex align-items-center justify-content-center rounded-3"
|
|
472
|
+
style="overflow: hidden;"
|
|
473
|
+
>
|
|
474
|
+
<img
|
|
475
|
+
class="w-100 "
|
|
476
|
+
src="${dd.template_config.image[0] ??
|
|
477
|
+
'https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/1713445383494-未命名(1080x1080像素).jpg'}"
|
|
478
|
+
/>
|
|
479
|
+
</div>
|
|
480
|
+
|
|
481
|
+
<div
|
|
482
|
+
class="position-absolute w-100 h-100 align-items-center justify-content-center rounded fs-6 flex-column"
|
|
483
|
+
style="background: rgba(0,0,0,0.5);gap:5px;"
|
|
484
|
+
>
|
|
485
|
+
<button
|
|
486
|
+
class="btn btn-secondary d-flex align-items-center "
|
|
487
|
+
style="height: 28px;width: 75px;gap:5px;"
|
|
488
|
+
onclick="${gvc.event(() => {
|
|
489
|
+
if (dd.tag === 'empty') {
|
|
490
|
+
const a: any = [];
|
|
491
|
+
(a as any).name = '空白頁面';
|
|
492
|
+
callback(a);
|
|
493
|
+
} else {
|
|
494
|
+
if (dd._config) {
|
|
495
|
+
dd._config.name = dd.template_config.name;
|
|
496
|
+
callback(dd._config);
|
|
497
|
+
} else {
|
|
498
|
+
BaseApi.create({
|
|
499
|
+
url: `${(window as any).glitterBackend}/api/v1/template?appName=${dd.appName}&tag=${
|
|
500
|
+
dd.tag
|
|
501
|
+
}`,
|
|
502
|
+
type: 'get',
|
|
503
|
+
}).then((res) => {
|
|
504
|
+
res.response.result[0].config.name = dd.template_config.name;
|
|
505
|
+
callback(res.response.result[0].config);
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
})}"
|
|
510
|
+
>
|
|
511
|
+
選擇
|
|
512
|
+
</button>
|
|
513
|
+
</div>
|
|
514
|
+
</div>
|
|
515
|
+
<h3 class="fs-6 mb-0 d-flex justify-content-between align-items-center fw-500 mt-1">
|
|
516
|
+
${dd.template_config.name}
|
|
517
|
+
<i
|
|
518
|
+
class="fa-solid fa-eye ${dd.tag === 'empty' ? `d-none` : ``}"
|
|
519
|
+
style="cursor:pointer;"
|
|
520
|
+
onclick="${gvc.event(() => {
|
|
521
|
+
(window.parent as any).glitter.openNewTab(
|
|
522
|
+
`${gvc.glitter.root_path}pages/${dd.tag}?appName=${dd.appName}`
|
|
523
|
+
);
|
|
524
|
+
})}"
|
|
525
|
+
></i>
|
|
526
|
+
</h3>
|
|
499
527
|
</div>
|
|
500
|
-
</div
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
class="fa-solid fa-eye ${dd.tag === 'empty' ? `d-none` : ``}"
|
|
505
|
-
style="cursor:pointer;"
|
|
506
|
-
onclick="${gvc.event(() => {
|
|
507
|
-
(window.parent as any).glitter.openNewTab(
|
|
508
|
-
`${gvc.glitter.root_path}pages/${dd.tag}?appName=${dd.appName}`
|
|
509
|
-
);
|
|
510
|
-
})}"
|
|
511
|
-
></i>
|
|
512
|
-
</h3>
|
|
513
|
-
</div>
|
|
514
|
-
</div>`;
|
|
515
|
-
})
|
|
516
|
-
.join('')}
|
|
528
|
+
</div>`;
|
|
529
|
+
})
|
|
530
|
+
.join('')}
|
|
531
|
+
</div>
|
|
517
532
|
</div>
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
}
|
|
532
|
-
};
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
}
|
|
537
|
-
})
|
|
533
|
+
`;
|
|
534
|
+
}
|
|
535
|
+
})();
|
|
536
|
+
} else {
|
|
537
|
+
return html` <div class="w-100 p-3 d-flex align-items-center justify-content-center flex-column" style="gap: 10px;">
|
|
538
|
+
<div class="spinner-border fs-5"></div>
|
|
539
|
+
<div class="fs-6 fw-500">載入中...</div>
|
|
540
|
+
</div>`;
|
|
541
|
+
}
|
|
542
|
+
},
|
|
543
|
+
divCreate: {
|
|
544
|
+
style: '',
|
|
545
|
+
},
|
|
546
|
+
};
|
|
547
|
+
});
|
|
548
|
+
},
|
|
549
|
+
divCreate: {},
|
|
550
|
+
};
|
|
551
|
+
})
|
|
538
552
|
),
|
|
539
|
-
].join('')}
|
|
553
|
+
].join('')}
|
|
554
|
+
`;
|
|
540
555
|
}
|
|
541
556
|
}
|
|
542
557
|
|
|
@@ -585,8 +600,7 @@ function editor(cf: { gvc: GVC; vm: any; is_page: boolean; widget: any; page_tab
|
|
|
585
600
|
},
|
|
586
601
|
def: vm.data.content.collection || [],
|
|
587
602
|
},
|
|
588
|
-
})
|
|
589
|
-
BgWidget.getContainerWidth()
|
|
603
|
+
})
|
|
590
604
|
);
|
|
591
605
|
case 'detail':
|
|
592
606
|
return detail(gvc, cf, vm, cVm, cf.page_tab);
|
|
@@ -598,8 +612,7 @@ function editor(cf: { gvc: GVC; vm: any; is_page: boolean; widget: any; page_tab
|
|
|
598
612
|
},
|
|
599
613
|
divCreate: {},
|
|
600
614
|
};
|
|
601
|
-
})
|
|
602
|
-
BgWidget.getContainerWidth()
|
|
615
|
+
})
|
|
603
616
|
);
|
|
604
617
|
}
|
|
605
618
|
|
|
@@ -614,136 +627,100 @@ function detail(gvc: GVC, cf: any, vm: any, cVm: any, page_tab: 'page' | 'hidden
|
|
|
614
627
|
}, 100);
|
|
615
628
|
return ``;
|
|
616
629
|
}
|
|
630
|
+
const domainPrefix = `${
|
|
631
|
+
cf.is_page
|
|
632
|
+
? (() => {
|
|
633
|
+
switch (page_tab) {
|
|
634
|
+
case 'shopping':
|
|
635
|
+
return 'shop';
|
|
636
|
+
case 'hidden':
|
|
637
|
+
return 'hidden';
|
|
638
|
+
case 'page':
|
|
639
|
+
return 'pages';
|
|
640
|
+
default:
|
|
641
|
+
return '';
|
|
642
|
+
}
|
|
643
|
+
})()
|
|
644
|
+
: 'blogs'
|
|
645
|
+
}`
|
|
617
646
|
return html`
|
|
618
|
-
<div class="
|
|
647
|
+
<div class="title-container">
|
|
619
648
|
${BgWidget.goBack(
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
649
|
+
gvc.event(() => {
|
|
650
|
+
(window.parent as any).glitter.setUrlParameter('page-id', undefined)
|
|
651
|
+
vm.type = 'list';
|
|
652
|
+
})
|
|
623
653
|
)}
|
|
624
654
|
${BgWidget.title(
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
655
|
+
cf.is_page
|
|
656
|
+
? (() => {
|
|
657
|
+
switch (page_tab) {
|
|
658
|
+
case 'hidden':
|
|
659
|
+
return '隱形賣場';
|
|
660
|
+
case 'page':
|
|
661
|
+
return '自訂頁面';
|
|
662
|
+
case 'shopping':
|
|
663
|
+
return '一頁商店';
|
|
664
|
+
}
|
|
665
|
+
})()
|
|
666
|
+
: '編輯網誌'
|
|
637
667
|
)}
|
|
638
668
|
<div class="flex-fill"></div>
|
|
639
669
|
<div class="d-flex ${cf.is_page ? `` : `d-none`}">
|
|
640
670
|
${BgWidget.grayButton(
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
671
|
+
'套用模板',
|
|
672
|
+
gvc.event(() => {
|
|
673
|
+
cVm.type = 'template';
|
|
674
|
+
gvc.notifyDataChange(cVm.id);
|
|
675
|
+
})
|
|
646
676
|
)}
|
|
647
677
|
<div class="mx-1"></div>
|
|
648
678
|
${BgWidget.grayButton(
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
return gvc.bindView(() => {
|
|
655
|
-
const id = gvc.glitter.getUUID();
|
|
656
|
-
return {
|
|
657
|
-
bind: id,
|
|
658
|
-
view: () => {
|
|
659
|
-
return html` <iframe
|
|
660
|
-
class="rounded-3"
|
|
661
|
-
id="editor_dialog"
|
|
662
|
-
src="${(() => {
|
|
663
|
-
const url = new URL(window.parent.location.href);
|
|
664
|
-
url.searchParams.set('function', 'user-editor');
|
|
665
|
-
return url.href;
|
|
666
|
-
})()}"
|
|
667
|
-
></iframe>`;
|
|
668
|
-
},
|
|
669
|
-
divCreate: {
|
|
670
|
-
class: `vw-100 vh-100 p-2`,
|
|
671
|
-
style: `background: rgba(0,0,0,0.5);`,
|
|
672
|
-
},
|
|
673
|
-
onCreate: () => {
|
|
674
|
-
const interval = setInterval(() => {
|
|
675
|
-
const iframe: any = window.parent.document.querySelector('#editor_dialog')!;
|
|
676
|
-
if (iframe.contentWindow.glitter) {
|
|
677
|
-
iframe.contentWindow.glitter.share.editor_vm = {
|
|
678
|
-
close: () => {
|
|
679
|
-
gvc.closeDialog();
|
|
680
|
-
},
|
|
681
|
-
callback: (cf: any) => {
|
|
682
|
-
vm.data.content.config = cf.config;
|
|
683
|
-
saveData(gvc, cf, vm, cVm, true);
|
|
684
|
-
},
|
|
685
|
-
page_data: {
|
|
686
|
-
config: JSON.parse(JSON.stringify(vm.data.content.config || [])),
|
|
687
|
-
page_config: {},
|
|
688
|
-
name: vm.data.content.name || '尚未設定頁面標題',
|
|
689
|
-
},
|
|
690
|
-
title: vm.data.content.name || '尚未設定頁面標題',
|
|
691
|
-
};
|
|
692
|
-
clearInterval(interval);
|
|
693
|
-
}
|
|
694
|
-
}, 100);
|
|
695
|
-
},
|
|
696
|
-
};
|
|
697
|
-
});
|
|
698
|
-
},
|
|
699
|
-
'',
|
|
700
|
-
{
|
|
701
|
-
dismiss: () => {},
|
|
702
|
-
}
|
|
703
|
-
);
|
|
704
|
-
})
|
|
679
|
+
'前往設計',
|
|
680
|
+
gvc.event(() => {
|
|
681
|
+
(window.parent as any).glitter.setUrlParameter('page-id', vm.data.id);
|
|
682
|
+
(window.parent as any).glitter.share.switch_to_web_builder(`${domainPrefix}/${vm.data.content.tag}`);
|
|
683
|
+
})
|
|
705
684
|
)}
|
|
706
685
|
</div>
|
|
707
686
|
</div>
|
|
708
|
-
${BgWidget.
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
gvc.
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
return [
|
|
720
|
-
BgWidget.mainCard(
|
|
687
|
+
${BgWidget.container1x2(
|
|
688
|
+
{
|
|
689
|
+
html: [
|
|
690
|
+
gvc.bindView(() => {
|
|
691
|
+
vm.data.status = vm.data.status ?? 1;
|
|
692
|
+
const id = gvc.glitter.getUUID();
|
|
693
|
+
return {
|
|
694
|
+
bind: id,
|
|
695
|
+
view: () => {
|
|
696
|
+
return [
|
|
697
|
+
BgWidget.mainCard(
|
|
721
698
|
(() => {
|
|
722
699
|
const prefixURL = `https://${(window.parent as any).glitter.share.editorViewModel.domain}/${
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
700
|
+
cf.is_page
|
|
701
|
+
? (() => {
|
|
702
|
+
switch (page_tab) {
|
|
703
|
+
case 'shopping':
|
|
704
|
+
return 'shop';
|
|
705
|
+
case 'hidden':
|
|
706
|
+
return 'hidden';
|
|
707
|
+
case 'page':
|
|
708
|
+
return 'pages';
|
|
709
|
+
default:
|
|
710
|
+
return '';
|
|
711
|
+
}
|
|
712
|
+
})()
|
|
713
|
+
: 'blogs'
|
|
737
714
|
}/`;
|
|
738
715
|
return [
|
|
739
716
|
BgWidget.title('基本設定', 'font-size: 16px;'),
|
|
740
717
|
html` <div style="display: flex; align-items: center; gap: 4px; margin: 18px 0;">
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
718
|
+
<div class="tx_normal">網頁啟用</div>
|
|
719
|
+
${BgWidget.switchButton(gvc, vm.data.status, (bool) => {
|
|
720
|
+
vm.data.status = bool ? 1 : 0;
|
|
721
|
+
gvc.notifyDataChange(id);
|
|
722
|
+
})}
|
|
723
|
+
</div>`,
|
|
747
724
|
BgWidget.editeInput({
|
|
748
725
|
gvc: gvc,
|
|
749
726
|
title: '網頁名稱',
|
|
@@ -754,40 +731,40 @@ function detail(gvc: GVC, cf: any, vm: any, cVm: any, page_tab: 'page' | 'hidden
|
|
|
754
731
|
},
|
|
755
732
|
}),
|
|
756
733
|
html` <div>
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
</div>
|
|
769
|
-
</div>
|
|
770
|
-
<input
|
|
771
|
-
class="flex-fill"
|
|
772
|
-
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
|
|
773
|
-
.body.clientWidth > 768
|
|
774
|
-
? ''
|
|
775
|
-
: 'padding: 9px 18px;'}"
|
|
776
|
-
value="${vm.data.content.tag || ''}"
|
|
777
|
-
onchange="${gvc.event((e) => {
|
|
778
|
-
let text = e.value;
|
|
779
|
-
if (!CheckInput.isEnglishNumberHyphen(text)) {
|
|
780
|
-
const dialog = new ShareDialog(gvc.glitter);
|
|
781
|
-
dialog.infoMessage({ text: '僅能輸入英文或數字與連接號' });
|
|
782
|
-
gvc.notifyDataChange(id);
|
|
783
|
-
} else {
|
|
784
|
-
vm.data.content.tag = text;
|
|
785
|
-
gvc.notifyDataChange(id);
|
|
786
|
-
}
|
|
787
|
-
})}"
|
|
788
|
-
/>
|
|
734
|
+
<div class="tx_normal fw-normal mb-2">自訂網址</div>
|
|
735
|
+
<div
|
|
736
|
+
style="justify-content: flex-start; align-items: center; display: inline-flex;border:1px solid #EAEAEA;border-radius: 10px;overflow: hidden; ${document
|
|
737
|
+
.body.clientWidth > 768
|
|
738
|
+
? 'gap: 18px; '
|
|
739
|
+
: 'flex-direction: column; gap: 0px; '}"
|
|
740
|
+
class="w-100"
|
|
741
|
+
>
|
|
742
|
+
<div style="width:100%;padding: 9px 18px;background: #EAEAEA; justify-content: flex-start; align-items: center; gap: 5px; display: flex">
|
|
743
|
+
<div style="text-align: right; color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
|
|
744
|
+
${prefixURL}
|
|
789
745
|
</div>
|
|
790
|
-
</div
|
|
746
|
+
</div>
|
|
747
|
+
<input
|
|
748
|
+
class="flex-fill"
|
|
749
|
+
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
|
|
750
|
+
.body.clientWidth > 768
|
|
751
|
+
? ''
|
|
752
|
+
: 'padding: 9px 18px;'}"
|
|
753
|
+
value="${vm.data.content.tag || ''}"
|
|
754
|
+
onchange="${gvc.event((e) => {
|
|
755
|
+
let text = e.value;
|
|
756
|
+
if (!CheckInput.isEnglishNumberHyphen(text)) {
|
|
757
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
758
|
+
dialog.infoMessage({ text: '僅能輸入英文或數字與連接號' });
|
|
759
|
+
gvc.notifyDataChange(id);
|
|
760
|
+
} else {
|
|
761
|
+
vm.data.content.tag = text;
|
|
762
|
+
gvc.notifyDataChange(id);
|
|
763
|
+
}
|
|
764
|
+
})}"
|
|
765
|
+
/>
|
|
766
|
+
</div>
|
|
767
|
+
</div>`,
|
|
791
768
|
html` <div class="mt-2 mb-1"><span class="tx_normal me-2">網址預覽</span>${BgWidget.greenNote(prefixURL + (vm.data.content.tag ?? ''))}</div>`,
|
|
792
769
|
...(() => {
|
|
793
770
|
return [
|
|
@@ -814,13 +791,13 @@ function detail(gvc: GVC, cf: any, vm: any, cVm: any, page_tab: 'page' | 'hidden
|
|
|
814
791
|
},
|
|
815
792
|
}),
|
|
816
793
|
html` <div>
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
794
|
+
<div class="tx_normal">社群分享縮圖</div>
|
|
795
|
+
<div class="mt-1 mb-2">${BgWidget.grayNote('建議尺寸為 200px * 200px 以上')}</div>
|
|
796
|
+
${BgWidget.imageSelector(gvc, vm.data.content.seo.image || '', (text) => {
|
|
797
|
+
vm.data.content.seo.image = text;
|
|
798
|
+
gvc.notifyDataChange(id);
|
|
799
|
+
})}
|
|
800
|
+
</div>`,
|
|
824
801
|
,
|
|
825
802
|
];
|
|
826
803
|
})(),
|
|
@@ -844,18 +821,15 @@ function detail(gvc: GVC, cf: any, vm: any, cVm: any, page_tab: 'page' | 'hidden
|
|
|
844
821
|
})(),
|
|
845
822
|
].join(BgWidget.mbContainer(12));
|
|
846
823
|
})()
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
'padding: 0 !important; margin: 0 !important; width: 100%;'
|
|
857
|
-
)}
|
|
858
|
-
${(() => {
|
|
824
|
+
),
|
|
825
|
+
].join('');
|
|
826
|
+
},
|
|
827
|
+
divCreate: {
|
|
828
|
+
style: 'padding: 0;',
|
|
829
|
+
},
|
|
830
|
+
};
|
|
831
|
+
}),
|
|
832
|
+
(() => {
|
|
859
833
|
vm.data.content.relative = vm.data.content.relative || 'collection';
|
|
860
834
|
vm.data.content.relative_data = vm.data.content.relative_data || [];
|
|
861
835
|
vm.data.content.with_discount = vm.data.content.with_discount || 'false';
|
|
@@ -868,142 +842,142 @@ function detail(gvc: GVC, cf: any, vm: any, cVm: any, page_tab: 'page' | 'hidden
|
|
|
868
842
|
// 顯示套用的賣場商品列表
|
|
869
843
|
if (vm.data.content.page_type === 'hidden' || vm.data.content.page_type === 'shopping') {
|
|
870
844
|
return [
|
|
845
|
+
BgWidget.mbContainer(24),
|
|
871
846
|
BgWidget.mainCard(
|
|
872
|
-
[
|
|
873
|
-
BgWidget.title(
|
|
874
|
-
html`預設加入購物車
|
|
875
|
-
<div class="badge ms-2" style="background:#eaeaea;color:#393939;">以下設定的商品會自動加入購物車</div>`,
|
|
876
|
-
'font-size: 16px;'
|
|
877
|
-
),
|
|
878
|
-
html`<div class="my-2"></div>`,
|
|
879
847
|
[
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
return [dd.product_id].concat(dd.variant.spec).join('-');
|
|
906
|
-
}),
|
|
907
|
-
callback: async (value) => {
|
|
908
|
-
vm.data.content.relative_data = value.map((dd: any) => {
|
|
909
|
-
return {
|
|
910
|
-
variant: dd.variant_content,
|
|
911
|
-
product_id: dd.product_id,
|
|
912
|
-
};
|
|
913
|
-
});
|
|
914
|
-
subVM.loading = true;
|
|
915
|
-
gvc.notifyDataChange(subVM.id);
|
|
916
|
-
},
|
|
917
|
-
});
|
|
918
|
-
}),
|
|
919
|
-
{ textStyle: 'font-weight: 400;' }
|
|
920
|
-
)}
|
|
848
|
+
BgWidget.title(
|
|
849
|
+
html`預設加入購物車
|
|
850
|
+
<div class="badge ms-2" style="background:#eaeaea;color:#393939;">以下設定的商品會自動加入購物車</div>`,
|
|
851
|
+
'font-size: 16px;'
|
|
852
|
+
),
|
|
853
|
+
html`<div class="my-2"></div>`,
|
|
854
|
+
[
|
|
855
|
+
html`${(() => {
|
|
856
|
+
return gvc.bindView(() => {
|
|
857
|
+
const subVM = {
|
|
858
|
+
id: gvc.glitter.getUUID(),
|
|
859
|
+
loading: true,
|
|
860
|
+
dataList: [] as OptionsItem[],
|
|
861
|
+
};
|
|
862
|
+
return {
|
|
863
|
+
bind: subVM.id,
|
|
864
|
+
view: () => {
|
|
865
|
+
if (subVM.loading) {
|
|
866
|
+
return BgWidget.spinner();
|
|
867
|
+
}
|
|
868
|
+
return html`
|
|
869
|
+
<div class="d-flex flex-column p-2" style="gap: 18px;">
|
|
870
|
+
<div class="d-flex align-items-center gray-bottom-line-18 " style="gap: 24px; justify-content: space-between;">
|
|
871
|
+
<div class="form-check-label c_updown_label">
|
|
872
|
+
<div class="tx_normal">產品列表</div>
|
|
921
873
|
</div>
|
|
922
|
-
${
|
|
874
|
+
${BgWidget.grayButton(
|
|
875
|
+
'搜尋商品',
|
|
876
|
+
gvc.event(() => {
|
|
877
|
+
BgProduct.variantsSelector({
|
|
878
|
+
gvc: gvc,
|
|
879
|
+
filter_variants: vm.data.content.relative_data.map((dd: any) => {
|
|
880
|
+
return [dd.product_id].concat(dd.variant.spec).join('-');
|
|
881
|
+
}),
|
|
882
|
+
callback: async (value) => {
|
|
883
|
+
vm.data.content.relative_data = value.map((dd: any) => {
|
|
884
|
+
return {
|
|
885
|
+
variant: dd.variant_content,
|
|
886
|
+
product_id: dd.product_id,
|
|
887
|
+
};
|
|
888
|
+
});
|
|
889
|
+
subVM.loading = true;
|
|
890
|
+
gvc.notifyDataChange(subVM.id);
|
|
891
|
+
},
|
|
892
|
+
});
|
|
893
|
+
}),
|
|
894
|
+
{ textStyle: 'font-weight: 400;' }
|
|
895
|
+
)}
|
|
896
|
+
</div>
|
|
897
|
+
${subVM.dataList
|
|
923
898
|
.map((opt: OptionsItem, index) => {
|
|
924
899
|
return html`
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
</div>
|
|
931
|
-
<div class="flex-fill"></div>
|
|
932
|
-
${BgWidget.cancel(
|
|
933
|
-
gvc.event(() => {
|
|
934
|
-
vm.data.content.relative_data.splice(index, 1);
|
|
935
|
-
subVM.dataList.splice(index, 1);
|
|
936
|
-
gvc.notifyDataChange(subVM.id);
|
|
937
|
-
}),
|
|
938
|
-
'移除'
|
|
939
|
-
)}
|
|
900
|
+
<div class="d-flex align-items-center form-check-label c_updown_label gap-3">
|
|
901
|
+
<span class="tx_normal" style="min-width: 20px;">${index + 1} .</span>
|
|
902
|
+
${BgWidget.validImageBox({ gvc: gvc, image: opt.image, width: 40 })}
|
|
903
|
+
<div class="tx_normal ${opt.note ? 'mb-1' : ''} d-flex flex-column">
|
|
904
|
+
${opt.value} ${opt.note ? html` <div class="tx_gray_12">${opt.note}</div> ` : ''}
|
|
940
905
|
</div>
|
|
941
|
-
|
|
906
|
+
<div class="flex-fill"></div>
|
|
907
|
+
${BgWidget.cancel(
|
|
908
|
+
gvc.event(() => {
|
|
909
|
+
vm.data.content.relative_data.splice(index, 1);
|
|
910
|
+
subVM.dataList.splice(index, 1);
|
|
911
|
+
gvc.notifyDataChange(subVM.id);
|
|
912
|
+
}),
|
|
913
|
+
'移除'
|
|
914
|
+
)}
|
|
915
|
+
</div>
|
|
916
|
+
`;
|
|
942
917
|
})
|
|
943
918
|
.join('') || `<div class="w-100 d-flex align-content-center justify-content-center">尚未加入任何賣場商品</div>`}
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
})
|
|
961
|
-
);
|
|
962
|
-
vm.data.content.relative_data = vm.data.content.relative_data.filter((dd: any) => {
|
|
963
|
-
return products_data.find((d1) => {
|
|
964
|
-
return `${dd.product_id}` === `${d1.key}`;
|
|
965
|
-
});
|
|
966
|
-
});
|
|
967
|
-
subVM.dataList = vm.data.content.relative_data.map((dd: any) => {
|
|
968
|
-
const product: any = JSON.parse(
|
|
969
|
-
JSON.stringify(
|
|
970
|
-
products_data.find((d1) => {
|
|
971
|
-
return `${dd.product_id}` === `${d1.key}`;
|
|
919
|
+
</div>
|
|
920
|
+
`;
|
|
921
|
+
},
|
|
922
|
+
onCreate: () => {
|
|
923
|
+
if (subVM.loading) {
|
|
924
|
+
if (vm.data.content.relative_data.length === 0) {
|
|
925
|
+
setTimeout(() => {
|
|
926
|
+
subVM.dataList = [];
|
|
927
|
+
subVM.loading = false;
|
|
928
|
+
gvc.notifyDataChange(subVM.id);
|
|
929
|
+
}, 300);
|
|
930
|
+
} else {
|
|
931
|
+
new Promise<OptionsItem[]>(async (resolve) => {
|
|
932
|
+
const products_data = await BgProduct.getProductOpts(
|
|
933
|
+
vm.data.content.relative_data.map((dd: any) => {
|
|
934
|
+
return dd.product_id;
|
|
972
935
|
})
|
|
973
|
-
)
|
|
974
936
|
);
|
|
975
|
-
|
|
976
|
-
|
|
937
|
+
vm.data.content.relative_data = vm.data.content.relative_data.filter((dd: any) => {
|
|
938
|
+
return products_data.find((d1) => {
|
|
939
|
+
return `${dd.product_id}` === `${d1.key}`;
|
|
940
|
+
});
|
|
941
|
+
});
|
|
942
|
+
subVM.dataList = vm.data.content.relative_data.map((dd: any) => {
|
|
943
|
+
const product: any = JSON.parse(
|
|
944
|
+
JSON.stringify(
|
|
945
|
+
products_data.find((d1) => {
|
|
946
|
+
return `${dd.product_id}` === `${d1.key}`;
|
|
947
|
+
})
|
|
948
|
+
)
|
|
949
|
+
);
|
|
950
|
+
product.note = dd.variant.spec.join(' / ');
|
|
951
|
+
return product;
|
|
952
|
+
});
|
|
953
|
+
resolve(subVM.dataList);
|
|
954
|
+
}).then((data) => {
|
|
955
|
+
subVM.dataList = data;
|
|
956
|
+
subVM.loading = false;
|
|
957
|
+
gvc.notifyDataChange(subVM.id);
|
|
977
958
|
});
|
|
978
|
-
|
|
979
|
-
}).then((data) => {
|
|
980
|
-
subVM.dataList = data;
|
|
981
|
-
subVM.loading = false;
|
|
982
|
-
gvc.notifyDataChange(subVM.id);
|
|
983
|
-
});
|
|
959
|
+
}
|
|
984
960
|
}
|
|
985
|
-
}
|
|
986
|
-
}
|
|
987
|
-
};
|
|
988
|
-
})
|
|
989
|
-
|
|
990
|
-
].join('')
|
|
991
|
-
].join('')
|
|
961
|
+
},
|
|
962
|
+
};
|
|
963
|
+
});
|
|
964
|
+
})()}`,
|
|
965
|
+
].join(''),
|
|
966
|
+
].join('')
|
|
992
967
|
),
|
|
993
968
|
].join('');
|
|
994
969
|
} else {
|
|
995
970
|
return [].join('');
|
|
996
971
|
}
|
|
997
972
|
},
|
|
998
|
-
divCreate: {
|
|
999
|
-
class: `w-100 mt-2`,
|
|
1000
|
-
},
|
|
1001
973
|
};
|
|
1002
974
|
});
|
|
1003
|
-
})()
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
975
|
+
})(),
|
|
976
|
+
].join(''),
|
|
977
|
+
ratio: 75,
|
|
978
|
+
},
|
|
979
|
+
{
|
|
980
|
+
html: BgWidget.summaryCard(
|
|
1007
981
|
gvc.bindView(() => {
|
|
1008
982
|
console.log(`vm.data.content.template=>`, vm.data.content.template);
|
|
1009
983
|
const id = gvc.glitter.getUUID();
|
|
@@ -1013,41 +987,41 @@ function detail(gvc: GVC, cf: any, vm: any, cVm: any, page_tab: 'page' | 'hidden
|
|
|
1013
987
|
view: () => {
|
|
1014
988
|
return [
|
|
1015
989
|
cf.is_page
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
990
|
+
? ``
|
|
991
|
+
: EditorElem.select({
|
|
992
|
+
title: '啟用狀態',
|
|
993
|
+
gvc: gvc,
|
|
994
|
+
def: `${vm.data.status}`,
|
|
995
|
+
array: [
|
|
996
|
+
{
|
|
997
|
+
title: '啟用',
|
|
998
|
+
value: '1',
|
|
999
|
+
},
|
|
1000
|
+
{
|
|
1001
|
+
title: '隱藏',
|
|
1002
|
+
value: '0',
|
|
1003
|
+
},
|
|
1004
|
+
],
|
|
1005
|
+
callback: (text: string) => {
|
|
1006
|
+
vm.data.status = text;
|
|
1007
|
+
gvc.notifyDataChange(id);
|
|
1008
|
+
},
|
|
1009
|
+
}),
|
|
1036
1010
|
EditorElem.pageSelect(
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1011
|
+
gvc,
|
|
1012
|
+
'選擇佈景主題',
|
|
1013
|
+
vm.data.content.template ?? '',
|
|
1014
|
+
(data) => {
|
|
1015
|
+
vm.data.content.template = data;
|
|
1016
|
+
},
|
|
1017
|
+
(dd) => {
|
|
1018
|
+
const filter_result = dd.group !== 'glitter-article' && dd.page_type === 'article' && dd.page_config.template_type === 'blog';
|
|
1019
|
+
if (filter_result && !vm.data.content.template) {
|
|
1020
|
+
vm.data.content.template = dd.tag;
|
|
1021
|
+
gvc.notifyDataChange(id);
|
|
1022
|
+
}
|
|
1023
|
+
return filter_result;
|
|
1048
1024
|
}
|
|
1049
|
-
return filter_result;
|
|
1050
|
-
}
|
|
1051
1025
|
),
|
|
1052
1026
|
EditorElem.editeInput({
|
|
1053
1027
|
gvc: gvc,
|
|
@@ -1069,8 +1043,8 @@ function detail(gvc: GVC, cf: any, vm: any, cVm: any, page_tab: 'page' | 'hidden
|
|
|
1069
1043
|
vm.data.content.collection = vm.data.content.collection ?? [];
|
|
1070
1044
|
return [
|
|
1071
1045
|
html` <div class="d-flex align-items-center my-3" style="gap: 10px;">
|
|
1072
|
-
|
|
1073
|
-
|
|
1046
|
+
${EditorElem.h3('預覽圖')}
|
|
1047
|
+
${BgWidget.grayButton(
|
|
1074
1048
|
'添加檔案',
|
|
1075
1049
|
gvc.event(() => {
|
|
1076
1050
|
EditorElem.uploadFileFunction({
|
|
@@ -1082,8 +1056,8 @@ function detail(gvc: GVC, cf: any, vm: any, cVm: any, page_tab: 'page' | 'hidden
|
|
|
1082
1056
|
type: `image/*, video/*`,
|
|
1083
1057
|
});
|
|
1084
1058
|
})
|
|
1085
|
-
|
|
1086
|
-
|
|
1059
|
+
)}
|
|
1060
|
+
</div>`,
|
|
1087
1061
|
EditorElem.flexMediaManager({
|
|
1088
1062
|
gvc: gvc,
|
|
1089
1063
|
data: vm.data.content.preview_image ? [vm.data.content.preview_image] : [],
|
|
@@ -1093,54 +1067,54 @@ function detail(gvc: GVC, cf: any, vm: any, cVm: any, page_tab: 'page' | 'hidden
|
|
|
1093
1067
|
return ``;
|
|
1094
1068
|
}
|
|
1095
1069
|
return html`
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1070
|
+
${EditorElem.h3('文章分類')}
|
|
1071
|
+
${gvc.bindView(() => {
|
|
1072
|
+
const tagID = gvc.glitter.getUUID();
|
|
1073
|
+
let listTag: string[] = [];
|
|
1074
|
+
ApiUser.getPublicConfig('blog_collection', 'manager').then((data: any) => {
|
|
1075
|
+
if (data.response.value) {
|
|
1076
|
+
vm.link = data.response.value;
|
|
1103
1077
|
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
});
|
|
1109
|
-
it && listTag.push(dd.title);
|
|
1110
|
-
setCheck(dd.items);
|
|
1078
|
+
function setCheck(link: MenuItem[]) {
|
|
1079
|
+
link.map((dd) => {
|
|
1080
|
+
const it = vm.data.content.collection.find((d1: string) => {
|
|
1081
|
+
return d1 === dd.link;
|
|
1111
1082
|
});
|
|
1112
|
-
|
|
1083
|
+
it && listTag.push(dd.title);
|
|
1084
|
+
setCheck(dd.items);
|
|
1085
|
+
});
|
|
1086
|
+
}
|
|
1113
1087
|
|
|
1114
|
-
|
|
1088
|
+
setCheck(vm.link);
|
|
1115
1089
|
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1090
|
+
gvc.notifyDataChange(tagID);
|
|
1091
|
+
}
|
|
1092
|
+
});
|
|
1093
|
+
return {
|
|
1094
|
+
bind: tagID,
|
|
1095
|
+
view: () => {
|
|
1096
|
+
return listTag
|
|
1123
1097
|
.map((dd: any) => {
|
|
1124
1098
|
return html` <div class="badge bg_orange mt-2 me-2 fs-sm">${dd}</div>`;
|
|
1125
1099
|
})
|
|
1126
1100
|
.join('');
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1101
|
+
},
|
|
1102
|
+
divCreate: {
|
|
1103
|
+
class: `d-flex flex-wrap`,
|
|
1104
|
+
},
|
|
1105
|
+
};
|
|
1106
|
+
})}
|
|
1107
|
+
<div
|
|
1108
|
+
class="cursor_pointer bt_c39 ms-2 p-1 mt-3"
|
|
1109
|
+
onclick="${gvc.event(() => {
|
|
1110
|
+
cVm.type = 'collection';
|
|
1111
|
+
gvc.notifyDataChange(cVm.id);
|
|
1112
|
+
})}"
|
|
1113
|
+
>
|
|
1114
|
+
<i class="fa-solid fa-plus me-2" aria-hidden="true"></i>
|
|
1115
|
+
添加與編輯分類
|
|
1116
|
+
</div>
|
|
1117
|
+
`;
|
|
1144
1118
|
})(),
|
|
1145
1119
|
].join(`<div class="my-2"></div>`);
|
|
1146
1120
|
},
|
|
@@ -1151,92 +1125,87 @@ function detail(gvc: GVC, cf: any, vm: any, cVm: any, page_tab: 'page' | 'hidden
|
|
|
1151
1125
|
},
|
|
1152
1126
|
};
|
|
1153
1127
|
})
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
)}
|
|
1158
|
-
</div>
|
|
1159
|
-
`,
|
|
1160
|
-
undefined,
|
|
1161
|
-
'padding: 0 !important;'
|
|
1128
|
+
),
|
|
1129
|
+
ratio: 25,
|
|
1130
|
+
}
|
|
1162
1131
|
)}
|
|
1163
1132
|
${BgWidget.mbContainer(240)}
|
|
1164
1133
|
<div class="update-bar-container">
|
|
1165
1134
|
${vm.data.id
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1135
|
+
? BgWidget.redButton(
|
|
1136
|
+
`刪除${cf.is_page ? '頁面' : '網誌'}`,
|
|
1137
|
+
gvc.event(() => {
|
|
1138
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
1139
|
+
dialog.checkYesOrNot({
|
|
1140
|
+
text: '是否確認刪除此頁面?',
|
|
1141
|
+
callback: async (response) => {
|
|
1142
|
+
if (response) {
|
|
1143
|
+
await cf.widget.event('loading', {
|
|
1144
|
+
title: '刪除中...',
|
|
1145
|
+
});
|
|
1146
|
+
Article.deleteV2({
|
|
1147
|
+
id: `${vm.data.id}`,
|
|
1148
|
+
}).then(async (res) => {
|
|
1149
|
+
await cf.widget.event('loading', {
|
|
1150
|
+
title: '刪除中...',
|
|
1151
|
+
visible: false,
|
|
1152
|
+
});
|
|
1153
|
+
if (res.result) {
|
|
1154
|
+
vm.dataList = undefined;
|
|
1155
|
+
vm.type = 'list';
|
|
1156
|
+
} else {
|
|
1157
|
+
await cf.widget.event('error', {
|
|
1158
|
+
title: '刪除失敗',
|
|
1159
|
+
visible: false,
|
|
1160
|
+
});
|
|
1161
|
+
}
|
|
1162
|
+
});
|
|
1163
|
+
}
|
|
1164
|
+
},
|
|
1165
|
+
});
|
|
1166
|
+
})
|
|
1167
|
+
)
|
|
1168
|
+
: ''}
|
|
1200
1169
|
${BgWidget.cancel(
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1170
|
+
gvc.event(() => {
|
|
1171
|
+
if (!vm.data.id) {
|
|
1172
|
+
cf.widget.event('error', {
|
|
1173
|
+
title: '請先儲存',
|
|
1174
|
+
});
|
|
1175
|
+
} else {
|
|
1176
|
+
const href = (() => {
|
|
1177
|
+
return `${gvc.glitter.root_path}${
|
|
1178
|
+
cf.is_page
|
|
1179
|
+
? (() => {
|
|
1180
|
+
switch (page_tab) {
|
|
1181
|
+
case 'shopping':
|
|
1182
|
+
return 'shop';
|
|
1183
|
+
case 'hidden':
|
|
1184
|
+
return 'hidden';
|
|
1185
|
+
case 'page':
|
|
1186
|
+
return 'pages';
|
|
1187
|
+
}
|
|
1188
|
+
return ``;
|
|
1189
|
+
})()
|
|
1190
|
+
: `blogs`
|
|
1191
|
+
}/${vm.data.content.tag}?preview=true&appName=${(window.parent as any).appName}`;
|
|
1192
|
+
})();
|
|
1193
|
+
localStorage.setItem('preview_data', JSON.stringify(vm.data.content));
|
|
1194
|
+
(window.parent as any).glitter.openNewTab(href);
|
|
1195
|
+
}
|
|
1196
|
+
}),
|
|
1197
|
+
'預覽'
|
|
1229
1198
|
)}
|
|
1230
1199
|
${BgWidget.cancel(
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1200
|
+
gvc.event(() => {
|
|
1201
|
+
vm.type = 'list';
|
|
1202
|
+
}),
|
|
1203
|
+
'取消'
|
|
1235
1204
|
)}
|
|
1236
1205
|
${BgWidget.save(
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1206
|
+
gvc.event(async () => {
|
|
1207
|
+
saveData(gvc, cf, vm, cVm, false);
|
|
1208
|
+
})
|
|
1240
1209
|
)}
|
|
1241
1210
|
</div>
|
|
1242
1211
|
`;
|
|
@@ -1470,63 +1439,63 @@ function setCollection(cf: {
|
|
|
1470
1439
|
return {
|
|
1471
1440
|
bind: vm.id,
|
|
1472
1441
|
view: () => {
|
|
1473
|
-
return html` <div class="
|
|
1474
|
-
|
|
1442
|
+
return html` <div class="title-container">
|
|
1443
|
+
${BgWidget.goBack(
|
|
1475
1444
|
cf.gvc.event(() => {
|
|
1476
1445
|
cf.goBack();
|
|
1477
1446
|
})
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1447
|
+
)}${BgWidget.title('分類設定')}
|
|
1448
|
+
</div>
|
|
1449
|
+
<div
|
|
1481
1450
|
style="max-width:100%;width: 856px; 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"
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1451
|
+
>
|
|
1452
|
+
<div style="width: 100%; position: relative">
|
|
1453
|
+
<div style="width: 100%; left: 0px; top: 0px; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 20px; display: inline-flex">
|
|
1454
|
+
<div
|
|
1486
1455
|
class="w-100 ${getSelectCount({
|
|
1487
1456
|
items: vm.link,
|
|
1488
1457
|
}) > 0
|
|
1489
|
-
|
|
1490
|
-
|
|
1458
|
+
? ``
|
|
1459
|
+
: `d-none`}"
|
|
1491
1460
|
style="height: 40px; padding: 12px 18px;background: #F7F7F7; border-radius: 10px; justify-content: flex-end; align-items: center; gap: 8px; display: inline-flex"
|
|
1492
|
-
|
|
1493
|
-
|
|
1461
|
+
>
|
|
1462
|
+
<div style="flex: 1 1 0; color: #393939; font-size: 14px; font-family: Noto Sans; font-weight: 700; word-wrap: break-word">
|
|
1494
1463
|
已選取${getSelectCount({
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1464
|
+
items: vm.link,
|
|
1465
|
+
})}項
|
|
1466
|
+
</div>
|
|
1467
|
+
<div
|
|
1499
1468
|
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"
|
|
1500
|
-
|
|
1501
|
-
|
|
1469
|
+
>
|
|
1470
|
+
<div
|
|
1502
1471
|
style="color: #393939; font-size: 14px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word"
|
|
1503
1472
|
onclick="${gvc.event(() => {
|
|
1504
1473
|
vm.link = deleteSelect(vm.link);
|
|
1505
1474
|
gvc.notifyDataChange(vm.id);
|
|
1506
1475
|
})}"
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
</div>
|
|
1476
|
+
>
|
|
1477
|
+
刪除
|
|
1510
1478
|
</div>
|
|
1511
1479
|
</div>
|
|
1512
|
-
|
|
1513
|
-
|
|
1480
|
+
</div>
|
|
1481
|
+
<div class="d-flex align-items-center" style="width: 100%; height: 22px; position: relative;gap:29px;">
|
|
1482
|
+
<div
|
|
1514
1483
|
class="${allSelect({
|
|
1515
1484
|
items: vm.link,
|
|
1516
1485
|
selected: !vm.link.find((dd) => {
|
|
1517
1486
|
return !(dd as any).selected;
|
|
1518
1487
|
}),
|
|
1519
1488
|
})
|
|
1520
|
-
|
|
1521
|
-
|
|
1489
|
+
? `fa-solid fa-square-check`
|
|
1490
|
+
: `fa-regular fa-square`}"
|
|
1522
1491
|
style="color:#393939;width: 16px; height: 16px;cursor: pointer;"
|
|
1523
1492
|
onclick="${cf.gvc.event((e, event) => {
|
|
1524
1493
|
event.stopPropagation();
|
|
1525
1494
|
|
|
1526
1495
|
if (
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1496
|
+
vm.link.find((dd) => {
|
|
1497
|
+
return !(dd as any).selected;
|
|
1498
|
+
})
|
|
1530
1499
|
) {
|
|
1531
1500
|
selectAll({
|
|
1532
1501
|
items: vm.link,
|
|
@@ -1538,134 +1507,134 @@ function setCollection(cf: {
|
|
|
1538
1507
|
}
|
|
1539
1508
|
gvc.notifyDataChange(vm.id);
|
|
1540
1509
|
})}"
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1510
|
+
></div>
|
|
1511
|
+
<div style="left: 61px; top: 0px; color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 700; word-wrap: break-word">選單名稱</div>
|
|
1512
|
+
</div>
|
|
1513
|
+
<div style="align-self: stretch; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 18px; display: flex">
|
|
1514
|
+
${(() => {
|
|
1515
|
+
function renderItems(array: MenuItem[]): string {
|
|
1516
|
+
const id = gvc.glitter.getUUID();
|
|
1517
|
+
return (
|
|
1549
1518
|
gvc.bindView(() => {
|
|
1550
1519
|
return {
|
|
1551
1520
|
bind: id,
|
|
1552
1521
|
view: () => {
|
|
1553
1522
|
return array
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
<div
|
|
1558
|
-
class=" w-100 "
|
|
1559
|
-
style="width: 100%; justify-content: flex-start; align-items: center; gap: 5px; display: inline-flex;cursor: pointer;"
|
|
1560
|
-
onclick="${cf.gvc.event(() => {
|
|
1561
|
-
if (dd.items && dd.items.length > 0) {
|
|
1562
|
-
(dd as any).toggle = !(dd as any).toggle;
|
|
1563
|
-
gvc.notifyDataChange(vm.id);
|
|
1564
|
-
}
|
|
1565
|
-
})}"
|
|
1566
|
-
>
|
|
1523
|
+
.map((dd, index) => {
|
|
1524
|
+
dd.items;
|
|
1525
|
+
const list = html`
|
|
1567
1526
|
<div
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
} else {
|
|
1576
|
-
clearAll(dd);
|
|
1577
|
-
}
|
|
1578
|
-
gvc.notifyDataChange(vm.id);
|
|
1579
|
-
})}"
|
|
1580
|
-
></div>
|
|
1581
|
-
<div class="hoverF2 pe-2" style="width: 100%; justify-content: flex-start; align-items: center; gap: 8px; display: flex">
|
|
1582
|
-
<i
|
|
1583
|
-
class="ms-2 fa-solid fa-grip-dots-vertical color39 dragItem hoverBtn d-flex align-items-center justify-content-center"
|
|
1584
|
-
style="cursor: pointer;width:25px;height: 25px;"
|
|
1585
|
-
></i>
|
|
1586
|
-
<div style="flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px; display: inline-flex">
|
|
1587
|
-
<div style="justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex">
|
|
1588
|
-
<div style="color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
|
|
1589
|
-
${dd.title}
|
|
1590
|
-
</div>
|
|
1591
|
-
${dd.items && dd.items.length > 0
|
|
1592
|
-
? !(dd as any).toggle
|
|
1593
|
-
? `<i class="fa-solid fa-angle-down color39"></i>`
|
|
1594
|
-
: `<i class="fa-solid fa-angle-up color39"></i>`
|
|
1595
|
-
: ``}
|
|
1596
|
-
</div>
|
|
1597
|
-
<div style="justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex">
|
|
1598
|
-
<div
|
|
1599
|
-
style="color: #3366BB; font-size: 14px; font-family: Noto Sans; font-weight: 400; line-height: 14px; word-wrap: break-word"
|
|
1600
|
-
>
|
|
1601
|
-
${dd.title}
|
|
1602
|
-
</div>
|
|
1603
|
-
<div style="color: #159240; font-size: 14px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
|
|
1604
|
-
${dd.link}
|
|
1605
|
-
</div>
|
|
1606
|
-
</div>
|
|
1607
|
-
</div>
|
|
1608
|
-
<div class="flex-fill"></div>
|
|
1609
|
-
<div
|
|
1610
|
-
class="child me-2"
|
|
1611
|
-
onclick="${cf.gvc.event((e, event) => {
|
|
1612
|
-
event.stopPropagation();
|
|
1613
|
-
MenusSetting.collectionEvent(
|
|
1614
|
-
{
|
|
1615
|
-
link: '',
|
|
1616
|
-
title: '',
|
|
1617
|
-
items: [],
|
|
1618
|
-
},
|
|
1619
|
-
(data) => {
|
|
1620
|
-
dd.items = dd.items || [];
|
|
1621
|
-
dd.items.push(data);
|
|
1622
|
-
if (checkLinkExists(data, vm.link)) {
|
|
1623
|
-
gvc.notifyDataChange(vm.id);
|
|
1624
|
-
return true;
|
|
1625
|
-
} else {
|
|
1626
|
-
dd.items.splice(dd.items.length - 1, 1);
|
|
1627
|
-
return false;
|
|
1628
|
-
}
|
|
1629
|
-
}
|
|
1630
|
-
);
|
|
1527
|
+
class=" w-100 "
|
|
1528
|
+
style="width: 100%; justify-content: flex-start; align-items: center; gap: 5px; display: inline-flex;cursor: pointer;"
|
|
1529
|
+
onclick="${cf.gvc.event(() => {
|
|
1530
|
+
if (dd.items && dd.items.length > 0) {
|
|
1531
|
+
(dd as any).toggle = !(dd as any).toggle;
|
|
1532
|
+
gvc.notifyDataChange(vm.id);
|
|
1533
|
+
}
|
|
1631
1534
|
})}"
|
|
1632
|
-
|
|
1633
|
-
<i class="fa-solid fa-plus" style="color:#393939;"></i>
|
|
1634
|
-
</div>
|
|
1535
|
+
>
|
|
1635
1536
|
<div
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
event
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
array[index] = data;
|
|
1644
|
-
gvc.notifyDataChange(vm.id);
|
|
1645
|
-
return true;
|
|
1537
|
+
class="${allSelect(dd) ? `fa-solid fa-square-check` : `fa-regular fa-square`}"
|
|
1538
|
+
style="color:#393939;width: 16px; height: 16px;"
|
|
1539
|
+
onclick="${cf.gvc.event((e, event) => {
|
|
1540
|
+
event.stopPropagation();
|
|
1541
|
+
(dd as any).selected = !(dd as any).selected;
|
|
1542
|
+
if ((dd as any).selected) {
|
|
1543
|
+
selectAll(dd);
|
|
1646
1544
|
} else {
|
|
1647
|
-
|
|
1648
|
-
data.title = og.title;
|
|
1649
|
-
return false;
|
|
1545
|
+
clearAll(dd);
|
|
1650
1546
|
}
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
>
|
|
1654
|
-
|
|
1547
|
+
gvc.notifyDataChange(vm.id);
|
|
1548
|
+
})}"
|
|
1549
|
+
></div>
|
|
1550
|
+
<div class="hoverF2 pe-2" style="width: 100%; justify-content: flex-start; align-items: center; gap: 8px; display: flex">
|
|
1551
|
+
<i
|
|
1552
|
+
class="ms-2 fa-solid fa-grip-dots-vertical color39 dragItem hoverBtn d-flex align-items-center justify-content-center"
|
|
1553
|
+
style="cursor: pointer;width:25px;height: 25px;"
|
|
1554
|
+
></i>
|
|
1555
|
+
<div style="flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px; display: inline-flex">
|
|
1556
|
+
<div style="justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex">
|
|
1557
|
+
<div style="color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
|
|
1558
|
+
${dd.title}
|
|
1559
|
+
</div>
|
|
1560
|
+
${dd.items && dd.items.length > 0
|
|
1561
|
+
? !(dd as any).toggle
|
|
1562
|
+
? `<i class="fa-solid fa-angle-down color39"></i>`
|
|
1563
|
+
: `<i class="fa-solid fa-angle-up color39"></i>`
|
|
1564
|
+
: ``}
|
|
1565
|
+
</div>
|
|
1566
|
+
<div style="justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex">
|
|
1567
|
+
<div
|
|
1568
|
+
style="color: #3366BB; font-size: 14px; font-family: Noto Sans; font-weight: 400; line-height: 14px; word-wrap: break-word"
|
|
1569
|
+
>
|
|
1570
|
+
${dd.title}
|
|
1571
|
+
</div>
|
|
1572
|
+
<div style="color: #159240; font-size: 14px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
|
|
1573
|
+
${dd.link}
|
|
1574
|
+
</div>
|
|
1575
|
+
</div>
|
|
1576
|
+
</div>
|
|
1577
|
+
<div class="flex-fill"></div>
|
|
1578
|
+
<div
|
|
1579
|
+
class="child me-2"
|
|
1580
|
+
onclick="${cf.gvc.event((e, event) => {
|
|
1581
|
+
event.stopPropagation();
|
|
1582
|
+
MenusSetting.collectionEvent(
|
|
1583
|
+
{
|
|
1584
|
+
link: '',
|
|
1585
|
+
title: '',
|
|
1586
|
+
items: [],
|
|
1587
|
+
},
|
|
1588
|
+
(data) => {
|
|
1589
|
+
dd.items = dd.items || [];
|
|
1590
|
+
dd.items.push(data);
|
|
1591
|
+
if (checkLinkExists(data, vm.link)) {
|
|
1592
|
+
gvc.notifyDataChange(vm.id);
|
|
1593
|
+
return true;
|
|
1594
|
+
} else {
|
|
1595
|
+
dd.items.splice(dd.items.length - 1, 1);
|
|
1596
|
+
return false;
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
);
|
|
1600
|
+
})}"
|
|
1601
|
+
>
|
|
1602
|
+
<i class="fa-solid fa-plus" style="color:#393939;"></i>
|
|
1603
|
+
</div>
|
|
1604
|
+
<div
|
|
1605
|
+
class="child"
|
|
1606
|
+
onclick="${cf.gvc.event((e, event) => {
|
|
1607
|
+
event.stopPropagation();
|
|
1608
|
+
const og = JSON.parse(JSON.stringify(dd));
|
|
1609
|
+
|
|
1610
|
+
MenusSetting.collectionEvent(dd, (data) => {
|
|
1611
|
+
if (checkLinkExists(data, vm.link)) {
|
|
1612
|
+
array[index] = data;
|
|
1613
|
+
gvc.notifyDataChange(vm.id);
|
|
1614
|
+
return true;
|
|
1615
|
+
} else {
|
|
1616
|
+
data.link = og.link;
|
|
1617
|
+
data.title = og.title;
|
|
1618
|
+
return false;
|
|
1619
|
+
}
|
|
1620
|
+
});
|
|
1621
|
+
})}"
|
|
1622
|
+
>
|
|
1623
|
+
<i class="fa-solid fa-pencil" style="color:#393939;"></i>
|
|
1624
|
+
</div>
|
|
1655
1625
|
</div>
|
|
1656
1626
|
</div>
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
.join('');
|
|
1627
|
+
${dd.items && dd.items.length > 0
|
|
1628
|
+
? html`
|
|
1629
|
+
<div class=" w-100 ${(dd as any).toggle ? `` : `d-none`}" style="padding-left: 35px;">
|
|
1630
|
+
${renderItems(dd.items as MenuItem[]) as any}
|
|
1631
|
+
</div>
|
|
1632
|
+
`
|
|
1633
|
+
: ``}
|
|
1634
|
+
`;
|
|
1635
|
+
return html` <li class="w-100 ">${list}</li>`;
|
|
1636
|
+
})
|
|
1637
|
+
.join('');
|
|
1669
1638
|
},
|
|
1670
1639
|
divCreate: {
|
|
1671
1640
|
elem: 'ul',
|
|
@@ -1674,13 +1643,13 @@ function setCollection(cf: {
|
|
|
1674
1643
|
},
|
|
1675
1644
|
onCreate: () => {
|
|
1676
1645
|
gvc.glitter.addMtScript(
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1646
|
+
[
|
|
1647
|
+
{
|
|
1648
|
+
src: `https://raw.githack.com/SortableJS/Sortable/master/Sortable.js`,
|
|
1649
|
+
},
|
|
1650
|
+
],
|
|
1651
|
+
() => {},
|
|
1652
|
+
() => {}
|
|
1684
1653
|
);
|
|
1685
1654
|
const interval = setInterval(() => {
|
|
1686
1655
|
//@ts-ignore
|
|
@@ -1722,57 +1691,57 @@ function setCollection(cf: {
|
|
|
1722
1691
|
};
|
|
1723
1692
|
}) +
|
|
1724
1693
|
html` <div
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1694
|
+
class=""
|
|
1695
|
+
style="cursor:pointer;align-self: stretch; height: 50px; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 10px; display: flex"
|
|
1696
|
+
onclick="${cf.gvc.event(() => {
|
|
1697
|
+
MenusSetting.collectionEvent(
|
|
1698
|
+
{
|
|
1699
|
+
link: '',
|
|
1700
|
+
title: '',
|
|
1701
|
+
items: [],
|
|
1702
|
+
},
|
|
1703
|
+
(data) => {
|
|
1704
|
+
array.push(data);
|
|
1705
|
+
if (checkLinkExists(data, vm.link)) {
|
|
1706
|
+
gvc.notifyDataChange(vm.id);
|
|
1707
|
+
return true;
|
|
1708
|
+
} else {
|
|
1709
|
+
array.splice(array.length - 1, 1);
|
|
1710
|
+
return false;
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1713
|
+
);
|
|
1714
|
+
})}"
|
|
1746
1715
|
>
|
|
1747
1716
|
<div
|
|
1748
|
-
|
|
1717
|
+
style="align-self: stretch; height: 54px; border-radius: 10px; border: 1px #DDDDDD solid; justify-content: center; align-items: center; gap: 6px; display: inline-flex"
|
|
1749
1718
|
>
|
|
1750
1719
|
<i class="fa-solid fa-plus" style="color: #3366BB;font-size: 16px; "></i>
|
|
1751
1720
|
<div style="color: #3366BB; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">新增選單</div>
|
|
1752
1721
|
</div>
|
|
1753
1722
|
</div>`
|
|
1754
|
-
|
|
1755
|
-
|
|
1723
|
+
);
|
|
1724
|
+
}
|
|
1756
1725
|
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
</div>
|
|
1726
|
+
return renderItems(vm.link);
|
|
1727
|
+
})()}
|
|
1760
1728
|
</div>
|
|
1761
1729
|
</div>
|
|
1762
1730
|
</div>
|
|
1763
|
-
|
|
1764
|
-
|
|
1731
|
+
</div>
|
|
1732
|
+
<div class="position-fixed bg-body bottom-0 w-100 d-flex align-items-center justify-content-end p-3 border-top" style="gap:10px;left:0px;">
|
|
1733
|
+
${BgWidget.cancel(
|
|
1765
1734
|
gvc.event(() => {
|
|
1766
1735
|
cf.goBack();
|
|
1767
1736
|
})
|
|
1768
|
-
|
|
1769
|
-
|
|
1737
|
+
)}
|
|
1738
|
+
${BgWidget.save(
|
|
1770
1739
|
gvc.event(() => {
|
|
1771
1740
|
save();
|
|
1772
1741
|
}),
|
|
1773
1742
|
'確認'
|
|
1774
|
-
|
|
1775
|
-
|
|
1743
|
+
)}
|
|
1744
|
+
</div>`;
|
|
1776
1745
|
},
|
|
1777
1746
|
divCreate: {
|
|
1778
1747
|
style: `padding-bottom:60px;`,
|
|
@@ -1804,4 +1773,4 @@ function template_select(gvc: GVC, cf: any, vm: any, cVm: any, page_type: any) {
|
|
|
1804
1773
|
);
|
|
1805
1774
|
}
|
|
1806
1775
|
|
|
1807
|
-
(window as any).glitter.setModule(import.meta.url, BgBlog);
|
|
1776
|
+
(window as any).glitter.setModule(import.meta.url, BgBlog);
|