ts-glitter 13.5.8 → 13.6.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 -1
- package/lowcode/backend-manager/bg-blog.js +146 -143
- package/lowcode/backend-manager/bg-blog.ts +1008 -1005
- package/lowcode/backend-manager/bg-graph-api.js +1 -1
- package/lowcode/backend-manager/bg-graph-api.ts +1 -1
- package/lowcode/backend-manager/bg-line.js +42 -17
- package/lowcode/backend-manager/bg-line.ts +41 -20
- package/lowcode/backend-manager/bg-notify.js +69 -18
- package/lowcode/backend-manager/bg-notify.ts +68 -25
- package/lowcode/backend-manager/bg-project.js +7 -7
- package/lowcode/backend-manager/bg-project.ts +7 -7
- package/lowcode/backend-manager/bg-shopping.js +9 -9
- package/lowcode/backend-manager/bg-shopping.ts +9 -9
- package/lowcode/backend-manager/bg-sns.js +46 -26
- package/lowcode/backend-manager/bg-sns.ts +48 -34
- package/lowcode/backend-manager/bg-wallet.js +2 -2
- package/lowcode/backend-manager/bg-wallet.ts +2 -2
- package/lowcode/backend-manager/bg-widget.js +17 -6
- package/lowcode/backend-manager/bg-widget.ts +20 -7
- package/lowcode/cms-plugin/ai-points-list.js +2 -2
- package/lowcode/cms-plugin/ai-points-list.ts +2 -2
- package/lowcode/cms-plugin/ai-points.js +1 -4
- package/lowcode/cms-plugin/ai-points.ts +1 -4
- package/lowcode/cms-plugin/app-release.js +73 -89
- package/lowcode/cms-plugin/app-release.ts +120 -130
- package/lowcode/cms-plugin/auto-reply.js +10 -4
- package/lowcode/cms-plugin/auto-reply.ts +10 -4
- package/lowcode/cms-plugin/data-analyze.js +186 -129
- package/lowcode/cms-plugin/data-analyze.ts +411 -347
- package/lowcode/cms-plugin/form-setting.js +2 -2
- package/lowcode/cms-plugin/form-setting.ts +2 -2
- package/lowcode/cms-plugin/line-auto-reply.js +5 -5
- package/lowcode/cms-plugin/line-auto-reply.ts +5 -5
- package/lowcode/cms-plugin/menus-setting.js +1 -1
- package/lowcode/cms-plugin/menus-setting.ts +1 -1
- package/lowcode/cms-plugin/module/form-module.ts +1 -0
- package/lowcode/cms-plugin/pos-checkout-setting.js +1 -1
- package/lowcode/cms-plugin/pos-checkout-setting.ts +1 -1
- package/lowcode/cms-plugin/shopping-collections.js +0 -1
- package/lowcode/cms-plugin/shopping-collections.ts +0 -1
- package/lowcode/cms-plugin/shopping-discount-setting.js +2 -2
- package/lowcode/cms-plugin/shopping-discount-setting.ts +2 -2
- package/lowcode/cms-plugin/shopping-finance-setting.js +39 -14
- package/lowcode/cms-plugin/shopping-finance-setting.ts +37 -14
- package/lowcode/cms-plugin/shopping-product-setting.js +2 -3
- package/lowcode/cms-plugin/shopping-product-setting.ts +2 -3
- package/lowcode/cms-plugin/shopping-product-text.js +5 -1
- package/lowcode/cms-plugin/shopping-product-text.ts +5 -1
- package/lowcode/cms-plugin/sms-points.js +2 -7
- package/lowcode/cms-plugin/sms-points.ts +2 -6
- package/lowcode/cms-plugin/sns-auto-reply.js +4 -4
- package/lowcode/cms-plugin/sns-auto-reply.ts +4 -4
- package/lowcode/cms-plugin/third-party-apple.js +118 -111
- package/lowcode/cms-plugin/third-party-apple.ts +116 -112
- package/lowcode/cms-plugin/third-party-facebook.js +170 -160
- package/lowcode/cms-plugin/third-party-facebook.ts +137 -128
- package/lowcode/cms-plugin/third-party-google.js +144 -118
- package/lowcode/cms-plugin/third-party-google.ts +164 -140
- package/lowcode/cms-plugin/third-party-line.js +117 -106
- package/lowcode/cms-plugin/third-party-line.ts +123 -115
- package/lowcode/cms-plugin/user-list.js +3 -3
- package/lowcode/cms-plugin/user-list.ts +3 -3
- package/lowcode/cms-plugin/user-login-setting.js +2 -2
- package/lowcode/cms-plugin/user-login-setting.ts +2 -2
- package/lowcode/cms-plugin/wallet-list.js +2 -2
- package/lowcode/cms-plugin/wallet-list.ts +2 -2
- package/lowcode/cms-plugin/web-config-setting.js +1 -1
- package/lowcode/cms-plugin/web-config-setting.ts +1 -1
- package/lowcode/css/editor.css +13 -7
- package/lowcode/glitterBundle/html-component/global-widget.js +54 -29
- package/lowcode/glitterBundle/html-component/global-widget.ts +95 -72
- package/lowcode/glitterBundle/html-component/widget.js +44 -38
- package/lowcode/glitterBundle/html-component/widget.ts +166 -157
- package/lowcode/glitterBundle/module/html-generate.js +3 -3
- package/lowcode/glitterBundle/module/html-generate.ts +3 -3
- package/lowcode/index.html +2 -2
- package/lowcode/jspage/editor.js +201 -220
- package/lowcode/jspage/editor.ts +317 -329
- package/lowcode/jspage/function-page/main_editor.js +71 -10
- package/lowcode/jspage/function-page/main_editor.ts +67 -10
- package/lowcode/jspage/function-page/server-editor/router/api-manager.js +1 -1
- package/lowcode/jspage/function-page/server-editor/router/api-manager.ts +1 -1
- package/lowcode/jspage/function-page/server-editor/router/domain-manager.js +1 -1
- package/lowcode/jspage/function-page/server-editor/router/domain-manager.ts +1 -1
- package/lowcode/jspage/function-page/tool-setting.js +340 -320
- package/lowcode/jspage/function-page/tool-setting.ts +351 -331
- package/lowcode/official_view_component/official/component.js +132 -98
- package/lowcode/official_view_component/official/component.ts +151 -114
- package/package.json +1 -1
- package/src/api-public/services/ai-robot.js.map +1 -1
- package/src/api-public/services/fake-data-model/fake-order.js.map +1 -1
- package/src/api-public/services/line-message.d.ts +1 -1
- package/src/api-public/services/line-message.js +8 -2
- package/src/api-public/services/line-message.js.map +1 -1
- package/src/api-public/services/line-message.ts +10 -3
- package/src/api-public/services/schedule.js +5 -1
- package/src/api-public/services/schedule.js.map +1 -1
- package/src/api-public/services/schedule.ts +5 -1
- package/src/api-public/services/shopping.d.ts +1 -1
- package/src/modules/database.d.ts +2 -1
- package/src/modules/database.js.map +1 -1
- package/src/update-script.js.map +1 -1
|
@@ -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>
|
|
@@ -95,11 +95,11 @@ export class BgBlog {
|
|
|
95
95
|
Article.get({
|
|
96
96
|
page: 0,
|
|
97
97
|
limit: 1,
|
|
98
|
-
id: (window.parent as any).glitter.getUrlParameter('page-id')
|
|
98
|
+
id: (window.parent as any).glitter.getUrlParameter('page-id'),
|
|
99
99
|
}).then(async (data) => {
|
|
100
100
|
vm.data = data.response.data[0];
|
|
101
101
|
vm.type = 'replace';
|
|
102
|
-
})
|
|
102
|
+
});
|
|
103
103
|
}
|
|
104
104
|
return gvc.bindView(() => {
|
|
105
105
|
const id = glitter.getUUID();
|
|
@@ -107,8 +107,8 @@ export class BgBlog {
|
|
|
107
107
|
bind: id,
|
|
108
108
|
dataList: [{ obj: vm, key: 'type' }],
|
|
109
109
|
view: () => {
|
|
110
|
-
if ((window.parent as any).glitter.getUrlParameter('page-id') && vm.type!=='replace') {
|
|
111
|
-
return
|
|
110
|
+
if ((window.parent as any).glitter.getUrlParameter('page-id') && vm.type !== 'replace') {
|
|
111
|
+
return ``;
|
|
112
112
|
}
|
|
113
113
|
if (vm.type === 'list') {
|
|
114
114
|
return BgWidget.container(
|
|
@@ -116,140 +116,140 @@ export class BgBlog {
|
|
|
116
116
|
<div class="title-container gap-4 ${type === 'select' ? `d-none` : ``}">
|
|
117
117
|
<div class="d-flex flex-column" style="gap:5px;">
|
|
118
118
|
${BgWidget.title(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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
|
+
)}
|
|
132
132
|
${BgWidget.grayNote(
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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
|
+
)}
|
|
146
146
|
</div>
|
|
147
147
|
<div class="flex-fill"></div>
|
|
148
148
|
<div style="display: flex; gap: 12px;">
|
|
149
149
|
${is_page
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
150
|
+
? ''
|
|
151
|
+
: BgWidget.grayButton(
|
|
152
|
+
'網誌分類',
|
|
153
|
+
gvc.event(() => {
|
|
154
|
+
vm.type = 'collection';
|
|
155
|
+
gvc.notifyDataChange(id);
|
|
156
|
+
})
|
|
157
|
+
)}
|
|
158
158
|
${BgWidget.darkButton(
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
159
|
+
`新增${is_page ? `頁面` : `網誌`}`,
|
|
160
|
+
gvc.event(() => {
|
|
161
|
+
vm.data = { content: {} };
|
|
162
|
+
vm.type = 'add';
|
|
163
|
+
})
|
|
164
|
+
)}
|
|
165
165
|
</div>
|
|
166
166
|
</div>
|
|
167
167
|
${BgWidget.container(
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
},
|
|
199
|
-
rowClick: (data, index) => {
|
|
200
|
-
if (type === 'select') {
|
|
201
|
-
vm.dataList[index].checked = !vm.dataList[index].checked;
|
|
202
|
-
vmi.data = getDatalist();
|
|
203
|
-
vmi.callback();
|
|
204
|
-
callback(
|
|
205
|
-
vm.dataList.filter((dd: any) => {
|
|
206
|
-
return dd.checked;
|
|
207
|
-
})
|
|
208
|
-
);
|
|
209
|
-
} else {
|
|
210
|
-
vm.data = vm.dataList[index];
|
|
211
|
-
vm.type = 'replace';
|
|
212
|
-
}
|
|
213
|
-
},
|
|
214
|
-
filter: [
|
|
215
|
-
{
|
|
216
|
-
name: '批量移除',
|
|
217
|
-
event: (checkedData) => {
|
|
218
|
-
const dialog = new ShareDialog(glitter);
|
|
219
|
-
dialog.checkYesOrNot({
|
|
220
|
-
text: '是否確認刪除所選項目?',
|
|
221
|
-
callback: (response) => {
|
|
222
|
-
if (response) {
|
|
223
|
-
dialog.dataLoading({ visible: true });
|
|
224
|
-
Article.deleteV2({
|
|
225
|
-
id: checkedData
|
|
226
|
-
.map((dd: any) => {
|
|
227
|
-
return dd.id;
|
|
228
|
-
})
|
|
229
|
-
.join(`,`),
|
|
230
|
-
}).then((res) => {
|
|
231
|
-
dialog.dataLoading({ visible: false });
|
|
232
|
-
if (res.result) {
|
|
233
|
-
vm.dataList = undefined;
|
|
234
|
-
gvc.notifyDataChange(id);
|
|
235
|
-
} else {
|
|
236
|
-
dialog.errorMessage({ text: '刪除失敗' });
|
|
237
|
-
}
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
},
|
|
241
|
-
});
|
|
242
|
-
},
|
|
168
|
+
BgWidget.mainCard(
|
|
169
|
+
[
|
|
170
|
+
BgWidget.searchPlace(
|
|
171
|
+
gvc.event((e) => {
|
|
172
|
+
vm.query = e.value;
|
|
173
|
+
gvc.notifyDataChange(id);
|
|
174
|
+
}),
|
|
175
|
+
vm.query || '',
|
|
176
|
+
'搜尋所有文章'
|
|
177
|
+
),
|
|
178
|
+
BgWidget.tableV3({
|
|
179
|
+
gvc: gvc,
|
|
180
|
+
getData: (vd) => {
|
|
181
|
+
vmi = vd;
|
|
182
|
+
const limit = 20;
|
|
183
|
+
Article.get({
|
|
184
|
+
page: vmi.page - 1,
|
|
185
|
+
limit: limit,
|
|
186
|
+
search: vm.query || undefined,
|
|
187
|
+
for_index: is_page ? `false` : `true`,
|
|
188
|
+
status: '0,1',
|
|
189
|
+
page_type: page_tab,
|
|
190
|
+
}).then((data) => {
|
|
191
|
+
vm.dataList = data.response.data;
|
|
192
|
+
vmi.pageSize = Math.ceil(data.response.total / limit);
|
|
193
|
+
vmi.originalData = vm.dataList;
|
|
194
|
+
vmi.tableData = getDatalist();
|
|
195
|
+
vmi.loading = false;
|
|
196
|
+
vmi.callback();
|
|
197
|
+
});
|
|
243
198
|
},
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
199
|
+
rowClick: (data, index) => {
|
|
200
|
+
if (type === 'select') {
|
|
201
|
+
vm.dataList[index].checked = !vm.dataList[index].checked;
|
|
202
|
+
vmi.data = getDatalist();
|
|
203
|
+
vmi.callback();
|
|
204
|
+
callback(
|
|
205
|
+
vm.dataList.filter((dd: any) => {
|
|
206
|
+
return dd.checked;
|
|
207
|
+
})
|
|
208
|
+
);
|
|
209
|
+
} else {
|
|
210
|
+
vm.data = vm.dataList[index];
|
|
211
|
+
vm.type = 'replace';
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
filter: [
|
|
215
|
+
{
|
|
216
|
+
name: '批量移除',
|
|
217
|
+
event: (checkedData) => {
|
|
218
|
+
const dialog = new ShareDialog(glitter);
|
|
219
|
+
dialog.checkYesOrNot({
|
|
220
|
+
text: '是否確認刪除所選項目?',
|
|
221
|
+
callback: (response) => {
|
|
222
|
+
if (response) {
|
|
223
|
+
dialog.dataLoading({ visible: true });
|
|
224
|
+
Article.deleteV2({
|
|
225
|
+
id: checkedData
|
|
226
|
+
.map((dd: any) => {
|
|
227
|
+
return dd.id;
|
|
228
|
+
})
|
|
229
|
+
.join(`,`),
|
|
230
|
+
}).then((res) => {
|
|
231
|
+
dialog.dataLoading({ visible: false });
|
|
232
|
+
if (res.result) {
|
|
233
|
+
vm.dataList = undefined;
|
|
234
|
+
gvc.notifyDataChange(id);
|
|
235
|
+
} else {
|
|
236
|
+
dialog.errorMessage({ text: '刪除失敗' });
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
});
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
],
|
|
245
|
+
}),
|
|
246
|
+
].join('')
|
|
247
|
+
)
|
|
248
|
+
)}
|
|
249
249
|
`
|
|
250
250
|
);
|
|
251
251
|
} else if (vm.type == 'replace') {
|
|
252
|
-
(window.parent as any).glitter.setUrlParameter('page-id', vm.data.id)
|
|
252
|
+
(window.parent as any).glitter.setUrlParameter('page-id', vm.data.id);
|
|
253
253
|
return editor({
|
|
254
254
|
gvc: gvc,
|
|
255
255
|
vm: vm,
|
|
@@ -299,256 +299,256 @@ export class BgBlog {
|
|
|
299
299
|
return html`
|
|
300
300
|
<div class="title-container">
|
|
301
301
|
${BgWidget.goBack(
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
302
|
+
gvc.event(() => {
|
|
303
|
+
callback(undefined);
|
|
304
|
+
})
|
|
305
305
|
)}
|
|
306
306
|
<div>${[BgWidget.title('選擇模板'), BgWidget.grayNote('請選擇一個符合您需求的模板')].join('')}</div>
|
|
307
307
|
</div>
|
|
308
308
|
${[
|
|
309
309
|
html`<div class="my-3"></div>`,
|
|
310
|
-
BgWidget.
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
310
|
+
BgWidget.mainCard(
|
|
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',
|
|
341
|
+
name: '空白內容',
|
|
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: '',
|
|
341
349
|
name: '空白內容',
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
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
|
-
},
|
|
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: '',
|
|
357
356
|
},
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
357
|
+
},
|
|
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
|
+
{
|
|
376
|
+
id: 20739,
|
|
377
|
+
userID: '234285319',
|
|
378
|
+
tag: 'empty',
|
|
379
|
+
name: '空白內容',
|
|
380
|
+
page_type: 'page',
|
|
381
|
+
preview_image: null,
|
|
382
|
+
appName: 'shop_template_black_style',
|
|
383
|
+
template_type: 2,
|
|
384
|
+
template_config: {
|
|
385
|
+
tag: ['頁面範例'],
|
|
386
|
+
desc: '',
|
|
387
|
+
name: '空白內容',
|
|
388
|
+
image: ['https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1709282671899-BLANK PAGE.jpg'],
|
|
389
|
+
status: 'wait',
|
|
390
|
+
post_to: 'all',
|
|
391
|
+
version: '1.0',
|
|
392
|
+
created_by: 'liondesign.io',
|
|
393
|
+
preview_img: '',
|
|
394
|
+
},
|
|
395
|
+
},
|
|
396
|
+
].concat(
|
|
397
|
+
dd.response.data.map((dd: any) => {
|
|
398
|
+
return {
|
|
376
399
|
id: 20739,
|
|
377
400
|
userID: '234285319',
|
|
378
|
-
tag:
|
|
379
|
-
name:
|
|
401
|
+
tag: dd.content.tag,
|
|
402
|
+
name: dd.content.name,
|
|
380
403
|
page_type: 'page',
|
|
381
404
|
preview_image: null,
|
|
382
|
-
|
|
405
|
+
_config: dd.content.config,
|
|
406
|
+
appName: 't_1726217714800',
|
|
383
407
|
template_type: 2,
|
|
384
408
|
template_config: {
|
|
385
|
-
tag: [
|
|
409
|
+
tag: [],
|
|
386
410
|
desc: '',
|
|
387
|
-
name:
|
|
388
|
-
image: [
|
|
411
|
+
name: dd.content.name,
|
|
412
|
+
image: [dd.content.seo.image],
|
|
389
413
|
status: 'wait',
|
|
390
414
|
post_to: 'all',
|
|
391
415
|
version: '1.0',
|
|
392
416
|
created_by: 'liondesign.io',
|
|
393
417
|
preview_img: '',
|
|
394
418
|
},
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
|
|
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
|
-
},
|
|
419
|
+
};
|
|
420
|
+
})
|
|
421
|
+
),
|
|
423
422
|
},
|
|
424
|
-
}
|
|
423
|
+
},
|
|
424
|
+
};
|
|
425
425
|
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
426
|
+
gvc.notifyDataChange(id);
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
429
|
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
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
|
-
}
|
|
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
|
+
`;
|
|
451
443
|
} else {
|
|
452
444
|
return html`
|
|
453
|
-
<div class="w-100" style="
|
|
454
|
-
<
|
|
455
|
-
|
|
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}%;"
|
|
469
|
-
>
|
|
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>
|
|
527
|
-
</div>
|
|
528
|
-
</div>`;
|
|
529
|
-
})
|
|
530
|
-
.join('')}
|
|
531
|
-
</div>
|
|
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>
|
|
532
448
|
</div>
|
|
533
449
|
`;
|
|
534
450
|
}
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
451
|
+
} else {
|
|
452
|
+
return html`
|
|
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}%;"
|
|
469
|
+
>
|
|
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>
|
|
527
|
+
</div>
|
|
528
|
+
</div>`;
|
|
529
|
+
})
|
|
530
|
+
.join('')}
|
|
531
|
+
</div>
|
|
532
|
+
</div>
|
|
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
|
+
})
|
|
552
552
|
),
|
|
553
553
|
].join('')}
|
|
554
554
|
`;
|
|
@@ -630,113 +630,113 @@ function detail(gvc: GVC, cf: any, vm: any, cVm: any, page_tab: 'page' | 'hidden
|
|
|
630
630
|
const domainPrefix = `${
|
|
631
631
|
cf.is_page
|
|
632
632
|
? (() => {
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
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
644
|
: 'blogs'
|
|
645
|
-
}
|
|
645
|
+
}`;
|
|
646
646
|
return html`
|
|
647
647
|
<div class="title-container">
|
|
648
648
|
${BgWidget.goBack(
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
649
|
+
gvc.event(() => {
|
|
650
|
+
(window.parent as any).glitter.setUrlParameter('page-id', undefined);
|
|
651
|
+
vm.type = 'list';
|
|
652
|
+
})
|
|
653
653
|
)}
|
|
654
654
|
${BgWidget.title(
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
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
|
+
: '編輯網誌'
|
|
667
667
|
)}
|
|
668
668
|
<div class="flex-fill"></div>
|
|
669
669
|
<div class="d-flex ${cf.is_page ? `` : `d-none`}">
|
|
670
670
|
${BgWidget.grayButton(
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
671
|
+
'套用模板',
|
|
672
|
+
gvc.event(() => {
|
|
673
|
+
cVm.type = 'template';
|
|
674
|
+
gvc.notifyDataChange(cVm.id);
|
|
675
|
+
})
|
|
676
676
|
)}
|
|
677
677
|
<div class="mx-1"></div>
|
|
678
678
|
${BgWidget.grayButton(
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
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
|
+
})
|
|
684
684
|
)}
|
|
685
685
|
</div>
|
|
686
686
|
</div>
|
|
687
687
|
${BgWidget.container1x2(
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
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(
|
|
698
|
+
(() => {
|
|
699
|
+
const prefixURL = `https://${(window.parent as any).glitter.share.editorViewModel.domain}/${
|
|
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'
|
|
714
|
+
}/`;
|
|
715
|
+
return [
|
|
716
|
+
BgWidget.title('基本設定', 'font-size: 16px;'),
|
|
717
|
+
html` <div style="display: flex; align-items: center; gap: 4px; margin: 18px 0;">
|
|
718
718
|
<div class="tx_normal">網頁啟用</div>
|
|
719
719
|
${BgWidget.switchButton(gvc, vm.data.status, (bool) => {
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
720
|
+
vm.data.status = bool ? 1 : 0;
|
|
721
|
+
gvc.notifyDataChange(id);
|
|
722
|
+
})}
|
|
723
723
|
</div>`,
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
724
|
+
BgWidget.editeInput({
|
|
725
|
+
gvc: gvc,
|
|
726
|
+
title: '網頁名稱',
|
|
727
|
+
default: vm.data.content.name || '',
|
|
728
|
+
placeHolder: '請輸入網頁名稱',
|
|
729
|
+
callback: (text) => {
|
|
730
|
+
vm.data.content.name = text;
|
|
731
|
+
},
|
|
732
|
+
}),
|
|
733
|
+
html` <div>
|
|
734
734
|
<div class="tx_normal fw-normal mb-2">自訂網址</div>
|
|
735
735
|
<div
|
|
736
736
|
style="justify-content: flex-start; align-items: center; display: inline-flex;border:1px solid #EAEAEA;border-radius: 10px;overflow: hidden; ${document
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
737
|
+
.body.clientWidth > 768
|
|
738
|
+
? 'gap: 18px; '
|
|
739
|
+
: 'flex-direction: column; gap: 0px; '}"
|
|
740
740
|
class="w-100"
|
|
741
741
|
>
|
|
742
742
|
<div style="width:100%;padding: 9px 18px;background: #EAEAEA; justify-content: flex-start; align-items: center; gap: 5px; display: flex">
|
|
@@ -752,120 +752,123 @@ function detail(gvc: GVC, cf: any, vm: any, cVm: any, page_tab: 'page' | 'hidden
|
|
|
752
752
|
: 'padding: 9px 18px;'}"
|
|
753
753
|
value="${vm.data.content.tag || ''}"
|
|
754
754
|
onchange="${gvc.event((e) => {
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
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
765
|
/>
|
|
766
766
|
</div>
|
|
767
767
|
</div>`,
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
768
|
+
html` <div class="mt-2 mb-1"><span class="tx_normal me-2">網址預覽</span>${BgWidget.greenNote(prefixURL + (vm.data.content.tag ?? ''))}</div>`,
|
|
769
|
+
...(() => {
|
|
770
|
+
return [
|
|
771
|
+
BgWidget.editeInput({
|
|
772
|
+
gvc: gvc,
|
|
773
|
+
title: 'SEO標題',
|
|
774
|
+
default: vm.data.content.seo.title,
|
|
775
|
+
placeHolder: `請輸入SEO標題`,
|
|
776
|
+
callback: (text) => {
|
|
777
|
+
vm.data.content.title = text;
|
|
778
|
+
vm.data.content.seo.title = text;
|
|
779
|
+
gvc.notifyDataChange(id);
|
|
780
|
+
},
|
|
781
|
+
}),
|
|
782
|
+
BgWidget.textArea({
|
|
783
|
+
gvc: gvc,
|
|
784
|
+
title: 'SEO描述',
|
|
785
|
+
default: vm.data.content.seo.content,
|
|
786
|
+
placeHolder: `請輸入中繼描述`,
|
|
787
|
+
callback: (text) => {
|
|
788
|
+
vm.data.content.description = text;
|
|
789
|
+
vm.data.content.seo.content = text;
|
|
790
|
+
gvc.notifyDataChange(id);
|
|
791
|
+
},
|
|
792
|
+
}),
|
|
793
|
+
html` <div>
|
|
794
794
|
<div class="tx_normal">社群分享縮圖</div>
|
|
795
795
|
<div class="mt-1 mb-2">${BgWidget.grayNote('建議尺寸為 200px * 200px 以上')}</div>
|
|
796
796
|
${BgWidget.imageSelector(gvc, vm.data.content.seo.image || '', (text) => {
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
797
|
+
vm.data.content.seo.image = text;
|
|
798
|
+
gvc.notifyDataChange(id);
|
|
799
|
+
})}
|
|
800
800
|
</div>`,
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
801
|
+
,
|
|
802
|
+
];
|
|
803
|
+
})(),
|
|
804
|
+
...(() => {
|
|
805
|
+
if (`${vm.data.content.for_index}` === 'true') {
|
|
806
|
+
return [
|
|
807
|
+
[
|
|
808
|
+
html`<div class="d-flex w-100 align-items-center justify-content-between p-0 my-2">
|
|
809
|
+
<div class="tx_normal fw-normal">網誌內文</div>
|
|
810
|
+
${BgWidget.aiChatButton({ gvc, select: 'writer' })}
|
|
811
|
+
</div>`,
|
|
812
|
+
EditorElem.richText({
|
|
813
|
+
gvc: gvc,
|
|
814
|
+
def: vm.data.content.text ?? '',
|
|
815
|
+
callback: (text) => {
|
|
816
|
+
vm.data.content.text = text;
|
|
817
|
+
},
|
|
818
|
+
}),
|
|
819
|
+
].join(BgWidget.mbContainer(12)),
|
|
820
|
+
];
|
|
821
|
+
} else {
|
|
822
|
+
return [];
|
|
823
|
+
}
|
|
824
|
+
})(),
|
|
825
|
+
].join(BgWidget.mbContainer(12));
|
|
826
|
+
})()
|
|
827
|
+
),
|
|
828
|
+
].join('');
|
|
829
|
+
},
|
|
830
|
+
divCreate: {
|
|
831
|
+
style: 'padding: 0;',
|
|
832
|
+
},
|
|
833
|
+
};
|
|
834
|
+
}),
|
|
835
|
+
(() => {
|
|
836
|
+
vm.data.content.relative = vm.data.content.relative || 'collection';
|
|
837
|
+
vm.data.content.relative_data = vm.data.content.relative_data || [];
|
|
838
|
+
vm.data.content.with_discount = vm.data.content.with_discount || 'false';
|
|
836
839
|
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
840
|
+
return gvc.bindView(() => {
|
|
841
|
+
const id = gvc.glitter.getUUID();
|
|
842
|
+
return {
|
|
843
|
+
bind: id,
|
|
844
|
+
view: () => {
|
|
845
|
+
// 顯示套用的賣場商品列表
|
|
846
|
+
if (vm.data.content.page_type === 'hidden' || vm.data.content.page_type === 'shopping') {
|
|
847
|
+
return [
|
|
848
|
+
BgWidget.mbContainer(24),
|
|
849
|
+
BgWidget.mainCard(
|
|
850
|
+
[
|
|
851
|
+
BgWidget.title(
|
|
852
|
+
html`預設加入購物車
|
|
850
853
|
<div class="badge ms-2" style="background:#eaeaea;color:#393939;">以下設定的商品會自動加入購物車</div>`,
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
854
|
+
'font-size: 16px;'
|
|
855
|
+
),
|
|
856
|
+
html`<div class="my-2"></div>`,
|
|
857
|
+
[
|
|
858
|
+
html`${(() => {
|
|
859
|
+
return gvc.bindView(() => {
|
|
860
|
+
const subVM = {
|
|
861
|
+
id: gvc.glitter.getUUID(),
|
|
862
|
+
loading: true,
|
|
863
|
+
dataList: [] as OptionsItem[],
|
|
864
|
+
};
|
|
865
|
+
return {
|
|
866
|
+
bind: subVM.id,
|
|
867
|
+
view: () => {
|
|
868
|
+
if (subVM.loading) {
|
|
869
|
+
return BgWidget.spinner();
|
|
870
|
+
}
|
|
871
|
+
return html`
|
|
869
872
|
<div class="d-flex flex-column p-2" style="gap: 18px;">
|
|
870
873
|
<div class="d-flex align-items-center gray-bottom-line-18 " style="gap: 24px; justify-content: space-between;">
|
|
871
874
|
<div class="form-check-label c_updown_label">
|
|
@@ -892,11 +895,11 @@ function detail(gvc: GVC, cf: any, vm: any, cVm: any, page_tab: 'page' | 'hidden
|
|
|
892
895
|
});
|
|
893
896
|
}),
|
|
894
897
|
{ textStyle: 'font-weight: 400;' }
|
|
895
|
-
|
|
898
|
+
)}
|
|
896
899
|
</div>
|
|
897
900
|
${subVM.dataList
|
|
898
|
-
|
|
899
|
-
|
|
901
|
+
.map((opt: OptionsItem, index) => {
|
|
902
|
+
return html`
|
|
900
903
|
<div class="d-flex align-items-center form-check-label c_updown_label gap-3">
|
|
901
904
|
<span class="tx_normal" style="min-width: 20px;">${index + 1} .</span>
|
|
902
905
|
${BgWidget.validImageBox({ gvc: gvc, image: opt.image, width: 40 })}
|
|
@@ -911,199 +914,199 @@ function detail(gvc: GVC, cf: any, vm: any, cVm: any, page_tab: 'page' | 'hidden
|
|
|
911
914
|
gvc.notifyDataChange(subVM.id);
|
|
912
915
|
}),
|
|
913
916
|
'移除'
|
|
914
|
-
|
|
917
|
+
)}
|
|
915
918
|
</div>
|
|
916
919
|
`;
|
|
917
|
-
|
|
918
|
-
|
|
920
|
+
})
|
|
921
|
+
.join('') || `<div class="w-100 d-flex align-content-center justify-content-center">尚未加入任何賣場商品</div>`}
|
|
919
922
|
</div>
|
|
920
923
|
`;
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
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);
|
|
924
|
+
},
|
|
925
|
+
onCreate: () => {
|
|
926
|
+
if (subVM.loading) {
|
|
927
|
+
if (vm.data.content.relative_data.length === 0) {
|
|
928
|
+
setTimeout(() => {
|
|
929
|
+
subVM.dataList = [];
|
|
930
|
+
subVM.loading = false;
|
|
931
|
+
gvc.notifyDataChange(subVM.id);
|
|
932
|
+
}, 300);
|
|
933
|
+
} else {
|
|
934
|
+
new Promise<OptionsItem[]>(async (resolve) => {
|
|
935
|
+
const products_data = await BgProduct.getProductOpts(
|
|
936
|
+
vm.data.content.relative_data.map((dd: any) => {
|
|
937
|
+
return dd.product_id;
|
|
938
|
+
})
|
|
939
|
+
);
|
|
940
|
+
vm.data.content.relative_data = vm.data.content.relative_data.filter((dd: any) => {
|
|
941
|
+
return products_data.find((d1) => {
|
|
942
|
+
return `${dd.product_id}` === `${d1.key}`;
|
|
958
943
|
});
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
944
|
+
});
|
|
945
|
+
subVM.dataList = vm.data.content.relative_data.map((dd: any) => {
|
|
946
|
+
const product: any = JSON.parse(
|
|
947
|
+
JSON.stringify(
|
|
948
|
+
products_data.find((d1) => {
|
|
949
|
+
return `${dd.product_id}` === `${d1.key}`;
|
|
950
|
+
})
|
|
951
|
+
)
|
|
952
|
+
);
|
|
953
|
+
product.note = dd.variant.spec.join(' / ');
|
|
954
|
+
return product;
|
|
955
|
+
});
|
|
956
|
+
resolve(subVM.dataList);
|
|
957
|
+
}).then((data) => {
|
|
958
|
+
subVM.dataList = data;
|
|
959
|
+
subVM.loading = false;
|
|
960
|
+
gvc.notifyDataChange(subVM.id);
|
|
961
|
+
});
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
},
|
|
965
|
+
};
|
|
966
|
+
});
|
|
967
|
+
})()}`,
|
|
968
|
+
].join(''),
|
|
969
|
+
].join('')
|
|
970
|
+
),
|
|
971
|
+
].join('');
|
|
972
|
+
} else {
|
|
973
|
+
return [].join('');
|
|
974
|
+
}
|
|
975
|
+
},
|
|
976
|
+
};
|
|
977
|
+
});
|
|
978
|
+
})(),
|
|
979
|
+
].join(''),
|
|
980
|
+
ratio: 75,
|
|
981
|
+
},
|
|
982
|
+
{
|
|
983
|
+
html: BgWidget.summaryCard(
|
|
984
|
+
gvc.bindView(() => {
|
|
985
|
+
console.log(`vm.data.content.template=>`, vm.data.content.template);
|
|
986
|
+
const id = gvc.glitter.getUUID();
|
|
987
|
+
vm.data.status = vm.data.status ?? '1';
|
|
988
|
+
return {
|
|
989
|
+
bind: id,
|
|
990
|
+
view: () => {
|
|
991
|
+
return [
|
|
992
|
+
cf.is_page
|
|
993
|
+
? ``
|
|
994
|
+
: EditorElem.select({
|
|
995
|
+
title: '啟用狀態',
|
|
996
|
+
gvc: gvc,
|
|
997
|
+
def: `${vm.data.status}`,
|
|
998
|
+
array: [
|
|
999
|
+
{
|
|
1000
|
+
title: '啟用',
|
|
1001
|
+
value: '1',
|
|
1002
|
+
},
|
|
1003
|
+
{
|
|
1004
|
+
title: '隱藏',
|
|
1005
|
+
value: '0',
|
|
1006
|
+
},
|
|
1007
|
+
],
|
|
1008
|
+
callback: (text: string) => {
|
|
1009
|
+
vm.data.status = text;
|
|
1010
|
+
gvc.notifyDataChange(id);
|
|
1011
|
+
},
|
|
1012
|
+
}),
|
|
1013
|
+
EditorElem.pageSelect(
|
|
1014
|
+
gvc,
|
|
1015
|
+
'選擇佈景主題',
|
|
1016
|
+
vm.data.content.template ?? '',
|
|
1017
|
+
(data) => {
|
|
1018
|
+
vm.data.content.template = data;
|
|
1019
|
+
},
|
|
1020
|
+
(dd) => {
|
|
1021
|
+
const filter_result = dd.group !== 'glitter-article' && dd.page_type === 'article' && dd.page_config.template_type === 'blog';
|
|
1022
|
+
if (filter_result && !vm.data.content.template) {
|
|
1023
|
+
vm.data.content.template = dd.tag;
|
|
1024
|
+
gvc.notifyDataChange(id);
|
|
1025
|
+
}
|
|
1026
|
+
return filter_result;
|
|
971
1027
|
}
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
1028
|
+
),
|
|
1029
|
+
EditorElem.editeInput({
|
|
1030
|
+
gvc: gvc,
|
|
1031
|
+
title: '作者名稱',
|
|
1032
|
+
default: vm.data.content.author,
|
|
1033
|
+
placeHolder: '請輸入作者名稱',
|
|
1034
|
+
callback: (text) => {
|
|
1035
|
+
vm.data.content.author = text;
|
|
1036
|
+
},
|
|
1037
|
+
}),
|
|
1038
|
+
gvc.bindView(() => {
|
|
1039
|
+
const id = gvc.glitter.getUUID();
|
|
1040
|
+
return {
|
|
1041
|
+
bind: id,
|
|
1042
|
+
view: () => {
|
|
1043
|
+
if (cf.is_page) {
|
|
1044
|
+
return ``;
|
|
1045
|
+
}
|
|
1046
|
+
vm.data.content.collection = vm.data.content.collection ?? [];
|
|
1047
|
+
return [
|
|
1048
|
+
html` <div class="d-flex align-items-center my-3" style="gap: 10px;">
|
|
1049
|
+
${EditorElem.h3('預覽圖')}
|
|
1050
|
+
${BgWidget.grayButton(
|
|
1051
|
+
'添加檔案',
|
|
1052
|
+
gvc.event(() => {
|
|
1053
|
+
EditorElem.uploadFileFunction({
|
|
1054
|
+
gvc: gvc,
|
|
1055
|
+
callback: (text) => {
|
|
1056
|
+
vm.data.content.preview_image = text;
|
|
1057
|
+
gvc.notifyDataChange(id);
|
|
1058
|
+
},
|
|
1059
|
+
type: `image/*, video/*`,
|
|
1060
|
+
});
|
|
1061
|
+
})
|
|
1062
|
+
)}
|
|
1063
|
+
</div>`,
|
|
1064
|
+
EditorElem.flexMediaManager({
|
|
993
1065
|
gvc: gvc,
|
|
994
|
-
|
|
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
|
-
},
|
|
1066
|
+
data: vm.data.content.preview_image ? [vm.data.content.preview_image] : [],
|
|
1009
1067
|
}),
|
|
1010
|
-
|
|
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;
|
|
1024
|
-
}
|
|
1025
|
-
),
|
|
1026
|
-
EditorElem.editeInput({
|
|
1027
|
-
gvc: gvc,
|
|
1028
|
-
title: '作者名稱',
|
|
1029
|
-
default: vm.data.content.author,
|
|
1030
|
-
placeHolder: '請輸入作者名稱',
|
|
1031
|
-
callback: (text) => {
|
|
1032
|
-
vm.data.content.author = text;
|
|
1033
|
-
},
|
|
1034
|
-
}),
|
|
1035
|
-
gvc.bindView(() => {
|
|
1036
|
-
const id = gvc.glitter.getUUID();
|
|
1037
|
-
return {
|
|
1038
|
-
bind: id,
|
|
1039
|
-
view: () => {
|
|
1068
|
+
(() => {
|
|
1040
1069
|
if (cf.is_page) {
|
|
1041
1070
|
return ``;
|
|
1042
1071
|
}
|
|
1043
|
-
|
|
1044
|
-
return [
|
|
1045
|
-
html` <div class="d-flex align-items-center my-3" style="gap: 10px;">
|
|
1046
|
-
${EditorElem.h3('預覽圖')}
|
|
1047
|
-
${BgWidget.grayButton(
|
|
1048
|
-
'添加檔案',
|
|
1049
|
-
gvc.event(() => {
|
|
1050
|
-
EditorElem.uploadFileFunction({
|
|
1051
|
-
gvc: gvc,
|
|
1052
|
-
callback: (text) => {
|
|
1053
|
-
vm.data.content.preview_image = text;
|
|
1054
|
-
gvc.notifyDataChange(id);
|
|
1055
|
-
},
|
|
1056
|
-
type: `image/*, video/*`,
|
|
1057
|
-
});
|
|
1058
|
-
})
|
|
1059
|
-
)}
|
|
1060
|
-
</div>`,
|
|
1061
|
-
EditorElem.flexMediaManager({
|
|
1062
|
-
gvc: gvc,
|
|
1063
|
-
data: vm.data.content.preview_image ? [vm.data.content.preview_image] : [],
|
|
1064
|
-
}),
|
|
1065
|
-
(() => {
|
|
1066
|
-
if (cf.is_page) {
|
|
1067
|
-
return ``;
|
|
1068
|
-
}
|
|
1069
|
-
return html`
|
|
1072
|
+
return html`
|
|
1070
1073
|
${EditorElem.h3('文章分類')}
|
|
1071
1074
|
${gvc.bindView(() => {
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1075
|
+
const tagID = gvc.glitter.getUUID();
|
|
1076
|
+
let listTag: string[] = [];
|
|
1077
|
+
ApiUser.getPublicConfig('blog_collection', 'manager').then((data: any) => {
|
|
1078
|
+
if (data.response.value) {
|
|
1079
|
+
vm.link = data.response.value;
|
|
1077
1080
|
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
});
|
|
1083
|
-
it && listTag.push(dd.title);
|
|
1084
|
-
setCheck(dd.items);
|
|
1081
|
+
function setCheck(link: MenuItem[]) {
|
|
1082
|
+
link.map((dd) => {
|
|
1083
|
+
const it = vm.data.content.collection.find((d1: string) => {
|
|
1084
|
+
return d1 === dd.link;
|
|
1085
1085
|
});
|
|
1086
|
-
|
|
1086
|
+
it && listTag.push(dd.title);
|
|
1087
|
+
setCheck(dd.items);
|
|
1088
|
+
});
|
|
1089
|
+
}
|
|
1087
1090
|
|
|
1088
|
-
|
|
1091
|
+
setCheck(vm.link);
|
|
1089
1092
|
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1093
|
+
gvc.notifyDataChange(tagID);
|
|
1094
|
+
}
|
|
1095
|
+
});
|
|
1096
|
+
return {
|
|
1097
|
+
bind: tagID,
|
|
1098
|
+
view: () => {
|
|
1099
|
+
return listTag
|
|
1100
|
+
.map((dd: any) => {
|
|
1101
|
+
return html` <div class="badge bg_orange mt-2 me-2 fs-sm">${dd}</div>`;
|
|
1102
|
+
})
|
|
1103
|
+
.join('');
|
|
1104
|
+
},
|
|
1105
|
+
divCreate: {
|
|
1106
|
+
class: `d-flex flex-wrap`,
|
|
1107
|
+
},
|
|
1108
|
+
};
|
|
1109
|
+
})}
|
|
1107
1110
|
<div
|
|
1108
1111
|
class="cursor_pointer bt_c39 ms-2 p-1 mt-3"
|
|
1109
1112
|
onclick="${gvc.event(() => {
|
|
@@ -1115,97 +1118,97 @@ function detail(gvc: GVC, cf: any, vm: any, cVm: any, page_tab: 'page' | 'hidden
|
|
|
1115
1118
|
添加與編輯分類
|
|
1116
1119
|
</div>
|
|
1117
1120
|
`;
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1121
|
+
})(),
|
|
1122
|
+
].join(`<div class="my-2"></div>`);
|
|
1123
|
+
},
|
|
1124
|
+
divCreate: {},
|
|
1125
|
+
};
|
|
1126
|
+
}),
|
|
1127
|
+
].join('');
|
|
1128
|
+
},
|
|
1129
|
+
};
|
|
1130
|
+
})
|
|
1131
|
+
),
|
|
1132
|
+
ratio: 25,
|
|
1133
|
+
}
|
|
1131
1134
|
)}
|
|
1132
1135
|
${BgWidget.mbContainer(240)}
|
|
1133
1136
|
<div class="update-bar-container">
|
|
1134
1137
|
${vm.data.id
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1138
|
+
? BgWidget.redButton(
|
|
1139
|
+
`刪除${cf.is_page ? '頁面' : '網誌'}`,
|
|
1140
|
+
gvc.event(() => {
|
|
1141
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
1142
|
+
dialog.checkYesOrNot({
|
|
1143
|
+
text: '是否確認刪除此頁面?',
|
|
1144
|
+
callback: async (response) => {
|
|
1145
|
+
if (response) {
|
|
1146
|
+
await cf.widget.event('loading', {
|
|
1147
|
+
title: '刪除中...',
|
|
1148
|
+
});
|
|
1149
|
+
Article.deleteV2({
|
|
1150
|
+
id: `${vm.data.id}`,
|
|
1151
|
+
}).then(async (res) => {
|
|
1152
|
+
await cf.widget.event('loading', {
|
|
1153
|
+
title: '刪除中...',
|
|
1154
|
+
visible: false,
|
|
1155
|
+
});
|
|
1156
|
+
if (res.result) {
|
|
1157
|
+
vm.dataList = undefined;
|
|
1158
|
+
vm.type = 'list';
|
|
1159
|
+
} else {
|
|
1160
|
+
await cf.widget.event('error', {
|
|
1161
|
+
title: '刪除失敗',
|
|
1162
|
+
visible: false,
|
|
1163
|
+
});
|
|
1164
|
+
}
|
|
1165
|
+
});
|
|
1166
|
+
}
|
|
1167
|
+
},
|
|
1168
|
+
});
|
|
1169
|
+
})
|
|
1170
|
+
)
|
|
1171
|
+
: ''}
|
|
1169
1172
|
${BgWidget.cancel(
|
|
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
|
-
|
|
1173
|
+
gvc.event(() => {
|
|
1174
|
+
if (!vm.data.id) {
|
|
1175
|
+
cf.widget.event('error', {
|
|
1176
|
+
title: '請先儲存',
|
|
1177
|
+
});
|
|
1178
|
+
} else {
|
|
1179
|
+
const href = (() => {
|
|
1180
|
+
return `${gvc.glitter.root_path}${
|
|
1181
|
+
cf.is_page
|
|
1182
|
+
? (() => {
|
|
1183
|
+
switch (page_tab) {
|
|
1184
|
+
case 'shopping':
|
|
1185
|
+
return 'shop';
|
|
1186
|
+
case 'hidden':
|
|
1187
|
+
return 'hidden';
|
|
1188
|
+
case 'page':
|
|
1189
|
+
return 'pages';
|
|
1190
|
+
}
|
|
1191
|
+
return ``;
|
|
1192
|
+
})()
|
|
1193
|
+
: `blogs`
|
|
1194
|
+
}/${vm.data.content.tag}?preview=true&appName=${(window.parent as any).appName}`;
|
|
1195
|
+
})();
|
|
1196
|
+
localStorage.setItem('preview_data', JSON.stringify(vm.data.content));
|
|
1197
|
+
(window.parent as any).glitter.openNewTab(href);
|
|
1198
|
+
}
|
|
1199
|
+
}),
|
|
1200
|
+
'預覽'
|
|
1198
1201
|
)}
|
|
1199
1202
|
${BgWidget.cancel(
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1203
|
+
gvc.event(() => {
|
|
1204
|
+
vm.type = 'list';
|
|
1205
|
+
}),
|
|
1206
|
+
'取消'
|
|
1204
1207
|
)}
|
|
1205
1208
|
${BgWidget.save(
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
+
gvc.event(async () => {
|
|
1210
|
+
saveData(gvc, cf, vm, cVm, false);
|
|
1211
|
+
})
|
|
1209
1212
|
)}
|
|
1210
1213
|
</div>
|
|
1211
1214
|
`;
|
|
@@ -1440,62 +1443,62 @@ function setCollection(cf: {
|
|
|
1440
1443
|
bind: vm.id,
|
|
1441
1444
|
view: () => {
|
|
1442
1445
|
return html` <div class="title-container">
|
|
1443
|
-
|
|
1446
|
+
${BgWidget.goBack(
|
|
1444
1447
|
cf.gvc.event(() => {
|
|
1445
1448
|
cf.goBack();
|
|
1446
1449
|
})
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
+
)}${BgWidget.title('分類設定')}
|
|
1451
|
+
</div>
|
|
1452
|
+
${BgWidget.container(html`<div
|
|
1450
1453
|
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"
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1454
|
+
>
|
|
1455
|
+
<div style="width: 100%; position: relative">
|
|
1456
|
+
<div style="width: 100%; left: 0px; top: 0px; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 20px; display: inline-flex">
|
|
1457
|
+
<div
|
|
1455
1458
|
class="w-100 ${getSelectCount({
|
|
1456
1459
|
items: vm.link,
|
|
1457
1460
|
}) > 0
|
|
1458
|
-
|
|
1459
|
-
|
|
1461
|
+
? ``
|
|
1462
|
+
: `d-none`}"
|
|
1460
1463
|
style="height: 40px; padding: 12px 18px;background: #F7F7F7; border-radius: 10px; justify-content: flex-end; align-items: center; gap: 8px; display: inline-flex"
|
|
1461
|
-
>
|
|
1462
|
-
<div style="flex: 1 1 0; color: #393939; font-size: 14px; font-family: Noto Sans; font-weight: 700; word-wrap: break-word">
|
|
1463
|
-
已選取${getSelectCount({
|
|
1464
|
-
items: vm.link,
|
|
1465
|
-
})}項
|
|
1466
|
-
</div>
|
|
1467
|
-
<div
|
|
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"
|
|
1469
1464
|
>
|
|
1465
|
+
<div style="flex: 1 1 0; color: #393939; font-size: 14px; font-family: Noto Sans; font-weight: 700; word-wrap: break-word">
|
|
1466
|
+
已選取${getSelectCount({
|
|
1467
|
+
items: vm.link,
|
|
1468
|
+
})}項
|
|
1469
|
+
</div>
|
|
1470
1470
|
<div
|
|
1471
|
+
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"
|
|
1472
|
+
>
|
|
1473
|
+
<div
|
|
1471
1474
|
style="color: #393939; font-size: 14px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word"
|
|
1472
1475
|
onclick="${gvc.event(() => {
|
|
1473
1476
|
vm.link = deleteSelect(vm.link);
|
|
1474
1477
|
gvc.notifyDataChange(vm.id);
|
|
1475
1478
|
})}"
|
|
1476
|
-
|
|
1477
|
-
|
|
1479
|
+
>
|
|
1480
|
+
刪除
|
|
1481
|
+
</div>
|
|
1478
1482
|
</div>
|
|
1479
1483
|
</div>
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
<div
|
|
1484
|
+
<div class="d-flex align-items-center" style="width: 100%; height: 22px; position: relative;gap:29px;">
|
|
1485
|
+
<div
|
|
1483
1486
|
class="${allSelect({
|
|
1484
1487
|
items: vm.link,
|
|
1485
1488
|
selected: !vm.link.find((dd) => {
|
|
1486
1489
|
return !(dd as any).selected;
|
|
1487
1490
|
}),
|
|
1488
1491
|
})
|
|
1489
|
-
|
|
1490
|
-
|
|
1492
|
+
? `fa-solid fa-square-check`
|
|
1493
|
+
: `fa-regular fa-square`}"
|
|
1491
1494
|
style="color:#393939;width: 16px; height: 16px;cursor: pointer;"
|
|
1492
1495
|
onclick="${cf.gvc.event((e, event) => {
|
|
1493
1496
|
event.stopPropagation();
|
|
1494
1497
|
|
|
1495
1498
|
if (
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
+
vm.link.find((dd) => {
|
|
1500
|
+
return !(dd as any).selected;
|
|
1501
|
+
})
|
|
1499
1502
|
) {
|
|
1500
1503
|
selectAll({
|
|
1501
1504
|
items: vm.link,
|
|
@@ -1507,134 +1510,134 @@ function setCollection(cf: {
|
|
|
1507
1510
|
}
|
|
1508
1511
|
gvc.notifyDataChange(vm.id);
|
|
1509
1512
|
})}"
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1513
|
+
></div>
|
|
1514
|
+
<div style="left: 61px; top: 0px; color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 700; word-wrap: break-word">選單名稱</div>
|
|
1515
|
+
</div>
|
|
1516
|
+
<div style="align-self: stretch; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 18px; display: flex">
|
|
1517
|
+
${(() => {
|
|
1518
|
+
function renderItems(array: MenuItem[]): string {
|
|
1519
|
+
const id = gvc.glitter.getUUID();
|
|
1520
|
+
return (
|
|
1518
1521
|
gvc.bindView(() => {
|
|
1519
1522
|
return {
|
|
1520
1523
|
bind: id,
|
|
1521
1524
|
view: () => {
|
|
1522
1525
|
return array
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
+
.map((dd, index) => {
|
|
1527
|
+
dd.items;
|
|
1528
|
+
const list = html`
|
|
1529
|
+
<div
|
|
1530
|
+
class=" w-100 "
|
|
1531
|
+
style="width: 100%; justify-content: flex-start; align-items: center; gap: 5px; display: inline-flex;cursor: pointer;"
|
|
1532
|
+
onclick="${cf.gvc.event(() => {
|
|
1533
|
+
if (dd.items && dd.items.length > 0) {
|
|
1534
|
+
(dd as any).toggle = !(dd as any).toggle;
|
|
1535
|
+
gvc.notifyDataChange(vm.id);
|
|
1536
|
+
}
|
|
1537
|
+
})}"
|
|
1538
|
+
>
|
|
1526
1539
|
<div
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
}
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
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>
|
|
1540
|
+
class="${allSelect(dd) ? `fa-solid fa-square-check` : `fa-regular fa-square`}"
|
|
1541
|
+
style="color:#393939;width: 16px; height: 16px;"
|
|
1542
|
+
onclick="${cf.gvc.event((e, event) => {
|
|
1543
|
+
event.stopPropagation();
|
|
1544
|
+
(dd as any).selected = !(dd as any).selected;
|
|
1545
|
+
if ((dd as any).selected) {
|
|
1546
|
+
selectAll(dd);
|
|
1547
|
+
} else {
|
|
1548
|
+
clearAll(dd);
|
|
1549
|
+
}
|
|
1550
|
+
gvc.notifyDataChange(vm.id);
|
|
1551
|
+
})}"
|
|
1552
|
+
></div>
|
|
1553
|
+
<div class="hoverF2 pe-2" style="width: 100%; justify-content: flex-start; align-items: center; gap: 8px; display: flex">
|
|
1554
|
+
<i
|
|
1555
|
+
class="ms-2 fa-solid fa-grip-dots-vertical color39 dragItem hoverBtn d-flex align-items-center justify-content-center"
|
|
1556
|
+
style="cursor: pointer;width:25px;height: 25px;"
|
|
1557
|
+
></i>
|
|
1558
|
+
<div style="flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px; display: inline-flex">
|
|
1559
|
+
<div style="justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex">
|
|
1560
|
+
<div style="color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
|
|
1561
|
+
${dd.title}
|
|
1575
1562
|
</div>
|
|
1563
|
+
${dd.items && dd.items.length > 0
|
|
1564
|
+
? !(dd as any).toggle
|
|
1565
|
+
? `<i class="fa-solid fa-angle-down color39"></i>`
|
|
1566
|
+
: `<i class="fa-solid fa-angle-up color39"></i>`
|
|
1567
|
+
: ``}
|
|
1576
1568
|
</div>
|
|
1577
|
-
<div
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
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>
|
|
1569
|
+
<div style="justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex">
|
|
1570
|
+
<div
|
|
1571
|
+
style="color: #3366BB; font-size: 14px; font-family: Noto Sans; font-weight: 400; line-height: 14px; word-wrap: break-word"
|
|
1572
|
+
>
|
|
1573
|
+
${dd.title}
|
|
1574
|
+
</div>
|
|
1575
|
+
<div style="color: #159240; font-size: 14px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
|
|
1576
|
+
${dd.link}
|
|
1577
|
+
</div>
|
|
1603
1578
|
</div>
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1579
|
+
</div>
|
|
1580
|
+
<div class="flex-fill"></div>
|
|
1581
|
+
<div
|
|
1582
|
+
class="child me-2"
|
|
1583
|
+
onclick="${cf.gvc.event((e, event) => {
|
|
1584
|
+
event.stopPropagation();
|
|
1585
|
+
MenusSetting.collectionEvent(
|
|
1586
|
+
{
|
|
1587
|
+
link: '',
|
|
1588
|
+
title: '',
|
|
1589
|
+
items: [],
|
|
1590
|
+
},
|
|
1591
|
+
(data) => {
|
|
1592
|
+
dd.items = dd.items || [];
|
|
1593
|
+
dd.items.push(data);
|
|
1594
|
+
if (checkLinkExists(data, vm.link)) {
|
|
1595
|
+
gvc.notifyDataChange(vm.id);
|
|
1596
|
+
return true;
|
|
1597
|
+
} else {
|
|
1598
|
+
dd.items.splice(dd.items.length - 1, 1);
|
|
1599
|
+
return false;
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
);
|
|
1603
|
+
})}"
|
|
1604
|
+
>
|
|
1605
|
+
<i class="fa-solid fa-plus" style="color:#393939;"></i>
|
|
1606
|
+
</div>
|
|
1607
|
+
<div
|
|
1608
|
+
class="child"
|
|
1609
|
+
onclick="${cf.gvc.event((e, event) => {
|
|
1610
|
+
event.stopPropagation();
|
|
1611
|
+
const og = JSON.parse(JSON.stringify(dd));
|
|
1609
1612
|
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
</div>
|
|
1613
|
+
MenusSetting.collectionEvent(dd, (data) => {
|
|
1614
|
+
if (checkLinkExists(data, vm.link)) {
|
|
1615
|
+
array[index] = data;
|
|
1616
|
+
gvc.notifyDataChange(vm.id);
|
|
1617
|
+
return true;
|
|
1618
|
+
} else {
|
|
1619
|
+
data.link = og.link;
|
|
1620
|
+
data.title = og.title;
|
|
1621
|
+
return false;
|
|
1622
|
+
}
|
|
1623
|
+
});
|
|
1624
|
+
})}"
|
|
1625
|
+
>
|
|
1626
|
+
<i class="fa-solid fa-pencil" style="color:#393939;"></i>
|
|
1625
1627
|
</div>
|
|
1626
1628
|
</div>
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
}
|
|
1637
|
-
|
|
1629
|
+
</div>
|
|
1630
|
+
${dd.items && dd.items.length > 0
|
|
1631
|
+
? html`
|
|
1632
|
+
<div class=" w-100 ${(dd as any).toggle ? `` : `d-none`}" style="padding-left: 35px;">
|
|
1633
|
+
${renderItems(dd.items as MenuItem[]) as any}
|
|
1634
|
+
</div>
|
|
1635
|
+
`
|
|
1636
|
+
: ``}
|
|
1637
|
+
`;
|
|
1638
|
+
return html` <li class="w-100 ">${list}</li>`;
|
|
1639
|
+
})
|
|
1640
|
+
.join('');
|
|
1638
1641
|
},
|
|
1639
1642
|
divCreate: {
|
|
1640
1643
|
elem: 'ul',
|
|
@@ -1643,13 +1646,13 @@ function setCollection(cf: {
|
|
|
1643
1646
|
},
|
|
1644
1647
|
onCreate: () => {
|
|
1645
1648
|
gvc.glitter.addMtScript(
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1649
|
+
[
|
|
1650
|
+
{
|
|
1651
|
+
src: `https://raw.githack.com/SortableJS/Sortable/master/Sortable.js`,
|
|
1652
|
+
},
|
|
1653
|
+
],
|
|
1654
|
+
() => {},
|
|
1655
|
+
() => {}
|
|
1653
1656
|
);
|
|
1654
1657
|
const interval = setInterval(() => {
|
|
1655
1658
|
//@ts-ignore
|
|
@@ -1691,57 +1694,57 @@ function setCollection(cf: {
|
|
|
1691
1694
|
};
|
|
1692
1695
|
}) +
|
|
1693
1696
|
html` <div
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1697
|
+
class=""
|
|
1698
|
+
style="cursor:pointer;align-self: stretch; height: 50px; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 10px; display: flex"
|
|
1699
|
+
onclick="${cf.gvc.event(() => {
|
|
1700
|
+
MenusSetting.collectionEvent(
|
|
1701
|
+
{
|
|
1702
|
+
link: '',
|
|
1703
|
+
title: '',
|
|
1704
|
+
items: [],
|
|
1705
|
+
},
|
|
1706
|
+
(data) => {
|
|
1707
|
+
array.push(data);
|
|
1708
|
+
if (checkLinkExists(data, vm.link)) {
|
|
1709
|
+
gvc.notifyDataChange(vm.id);
|
|
1710
|
+
return true;
|
|
1711
|
+
} else {
|
|
1712
|
+
array.splice(array.length - 1, 1);
|
|
1713
|
+
return false;
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
);
|
|
1717
|
+
})}"
|
|
1715
1718
|
>
|
|
1716
1719
|
<div
|
|
1717
|
-
|
|
1720
|
+
style="align-self: stretch; height: 54px; border-radius: 10px; border: 1px #DDDDDD solid; justify-content: center; align-items: center; gap: 6px; display: inline-flex"
|
|
1718
1721
|
>
|
|
1719
1722
|
<i class="fa-solid fa-plus" style="color: #3366BB;font-size: 16px; "></i>
|
|
1720
1723
|
<div style="color: #3366BB; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">新增選單</div>
|
|
1721
1724
|
</div>
|
|
1722
1725
|
</div>`
|
|
1723
|
-
|
|
1724
|
-
|
|
1726
|
+
);
|
|
1727
|
+
}
|
|
1725
1728
|
|
|
1726
|
-
|
|
1727
|
-
|
|
1729
|
+
return renderItems(vm.link);
|
|
1730
|
+
})()}
|
|
1731
|
+
</div>
|
|
1728
1732
|
</div>
|
|
1729
1733
|
</div>
|
|
1730
|
-
</div
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
${BgWidget.cancel(
|
|
1734
|
+
</div>`)}
|
|
1735
|
+
<div class="update-bar-container">
|
|
1736
|
+
${BgWidget.cancel(
|
|
1734
1737
|
gvc.event(() => {
|
|
1735
1738
|
cf.goBack();
|
|
1736
1739
|
})
|
|
1737
|
-
|
|
1738
|
-
|
|
1740
|
+
)}
|
|
1741
|
+
${BgWidget.save(
|
|
1739
1742
|
gvc.event(() => {
|
|
1740
1743
|
save();
|
|
1741
1744
|
}),
|
|
1742
1745
|
'確認'
|
|
1743
|
-
|
|
1744
|
-
|
|
1746
|
+
)}
|
|
1747
|
+
</div>`;
|
|
1745
1748
|
},
|
|
1746
1749
|
divCreate: {
|
|
1747
1750
|
style: `padding-bottom:60px;`,
|
|
@@ -1773,4 +1776,4 @@ function template_select(gvc: GVC, cf: any, vm: any, cVm: any, page_type: any) {
|
|
|
1773
1776
|
);
|
|
1774
1777
|
}
|
|
1775
1778
|
|
|
1776
|
-
(window as any).glitter.setModule(import.meta.url, BgBlog);
|
|
1779
|
+
(window as any).glitter.setModule(import.meta.url, BgBlog);
|