ts-glitter 13.4.8 → 13.5.1
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 +691 -761
- package/lowcode/backend-manager/bg-blog.ts +956 -1041
- 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/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 +1 -1
- package/lowcode/glitterBundle/Glitter.ts +1 -1
- package/lowcode/jspage/editor.js +1 -1
- package/lowcode/jspage/editor.ts +1 -1
- 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 +13 -7
- package/lowcode/jspage/main.ts +13 -9
- 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/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
|
@@ -19,8 +19,7 @@ import { BgProduct } from './bg-product.js';
|
|
|
19
19
|
import { CheckInput } from '../modules/checkInput.js';
|
|
20
20
|
const html = String.raw;
|
|
21
21
|
export class BgBlog {
|
|
22
|
-
static contentManager(gvc, type = 'list', callback = () => {
|
|
23
|
-
}, is_page, widget, page_tab) {
|
|
22
|
+
static contentManager(gvc, type = 'list', callback = () => { }, is_page, widget, page_tab) {
|
|
24
23
|
const html = String.raw;
|
|
25
24
|
const glitter = gvc.glitter;
|
|
26
25
|
const vm = {
|
|
@@ -44,8 +43,7 @@ export class BgBlog {
|
|
|
44
43
|
},
|
|
45
44
|
{
|
|
46
45
|
key: '發布時間',
|
|
47
|
-
value: html `<span
|
|
48
|
-
class="fs-7">${glitter.ut.dateFormat(new Date(dd.created_time), 'yyyy-MM-dd')}</span>`,
|
|
46
|
+
value: html `<span class="fs-7">${glitter.ut.dateFormat(new Date(dd.created_time), 'yyyy-MM-dd')}</span>`,
|
|
49
47
|
},
|
|
50
48
|
{
|
|
51
49
|
key: '預覽',
|
|
@@ -98,156 +96,154 @@ export class BgBlog {
|
|
|
98
96
|
if (window.parent.glitter.getUrlParameter('page-id') && vm.type !== 'replace') {
|
|
99
97
|
return ``;
|
|
100
98
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
<div class="d-flex
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
gvc.notifyDataChange(id);
|
|
138
|
-
}))}
|
|
139
|
-
${BgWidget.darkButton(`新增${is_page ? `頁面` : `網誌`}`, gvc.event(() => {
|
|
140
|
-
vm.data = { content: {} };
|
|
141
|
-
vm.type = 'add';
|
|
99
|
+
if (vm.type === 'list') {
|
|
100
|
+
return BgWidget.container(html `
|
|
101
|
+
<div class="title-container gap-4 ${type === 'select' ? `d-none` : ``}">
|
|
102
|
+
<div class="d-flex flex-column" style="gap:5px;">
|
|
103
|
+
${BgWidget.title(is_page
|
|
104
|
+
? (() => {
|
|
105
|
+
switch (page_tab) {
|
|
106
|
+
case 'hidden':
|
|
107
|
+
return '隱形賣場';
|
|
108
|
+
case 'page':
|
|
109
|
+
return '自訂頁面';
|
|
110
|
+
case 'shopping':
|
|
111
|
+
return '一頁商店';
|
|
112
|
+
}
|
|
113
|
+
})()
|
|
114
|
+
: '網誌文章')}
|
|
115
|
+
${BgWidget.grayNote(is_page
|
|
116
|
+
? (() => {
|
|
117
|
+
switch (page_tab) {
|
|
118
|
+
case 'hidden':
|
|
119
|
+
return '隱形賣場僅能透過連結分享,無法顯示於 Google 搜尋列表';
|
|
120
|
+
case 'page':
|
|
121
|
+
return '打造自訂頁面,顯示品牌官網的獨特內容';
|
|
122
|
+
case 'shopping':
|
|
123
|
+
return '放大特定商品重點,打造專屬爆品產品,一頁下單快速購物';
|
|
124
|
+
}
|
|
125
|
+
})()
|
|
126
|
+
: '快速分享商店最新資訊的好功能')}
|
|
127
|
+
</div>
|
|
128
|
+
<div class="flex-fill"></div>
|
|
129
|
+
<div style="display: flex; gap: 12px;">
|
|
130
|
+
${is_page
|
|
131
|
+
? ''
|
|
132
|
+
: BgWidget.grayButton('網誌分類', gvc.event(() => {
|
|
133
|
+
vm.type = 'collection';
|
|
134
|
+
gvc.notifyDataChange(id);
|
|
142
135
|
}))}
|
|
143
|
-
|
|
136
|
+
${BgWidget.darkButton(`新增${is_page ? `頁面` : `網誌`}`, gvc.event(() => {
|
|
137
|
+
vm.data = { content: {} };
|
|
138
|
+
vm.type = 'add';
|
|
139
|
+
}))}
|
|
144
140
|
</div>
|
|
145
|
-
|
|
146
|
-
BgWidget.
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
getData: (vd) => {
|
|
153
|
-
vmi = vd;
|
|
154
|
-
const limit = 20;
|
|
155
|
-
Article.get({
|
|
156
|
-
page: vmi.page - 1,
|
|
157
|
-
limit: limit,
|
|
158
|
-
search: vm.query || undefined,
|
|
159
|
-
for_index: is_page ? `false` : `true`,
|
|
160
|
-
status: '0,1',
|
|
161
|
-
page_type: page_tab,
|
|
162
|
-
}).then((data) => {
|
|
163
|
-
vm.dataList = data.response.data;
|
|
164
|
-
vmi.pageSize = Math.ceil(data.response.total / limit);
|
|
165
|
-
vmi.originalData = vm.dataList;
|
|
166
|
-
vmi.tableData = getDatalist();
|
|
167
|
-
vmi.loading = false;
|
|
168
|
-
vmi.callback();
|
|
169
|
-
});
|
|
170
|
-
},
|
|
171
|
-
rowClick: (data, index) => {
|
|
172
|
-
if (type === 'select') {
|
|
173
|
-
vm.dataList[index].checked = !vm.dataList[index].checked;
|
|
174
|
-
vmi.data = getDatalist();
|
|
175
|
-
vmi.callback();
|
|
176
|
-
callback(vm.dataList.filter((dd) => {
|
|
177
|
-
return dd.checked;
|
|
178
|
-
}));
|
|
179
|
-
}
|
|
180
|
-
else {
|
|
181
|
-
vm.data = vm.dataList[index];
|
|
182
|
-
vm.type = 'replace';
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
filter: [
|
|
186
|
-
{
|
|
187
|
-
name: '批量移除',
|
|
188
|
-
event: (checkedData) => {
|
|
189
|
-
const dialog = new ShareDialog(glitter);
|
|
190
|
-
dialog.checkYesOrNot({
|
|
191
|
-
text: '是否確認刪除所選項目?',
|
|
192
|
-
callback: (response) => {
|
|
193
|
-
if (response) {
|
|
194
|
-
dialog.dataLoading({ visible: true });
|
|
195
|
-
Article.deleteV2({
|
|
196
|
-
id: checkedData
|
|
197
|
-
.map((dd) => {
|
|
198
|
-
return dd.id;
|
|
199
|
-
})
|
|
200
|
-
.join(`,`),
|
|
201
|
-
}).then((res) => {
|
|
202
|
-
dialog.dataLoading({ visible: false });
|
|
203
|
-
if (res.result) {
|
|
204
|
-
vm.dataList = undefined;
|
|
205
|
-
gvc.notifyDataChange(id);
|
|
206
|
-
}
|
|
207
|
-
else {
|
|
208
|
-
dialog.errorMessage({ text: '刪除失敗' });
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
},
|
|
213
|
-
});
|
|
214
|
-
},
|
|
215
|
-
},
|
|
216
|
-
],
|
|
217
|
-
}),
|
|
218
|
-
].join(''))}
|
|
219
|
-
`, BgWidget.getContainerWidth());
|
|
220
|
-
}
|
|
221
|
-
else if (vm.type == 'replace') {
|
|
222
|
-
window.parent.glitter.setUrlParameter('page-id', vm.data.id);
|
|
223
|
-
return editor({
|
|
224
|
-
gvc: gvc,
|
|
225
|
-
vm: vm,
|
|
226
|
-
is_page: is_page,
|
|
227
|
-
widget: widget,
|
|
228
|
-
page_tab: page_tab,
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
|
-
else if (vm.type == 'collection') {
|
|
232
|
-
return BgWidget.container(setCollection({
|
|
141
|
+
</div>
|
|
142
|
+
${BgWidget.container(BgWidget.mainCard([
|
|
143
|
+
BgWidget.searchPlace(gvc.event((e) => {
|
|
144
|
+
vm.query = e.value;
|
|
145
|
+
gvc.notifyDataChange(id);
|
|
146
|
+
}), vm.query || '', '搜尋所有文章'),
|
|
147
|
+
BgWidget.tableV3({
|
|
233
148
|
gvc: gvc,
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
149
|
+
getData: (vd) => {
|
|
150
|
+
vmi = vd;
|
|
151
|
+
const limit = 20;
|
|
152
|
+
Article.get({
|
|
153
|
+
page: vmi.page - 1,
|
|
154
|
+
limit: limit,
|
|
155
|
+
search: vm.query || undefined,
|
|
156
|
+
for_index: is_page ? `false` : `true`,
|
|
157
|
+
status: '0,1',
|
|
158
|
+
page_type: page_tab,
|
|
159
|
+
}).then((data) => {
|
|
160
|
+
vm.dataList = data.response.data;
|
|
161
|
+
vmi.pageSize = Math.ceil(data.response.total / limit);
|
|
162
|
+
vmi.originalData = vm.dataList;
|
|
163
|
+
vmi.tableData = getDatalist();
|
|
164
|
+
vmi.loading = false;
|
|
165
|
+
vmi.callback();
|
|
166
|
+
});
|
|
239
167
|
},
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
168
|
+
rowClick: (data, index) => {
|
|
169
|
+
if (type === 'select') {
|
|
170
|
+
vm.dataList[index].checked = !vm.dataList[index].checked;
|
|
171
|
+
vmi.data = getDatalist();
|
|
172
|
+
vmi.callback();
|
|
173
|
+
callback(vm.dataList.filter((dd) => {
|
|
174
|
+
return dd.checked;
|
|
175
|
+
}));
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
vm.data = vm.dataList[index];
|
|
179
|
+
vm.type = 'replace';
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
filter: [
|
|
183
|
+
{
|
|
184
|
+
name: '批量移除',
|
|
185
|
+
event: (checkedData) => {
|
|
186
|
+
const dialog = new ShareDialog(glitter);
|
|
187
|
+
dialog.checkYesOrNot({
|
|
188
|
+
text: '是否確認刪除所選項目?',
|
|
189
|
+
callback: (response) => {
|
|
190
|
+
if (response) {
|
|
191
|
+
dialog.dataLoading({ visible: true });
|
|
192
|
+
Article.deleteV2({
|
|
193
|
+
id: checkedData
|
|
194
|
+
.map((dd) => {
|
|
195
|
+
return dd.id;
|
|
196
|
+
})
|
|
197
|
+
.join(`,`),
|
|
198
|
+
}).then((res) => {
|
|
199
|
+
dialog.dataLoading({ visible: false });
|
|
200
|
+
if (res.result) {
|
|
201
|
+
vm.dataList = undefined;
|
|
202
|
+
gvc.notifyDataChange(id);
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
dialog.errorMessage({ text: '刪除失敗' });
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
});
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
],
|
|
214
|
+
}),
|
|
215
|
+
].join('')))}
|
|
216
|
+
`);
|
|
217
|
+
}
|
|
218
|
+
else if (vm.type == 'replace') {
|
|
219
|
+
window.parent.glitter.setUrlParameter('page-id', vm.data.id);
|
|
220
|
+
return editor({
|
|
221
|
+
gvc: gvc,
|
|
222
|
+
vm: vm,
|
|
223
|
+
is_page: is_page,
|
|
224
|
+
widget: widget,
|
|
225
|
+
page_tab: page_tab,
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
else if (vm.type == 'collection') {
|
|
229
|
+
return BgWidget.container(setCollection({
|
|
230
|
+
gvc: gvc,
|
|
231
|
+
widget: widget,
|
|
232
|
+
key: 'blog_collection',
|
|
233
|
+
goBack: () => {
|
|
234
|
+
vm.type = 'list';
|
|
235
|
+
gvc.notifyDataChange(id);
|
|
236
|
+
},
|
|
237
|
+
}));
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
return editor({
|
|
241
|
+
gvc: gvc,
|
|
242
|
+
vm: vm,
|
|
243
|
+
is_page: is_page,
|
|
244
|
+
widget: widget,
|
|
245
|
+
page_tab: page_tab,
|
|
246
|
+
});
|
|
251
247
|
}
|
|
252
248
|
},
|
|
253
249
|
};
|
|
@@ -267,15 +263,14 @@ export class BgBlog {
|
|
|
267
263
|
`);
|
|
268
264
|
const containerID = gvc.glitter.getUUID();
|
|
269
265
|
return html `
|
|
270
|
-
<div class="
|
|
266
|
+
<div class="title-container">
|
|
271
267
|
${BgWidget.goBack(gvc.event(() => {
|
|
272
268
|
callback(undefined);
|
|
273
269
|
}))}
|
|
274
270
|
<div>${[BgWidget.title('選擇模板'), BgWidget.grayNote('請選擇一個符合您需求的模板')].join('')}</div>
|
|
275
271
|
</div>
|
|
276
272
|
${[
|
|
277
|
-
html
|
|
278
|
-
<div class="my-3"></div>`,
|
|
273
|
+
html `<div class="my-3"></div>`,
|
|
279
274
|
BgWidget.card(gvc.bindView(() => {
|
|
280
275
|
return {
|
|
281
276
|
bind: containerID,
|
|
@@ -400,18 +395,16 @@ export class BgBlog {
|
|
|
400
395
|
if (data.response.result.data.length === 0) {
|
|
401
396
|
if (!vm.search) {
|
|
402
397
|
return html `
|
|
403
|
-
<div class="d-flex align-items-center justify-content-center flex-column w-100 py-4"
|
|
404
|
-
|
|
405
|
-
<
|
|
406
|
-
<span class="color39 text-center">尚未自製任何模塊<br/>請前往開發者模式自製專屬模塊</span>
|
|
398
|
+
<div class="d-flex align-items-center justify-content-center flex-column w-100 py-4" style="width:700px;gap:10px;">
|
|
399
|
+
<img src="./img/box-open-solid.svg" />
|
|
400
|
+
<span class="color39 text-center">尚未自製任何模塊<br />請前往開發者模式自製專屬模塊</span>
|
|
407
401
|
</div>
|
|
408
402
|
`;
|
|
409
403
|
}
|
|
410
404
|
else {
|
|
411
405
|
return html `
|
|
412
|
-
<div class="d-flex align-items-center justify-content-center flex-column w-100 py-4"
|
|
413
|
-
|
|
414
|
-
<img src="./img/box-open-solid.svg"/>
|
|
406
|
+
<div class="d-flex align-items-center justify-content-center flex-column w-100 py-4" style="width:700px;gap:10px;">
|
|
407
|
+
<img src="./img/box-open-solid.svg" />
|
|
415
408
|
<span class="color39 text-center">查無相關模塊</span>
|
|
416
409
|
</div>
|
|
417
410
|
`;
|
|
@@ -432,32 +425,30 @@ export class BgBlog {
|
|
|
432
425
|
})
|
|
433
426
|
.map((dd, index) => {
|
|
434
427
|
var _a;
|
|
435
|
-
return html
|
|
436
|
-
<div class="
|
|
437
|
-
<div
|
|
438
|
-
|
|
428
|
+
return html `<div class="col-6 col-sm-3 mb-3 rounded-3">
|
|
429
|
+
<div class="d-flex flex-column justify-content-center w-100 " style="gap:5px;cursor:pointer;">
|
|
430
|
+
<div
|
|
431
|
+
class="card w-100 position-relative rounded hoverHidden bgf6 rounded-3"
|
|
432
|
+
style="padding-bottom: ${(800 / 600) * 100}%;"
|
|
433
|
+
>
|
|
439
434
|
<div
|
|
440
|
-
class="
|
|
441
|
-
style="
|
|
435
|
+
class="position-absolute w-100 h-100 d-flex align-items-center justify-content-center rounded-3"
|
|
436
|
+
style="overflow: hidden;"
|
|
442
437
|
>
|
|
443
|
-
<
|
|
444
|
-
class="
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
class="w-100 "
|
|
449
|
-
src="${(_a = dd.template_config.image[0]) !== null && _a !== void 0 ? _a : 'https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/1713445383494-未命名(1080x1080像素).jpg'}"
|
|
450
|
-
/>
|
|
451
|
-
</div>
|
|
438
|
+
<img
|
|
439
|
+
class="w-100 "
|
|
440
|
+
src="${(_a = dd.template_config.image[0]) !== null && _a !== void 0 ? _a : 'https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/1713445383494-未命名(1080x1080像素).jpg'}"
|
|
441
|
+
/>
|
|
442
|
+
</div>
|
|
452
443
|
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
444
|
+
<div
|
|
445
|
+
class="position-absolute w-100 h-100 align-items-center justify-content-center rounded fs-6 flex-column"
|
|
446
|
+
style="background: rgba(0,0,0,0.5);gap:5px;"
|
|
447
|
+
>
|
|
448
|
+
<button
|
|
449
|
+
class="btn btn-secondary d-flex align-items-center "
|
|
450
|
+
style="height: 28px;width: 75px;gap:5px;"
|
|
451
|
+
onclick="${gvc.event(() => {
|
|
461
452
|
if (dd.tag === 'empty') {
|
|
462
453
|
const a = [];
|
|
463
454
|
a.name = '空白頁面';
|
|
@@ -479,23 +470,23 @@ export class BgBlog {
|
|
|
479
470
|
}
|
|
480
471
|
}
|
|
481
472
|
})}"
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
</div>
|
|
473
|
+
>
|
|
474
|
+
選擇
|
|
475
|
+
</button>
|
|
486
476
|
</div>
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
477
|
+
</div>
|
|
478
|
+
<h3 class="fs-6 mb-0 d-flex justify-content-between align-items-center fw-500 mt-1">
|
|
479
|
+
${dd.template_config.name}
|
|
480
|
+
<i
|
|
481
|
+
class="fa-solid fa-eye ${dd.tag === 'empty' ? `d-none` : ``}"
|
|
482
|
+
style="cursor:pointer;"
|
|
483
|
+
onclick="${gvc.event(() => {
|
|
493
484
|
window.parent.glitter.openNewTab(`${gvc.glitter.root_path}pages/${dd.tag}?appName=${dd.appName}`);
|
|
494
485
|
})}"
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
486
|
+
></i>
|
|
487
|
+
</h3>
|
|
488
|
+
</div>
|
|
489
|
+
</div>`;
|
|
499
490
|
})
|
|
500
491
|
.join('')}
|
|
501
492
|
</div>
|
|
@@ -505,12 +496,10 @@ export class BgBlog {
|
|
|
505
496
|
})();
|
|
506
497
|
}
|
|
507
498
|
else {
|
|
508
|
-
return html `
|
|
509
|
-
<div class="
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
<div class="fs-6 fw-500">載入中...</div>
|
|
513
|
-
</div>`;
|
|
499
|
+
return html ` <div class="w-100 p-3 d-flex align-items-center justify-content-center flex-column" style="gap: 10px;">
|
|
500
|
+
<div class="spinner-border fs-5"></div>
|
|
501
|
+
<div class="fs-6 fw-500">載入中...</div>
|
|
502
|
+
</div>`;
|
|
514
503
|
}
|
|
515
504
|
},
|
|
516
505
|
divCreate: {
|
|
@@ -522,7 +511,8 @@ export class BgBlog {
|
|
|
522
511
|
divCreate: {},
|
|
523
512
|
};
|
|
524
513
|
})),
|
|
525
|
-
].join('')}
|
|
514
|
+
].join('')}
|
|
515
|
+
`;
|
|
526
516
|
}
|
|
527
517
|
}
|
|
528
518
|
function editor(cf) {
|
|
@@ -567,7 +557,7 @@ function editor(cf) {
|
|
|
567
557
|
},
|
|
568
558
|
def: vm.data.content.collection || [],
|
|
569
559
|
},
|
|
570
|
-
})
|
|
560
|
+
}));
|
|
571
561
|
case 'detail':
|
|
572
562
|
return detail(gvc, cf, vm, cVm, cf.page_tab);
|
|
573
563
|
case 'template':
|
|
@@ -578,7 +568,7 @@ function editor(cf) {
|
|
|
578
568
|
},
|
|
579
569
|
divCreate: {},
|
|
580
570
|
};
|
|
581
|
-
})
|
|
571
|
+
}));
|
|
582
572
|
}
|
|
583
573
|
function detail(gvc, cf, vm, cVm, page_tab) {
|
|
584
574
|
vm.data.content.tag = vm.data.content.tag || `${new Date().getTime()}`;
|
|
@@ -605,7 +595,7 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
605
595
|
})()
|
|
606
596
|
: 'blogs'}`;
|
|
607
597
|
return html `
|
|
608
|
-
<div class="
|
|
598
|
+
<div class="title-container">
|
|
609
599
|
${BgWidget.goBack(gvc.event(() => {
|
|
610
600
|
window.parent.glitter.setUrlParameter('page-id', undefined);
|
|
611
601
|
vm.type = 'list';
|
|
@@ -635,462 +625,420 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
635
625
|
}))}
|
|
636
626
|
</div>
|
|
637
627
|
</div>
|
|
638
|
-
${BgWidget.
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
return {
|
|
648
|
-
bind: id,
|
|
649
|
-
view: () => {
|
|
650
|
-
return [
|
|
651
|
-
BgWidget.mainCard((() => {
|
|
652
|
-
var _a;
|
|
653
|
-
const prefixURL = `https://${window.parent.glitter.share.editorViewModel.domain}/${cf.is_page
|
|
654
|
-
? (() => {
|
|
655
|
-
switch (page_tab) {
|
|
656
|
-
case 'shopping':
|
|
657
|
-
return 'shop';
|
|
658
|
-
case 'hidden':
|
|
659
|
-
return 'hidden';
|
|
660
|
-
case 'page':
|
|
661
|
-
return 'pages';
|
|
662
|
-
default:
|
|
663
|
-
return '';
|
|
664
|
-
}
|
|
665
|
-
})()
|
|
666
|
-
: 'blogs'}/`;
|
|
628
|
+
${BgWidget.container1x2({
|
|
629
|
+
html: [
|
|
630
|
+
gvc.bindView(() => {
|
|
631
|
+
var _a;
|
|
632
|
+
vm.data.status = (_a = vm.data.status) !== null && _a !== void 0 ? _a : 1;
|
|
633
|
+
const id = gvc.glitter.getUUID();
|
|
634
|
+
return {
|
|
635
|
+
bind: id,
|
|
636
|
+
view: () => {
|
|
667
637
|
return [
|
|
668
|
-
BgWidget.
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
},
|
|
685
|
-
}),
|
|
686
|
-
html `
|
|
687
|
-
<div>
|
|
688
|
-
<div class="tx_normal fw-normal mb-2">
|
|
689
|
-
自訂網址
|
|
690
|
-
</div>
|
|
691
|
-
<div
|
|
692
|
-
style="justify-content: flex-start; align-items: center; display: inline-flex;border:1px solid #EAEAEA;border-radius: 10px;overflow: hidden; ${document
|
|
693
|
-
.body.clientWidth > 768
|
|
694
|
-
? 'gap: 18px; '
|
|
695
|
-
: 'flex-direction: column; gap: 0px; '}"
|
|
696
|
-
class="w-100"
|
|
697
|
-
>
|
|
698
|
-
<div class="${document.body.clientWidth > 768 ? `` : `w-100`}"
|
|
699
|
-
style="padding: 9px 18px;background: #EAEAEA ;${document.body.clientWidth > 768 ? `justify-content: center;` : `justify-content: start;`} align-items: center; gap: 5px; display: flex">
|
|
700
|
-
<div style="text-align: right; color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
|
|
701
|
-
${prefixURL}
|
|
702
|
-
</div>
|
|
703
|
-
</div>
|
|
704
|
-
<input
|
|
705
|
-
class="flex-fill"
|
|
706
|
-
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
|
|
707
|
-
.body.clientWidth > 768
|
|
708
|
-
? ''
|
|
709
|
-
: 'padding: 9px 18px;'}"
|
|
710
|
-
value="${vm.data.content.tag || ''}"
|
|
711
|
-
onchange="${gvc.event((e) => {
|
|
712
|
-
let text = e.value;
|
|
713
|
-
if (!CheckInput.isEnglishNumberHyphen(text)) {
|
|
714
|
-
const dialog = new ShareDialog(gvc.glitter);
|
|
715
|
-
dialog.infoMessage({ text: '僅能輸入英文或數字與連接號' });
|
|
716
|
-
gvc.notifyDataChange(id);
|
|
717
|
-
}
|
|
718
|
-
else {
|
|
719
|
-
vm.data.content.tag = text;
|
|
720
|
-
gvc.notifyDataChange(id);
|
|
721
|
-
}
|
|
722
|
-
})}"
|
|
723
|
-
/>
|
|
724
|
-
</div>
|
|
725
|
-
</div>`,
|
|
726
|
-
html `
|
|
727
|
-
<div class="mt-2 mb-1"><span
|
|
728
|
-
class="tx_normal me-2">網址預覽</span>${BgWidget.greenNote(prefixURL + ((_a = vm.data.content.tag) !== null && _a !== void 0 ? _a : ''))}
|
|
729
|
-
</div>`,
|
|
730
|
-
...(() => {
|
|
638
|
+
BgWidget.mainCard((() => {
|
|
639
|
+
var _a;
|
|
640
|
+
const prefixURL = `https://${window.parent.glitter.share.editorViewModel.domain}/${cf.is_page
|
|
641
|
+
? (() => {
|
|
642
|
+
switch (page_tab) {
|
|
643
|
+
case 'shopping':
|
|
644
|
+
return 'shop';
|
|
645
|
+
case 'hidden':
|
|
646
|
+
return 'hidden';
|
|
647
|
+
case 'page':
|
|
648
|
+
return 'pages';
|
|
649
|
+
default:
|
|
650
|
+
return '';
|
|
651
|
+
}
|
|
652
|
+
})()
|
|
653
|
+
: 'blogs'}/`;
|
|
731
654
|
return [
|
|
655
|
+
BgWidget.title('基本設定', 'font-size: 16px;'),
|
|
656
|
+
html ` <div style="display: flex; align-items: center; gap: 4px; margin: 18px 0;">
|
|
657
|
+
<div class="tx_normal">網頁啟用</div>
|
|
658
|
+
${BgWidget.switchButton(gvc, vm.data.status, (bool) => {
|
|
659
|
+
vm.data.status = bool ? 1 : 0;
|
|
660
|
+
gvc.notifyDataChange(id);
|
|
661
|
+
})}
|
|
662
|
+
</div>`,
|
|
732
663
|
BgWidget.editeInput({
|
|
733
664
|
gvc: gvc,
|
|
734
|
-
title: '
|
|
735
|
-
default: vm.data.content.
|
|
736
|
-
placeHolder:
|
|
665
|
+
title: '網頁名稱',
|
|
666
|
+
default: vm.data.content.name || '',
|
|
667
|
+
placeHolder: '請輸入網頁名稱',
|
|
737
668
|
callback: (text) => {
|
|
738
|
-
vm.data.content.
|
|
739
|
-
vm.data.content.seo.title = text;
|
|
740
|
-
gvc.notifyDataChange(id);
|
|
669
|
+
vm.data.content.name = text;
|
|
741
670
|
},
|
|
742
671
|
}),
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
672
|
+
html ` <div>
|
|
673
|
+
<div class="tx_normal fw-normal mb-2">自訂網址</div>
|
|
674
|
+
<div
|
|
675
|
+
style="justify-content: flex-start; align-items: center; display: inline-flex;border:1px solid #EAEAEA;border-radius: 10px;overflow: hidden; ${document
|
|
676
|
+
.body.clientWidth > 768
|
|
677
|
+
? 'gap: 18px; '
|
|
678
|
+
: 'flex-direction: column; gap: 0px; '}"
|
|
679
|
+
class="w-100"
|
|
680
|
+
>
|
|
681
|
+
<div style="width:100%;padding: 9px 18px;background: #EAEAEA; justify-content: flex-start; align-items: center; gap: 5px; display: flex">
|
|
682
|
+
<div style="text-align: right; color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
|
|
683
|
+
${prefixURL}
|
|
684
|
+
</div>
|
|
685
|
+
</div>
|
|
686
|
+
<input
|
|
687
|
+
class="flex-fill"
|
|
688
|
+
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
|
|
689
|
+
.body.clientWidth > 768
|
|
690
|
+
? ''
|
|
691
|
+
: 'padding: 9px 18px;'}"
|
|
692
|
+
value="${vm.data.content.tag || ''}"
|
|
693
|
+
onchange="${gvc.event((e) => {
|
|
694
|
+
let text = e.value;
|
|
695
|
+
if (!CheckInput.isEnglishNumberHyphen(text)) {
|
|
696
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
697
|
+
dialog.infoMessage({ text: '僅能輸入英文或數字與連接號' });
|
|
751
698
|
gvc.notifyDataChange(id);
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
})}
|
|
766
|
-
</div>`,
|
|
767
|
-
,
|
|
768
|
-
];
|
|
769
|
-
})(),
|
|
770
|
-
...(() => {
|
|
771
|
-
var _a;
|
|
772
|
-
if (`${vm.data.content.for_index}` === 'true') {
|
|
773
|
-
return [
|
|
774
|
-
[
|
|
775
|
-
html `
|
|
776
|
-
<div class="tx_normal my-3">
|
|
777
|
-
網誌內文
|
|
778
|
-
</div>`,
|
|
779
|
-
EditorElem.richText({
|
|
699
|
+
}
|
|
700
|
+
else {
|
|
701
|
+
vm.data.content.tag = text;
|
|
702
|
+
gvc.notifyDataChange(id);
|
|
703
|
+
}
|
|
704
|
+
})}"
|
|
705
|
+
/>
|
|
706
|
+
</div>
|
|
707
|
+
</div>`,
|
|
708
|
+
html ` <div class="mt-2 mb-1"><span class="tx_normal me-2">網址預覽</span>${BgWidget.greenNote(prefixURL + ((_a = vm.data.content.tag) !== null && _a !== void 0 ? _a : ''))}</div>`,
|
|
709
|
+
...(() => {
|
|
710
|
+
return [
|
|
711
|
+
BgWidget.editeInput({
|
|
780
712
|
gvc: gvc,
|
|
781
|
-
|
|
713
|
+
title: 'SEO標題',
|
|
714
|
+
default: vm.data.content.seo.title,
|
|
715
|
+
placeHolder: `請輸入SEO標題`,
|
|
782
716
|
callback: (text) => {
|
|
783
|
-
vm.data.content.
|
|
717
|
+
vm.data.content.title = text;
|
|
718
|
+
vm.data.content.seo.title = text;
|
|
719
|
+
gvc.notifyDataChange(id);
|
|
784
720
|
},
|
|
785
721
|
}),
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
722
|
+
BgWidget.textArea({
|
|
723
|
+
gvc: gvc,
|
|
724
|
+
title: 'SEO描述',
|
|
725
|
+
default: vm.data.content.seo.content,
|
|
726
|
+
placeHolder: `請輸入中繼描述`,
|
|
727
|
+
callback: (text) => {
|
|
728
|
+
vm.data.content.description = text;
|
|
729
|
+
vm.data.content.seo.content = text;
|
|
730
|
+
gvc.notifyDataChange(id);
|
|
731
|
+
},
|
|
732
|
+
}),
|
|
733
|
+
html ` <div>
|
|
734
|
+
<div class="tx_normal">社群分享縮圖</div>
|
|
735
|
+
<div class="mt-1 mb-2">${BgWidget.grayNote('建議尺寸為 200px * 200px 以上')}</div>
|
|
736
|
+
${BgWidget.imageSelector(gvc, vm.data.content.seo.image || '', (text) => {
|
|
737
|
+
vm.data.content.seo.image = text;
|
|
738
|
+
gvc.notifyDataChange(id);
|
|
739
|
+
})}
|
|
740
|
+
</div>`,
|
|
741
|
+
,
|
|
742
|
+
];
|
|
743
|
+
})(),
|
|
744
|
+
...(() => {
|
|
745
|
+
var _a;
|
|
746
|
+
if (`${vm.data.content.for_index}` === 'true') {
|
|
747
|
+
return [
|
|
748
|
+
[
|
|
749
|
+
html `<div class="tx_normal my-3">網誌內文</div>`,
|
|
750
|
+
EditorElem.richText({
|
|
751
|
+
gvc: gvc,
|
|
752
|
+
def: (_a = vm.data.content.text) !== null && _a !== void 0 ? _a : '',
|
|
753
|
+
callback: (text) => {
|
|
754
|
+
vm.data.content.text = text;
|
|
755
|
+
},
|
|
756
|
+
}),
|
|
757
|
+
].join(BgWidget.mbContainer(12)),
|
|
758
|
+
];
|
|
759
|
+
}
|
|
760
|
+
else {
|
|
761
|
+
return [];
|
|
762
|
+
}
|
|
763
|
+
})(),
|
|
764
|
+
].join(BgWidget.mbContainer(12));
|
|
765
|
+
})()),
|
|
766
|
+
].join('');
|
|
767
|
+
},
|
|
768
|
+
divCreate: {
|
|
769
|
+
style: 'padding: 0;',
|
|
770
|
+
},
|
|
771
|
+
};
|
|
772
|
+
}),
|
|
773
|
+
(() => {
|
|
774
|
+
vm.data.content.relative = vm.data.content.relative || 'collection';
|
|
775
|
+
vm.data.content.relative_data = vm.data.content.relative_data || [];
|
|
776
|
+
vm.data.content.with_discount = vm.data.content.with_discount || 'false';
|
|
777
|
+
return gvc.bindView(() => {
|
|
778
|
+
const id = gvc.glitter.getUUID();
|
|
779
|
+
return {
|
|
780
|
+
bind: id,
|
|
781
|
+
view: () => {
|
|
782
|
+
if (vm.data.content.page_type === 'hidden' || vm.data.content.page_type === 'shopping') {
|
|
783
|
+
return [
|
|
784
|
+
BgWidget.mbContainer(24),
|
|
785
|
+
BgWidget.mainCard([
|
|
786
|
+
BgWidget.title(html `預設加入購物車
|
|
787
|
+
<div class="badge ms-2" style="background:#eaeaea;color:#393939;">以下設定的商品會自動加入購物車</div>`, 'font-size: 16px;'),
|
|
788
|
+
html `<div class="my-2"></div>`,
|
|
789
|
+
[
|
|
790
|
+
html `${(() => {
|
|
791
|
+
return gvc.bindView(() => {
|
|
792
|
+
const subVM = {
|
|
793
|
+
id: gvc.glitter.getUUID(),
|
|
794
|
+
loading: true,
|
|
795
|
+
dataList: [],
|
|
796
|
+
};
|
|
797
|
+
return {
|
|
798
|
+
bind: subVM.id,
|
|
799
|
+
view: () => {
|
|
800
|
+
if (subVM.loading) {
|
|
801
|
+
return BgWidget.spinner();
|
|
802
|
+
}
|
|
803
|
+
return html `
|
|
804
|
+
<div class="d-flex flex-column p-2" style="gap: 18px;">
|
|
805
|
+
<div class="d-flex align-items-center gray-bottom-line-18 " style="gap: 24px; justify-content: space-between;">
|
|
806
|
+
<div class="form-check-label c_updown_label">
|
|
807
|
+
<div class="tx_normal">產品列表</div>
|
|
808
|
+
</div>
|
|
809
|
+
${BgWidget.grayButton('搜尋商品', gvc.event(() => {
|
|
810
|
+
BgProduct.variantsSelector({
|
|
811
|
+
gvc: gvc,
|
|
812
|
+
filter_variants: vm.data.content.relative_data.map((dd) => {
|
|
813
|
+
return [dd.product_id].concat(dd.variant.spec).join('-');
|
|
814
|
+
}),
|
|
815
|
+
callback: (value) => __awaiter(this, void 0, void 0, function* () {
|
|
816
|
+
vm.data.content.relative_data = value.map((dd) => {
|
|
817
|
+
return {
|
|
818
|
+
variant: dd.variant_content,
|
|
819
|
+
product_id: dd.product_id,
|
|
820
|
+
};
|
|
821
|
+
});
|
|
822
|
+
subVM.loading = true;
|
|
823
|
+
gvc.notifyDataChange(subVM.id);
|
|
824
|
+
}),
|
|
825
|
+
});
|
|
826
|
+
}), { textStyle: 'font-weight: 400;' })}
|
|
827
|
+
</div>
|
|
828
|
+
${subVM.dataList
|
|
829
|
+
.map((opt, index) => {
|
|
830
|
+
return html `
|
|
831
|
+
<div class="d-flex align-items-center form-check-label c_updown_label gap-3">
|
|
832
|
+
<span class="tx_normal" style="min-width: 20px;">${index + 1} .</span>
|
|
833
|
+
${BgWidget.validImageBox({ gvc: gvc, image: opt.image, width: 40 })}
|
|
834
|
+
<div class="tx_normal ${opt.note ? 'mb-1' : ''} d-flex flex-column">
|
|
835
|
+
${opt.value} ${opt.note ? html ` <div class="tx_gray_12">${opt.note}</div> ` : ''}
|
|
836
|
+
</div>
|
|
837
|
+
<div class="flex-fill"></div>
|
|
838
|
+
${BgWidget.cancel(gvc.event(() => {
|
|
839
|
+
vm.data.content.relative_data.splice(index, 1);
|
|
840
|
+
subVM.dataList.splice(index, 1);
|
|
841
|
+
gvc.notifyDataChange(subVM.id);
|
|
842
|
+
}), '移除')}
|
|
843
|
+
</div>
|
|
844
|
+
`;
|
|
845
|
+
})
|
|
846
|
+
.join('') || `<div class="w-100 d-flex align-content-center justify-content-center">尚未加入任何賣場商品</div>`}
|
|
847
|
+
</div>
|
|
848
|
+
`;
|
|
849
|
+
},
|
|
850
|
+
onCreate: () => {
|
|
851
|
+
if (subVM.loading) {
|
|
852
|
+
if (vm.data.content.relative_data.length === 0) {
|
|
853
|
+
setTimeout(() => {
|
|
854
|
+
subVM.dataList = [];
|
|
855
|
+
subVM.loading = false;
|
|
856
|
+
gvc.notifyDataChange(subVM.id);
|
|
857
|
+
}, 300);
|
|
858
|
+
}
|
|
859
|
+
else {
|
|
860
|
+
new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
|
|
861
|
+
const products_data = yield BgProduct.getProductOpts(vm.data.content.relative_data.map((dd) => {
|
|
862
|
+
return dd.product_id;
|
|
863
|
+
}));
|
|
864
|
+
vm.data.content.relative_data = vm.data.content.relative_data.filter((dd) => {
|
|
865
|
+
return products_data.find((d1) => {
|
|
866
|
+
return `${dd.product_id}` === `${d1.key}`;
|
|
867
|
+
});
|
|
868
|
+
});
|
|
869
|
+
subVM.dataList = vm.data.content.relative_data.map((dd) => {
|
|
870
|
+
const product = JSON.parse(JSON.stringify(products_data.find((d1) => {
|
|
871
|
+
return `${dd.product_id}` === `${d1.key}`;
|
|
872
|
+
})));
|
|
873
|
+
product.note = dd.variant.spec.join(' / ');
|
|
874
|
+
return product;
|
|
875
|
+
});
|
|
876
|
+
resolve(subVM.dataList);
|
|
877
|
+
})).then((data) => {
|
|
878
|
+
subVM.dataList = data;
|
|
879
|
+
subVM.loading = false;
|
|
880
|
+
gvc.notifyDataChange(subVM.id);
|
|
881
|
+
});
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
},
|
|
885
|
+
};
|
|
886
|
+
});
|
|
887
|
+
})()}`,
|
|
888
|
+
].join(''),
|
|
889
|
+
].join('')),
|
|
890
|
+
].join('');
|
|
891
|
+
}
|
|
892
|
+
else {
|
|
893
|
+
return [].join('');
|
|
894
|
+
}
|
|
895
|
+
},
|
|
896
|
+
};
|
|
897
|
+
});
|
|
898
|
+
})(),
|
|
899
|
+
].join(''),
|
|
900
|
+
ratio: 75,
|
|
901
|
+
}, {
|
|
902
|
+
html: BgWidget.summaryCard(gvc.bindView(() => {
|
|
903
|
+
var _a;
|
|
904
|
+
console.log(`vm.data.content.template=>`, vm.data.content.template);
|
|
807
905
|
const id = gvc.glitter.getUUID();
|
|
906
|
+
vm.data.status = (_a = vm.data.status) !== null && _a !== void 0 ? _a : '1';
|
|
808
907
|
return {
|
|
809
908
|
bind: id,
|
|
810
909
|
view: () => {
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
if (subVM.loading) {
|
|
833
|
-
return BgWidget.spinner();
|
|
834
|
-
}
|
|
835
|
-
return html `
|
|
836
|
-
<div class="d-flex flex-column p-2"
|
|
837
|
-
style="gap: 18px;">
|
|
838
|
-
<div class="d-flex align-items-center gray-bottom-line-18 "
|
|
839
|
-
style="gap: 24px; justify-content: space-between;">
|
|
840
|
-
<div class="form-check-label c_updown_label">
|
|
841
|
-
<div class="tx_normal">
|
|
842
|
-
產品列表
|
|
843
|
-
</div>
|
|
844
|
-
</div>
|
|
845
|
-
${BgWidget.grayButton('搜尋商品', gvc.event(() => {
|
|
846
|
-
BgProduct.variantsSelector({
|
|
847
|
-
gvc: gvc,
|
|
848
|
-
filter_variants: vm.data.content.relative_data.map((dd) => {
|
|
849
|
-
return [dd.product_id].concat(dd.variant.spec).join('-');
|
|
850
|
-
}),
|
|
851
|
-
callback: (value) => __awaiter(this, void 0, void 0, function* () {
|
|
852
|
-
vm.data.content.relative_data = value.map((dd) => {
|
|
853
|
-
return {
|
|
854
|
-
variant: dd.variant_content,
|
|
855
|
-
product_id: dd.product_id,
|
|
856
|
-
};
|
|
857
|
-
});
|
|
858
|
-
subVM.loading = true;
|
|
859
|
-
gvc.notifyDataChange(subVM.id);
|
|
860
|
-
}),
|
|
861
|
-
});
|
|
862
|
-
}), { textStyle: 'font-weight: 400;' })}
|
|
863
|
-
</div>
|
|
864
|
-
${subVM.dataList
|
|
865
|
-
.map((opt, index) => {
|
|
866
|
-
return html `
|
|
867
|
-
<div class="d-flex align-items-center form-check-label c_updown_label gap-3">
|
|
868
|
-
<span class="tx_normal"
|
|
869
|
-
style="min-width: 20px;">${index + 1} .</span>
|
|
870
|
-
${BgWidget.validImageBox({
|
|
871
|
-
gvc: gvc,
|
|
872
|
-
image: opt.image,
|
|
873
|
-
width: 40
|
|
874
|
-
})}
|
|
875
|
-
<div class="tx_normal ${opt.note ? 'mb-1' : ''} d-flex flex-column">
|
|
876
|
-
${opt.value}
|
|
877
|
-
${opt.note ? html `
|
|
878
|
-
<div class="tx_gray_12">
|
|
879
|
-
${opt.note}
|
|
880
|
-
</div> ` : ''}
|
|
881
|
-
</div>
|
|
882
|
-
<div class="flex-fill"></div>
|
|
883
|
-
${BgWidget.cancel(gvc.event(() => {
|
|
884
|
-
vm.data.content.relative_data.splice(index, 1);
|
|
885
|
-
subVM.dataList.splice(index, 1);
|
|
886
|
-
gvc.notifyDataChange(subVM.id);
|
|
887
|
-
}), '移除')}
|
|
888
|
-
</div>
|
|
889
|
-
`;
|
|
890
|
-
})
|
|
891
|
-
.join('') || `<div class="w-100 d-flex align-content-center justify-content-center">尚未加入任何賣場商品</div>`}
|
|
892
|
-
</div>
|
|
893
|
-
`;
|
|
894
|
-
},
|
|
895
|
-
onCreate: () => {
|
|
896
|
-
if (subVM.loading) {
|
|
897
|
-
if (vm.data.content.relative_data.length === 0) {
|
|
898
|
-
setTimeout(() => {
|
|
899
|
-
subVM.dataList = [];
|
|
900
|
-
subVM.loading = false;
|
|
901
|
-
gvc.notifyDataChange(subVM.id);
|
|
902
|
-
}, 300);
|
|
903
|
-
}
|
|
904
|
-
else {
|
|
905
|
-
new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
|
|
906
|
-
const products_data = yield BgProduct.getProductOpts(vm.data.content.relative_data.map((dd) => {
|
|
907
|
-
return dd.product_id;
|
|
908
|
-
}));
|
|
909
|
-
vm.data.content.relative_data = vm.data.content.relative_data.filter((dd) => {
|
|
910
|
-
return products_data.find((d1) => {
|
|
911
|
-
return `${dd.product_id}` === `${d1.key}`;
|
|
912
|
-
});
|
|
913
|
-
});
|
|
914
|
-
subVM.dataList = vm.data.content.relative_data.map((dd) => {
|
|
915
|
-
const product = JSON.parse(JSON.stringify(products_data.find((d1) => {
|
|
916
|
-
return `${dd.product_id}` === `${d1.key}`;
|
|
917
|
-
})));
|
|
918
|
-
product.note = dd.variant.spec.join(' / ');
|
|
919
|
-
return product;
|
|
920
|
-
});
|
|
921
|
-
resolve(subVM.dataList);
|
|
922
|
-
})).then((data) => {
|
|
923
|
-
subVM.dataList = data;
|
|
924
|
-
subVM.loading = false;
|
|
925
|
-
gvc.notifyDataChange(subVM.id);
|
|
926
|
-
});
|
|
927
|
-
}
|
|
928
|
-
}
|
|
929
|
-
},
|
|
930
|
-
};
|
|
931
|
-
});
|
|
932
|
-
})()}`,
|
|
933
|
-
].join(''),
|
|
934
|
-
].join('')),
|
|
935
|
-
].join('');
|
|
936
|
-
}
|
|
937
|
-
else {
|
|
938
|
-
return [].join('');
|
|
939
|
-
}
|
|
940
|
-
},
|
|
941
|
-
divCreate: {
|
|
942
|
-
class: `w-100 mt-2`,
|
|
943
|
-
},
|
|
944
|
-
};
|
|
945
|
-
});
|
|
946
|
-
})()}
|
|
947
|
-
</div>
|
|
948
|
-
${BgWidget.container(BgWidget.mainCard(gvc.bindView(() => {
|
|
949
|
-
var _a;
|
|
950
|
-
console.log(`vm.data.content.template=>`, vm.data.content.template);
|
|
951
|
-
const id = gvc.glitter.getUUID();
|
|
952
|
-
vm.data.status = (_a = vm.data.status) !== null && _a !== void 0 ? _a : '1';
|
|
953
|
-
return {
|
|
954
|
-
bind: id,
|
|
955
|
-
view: () => {
|
|
956
|
-
var _a;
|
|
957
|
-
return [
|
|
958
|
-
cf.is_page
|
|
959
|
-
? ``
|
|
960
|
-
: EditorElem.select({
|
|
961
|
-
title: '啟用狀態',
|
|
962
|
-
gvc: gvc,
|
|
963
|
-
def: `${vm.data.status}`,
|
|
964
|
-
array: [
|
|
965
|
-
{
|
|
966
|
-
title: '啟用',
|
|
967
|
-
value: '1',
|
|
968
|
-
},
|
|
969
|
-
{
|
|
970
|
-
title: '隱藏',
|
|
971
|
-
value: '0',
|
|
910
|
+
var _a;
|
|
911
|
+
return [
|
|
912
|
+
cf.is_page
|
|
913
|
+
? ``
|
|
914
|
+
: EditorElem.select({
|
|
915
|
+
title: '啟用狀態',
|
|
916
|
+
gvc: gvc,
|
|
917
|
+
def: `${vm.data.status}`,
|
|
918
|
+
array: [
|
|
919
|
+
{
|
|
920
|
+
title: '啟用',
|
|
921
|
+
value: '1',
|
|
922
|
+
},
|
|
923
|
+
{
|
|
924
|
+
title: '隱藏',
|
|
925
|
+
value: '0',
|
|
926
|
+
},
|
|
927
|
+
],
|
|
928
|
+
callback: (text) => {
|
|
929
|
+
vm.data.status = text;
|
|
930
|
+
gvc.notifyDataChange(id);
|
|
972
931
|
},
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
932
|
+
}),
|
|
933
|
+
EditorElem.pageSelect(gvc, '選擇佈景主題', (_a = vm.data.content.template) !== null && _a !== void 0 ? _a : '', (data) => {
|
|
934
|
+
vm.data.content.template = data;
|
|
935
|
+
}, (dd) => {
|
|
936
|
+
const filter_result = dd.group !== 'glitter-article' && dd.page_type === 'article' && dd.page_config.template_type === 'blog';
|
|
937
|
+
if (filter_result && !vm.data.content.template) {
|
|
938
|
+
vm.data.content.template = dd.tag;
|
|
976
939
|
gvc.notifyDataChange(id);
|
|
940
|
+
}
|
|
941
|
+
return filter_result;
|
|
942
|
+
}),
|
|
943
|
+
EditorElem.editeInput({
|
|
944
|
+
gvc: gvc,
|
|
945
|
+
title: '作者名稱',
|
|
946
|
+
default: vm.data.content.author,
|
|
947
|
+
placeHolder: '請輸入作者名稱',
|
|
948
|
+
callback: (text) => {
|
|
949
|
+
vm.data.content.author = text;
|
|
977
950
|
},
|
|
978
951
|
}),
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
if (cf.is_page) {
|
|
1005
|
-
return ``;
|
|
1006
|
-
}
|
|
1007
|
-
vm.data.content.collection = (_a = vm.data.content.collection) !== null && _a !== void 0 ? _a : [];
|
|
1008
|
-
return [
|
|
1009
|
-
html `
|
|
1010
|
-
<div class="d-flex align-items-center my-3"
|
|
1011
|
-
style="gap: 10px;">
|
|
1012
|
-
${EditorElem.h3('預覽圖')}
|
|
1013
|
-
${BgWidget.grayButton('添加檔案', gvc.event(() => {
|
|
1014
|
-
EditorElem.uploadFileFunction({
|
|
952
|
+
gvc.bindView(() => {
|
|
953
|
+
const id = gvc.glitter.getUUID();
|
|
954
|
+
return {
|
|
955
|
+
bind: id,
|
|
956
|
+
view: () => {
|
|
957
|
+
var _a;
|
|
958
|
+
if (cf.is_page) {
|
|
959
|
+
return ``;
|
|
960
|
+
}
|
|
961
|
+
vm.data.content.collection = (_a = vm.data.content.collection) !== null && _a !== void 0 ? _a : [];
|
|
962
|
+
return [
|
|
963
|
+
html ` <div class="d-flex align-items-center my-3" style="gap: 10px;">
|
|
964
|
+
${EditorElem.h3('預覽圖')}
|
|
965
|
+
${BgWidget.grayButton('添加檔案', gvc.event(() => {
|
|
966
|
+
EditorElem.uploadFileFunction({
|
|
967
|
+
gvc: gvc,
|
|
968
|
+
callback: (text) => {
|
|
969
|
+
vm.data.content.preview_image = text;
|
|
970
|
+
gvc.notifyDataChange(id);
|
|
971
|
+
},
|
|
972
|
+
type: `image/*, video/*`,
|
|
973
|
+
});
|
|
974
|
+
}))}
|
|
975
|
+
</div>`,
|
|
976
|
+
EditorElem.flexMediaManager({
|
|
1015
977
|
gvc: gvc,
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
ApiUser.getPublicConfig('blog_collection', 'manager').then((data) => {
|
|
1038
|
-
if (data.response.value) {
|
|
1039
|
-
vm.link = data.response.value;
|
|
1040
|
-
function setCheck(link) {
|
|
1041
|
-
link.map((dd) => {
|
|
1042
|
-
const it = vm.data.content.collection.find((d1) => {
|
|
1043
|
-
return d1 === dd.link;
|
|
978
|
+
data: vm.data.content.preview_image ? [vm.data.content.preview_image] : [],
|
|
979
|
+
}),
|
|
980
|
+
(() => {
|
|
981
|
+
if (cf.is_page) {
|
|
982
|
+
return ``;
|
|
983
|
+
}
|
|
984
|
+
return html `
|
|
985
|
+
${EditorElem.h3('文章分類')}
|
|
986
|
+
${gvc.bindView(() => {
|
|
987
|
+
const tagID = gvc.glitter.getUUID();
|
|
988
|
+
let listTag = [];
|
|
989
|
+
ApiUser.getPublicConfig('blog_collection', 'manager').then((data) => {
|
|
990
|
+
if (data.response.value) {
|
|
991
|
+
vm.link = data.response.value;
|
|
992
|
+
function setCheck(link) {
|
|
993
|
+
link.map((dd) => {
|
|
994
|
+
const it = vm.data.content.collection.find((d1) => {
|
|
995
|
+
return d1 === dd.link;
|
|
996
|
+
});
|
|
997
|
+
it && listTag.push(dd.title);
|
|
998
|
+
setCheck(dd.items);
|
|
1044
999
|
});
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1000
|
+
}
|
|
1001
|
+
setCheck(vm.link);
|
|
1002
|
+
gvc.notifyDataChange(tagID);
|
|
1048
1003
|
}
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
})
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
}),
|
|
1088
|
-
].join('');
|
|
1089
|
-
},
|
|
1090
|
-
};
|
|
1091
|
-
})), undefined, 'padding: 0 !important; margin: 0 !important; width: 26.5%;')}
|
|
1092
|
-
</div>
|
|
1093
|
-
`, undefined, 'padding: 0 !important;')}
|
|
1004
|
+
});
|
|
1005
|
+
return {
|
|
1006
|
+
bind: tagID,
|
|
1007
|
+
view: () => {
|
|
1008
|
+
return listTag
|
|
1009
|
+
.map((dd) => {
|
|
1010
|
+
return html ` <div class="badge bg_orange mt-2 me-2 fs-sm">${dd}</div>`;
|
|
1011
|
+
})
|
|
1012
|
+
.join('');
|
|
1013
|
+
},
|
|
1014
|
+
divCreate: {
|
|
1015
|
+
class: `d-flex flex-wrap`,
|
|
1016
|
+
},
|
|
1017
|
+
};
|
|
1018
|
+
})}
|
|
1019
|
+
<div
|
|
1020
|
+
class="cursor_pointer bt_c39 ms-2 p-1 mt-3"
|
|
1021
|
+
onclick="${gvc.event(() => {
|
|
1022
|
+
cVm.type = 'collection';
|
|
1023
|
+
gvc.notifyDataChange(cVm.id);
|
|
1024
|
+
})}"
|
|
1025
|
+
>
|
|
1026
|
+
<i class="fa-solid fa-plus me-2" aria-hidden="true"></i>
|
|
1027
|
+
添加與編輯分類
|
|
1028
|
+
</div>
|
|
1029
|
+
`;
|
|
1030
|
+
})(),
|
|
1031
|
+
].join(`<div class="my-2"></div>`);
|
|
1032
|
+
},
|
|
1033
|
+
divCreate: {},
|
|
1034
|
+
};
|
|
1035
|
+
}),
|
|
1036
|
+
].join('');
|
|
1037
|
+
},
|
|
1038
|
+
};
|
|
1039
|
+
})),
|
|
1040
|
+
ratio: 25,
|
|
1041
|
+
})}
|
|
1094
1042
|
${BgWidget.mbContainer(240)}
|
|
1095
1043
|
<div class="update-bar-container">
|
|
1096
1044
|
${vm.data.id
|
|
@@ -1364,48 +1312,46 @@ function setCollection(cf) {
|
|
|
1364
1312
|
return {
|
|
1365
1313
|
bind: vm.id,
|
|
1366
1314
|
view: () => {
|
|
1367
|
-
return html `
|
|
1368
|
-
|
|
1369
|
-
${BgWidget.goBack(cf.gvc.event(() => {
|
|
1315
|
+
return html ` <div class="title-container">
|
|
1316
|
+
${BgWidget.goBack(cf.gvc.event(() => {
|
|
1370
1317
|
cf.goBack();
|
|
1371
1318
|
}))}${BgWidget.title('分類設定')}
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1319
|
+
</div>
|
|
1320
|
+
<div
|
|
1321
|
+
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"
|
|
1322
|
+
>
|
|
1323
|
+
<div style="width: 100%; position: relative">
|
|
1324
|
+
<div style="width: 100%; left: 0px; top: 0px; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 20px; display: inline-flex">
|
|
1325
|
+
<div
|
|
1326
|
+
class="w-100 ${getSelectCount({
|
|
1380
1327
|
items: vm.link,
|
|
1381
1328
|
}) > 0
|
|
1382
1329
|
? ``
|
|
1383
1330
|
: `d-none`}"
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1331
|
+
style="height: 40px; padding: 12px 18px;background: #F7F7F7; border-radius: 10px; justify-content: flex-end; align-items: center; gap: 8px; display: inline-flex"
|
|
1332
|
+
>
|
|
1333
|
+
<div style="flex: 1 1 0; color: #393939; font-size: 14px; font-family: Noto Sans; font-weight: 700; word-wrap: break-word">
|
|
1334
|
+
已選取${getSelectCount({
|
|
1388
1335
|
items: vm.link,
|
|
1389
1336
|
})}項
|
|
1390
|
-
|
|
1337
|
+
</div>
|
|
1338
|
+
<div
|
|
1339
|
+
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"
|
|
1340
|
+
>
|
|
1391
1341
|
<div
|
|
1392
|
-
style="
|
|
1393
|
-
|
|
1394
|
-
<div
|
|
1395
|
-
style="color: #393939; font-size: 14px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word"
|
|
1396
|
-
onclick="${gvc.event(() => {
|
|
1342
|
+
style="color: #393939; font-size: 14px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word"
|
|
1343
|
+
onclick="${gvc.event(() => {
|
|
1397
1344
|
vm.link = deleteSelect(vm.link);
|
|
1398
1345
|
gvc.notifyDataChange(vm.id);
|
|
1399
1346
|
})}"
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
</div>
|
|
1347
|
+
>
|
|
1348
|
+
刪除
|
|
1403
1349
|
</div>
|
|
1404
1350
|
</div>
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1351
|
+
</div>
|
|
1352
|
+
<div class="d-flex align-items-center" style="width: 100%; height: 22px; position: relative;gap:29px;">
|
|
1353
|
+
<div
|
|
1354
|
+
class="${allSelect({
|
|
1409
1355
|
items: vm.link,
|
|
1410
1356
|
selected: !vm.link.find((dd) => {
|
|
1411
1357
|
return !dd.selected;
|
|
@@ -1413,8 +1359,8 @@ function setCollection(cf) {
|
|
|
1413
1359
|
})
|
|
1414
1360
|
? `fa-solid fa-square-check`
|
|
1415
1361
|
: `fa-regular fa-square`}"
|
|
1416
|
-
|
|
1417
|
-
|
|
1362
|
+
style="color:#393939;width: 16px; height: 16px;cursor: pointer;"
|
|
1363
|
+
onclick="${cf.gvc.event((e, event) => {
|
|
1418
1364
|
event.stopPropagation();
|
|
1419
1365
|
if (vm.link.find((dd) => {
|
|
1420
1366
|
return !dd.selected;
|
|
@@ -1430,13 +1376,11 @@ function setCollection(cf) {
|
|
|
1430
1376
|
}
|
|
1431
1377
|
gvc.notifyDataChange(vm.id);
|
|
1432
1378
|
})}"
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
<div style="align-self: stretch; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 18px; display: flex">
|
|
1439
|
-
${(() => {
|
|
1379
|
+
></div>
|
|
1380
|
+
<div style="left: 61px; top: 0px; color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 700; word-wrap: break-word">選單名稱</div>
|
|
1381
|
+
</div>
|
|
1382
|
+
<div style="align-self: stretch; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 18px; display: flex">
|
|
1383
|
+
${(() => {
|
|
1440
1384
|
function renderItems(array) {
|
|
1441
1385
|
const id = gvc.glitter.getUUID();
|
|
1442
1386
|
return (gvc.bindView(() => {
|
|
@@ -1447,20 +1391,20 @@ function setCollection(cf) {
|
|
|
1447
1391
|
.map((dd, index) => {
|
|
1448
1392
|
dd.items;
|
|
1449
1393
|
const list = html `
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1394
|
+
<div
|
|
1395
|
+
class=" w-100 "
|
|
1396
|
+
style="width: 100%; justify-content: flex-start; align-items: center; gap: 5px; display: inline-flex;cursor: pointer;"
|
|
1397
|
+
onclick="${cf.gvc.event(() => {
|
|
1454
1398
|
if (dd.items && dd.items.length > 0) {
|
|
1455
1399
|
dd.toggle = !dd.toggle;
|
|
1456
1400
|
gvc.notifyDataChange(vm.id);
|
|
1457
1401
|
}
|
|
1458
1402
|
})}"
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1403
|
+
>
|
|
1404
|
+
<div
|
|
1405
|
+
class="${allSelect(dd) ? `fa-solid fa-square-check` : `fa-regular fa-square`}"
|
|
1406
|
+
style="color:#393939;width: 16px; height: 16px;"
|
|
1407
|
+
onclick="${cf.gvc.event((e, event) => {
|
|
1464
1408
|
event.stopPropagation();
|
|
1465
1409
|
dd.selected = !dd.selected;
|
|
1466
1410
|
if (dd.selected) {
|
|
@@ -1471,39 +1415,38 @@ function setCollection(cf) {
|
|
|
1471
1415
|
}
|
|
1472
1416
|
gvc.notifyDataChange(vm.id);
|
|
1473
1417
|
})}"
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
<div style="
|
|
1482
|
-
<div style="
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
${dd.items && dd.items.length > 0
|
|
1418
|
+
></div>
|
|
1419
|
+
<div class="hoverF2 pe-2" style="width: 100%; justify-content: flex-start; align-items: center; gap: 8px; display: flex">
|
|
1420
|
+
<i
|
|
1421
|
+
class="ms-2 fa-solid fa-grip-dots-vertical color39 dragItem hoverBtn d-flex align-items-center justify-content-center"
|
|
1422
|
+
style="cursor: pointer;width:25px;height: 25px;"
|
|
1423
|
+
></i>
|
|
1424
|
+
<div style="flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px; display: inline-flex">
|
|
1425
|
+
<div style="justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex">
|
|
1426
|
+
<div style="color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
|
|
1427
|
+
${dd.title}
|
|
1428
|
+
</div>
|
|
1429
|
+
${dd.items && dd.items.length > 0
|
|
1487
1430
|
? !dd.toggle
|
|
1488
1431
|
? `<i class="fa-solid fa-angle-down color39"></i>`
|
|
1489
1432
|
: `<i class="fa-solid fa-angle-up color39"></i>`
|
|
1490
1433
|
: ``}
|
|
1434
|
+
</div>
|
|
1435
|
+
<div style="justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex">
|
|
1436
|
+
<div
|
|
1437
|
+
style="color: #3366BB; font-size: 14px; font-family: Noto Sans; font-weight: 400; line-height: 14px; word-wrap: break-word"
|
|
1438
|
+
>
|
|
1439
|
+
${dd.title}
|
|
1491
1440
|
</div>
|
|
1492
|
-
<div style="
|
|
1493
|
-
|
|
1494
|
-
style="color: #3366BB; font-size: 14px; font-family: Noto Sans; font-weight: 400; line-height: 14px; word-wrap: break-word"
|
|
1495
|
-
>
|
|
1496
|
-
${dd.title}
|
|
1497
|
-
</div>
|
|
1498
|
-
<div style="color: #159240; font-size: 14px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
|
|
1499
|
-
${dd.link}
|
|
1500
|
-
</div>
|
|
1441
|
+
<div style="color: #159240; font-size: 14px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
|
|
1442
|
+
${dd.link}
|
|
1501
1443
|
</div>
|
|
1502
1444
|
</div>
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1445
|
+
</div>
|
|
1446
|
+
<div class="flex-fill"></div>
|
|
1447
|
+
<div
|
|
1448
|
+
class="child me-2"
|
|
1449
|
+
onclick="${cf.gvc.event((e, event) => {
|
|
1507
1450
|
event.stopPropagation();
|
|
1508
1451
|
MenusSetting.collectionEvent({
|
|
1509
1452
|
link: '',
|
|
@@ -1522,13 +1465,12 @@ function setCollection(cf) {
|
|
|
1522
1465
|
}
|
|
1523
1466
|
});
|
|
1524
1467
|
})}"
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
onclick="${cf.gvc.event((e, event) => {
|
|
1468
|
+
>
|
|
1469
|
+
<i class="fa-solid fa-plus" style="color:#393939;"></i>
|
|
1470
|
+
</div>
|
|
1471
|
+
<div
|
|
1472
|
+
class="child"
|
|
1473
|
+
onclick="${cf.gvc.event((e, event) => {
|
|
1532
1474
|
event.stopPropagation();
|
|
1533
1475
|
const og = JSON.parse(JSON.stringify(dd));
|
|
1534
1476
|
MenusSetting.collectionEvent(dd, (data) => {
|
|
@@ -1544,23 +1486,20 @@ function setCollection(cf) {
|
|
|
1544
1486
|
}
|
|
1545
1487
|
});
|
|
1546
1488
|
})}"
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
style="color:#393939;"></i>
|
|
1550
|
-
</div>
|
|
1489
|
+
>
|
|
1490
|
+
<i class="fa-solid fa-pencil" style="color:#393939;"></i>
|
|
1551
1491
|
</div>
|
|
1552
1492
|
</div>
|
|
1553
|
-
|
|
1493
|
+
</div>
|
|
1494
|
+
${dd.items && dd.items.length > 0
|
|
1554
1495
|
? html `
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
`
|
|
1496
|
+
<div class=" w-100 ${dd.toggle ? `` : `d-none`}" style="padding-left: 35px;">
|
|
1497
|
+
${renderItems(dd.items)}
|
|
1498
|
+
</div>
|
|
1499
|
+
`
|
|
1560
1500
|
: ``}
|
|
1561
|
-
|
|
1562
|
-
return html `
|
|
1563
|
-
<li class="w-100 ">${list}</li>`;
|
|
1501
|
+
`;
|
|
1502
|
+
return html ` <li class="w-100 ">${list}</li>`;
|
|
1564
1503
|
})
|
|
1565
1504
|
.join('');
|
|
1566
1505
|
},
|
|
@@ -1574,9 +1513,7 @@ function setCollection(cf) {
|
|
|
1574
1513
|
{
|
|
1575
1514
|
src: `https://raw.githack.com/SortableJS/Sortable/master/Sortable.js`,
|
|
1576
1515
|
},
|
|
1577
|
-
], () => {
|
|
1578
|
-
}, () => {
|
|
1579
|
-
});
|
|
1516
|
+
], () => { }, () => { });
|
|
1580
1517
|
const interval = setInterval(() => {
|
|
1581
1518
|
if (window.Sortable) {
|
|
1582
1519
|
try {
|
|
@@ -1596,8 +1533,7 @@ function setCollection(cf) {
|
|
|
1596
1533
|
group: id,
|
|
1597
1534
|
animation: 100,
|
|
1598
1535
|
handle: '.dragItem',
|
|
1599
|
-
onChange: function (evt) {
|
|
1600
|
-
},
|
|
1536
|
+
onChange: function (evt) { },
|
|
1601
1537
|
onEnd: (evt) => {
|
|
1602
1538
|
swapArr(array, startIndex, evt.newIndex);
|
|
1603
1539
|
gvc.notifyDataChange(id);
|
|
@@ -1607,19 +1543,17 @@ function setCollection(cf) {
|
|
|
1607
1543
|
},
|
|
1608
1544
|
});
|
|
1609
1545
|
}
|
|
1610
|
-
catch (e) {
|
|
1611
|
-
}
|
|
1546
|
+
catch (e) { }
|
|
1612
1547
|
clearInterval(interval);
|
|
1613
1548
|
}
|
|
1614
1549
|
}, 100);
|
|
1615
1550
|
},
|
|
1616
1551
|
};
|
|
1617
1552
|
}) +
|
|
1618
|
-
html `
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
onclick="${cf.gvc.event(() => {
|
|
1553
|
+
html ` <div
|
|
1554
|
+
class=""
|
|
1555
|
+
style="cursor:pointer;align-self: stretch; height: 50px; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 10px; display: flex"
|
|
1556
|
+
onclick="${cf.gvc.event(() => {
|
|
1623
1557
|
MenusSetting.collectionEvent({
|
|
1624
1558
|
link: '',
|
|
1625
1559
|
title: '',
|
|
@@ -1636,33 +1570,29 @@ function setCollection(cf) {
|
|
|
1636
1570
|
}
|
|
1637
1571
|
});
|
|
1638
1572
|
})}"
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
</div>
|
|
1648
|
-
</div>
|
|
1649
|
-
</div>`);
|
|
1573
|
+
>
|
|
1574
|
+
<div
|
|
1575
|
+
style="align-self: stretch; height: 54px; border-radius: 10px; border: 1px #DDDDDD solid; justify-content: center; align-items: center; gap: 6px; display: inline-flex"
|
|
1576
|
+
>
|
|
1577
|
+
<i class="fa-solid fa-plus" style="color: #3366BB;font-size: 16px; "></i>
|
|
1578
|
+
<div style="color: #3366BB; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">新增選單</div>
|
|
1579
|
+
</div>
|
|
1580
|
+
</div>`);
|
|
1650
1581
|
}
|
|
1651
1582
|
return renderItems(vm.link);
|
|
1652
1583
|
})()}
|
|
1653
|
-
</div>
|
|
1654
1584
|
</div>
|
|
1655
1585
|
</div>
|
|
1656
1586
|
</div>
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1587
|
+
</div>
|
|
1588
|
+
<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;">
|
|
1589
|
+
${BgWidget.cancel(gvc.event(() => {
|
|
1660
1590
|
cf.goBack();
|
|
1661
1591
|
}))}
|
|
1662
|
-
|
|
1592
|
+
${BgWidget.save(gvc.event(() => {
|
|
1663
1593
|
save();
|
|
1664
1594
|
}), '確認')}
|
|
1665
|
-
|
|
1595
|
+
</div>`;
|
|
1666
1596
|
},
|
|
1667
1597
|
divCreate: {
|
|
1668
1598
|
style: `padding-bottom:60px;`,
|