ts-glitter 13.3.5 → 13.3.8
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 +2 -7
- package/lowcode/backend-manager/bg-blog.ts +8 -13
- package/lowcode/backend-manager/bg-graph-api.js +6 -11
- package/lowcode/backend-manager/bg-graph-api.ts +14 -20
- package/lowcode/backend-manager/bg-line.js +526 -1002
- package/lowcode/backend-manager/bg-line.ts +1815 -2354
- package/lowcode/backend-manager/bg-notify.js +392 -746
- package/lowcode/backend-manager/bg-notify.ts +436 -835
- package/lowcode/backend-manager/bg-project.js +176 -293
- package/lowcode/backend-manager/bg-project.ts +214 -344
- package/lowcode/backend-manager/bg-recommend.js +39 -148
- package/lowcode/backend-manager/bg-recommend.ts +43 -162
- package/lowcode/backend-manager/bg-sns.js +489 -814
- package/lowcode/backend-manager/bg-sns.ts +1876 -2238
- package/lowcode/backend-manager/bg-widget.js +301 -171
- package/lowcode/backend-manager/bg-widget.ts +324 -193
- package/lowcode/cms-plugin/ai-points.js +84 -67
- package/lowcode/cms-plugin/ai-points.ts +280 -247
- package/lowcode/cms-plugin/auto-reply.js +6 -7
- package/lowcode/cms-plugin/auto-reply.ts +6 -7
- package/lowcode/cms-plugin/data-analyze.js +5 -6
- package/lowcode/cms-plugin/data-analyze.ts +5 -6
- package/lowcode/cms-plugin/form-setting.js +122 -220
- package/lowcode/cms-plugin/form-setting.ts +124 -240
- package/lowcode/cms-plugin/line-auto-reply.js +17 -18
- package/lowcode/cms-plugin/line-auto-reply.ts +29 -36
- package/lowcode/cms-plugin/member-group-list.js +5 -2
- package/lowcode/cms-plugin/member-group-list.ts +5 -2
- package/lowcode/cms-plugin/member-type-list.js +36 -84
- package/lowcode/cms-plugin/member-type-list.ts +39 -92
- package/lowcode/cms-plugin/menus-setting.js +8 -73
- package/lowcode/cms-plugin/menus-setting.ts +8 -78
- package/lowcode/cms-plugin/permission-setting.js +73 -106
- package/lowcode/cms-plugin/permission-setting.ts +236 -278
- package/lowcode/cms-plugin/shopping-collections.js +95 -137
- package/lowcode/cms-plugin/shopping-collections.ts +103 -147
- package/lowcode/cms-plugin/shopping-discount-setting.js +310 -416
- package/lowcode/cms-plugin/shopping-discount-setting.ts +1269 -1386
- package/lowcode/cms-plugin/shopping-finance-setting.js +1 -0
- package/lowcode/cms-plugin/shopping-finance-setting.ts +1 -0
- package/lowcode/cms-plugin/shopping-order-manager.js +742 -973
- package/lowcode/cms-plugin/shopping-order-manager.ts +1928 -2164
- package/lowcode/cms-plugin/shopping-order-return.js +147 -267
- package/lowcode/cms-plugin/shopping-order-return.ts +154 -292
- package/lowcode/cms-plugin/shopping-product-setting.js +6 -2
- package/lowcode/cms-plugin/shopping-product-setting.ts +8 -4
- package/lowcode/cms-plugin/shopping-product-stock.js +12 -92
- package/lowcode/cms-plugin/shopping-product-stock.ts +14 -94
- package/lowcode/cms-plugin/shopping-product-text.js +0 -3
- package/lowcode/cms-plugin/shopping-product-text.ts +0 -3
- package/lowcode/cms-plugin/shopping-rebate.js +95 -151
- package/lowcode/cms-plugin/shopping-rebate.ts +101 -159
- package/lowcode/cms-plugin/sms-points.js +83 -67
- package/lowcode/cms-plugin/sms-points.ts +281 -241
- package/lowcode/cms-plugin/sns-auto-reply.js +18 -18
- package/lowcode/cms-plugin/sns-auto-reply.ts +34 -40
- package/lowcode/cms-plugin/user-list.js +71 -90
- package/lowcode/cms-plugin/user-list.ts +76 -95
- package/lowcode/cms-plugin/web-config-setting.js +61 -111
- package/lowcode/cms-plugin/web-config-setting.ts +65 -124
- package/lowcode/css/editor.css +5 -2
- package/lowcode/glitter-base/route/shopping.js +1 -1
- package/lowcode/glitter-base/route/shopping.ts +19 -19
- package/lowcode/jspage/editor.js +1 -1
- package/lowcode/jspage/editor.ts +1 -1
- package/lowcode/jspage/main.js +4 -0
- package/lowcode/jspage/main.ts +4 -0
- package/package.json +1 -2
- package/src/api-public/controllers/ai-chat.js.map +5 -1
- package/src/api-public/controllers/article.js.map +1 -1
- package/src/api-public/controllers/chat.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/line-message.js.map +1 -1
- package/src/api-public/controllers/rebate.js.map +1 -1
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/user.js.map +1 -1
- package/src/api-public/services/auto-send-email.js.map +1 -1
- package/src/api-public/services/chat.js +3 -3
- package/src/api-public/services/chat.js.map +1 -1
- package/src/api-public/services/chat.ts +2 -3
- package/src/api-public/services/fb-message.js.map +5 -1
- package/src/api-public/services/filter-protect-data.js.map +1 -1
- package/src/api-public/services/line-message.js.map +1 -1
- package/src/api-public/services/monitor.js.map +1 -1
- package/src/api-public/services/notify.js.map +1 -1
- package/src/api-public/services/rebate.js.map +1 -1
- package/src/api-public/services/schedule.js.map +1 -1
- package/src/api-public/services/share-permission.js.map +1 -1
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/user.js +67 -66
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +212 -182
- package/src/helper/glitter-util.js.map +1 -1
- package/src/modules/firebase.d.ts +1 -0
- package/src/modules/firebase.js +1 -1
- package/src/modules/firebase.js.map +1 -1
|
@@ -19,13 +19,12 @@ import { FilterOptions } from '../cms-plugin/filter-options.js';
|
|
|
19
19
|
import { ShoppingDiscountSetting } from '../cms-plugin/shopping-discount-setting.js';
|
|
20
20
|
import { BgListComponent } from './bg-list-component.js';
|
|
21
21
|
import { Tool } from '../modules/tool.js';
|
|
22
|
-
import { ApiWallet } from
|
|
23
|
-
import { ApiSns } from
|
|
22
|
+
import { ApiWallet } from '../glitter-base/route/wallet.js';
|
|
23
|
+
import { ApiSns } from '../glitter-base/route/sms.js';
|
|
24
24
|
const html = String.raw;
|
|
25
25
|
const inputStyle = 'font-size: 16px; height:40px; width:300px;';
|
|
26
26
|
export class BgSNS {
|
|
27
|
-
static email(gvc, type = 'list', callback = () => {
|
|
28
|
-
}) {
|
|
27
|
+
static email(gvc, type = 'list', callback = () => { }) {
|
|
29
28
|
const vm = {
|
|
30
29
|
type: 'list',
|
|
31
30
|
data: {
|
|
@@ -50,58 +49,8 @@ export class BgSNS {
|
|
|
50
49
|
view: () => {
|
|
51
50
|
let vmi = undefined;
|
|
52
51
|
function getDatalist() {
|
|
53
|
-
let interval = 0;
|
|
54
52
|
return vm.dataList.map((dd) => {
|
|
55
53
|
return [
|
|
56
|
-
{
|
|
57
|
-
key: (() => {
|
|
58
|
-
clearInterval(interval);
|
|
59
|
-
if (!vm.dataList.find((dd) => {
|
|
60
|
-
return !dd.checked;
|
|
61
|
-
})) {
|
|
62
|
-
interval = setTimeout(() => {
|
|
63
|
-
ApiUser.getSubScribe({
|
|
64
|
-
page: vmi.page - 1,
|
|
65
|
-
limit: 100000,
|
|
66
|
-
search: vm.query || undefined,
|
|
67
|
-
}).then((data) => {
|
|
68
|
-
callback(data.response.data);
|
|
69
|
-
});
|
|
70
|
-
}, 10);
|
|
71
|
-
}
|
|
72
|
-
return EditorElem.checkBoxOnly({
|
|
73
|
-
gvc: gvc,
|
|
74
|
-
def: !vm.dataList.find((dd) => {
|
|
75
|
-
return !dd.checked;
|
|
76
|
-
}),
|
|
77
|
-
callback: (result) => {
|
|
78
|
-
vm.dataList.map((dd) => {
|
|
79
|
-
dd.checked = result;
|
|
80
|
-
});
|
|
81
|
-
vmi.data = getDatalist();
|
|
82
|
-
vmi.callback();
|
|
83
|
-
gvc.notifyDataChange(filterID);
|
|
84
|
-
callback(vm.dataList.filter((dd) => {
|
|
85
|
-
return dd.checked;
|
|
86
|
-
}));
|
|
87
|
-
},
|
|
88
|
-
});
|
|
89
|
-
})(),
|
|
90
|
-
value: EditorElem.checkBoxOnly({
|
|
91
|
-
gvc: gvc,
|
|
92
|
-
def: dd.checked,
|
|
93
|
-
callback: (result) => {
|
|
94
|
-
dd.checked = result;
|
|
95
|
-
vmi.data = getDatalist();
|
|
96
|
-
vmi.callback();
|
|
97
|
-
gvc.notifyDataChange(filterID);
|
|
98
|
-
callback(vm.dataList.filter((dd) => {
|
|
99
|
-
return dd.checked;
|
|
100
|
-
}));
|
|
101
|
-
},
|
|
102
|
-
style: 'height:25px;',
|
|
103
|
-
}),
|
|
104
|
-
},
|
|
105
54
|
{
|
|
106
55
|
key: '註冊信箱',
|
|
107
56
|
value: `<span class="fs-7">${dd.email}</span>`,
|
|
@@ -113,107 +62,74 @@ export class BgSNS {
|
|
|
113
62
|
];
|
|
114
63
|
});
|
|
115
64
|
}
|
|
116
|
-
return BgWidget.container(BgWidget.mainCard(
|
|
117
|
-
gvc
|
|
118
|
-
getData: (vmk) => {
|
|
119
|
-
vmi = vmk;
|
|
120
|
-
ApiUser.getSubScribe({
|
|
121
|
-
page: vmi.page - 1,
|
|
122
|
-
limit: 20,
|
|
123
|
-
search: vm.query || undefined,
|
|
124
|
-
filter: { account: 'no' },
|
|
125
|
-
}).then((data) => {
|
|
126
|
-
vmi.pageSize = Math.ceil(data.response.total / 20);
|
|
127
|
-
vm.dataList = data.response.data;
|
|
128
|
-
vmi.data = getDatalist();
|
|
129
|
-
vmi.loading = false;
|
|
130
|
-
vmi.callback();
|
|
131
|
-
if (type === 'select') {
|
|
132
|
-
callback(vm.dataList.filter((dd) => {
|
|
133
|
-
return dd.checked;
|
|
134
|
-
}));
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
},
|
|
138
|
-
rowClick: (data, index) => {
|
|
139
|
-
vm.dataList[index].checked = !vm.dataList[index].checked;
|
|
140
|
-
vmi.data = getDatalist();
|
|
141
|
-
vmi.callback();
|
|
142
|
-
gvc.notifyDataChange(filterID);
|
|
143
|
-
callback(vm.dataList.filter((dd) => {
|
|
144
|
-
return dd.checked;
|
|
145
|
-
}));
|
|
146
|
-
},
|
|
147
|
-
filter: html `
|
|
148
|
-
${BgWidget.searchPlace(gvc.event((e, event) => {
|
|
65
|
+
return BgWidget.container(BgWidget.mainCard([
|
|
66
|
+
BgWidget.searchPlace(gvc.event((e) => {
|
|
149
67
|
vm.query = e.value;
|
|
150
68
|
gvc.notifyDataChange(id);
|
|
151
|
-
}), vm.query || '', '搜尋信箱或標籤')
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
69
|
+
}), vm.query || '', '搜尋信箱或標籤'),
|
|
70
|
+
BgWidget.tableV3({
|
|
71
|
+
gvc: gvc,
|
|
72
|
+
getData: (vmk) => {
|
|
73
|
+
vmi = vmk;
|
|
74
|
+
const limit = 20;
|
|
75
|
+
ApiUser.getSubScribe({
|
|
76
|
+
page: vmi.page - 1,
|
|
77
|
+
limit: limit,
|
|
78
|
+
search: vm.query || undefined,
|
|
79
|
+
filter: { account: 'no' },
|
|
80
|
+
}).then((data) => {
|
|
81
|
+
vm.dataList = data.response.data;
|
|
82
|
+
vmi.pageSize = Math.ceil(data.response.total / limit);
|
|
83
|
+
vmi.originalData = vm.dataList;
|
|
84
|
+
vmi.tableData = getDatalist();
|
|
85
|
+
vmi.loading = false;
|
|
86
|
+
vmi.callback();
|
|
87
|
+
if (type === 'select') {
|
|
88
|
+
callback(vm.dataList.filter((dd) => {
|
|
158
89
|
return dd.checked;
|
|
159
|
-
}))
|
|
160
|
-
return ``;
|
|
90
|
+
}));
|
|
161
91
|
}
|
|
162
|
-
|
|
92
|
+
});
|
|
93
|
+
},
|
|
94
|
+
rowClick: (data, index) => {
|
|
95
|
+
vm.dataList[index].checked = !vm.dataList[index].checked;
|
|
96
|
+
vmi.data = getDatalist();
|
|
97
|
+
vmi.callback();
|
|
98
|
+
gvc.notifyDataChange(filterID);
|
|
99
|
+
callback(vm.dataList.filter((dd) => {
|
|
100
|
+
return dd.checked;
|
|
101
|
+
}));
|
|
102
|
+
},
|
|
103
|
+
filter: [
|
|
104
|
+
{
|
|
105
|
+
name: '批量移除',
|
|
106
|
+
event: (checkedData) => {
|
|
163
107
|
const dialog = new ShareDialog(gvc.glitter);
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
return dd.email;
|
|
181
|
-
})
|
|
182
|
-
.join(`,`),
|
|
183
|
-
}).then((res) => {
|
|
184
|
-
dialog.dataLoading({ visible: false });
|
|
185
|
-
if (res.result) {
|
|
186
|
-
vm.dataList = undefined;
|
|
187
|
-
gvc.notifyDataChange(id);
|
|
188
|
-
}
|
|
189
|
-
else {
|
|
190
|
-
dialog.errorMessage({ text: '刪除失敗' });
|
|
191
|
-
}
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
},
|
|
108
|
+
dialog.checkYesOrNot({
|
|
109
|
+
text: '是否確認刪除所選項目?',
|
|
110
|
+
callback: (response) => {
|
|
111
|
+
if (response) {
|
|
112
|
+
dialog.dataLoading({ visible: true });
|
|
113
|
+
ApiUser.deleteSubscribe({
|
|
114
|
+
email: checkedData.map((dd) => dd.email).join(`,`),
|
|
115
|
+
}).then((res) => {
|
|
116
|
+
dialog.dataLoading({ visible: false });
|
|
117
|
+
if (res.result) {
|
|
118
|
+
vm.dataList = undefined;
|
|
119
|
+
gvc.notifyDataChange(id);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
dialog.errorMessage({ text: '刪除失敗' });
|
|
123
|
+
}
|
|
195
124
|
});
|
|
196
|
-
}
|
|
197
|
-
|
|
125
|
+
}
|
|
126
|
+
},
|
|
198
127
|
});
|
|
199
|
-
}
|
|
200
|
-
},
|
|
201
|
-
divCreate: () => {
|
|
202
|
-
return {
|
|
203
|
-
class: `d-flex align-items-center p-2 py-3 ${!vm.dataList ||
|
|
204
|
-
!vm.dataList.find((dd) => {
|
|
205
|
-
return dd.checked;
|
|
206
|
-
}) ||
|
|
207
|
-
type === 'select'
|
|
208
|
-
? `d-none`
|
|
209
|
-
: ``}`,
|
|
210
|
-
style: ``,
|
|
211
|
-
};
|
|
128
|
+
},
|
|
212
129
|
},
|
|
213
|
-
|
|
214
|
-
})
|
|
215
|
-
|
|
216
|
-
})), type === 'select' ? 850 : BgWidget.getContainerWidth(), 'padding: 0;');
|
|
130
|
+
],
|
|
131
|
+
}),
|
|
132
|
+
].join('')), type === 'select' ? 850 : BgWidget.getContainerWidth(), 'padding: 0;');
|
|
217
133
|
},
|
|
218
134
|
};
|
|
219
135
|
});
|
|
@@ -243,136 +159,78 @@ export class BgSNS {
|
|
|
243
159
|
vm.type = 'add';
|
|
244
160
|
}))}
|
|
245
161
|
</div>
|
|
246
|
-
${BgWidget.container(BgWidget.mainCard(
|
|
247
|
-
gvc
|
|
248
|
-
getData: (vmi) => {
|
|
249
|
-
ApiPost.getManagerPost({
|
|
250
|
-
page: vmi.page - 1,
|
|
251
|
-
limit: 20,
|
|
252
|
-
search: vm.query ? [`title->${vm.query}`] : undefined,
|
|
253
|
-
type: 'notify-sns-config',
|
|
254
|
-
}).then((data) => {
|
|
255
|
-
vmi.pageSize = Math.ceil(data.response.total / 20);
|
|
256
|
-
vm.dataList = data.response.data;
|
|
257
|
-
function getDatalist() {
|
|
258
|
-
return data.response.data.map((dd) => {
|
|
259
|
-
return [
|
|
260
|
-
{
|
|
261
|
-
key: EditorElem.checkBoxOnly({
|
|
262
|
-
gvc: gvc,
|
|
263
|
-
def: !data.response.data.find((dd) => {
|
|
264
|
-
return !dd.checked;
|
|
265
|
-
}),
|
|
266
|
-
callback: (result) => {
|
|
267
|
-
data.response.data.map((dd) => {
|
|
268
|
-
dd.checked = result;
|
|
269
|
-
});
|
|
270
|
-
vmi.data = getDatalist();
|
|
271
|
-
vmi.callback();
|
|
272
|
-
gvc.notifyDataChange(filterID);
|
|
273
|
-
},
|
|
274
|
-
}),
|
|
275
|
-
value: EditorElem.checkBoxOnly({
|
|
276
|
-
gvc: gvc,
|
|
277
|
-
def: dd.checked,
|
|
278
|
-
callback: (result) => {
|
|
279
|
-
dd.checked = result;
|
|
280
|
-
vmi.data = getDatalist();
|
|
281
|
-
vmi.callback();
|
|
282
|
-
gvc.notifyDataChange(filterID);
|
|
283
|
-
},
|
|
284
|
-
style: 'height:25px;',
|
|
285
|
-
}),
|
|
286
|
-
},
|
|
287
|
-
{
|
|
288
|
-
key: '標題',
|
|
289
|
-
value: html `<span
|
|
290
|
-
class="fs-7">${dd.content.title}</span>`,
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
key: '最後更新時間',
|
|
294
|
-
value: dd.updated_time ? gvc.glitter.ut.dateFormat(new Date(dd.updated_time), 'yyyy-MM-dd') : '無',
|
|
295
|
-
},
|
|
296
|
-
];
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
vmi.data = getDatalist();
|
|
300
|
-
vmi.loading = false;
|
|
301
|
-
vmi.callback();
|
|
302
|
-
});
|
|
303
|
-
},
|
|
304
|
-
style: ['', `min-width: ${BgWidget.getContainerWidth() / 2 - 30}px`, ''],
|
|
305
|
-
rowClick: (data, index) => {
|
|
306
|
-
vm.data = vm.dataList[index].content;
|
|
307
|
-
vm.type = 'replace';
|
|
308
|
-
},
|
|
309
|
-
filter: html ` ${BgWidget.searchPlace(gvc.event((e) => {
|
|
162
|
+
${BgWidget.container(BgWidget.mainCard([
|
|
163
|
+
BgWidget.searchPlace(gvc.event((e) => {
|
|
310
164
|
vm.query = e.value;
|
|
311
165
|
gvc.notifyDataChange(id);
|
|
312
|
-
}), vm.query || '', '搜尋所有信件內容')
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
166
|
+
}), vm.query || '', '搜尋所有信件內容'),
|
|
167
|
+
BgWidget.tableV3({
|
|
168
|
+
gvc: gvc,
|
|
169
|
+
getData: (vmi) => {
|
|
170
|
+
const limit = 20;
|
|
171
|
+
ApiPost.getManagerPost({
|
|
172
|
+
page: vmi.page - 1,
|
|
173
|
+
limit: limit,
|
|
174
|
+
search: vm.query ? [`title->${vm.query}`] : undefined,
|
|
175
|
+
type: 'notify-sns-config',
|
|
176
|
+
}).then((data) => {
|
|
177
|
+
function getDatalist() {
|
|
178
|
+
return data.response.data.map((dd) => {
|
|
179
|
+
return [
|
|
180
|
+
{
|
|
181
|
+
key: '標題',
|
|
182
|
+
value: html `<span class="fs-7">${dd.content.title}</span>`,
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
key: '最後更新時間',
|
|
186
|
+
value: dd.updated_time ? gvc.glitter.ut.dateFormat(new Date(dd.updated_time), 'yyyy-MM-dd') : '無',
|
|
187
|
+
},
|
|
188
|
+
];
|
|
189
|
+
});
|
|
322
190
|
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
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
|
+
});
|
|
198
|
+
},
|
|
199
|
+
rowClick: (data, index) => {
|
|
200
|
+
vm.data = vm.dataList[index].content;
|
|
201
|
+
vm.type = 'replace';
|
|
202
|
+
},
|
|
203
|
+
filter: [
|
|
204
|
+
{
|
|
205
|
+
name: '批量移除',
|
|
206
|
+
option: false,
|
|
207
|
+
event: (checkedData) => {
|
|
208
|
+
const dialog = new ShareDialog(glitter);
|
|
209
|
+
dialog.checkYesOrNot({
|
|
210
|
+
text: '是否確認刪除所選項目?',
|
|
211
|
+
callback: (response) => {
|
|
212
|
+
if (response) {
|
|
213
|
+
dialog.dataLoading({ visible: true });
|
|
214
|
+
ApiPost.delete({
|
|
215
|
+
id: checkedData.map((dd) => dd.id).join(`,`),
|
|
216
|
+
}).then((res) => {
|
|
217
|
+
dialog.dataLoading({ visible: false });
|
|
218
|
+
if (res.result) {
|
|
219
|
+
vm.dataList = undefined;
|
|
220
|
+
gvc.notifyDataChange(id);
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
dialog.errorMessage({ text: '刪除失敗' });
|
|
224
|
+
}
|
|
356
225
|
});
|
|
357
|
-
}
|
|
358
|
-
|
|
226
|
+
}
|
|
227
|
+
},
|
|
359
228
|
});
|
|
360
|
-
}
|
|
361
|
-
},
|
|
362
|
-
divCreate: () => {
|
|
363
|
-
return {
|
|
364
|
-
class: `d-flex align-items-center p-2 py-3 ${!vm.dataList ||
|
|
365
|
-
!vm.dataList.find((dd) => {
|
|
366
|
-
return dd.checked;
|
|
367
|
-
})
|
|
368
|
-
? `d-none`
|
|
369
|
-
: ``}`,
|
|
370
|
-
style: ``,
|
|
371
|
-
};
|
|
229
|
+
},
|
|
372
230
|
},
|
|
373
|
-
|
|
374
|
-
})
|
|
375
|
-
|
|
231
|
+
],
|
|
232
|
+
}),
|
|
233
|
+
].join('')))}
|
|
376
234
|
${BgWidget.mbContainer(120)}
|
|
377
235
|
`, BgWidget.getContainerWidth());
|
|
378
236
|
}
|
|
@@ -450,24 +308,18 @@ export class BgSNS {
|
|
|
450
308
|
];
|
|
451
309
|
const filterTags = ListComp.getFilterTags(FilterOptions.snsFunnel);
|
|
452
310
|
if (document.body.clientWidth < 768) {
|
|
453
|
-
return html `
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
${filterList[1]}
|
|
462
|
-
</div>
|
|
463
|
-
<div>${filterTags}</div>`;
|
|
311
|
+
return html ` <div style="display: flex; align-items: center; gap: 10px; width: 100%; justify-content: space-between">
|
|
312
|
+
<div>${filterList[0]}</div>
|
|
313
|
+
<div style="display: flex;">
|
|
314
|
+
<div class="me-2">${filterList[2]}</div>
|
|
315
|
+
</div>
|
|
316
|
+
</div>
|
|
317
|
+
<div style="display: flex; margin-top: 8px;">${filterList[1]}</div>
|
|
318
|
+
<div>${filterTags}</div>`;
|
|
464
319
|
}
|
|
465
320
|
else {
|
|
466
|
-
return html `
|
|
467
|
-
|
|
468
|
-
${filterList.join('')}
|
|
469
|
-
</div>
|
|
470
|
-
<div>${filterTags}</div>`;
|
|
321
|
+
return html ` <div style="display: flex; align-items: center; gap: 10px;">${filterList.join('')}</div>
|
|
322
|
+
<div>${filterTags}</div>`;
|
|
471
323
|
}
|
|
472
324
|
},
|
|
473
325
|
});
|
|
@@ -475,7 +327,7 @@ export class BgSNS {
|
|
|
475
327
|
gvc.bindView({
|
|
476
328
|
bind: vm.tableId,
|
|
477
329
|
view: () => {
|
|
478
|
-
return BgWidget.
|
|
330
|
+
return BgWidget.tableV3({
|
|
479
331
|
gvc: gvc,
|
|
480
332
|
getData: (vmi) => {
|
|
481
333
|
var _a, _b;
|
|
@@ -490,26 +342,21 @@ export class BgSNS {
|
|
|
490
342
|
mailType: vm.filter.mailType,
|
|
491
343
|
}).then((data) => {
|
|
492
344
|
if (data.result) {
|
|
493
|
-
vmi.pageSize = Math.ceil(data.response.total / limit);
|
|
494
|
-
vm.dataList = data.response.data;
|
|
495
345
|
function getDatalist() {
|
|
496
346
|
return data.response.data.map((dd) => {
|
|
497
347
|
return [
|
|
498
348
|
{
|
|
499
349
|
key: '寄件類型',
|
|
500
|
-
value: html `<span
|
|
501
|
-
class="fs-7">${dd.content.typeName}</span>`,
|
|
350
|
+
value: html `<span class="fs-7">${dd.content.typeName}</span>`,
|
|
502
351
|
},
|
|
503
352
|
{
|
|
504
353
|
key: '標題',
|
|
505
|
-
value: html `<span
|
|
506
|
-
class="fs-7">${Tool.truncateString(`${dd.content.title}`, 25)}</span>`,
|
|
354
|
+
value: html `<span class="fs-7">${Tool.truncateString(`${dd.content.title}`, 25)}</span>`,
|
|
507
355
|
},
|
|
508
356
|
{
|
|
509
357
|
key: '收件群組',
|
|
510
|
-
value: html `<span
|
|
511
|
-
|
|
512
|
-
>${(() => {
|
|
358
|
+
value: html `<span class="fs-7"
|
|
359
|
+
>${(() => {
|
|
513
360
|
if (!dd.content.sendGroup) {
|
|
514
361
|
return '沒有群組';
|
|
515
362
|
}
|
|
@@ -525,13 +372,11 @@ export class BgSNS {
|
|
|
525
372
|
tagList.push(group);
|
|
526
373
|
}
|
|
527
374
|
}
|
|
528
|
-
return tagList.join(html `<span
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
>${dd.content.boolean === 'and' ? '且' : '或'}</span
|
|
532
|
-
>`);
|
|
375
|
+
return tagList.join(html `<span class="badge fs-7 mx-1 px-1" style="color: #393939; background: #FFD5D0;"
|
|
376
|
+
>${dd.content.boolean === 'and' ? '且' : '或'}</span
|
|
377
|
+
>`);
|
|
533
378
|
})()}</span
|
|
534
|
-
|
|
379
|
+
>`,
|
|
535
380
|
},
|
|
536
381
|
{
|
|
537
382
|
key: '寄送時間',
|
|
@@ -542,30 +387,21 @@ export class BgSNS {
|
|
|
542
387
|
value: (() => {
|
|
543
388
|
switch (dd.status) {
|
|
544
389
|
case 0:
|
|
545
|
-
return html `
|
|
546
|
-
<div class="badge fs-7"
|
|
547
|
-
style="color: #393939; background: #ffd6a4;">
|
|
548
|
-
尚未寄送
|
|
549
|
-
</div>`;
|
|
390
|
+
return html ` <div class="badge fs-7" style="color: #393939; background: #ffd6a4;">尚未寄送</div>`;
|
|
550
391
|
case 1:
|
|
551
|
-
return html `
|
|
552
|
-
<div class="badge fs-7"
|
|
553
|
-
style="color: #393939; background: #0000000f;">
|
|
554
|
-
已寄出
|
|
555
|
-
</div>`;
|
|
392
|
+
return html ` <div class="badge fs-7" style="color: #393939; background: #0000000f;">已寄出</div>`;
|
|
556
393
|
case 2:
|
|
557
|
-
return html `
|
|
558
|
-
<div class="badge fs-7"
|
|
559
|
-
style="color: #393939; background: #0000000f;">
|
|
560
|
-
取消預約
|
|
561
|
-
</div>`;
|
|
394
|
+
return html ` <div class="badge fs-7" style="color: #393939; background: #0000000f;">取消預約</div>`;
|
|
562
395
|
}
|
|
563
396
|
})(),
|
|
564
397
|
},
|
|
565
398
|
];
|
|
566
399
|
});
|
|
567
400
|
}
|
|
568
|
-
|
|
401
|
+
vm.dataList = data.response.data;
|
|
402
|
+
vmi.pageSize = Math.ceil(data.response.total / limit);
|
|
403
|
+
vmi.originalData = vm.dataList;
|
|
404
|
+
vmi.tableData = getDatalist();
|
|
569
405
|
vmi.loading = false;
|
|
570
406
|
vmi.callback();
|
|
571
407
|
}
|
|
@@ -576,6 +412,7 @@ export class BgSNS {
|
|
|
576
412
|
vm.data = vm.dataList[index].content;
|
|
577
413
|
vm.type = 'replace';
|
|
578
414
|
},
|
|
415
|
+
filter: [],
|
|
579
416
|
});
|
|
580
417
|
},
|
|
581
418
|
}),
|
|
@@ -613,22 +450,13 @@ export class BgSNS {
|
|
|
613
450
|
<div class="flex-fill"></div>
|
|
614
451
|
${obj.readonly
|
|
615
452
|
? [
|
|
616
|
-
html `
|
|
617
|
-
<div class="badge fs-7 me-2" style="color: #393939; background: #0000000f;">
|
|
618
|
-
${vm.data.typeName}
|
|
619
|
-
</div>`,
|
|
453
|
+
html ` <div class="badge fs-7 me-2" style="color: #393939; background: #0000000f;">${vm.data.typeName}</div>`,
|
|
620
454
|
(() => {
|
|
621
455
|
switch (vm.data.status) {
|
|
622
456
|
case 0:
|
|
623
|
-
return html `
|
|
624
|
-
<div class="badge fs-7 me-1"
|
|
625
|
-
style="color: #393939; background: #ffd6a4;">尚未寄送
|
|
626
|
-
</div>`;
|
|
457
|
+
return html ` <div class="badge fs-7 me-1" style="color: #393939; background: #ffd6a4;">尚未寄送</div>`;
|
|
627
458
|
case 1:
|
|
628
|
-
return html `
|
|
629
|
-
<div class="badge fs-7 me-1"
|
|
630
|
-
style="color: #393939; background: #0000000f;">已寄出
|
|
631
|
-
</div>`;
|
|
459
|
+
return html ` <div class="badge fs-7 me-1" style="color: #393939; background: #0000000f;">已寄出</div>`;
|
|
632
460
|
}
|
|
633
461
|
})(),
|
|
634
462
|
].join('')
|
|
@@ -643,30 +471,25 @@ export class BgSNS {
|
|
|
643
471
|
var _a;
|
|
644
472
|
let htmlList = [];
|
|
645
473
|
if (obj.readonly) {
|
|
646
|
-
const sendGroupHTML = ((_a = vm.data.sendGroup) !== null && _a !== void 0 ? _a : []).map((str) => html `
|
|
647
|
-
|
|
648
|
-
const phoneHTML = vm.data.phone.map((str) => html `
|
|
649
|
-
<div class="c_filter_tag">${str}</div>`);
|
|
474
|
+
const sendGroupHTML = ((_a = vm.data.sendGroup) !== null && _a !== void 0 ? _a : []).map((str) => html ` <div class="c_filter_tag">${str}</div>`);
|
|
475
|
+
const phoneHTML = vm.data.phone.map((str) => html ` <div class="c_filter_tag">${str}</div>`);
|
|
650
476
|
htmlList = htmlList.concat([
|
|
651
477
|
BgWidget.mainCard(html `
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
478
|
+
<div class="tx_normal fw-normal">篩選條件</div>
|
|
479
|
+
<div class="c_filter_container">
|
|
480
|
+
${sendGroupHTML.length === 0
|
|
655
481
|
? '沒有群組'
|
|
656
|
-
: sendGroupHTML.join(html `<span
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
>`)}
|
|
661
|
-
</div>
|
|
662
|
-
`),
|
|
663
|
-
BgWidget.mainCard(html `
|
|
664
|
-
<div class="tx_normal fw-normal">電話號碼</div>
|
|
665
|
-
<div class="c_filter_container">${phoneHTML.join('')}</div>
|
|
482
|
+
: sendGroupHTML.join(html `<span class="badge fs-7 px-1" style="color: #393939; background: #FFD5D0;"
|
|
483
|
+
>${vm.data.boolean === 'and' ? '且' : '或'}</span
|
|
484
|
+
>`)}
|
|
485
|
+
</div>
|
|
666
486
|
`),
|
|
667
487
|
BgWidget.mainCard(html `
|
|
668
|
-
|
|
669
|
-
|
|
488
|
+
<div class="tx_normal fw-normal">電話號碼</div>
|
|
489
|
+
<div class="c_filter_container">${phoneHTML.join('')}</div>
|
|
490
|
+
`),
|
|
491
|
+
BgWidget.mainCard(html ` <div class="tx_700 mb-3">發送時間</div>
|
|
492
|
+
${EditorElem.radio({
|
|
670
493
|
gvc: gvc,
|
|
671
494
|
title: '',
|
|
672
495
|
def: vm.data.sendTime === undefined ? 'now' : 'set',
|
|
@@ -678,43 +501,37 @@ export class BgSNS {
|
|
|
678
501
|
{
|
|
679
502
|
title: '排定發送時間',
|
|
680
503
|
value: 'set',
|
|
681
|
-
innerHtml: html `
|
|
682
|
-
|
|
683
|
-
style="gap: 12px">
|
|
684
|
-
${EditorElem.editeInput({
|
|
504
|
+
innerHtml: html ` <div class="d-flex mt-3 ${document.body.clientWidth < 768 ? 'flex-column' : ''}" style="gap: 12px">
|
|
505
|
+
${EditorElem.editeInput({
|
|
685
506
|
gvc: gvc,
|
|
686
507
|
title: '',
|
|
687
508
|
type: 'date',
|
|
688
509
|
style: inputStyle,
|
|
689
510
|
default: vm.data.sendTime ? vm.data.sendTime.date : '',
|
|
690
511
|
placeHolder: '',
|
|
691
|
-
callback: () => {
|
|
692
|
-
},
|
|
512
|
+
callback: () => { },
|
|
693
513
|
readonly: true,
|
|
694
514
|
})}
|
|
695
|
-
|
|
515
|
+
${EditorElem.editeInput({
|
|
696
516
|
gvc: gvc,
|
|
697
517
|
title: '',
|
|
698
518
|
type: 'time',
|
|
699
519
|
style: inputStyle,
|
|
700
520
|
default: vm.data.sendTime ? vm.data.sendTime.time : '',
|
|
701
521
|
placeHolder: '',
|
|
702
|
-
callback: () => {
|
|
703
|
-
},
|
|
522
|
+
callback: () => { },
|
|
704
523
|
readonly: true,
|
|
705
524
|
})}
|
|
706
|
-
|
|
525
|
+
</div>`,
|
|
707
526
|
},
|
|
708
527
|
],
|
|
709
|
-
callback: () => {
|
|
710
|
-
},
|
|
528
|
+
callback: () => { },
|
|
711
529
|
readonly: true,
|
|
712
530
|
})}`),
|
|
713
531
|
]);
|
|
714
532
|
}
|
|
715
533
|
htmlList = htmlList.concat([
|
|
716
|
-
BgWidget.mainCard(html `
|
|
717
|
-
${BgWidget.editeInput({
|
|
534
|
+
BgWidget.mainCard(html ` ${BgWidget.editeInput({
|
|
718
535
|
gvc: gvc,
|
|
719
536
|
title: '簡訊主題',
|
|
720
537
|
default: postData.title,
|
|
@@ -723,23 +540,23 @@ export class BgSNS {
|
|
|
723
540
|
postData.title = text;
|
|
724
541
|
},
|
|
725
542
|
})}
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
543
|
+
<div class="d-flex align-items-center my-3">
|
|
544
|
+
<div class="tx_normal fw-normal me-2">簡訊內文</div>
|
|
545
|
+
${gvc.bindView(() => {
|
|
729
546
|
return {
|
|
730
547
|
bind: 'total_count',
|
|
731
548
|
view: () => {
|
|
732
549
|
return `<div class="d-flex align-items-end ms-3" style="font-size: 12px;color: #8D8D8D">預計每則簡訊花費${pointCount * this.ticket}點</div>`;
|
|
733
|
-
}
|
|
550
|
+
},
|
|
734
551
|
};
|
|
735
552
|
})}
|
|
736
|
-
|
|
737
|
-
|
|
553
|
+
</div>
|
|
554
|
+
${EditorElem.editeText({
|
|
738
555
|
gvc: gvc,
|
|
739
|
-
title:
|
|
556
|
+
title: '',
|
|
740
557
|
readonly: true,
|
|
741
|
-
default: postData.content ||
|
|
742
|
-
placeHolder:
|
|
558
|
+
default: postData.content || '',
|
|
559
|
+
placeHolder: '',
|
|
743
560
|
callback: (text) => {
|
|
744
561
|
postData.content = text;
|
|
745
562
|
let totalSize = 0;
|
|
@@ -759,7 +576,7 @@ export class BgSNS {
|
|
|
759
576
|
pointCount = Math.ceil(totalSize / this.longSMS);
|
|
760
577
|
}
|
|
761
578
|
gvc.notifyDataChange('total_count');
|
|
762
|
-
}
|
|
579
|
+
},
|
|
763
580
|
})}`),
|
|
764
581
|
]);
|
|
765
582
|
return htmlList.filter((str) => str.length > 0).join(BgWidget.mbContainer(16));
|
|
@@ -798,9 +615,9 @@ export class BgSNS {
|
|
|
798
615
|
const dialog = new ShareDialog(gvc.glitter);
|
|
799
616
|
dialog.dataLoading({ text: '取消預約中', visible: true });
|
|
800
617
|
ApiSns.delete({
|
|
801
|
-
id: vm.data.name
|
|
802
|
-
}).then(r => {
|
|
803
|
-
console.log(
|
|
618
|
+
id: vm.data.name,
|
|
619
|
+
}).then((r) => {
|
|
620
|
+
console.log('res -- ', r);
|
|
804
621
|
dialog.dataLoading({ visible: false });
|
|
805
622
|
if (r.result) {
|
|
806
623
|
vm.status = 'list';
|
|
@@ -1150,19 +967,18 @@ export class BgSNS {
|
|
|
1150
967
|
const formatName = value && value.length > 0 ? `${name}:${value}` : name;
|
|
1151
968
|
return {
|
|
1152
969
|
name: formatName,
|
|
1153
|
-
html: html `
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
onclick="${gvc.event(() => {
|
|
970
|
+
html: html ` <div class="c_filter_tag">
|
|
971
|
+
${formatName}
|
|
972
|
+
<i
|
|
973
|
+
class="fa-solid fa-xmark ms-1"
|
|
974
|
+
style="cursor: pointer"
|
|
975
|
+
onclick="${gvc.event(() => {
|
|
1160
976
|
postData.tagList = postData.tagList.filter((data) => data.tag !== key);
|
|
1161
977
|
setUserList();
|
|
1162
978
|
gvc.notifyDataChange(vm.tagsId);
|
|
1163
979
|
})}"
|
|
1164
|
-
|
|
1165
|
-
|
|
980
|
+
></i>
|
|
981
|
+
</div>`,
|
|
1166
982
|
};
|
|
1167
983
|
}
|
|
1168
984
|
function getTagsHTML() {
|
|
@@ -1182,12 +998,11 @@ export class BgSNS {
|
|
|
1182
998
|
});
|
|
1183
999
|
postData.sendGroup = badgeList.map((item) => item.name);
|
|
1184
1000
|
return [
|
|
1185
|
-
html `
|
|
1186
|
-
<div class="tx_normal fw-normal">標籤判斷</div>
|
|
1001
|
+
html ` <div class="tx_normal fw-normal">標籤判斷</div>
|
|
1187
1002
|
<div style="margin: 8px 0;">
|
|
1188
1003
|
${BgWidget.switchTextButton(gvc, postData.boolean === 'and', {
|
|
1189
1004
|
left: '或',
|
|
1190
|
-
right: '且'
|
|
1005
|
+
right: '且',
|
|
1191
1006
|
}, (bool) => {
|
|
1192
1007
|
postData.boolean = bool ? 'and' : 'or';
|
|
1193
1008
|
setUserList();
|
|
@@ -1211,8 +1026,7 @@ export class BgSNS {
|
|
|
1211
1026
|
gvc: gvc,
|
|
1212
1027
|
title: '預計寄件顧客',
|
|
1213
1028
|
tag: 'send_users_list',
|
|
1214
|
-
callback: () => {
|
|
1215
|
-
},
|
|
1029
|
+
callback: () => { },
|
|
1216
1030
|
default: [],
|
|
1217
1031
|
api: () => {
|
|
1218
1032
|
return new Promise((resolve) => {
|
|
@@ -1252,7 +1066,8 @@ export class BgSNS {
|
|
|
1252
1066
|
readonly: true,
|
|
1253
1067
|
});
|
|
1254
1068
|
}), { textStyle: 'font-weight: 400;' })}
|
|
1255
|
-
</div>
|
|
1069
|
+
</div>
|
|
1070
|
+
`,
|
|
1256
1071
|
html `
|
|
1257
1072
|
<div class="tx_normal fw-normal">篩選條件</div>
|
|
1258
1073
|
<div class="c_filter_container">
|
|
@@ -1267,7 +1082,7 @@ export class BgSNS {
|
|
|
1267
1082
|
`,
|
|
1268
1083
|
].join(BgWidget.mbContainer(18));
|
|
1269
1084
|
}
|
|
1270
|
-
ApiWallet.getWallet().then(r => {
|
|
1085
|
+
ApiWallet.getWallet().then((r) => {
|
|
1271
1086
|
wallet = r.response.sum;
|
|
1272
1087
|
});
|
|
1273
1088
|
return BgWidget.container(html `
|
|
@@ -1282,14 +1097,11 @@ export class BgSNS {
|
|
|
1282
1097
|
view: () => {
|
|
1283
1098
|
return [
|
|
1284
1099
|
BgWidget.mainCard([
|
|
1285
|
-
html `
|
|
1286
|
-
|
|
1287
|
-
html `
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
<div style="display: flex; ${document.body.clientWidth > 768 ? 'gap: 18px;' : 'flex-direction: column;'}">
|
|
1291
|
-
<div style="width: ${document.body.clientWidth > 768 ? '400px' : '100%'};">
|
|
1292
|
-
${BgWidget.select({
|
|
1100
|
+
html ` <div class="tx_700">選擇收件對象</div>`,
|
|
1101
|
+
html ` <div class="tx_normal fw-normal mt-3">根據</div>`,
|
|
1102
|
+
html ` <div style="display: flex; ${document.body.clientWidth > 768 ? 'gap: 18px;' : 'flex-direction: column;'}">
|
|
1103
|
+
<div style="width: ${document.body.clientWidth > 768 ? '400px' : '100%'};">
|
|
1104
|
+
${BgWidget.select({
|
|
1293
1105
|
gvc: gvc,
|
|
1294
1106
|
default: postData.tag,
|
|
1295
1107
|
callback: (key) => {
|
|
@@ -1300,9 +1112,9 @@ export class BgSNS {
|
|
|
1300
1112
|
options: FilterOptions.emailOptions,
|
|
1301
1113
|
style: 'margin: 8px 0;',
|
|
1302
1114
|
})}
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1115
|
+
</div>
|
|
1116
|
+
<div style="width: 100%; display: flex; align-items: center;">
|
|
1117
|
+
${gvc.bindView({
|
|
1306
1118
|
bind: vm.id,
|
|
1307
1119
|
view: () => {
|
|
1308
1120
|
const getDefault = (def) => {
|
|
@@ -1325,7 +1137,7 @@ export class BgSNS {
|
|
|
1325
1137
|
case 'all':
|
|
1326
1138
|
dialog.dataLoading({
|
|
1327
1139
|
visible: true,
|
|
1328
|
-
text: '取得所有會員資料中...'
|
|
1140
|
+
text: '取得所有會員資料中...',
|
|
1329
1141
|
});
|
|
1330
1142
|
new Promise((resolve) => {
|
|
1331
1143
|
ApiUser.getUserListOrders({
|
|
@@ -1447,8 +1259,8 @@ export class BgSNS {
|
|
|
1447
1259
|
}
|
|
1448
1260
|
},
|
|
1449
1261
|
})}
|
|
1450
|
-
|
|
1451
|
-
|
|
1262
|
+
</div>
|
|
1263
|
+
</div>`,
|
|
1452
1264
|
gvc.bindView({
|
|
1453
1265
|
bind: vm.tagsId,
|
|
1454
1266
|
view: () => getTagsHTML(),
|
|
@@ -1456,10 +1268,8 @@ export class BgSNS {
|
|
|
1456
1268
|
}),
|
|
1457
1269
|
].join('')),
|
|
1458
1270
|
BgWidget.mainCard([
|
|
1459
|
-
html `
|
|
1460
|
-
|
|
1461
|
-
html `
|
|
1462
|
-
<div class="tx_normal fw-normal mt-3">信件樣式</div>`,
|
|
1271
|
+
html ` <div class="tx_700">信件內容</div>`,
|
|
1272
|
+
html ` <div class="tx_normal fw-normal mt-3">信件樣式</div>`,
|
|
1463
1273
|
(() => {
|
|
1464
1274
|
const selectVM = {
|
|
1465
1275
|
id: glitter.getUUID(),
|
|
@@ -1529,14 +1339,13 @@ export class BgSNS {
|
|
|
1529
1339
|
view: () => {
|
|
1530
1340
|
return [
|
|
1531
1341
|
html `
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
${BgWidget.selEventButton('範例', gvc.event(() => {
|
|
1342
|
+
<div class="d-flex align-items-center mb-3">
|
|
1343
|
+
<div class="tx_normal fw-normal me-2 d-flex">簡訊內容</div>
|
|
1344
|
+
${BgWidget.selEventButton('範例', gvc.event(() => {
|
|
1536
1345
|
postData.content = defaultEmailText();
|
|
1537
1346
|
gvc.notifyDataChange(vm.containerId);
|
|
1538
1347
|
}))}
|
|
1539
|
-
|
|
1348
|
+
${gvc.bindView(() => {
|
|
1540
1349
|
return {
|
|
1541
1350
|
bind: 'total_count',
|
|
1542
1351
|
view: () => {
|
|
@@ -1544,15 +1353,15 @@ export class BgSNS {
|
|
|
1544
1353
|
style="font-size: 12px;color: #8D8D8D">
|
|
1545
1354
|
預計每則簡訊花費${pointCount * this.ticket}點
|
|
1546
1355
|
</div>`;
|
|
1547
|
-
}
|
|
1356
|
+
},
|
|
1548
1357
|
};
|
|
1549
1358
|
})}
|
|
1550
|
-
|
|
1551
|
-
|
|
1359
|
+
</div>
|
|
1360
|
+
${EditorElem.editeText({
|
|
1552
1361
|
gvc: gvc,
|
|
1553
|
-
title:
|
|
1554
|
-
default: postData.content ||
|
|
1555
|
-
placeHolder:
|
|
1362
|
+
title: '',
|
|
1363
|
+
default: postData.content || '',
|
|
1364
|
+
placeHolder: '',
|
|
1556
1365
|
callback: (text) => {
|
|
1557
1366
|
postData.content = text;
|
|
1558
1367
|
let totalSize = 0;
|
|
@@ -1572,16 +1381,15 @@ export class BgSNS {
|
|
|
1572
1381
|
pointCount = Math.ceil(totalSize / this.longSMS);
|
|
1573
1382
|
}
|
|
1574
1383
|
gvc.notifyDataChange('total_count');
|
|
1575
|
-
}
|
|
1384
|
+
},
|
|
1576
1385
|
})}
|
|
1577
|
-
|
|
1386
|
+
`,
|
|
1578
1387
|
].join('');
|
|
1579
1388
|
},
|
|
1580
1389
|
}),
|
|
1581
1390
|
].join('')),
|
|
1582
|
-
BgWidget.mainCard(html `
|
|
1583
|
-
|
|
1584
|
-
${EditorElem.radio({
|
|
1391
|
+
BgWidget.mainCard(html ` <div class="tx_700 mb-3">發送時間</div>
|
|
1392
|
+
${EditorElem.radio({
|
|
1585
1393
|
gvc: gvc,
|
|
1586
1394
|
title: '',
|
|
1587
1395
|
def: postData.sendTime === undefined ? 'now' : 'set',
|
|
@@ -1593,10 +1401,8 @@ export class BgSNS {
|
|
|
1593
1401
|
{
|
|
1594
1402
|
title: '排定發送時間',
|
|
1595
1403
|
value: 'set',
|
|
1596
|
-
innerHtml: html `
|
|
1597
|
-
|
|
1598
|
-
style="gap: 12px">
|
|
1599
|
-
${EditorElem.editeInput({
|
|
1404
|
+
innerHtml: html ` <div class="d-flex mt-3 ${document.body.clientWidth < 768 ? 'flex-column' : ''}" style="gap: 12px">
|
|
1405
|
+
${EditorElem.editeInput({
|
|
1600
1406
|
gvc: gvc,
|
|
1601
1407
|
title: '',
|
|
1602
1408
|
type: 'date',
|
|
@@ -1611,7 +1417,7 @@ export class BgSNS {
|
|
|
1611
1417
|
};
|
|
1612
1418
|
},
|
|
1613
1419
|
})}
|
|
1614
|
-
|
|
1420
|
+
${EditorElem.editeInput({
|
|
1615
1421
|
gvc: gvc,
|
|
1616
1422
|
title: '',
|
|
1617
1423
|
type: 'time',
|
|
@@ -1626,7 +1432,7 @@ export class BgSNS {
|
|
|
1626
1432
|
};
|
|
1627
1433
|
},
|
|
1628
1434
|
})}
|
|
1629
|
-
|
|
1435
|
+
</div>`,
|
|
1630
1436
|
},
|
|
1631
1437
|
],
|
|
1632
1438
|
callback: (text) => {
|
|
@@ -1674,12 +1480,15 @@ export class BgSNS {
|
|
|
1674
1480
|
}
|
|
1675
1481
|
else {
|
|
1676
1482
|
if (data.response.message === 'No_Points') {
|
|
1677
|
-
dialog.warningMessage({
|
|
1483
|
+
dialog.warningMessage({
|
|
1484
|
+
text: `餘額不足是否前往儲值?`,
|
|
1485
|
+
callback: (response) => {
|
|
1678
1486
|
if (response) {
|
|
1679
1487
|
window.parent.glitter.setUrlParameter('tab', 'sms-points');
|
|
1680
1488
|
window.parent.glitter.pageConfig[0].gvc.recreateView();
|
|
1681
1489
|
}
|
|
1682
|
-
}
|
|
1490
|
+
},
|
|
1491
|
+
});
|
|
1683
1492
|
}
|
|
1684
1493
|
else {
|
|
1685
1494
|
dialog.errorMessage({ text: '手動寄件失敗' });
|
|
@@ -1710,8 +1519,7 @@ export class BgSNS {
|
|
|
1710
1519
|
${BgWidget.title(`編輯推播通知`)}
|
|
1711
1520
|
<div class="flex-fill"></div>
|
|
1712
1521
|
</div>
|
|
1713
|
-
${BgWidget.container(html `
|
|
1714
|
-
<div class="d-flex px-0" style="gap: 10px;">
|
|
1522
|
+
${BgWidget.container(html ` <div class="d-flex px-0" style="gap: 10px;">
|
|
1715
1523
|
<div style="width: 100%">
|
|
1716
1524
|
${BgWidget.mainCard(obj.gvc.bindView(() => {
|
|
1717
1525
|
const bi = obj.gvc.glitter.getUUID();
|
|
@@ -1755,9 +1563,9 @@ export class BgSNS {
|
|
|
1755
1563
|
</div>
|
|
1756
1564
|
${obj.type === 'replace'
|
|
1757
1565
|
? html `
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1566
|
+
<div class="d-flex w-100 mt-2">
|
|
1567
|
+
<div class="flex-fill"></div>
|
|
1568
|
+
${BgWidget.redButton('刪除樣本', obj.gvc.event(() => {
|
|
1761
1569
|
const dialog = new ShareDialog(obj.gvc.glitter);
|
|
1762
1570
|
dialog.checkYesOrNot({
|
|
1763
1571
|
text: '是否確認刪除樣本?',
|
|
@@ -1779,8 +1587,8 @@ export class BgSNS {
|
|
|
1779
1587
|
},
|
|
1780
1588
|
});
|
|
1781
1589
|
}))}
|
|
1782
|
-
|
|
1783
|
-
|
|
1590
|
+
</div>
|
|
1591
|
+
`
|
|
1784
1592
|
: ``}
|
|
1785
1593
|
<div class="update-bar-container">
|
|
1786
1594
|
${BgWidget.cancel(gvc.event(() => {
|
|
@@ -1826,8 +1634,7 @@ export class BgSNS {
|
|
|
1826
1634
|
</div>`)}
|
|
1827
1635
|
`, BgWidget.getContainerWidth({ rate: { web: 0.68 } }));
|
|
1828
1636
|
}
|
|
1829
|
-
static fcmDevice(gvc, type = 'list', callback = () => {
|
|
1830
|
-
}) {
|
|
1637
|
+
static fcmDevice(gvc, type = 'list', callback = () => { }) {
|
|
1831
1638
|
const vm = {
|
|
1832
1639
|
type: 'list',
|
|
1833
1640
|
data: {
|
|
@@ -1853,59 +1660,9 @@ export class BgSNS {
|
|
|
1853
1660
|
view: () => {
|
|
1854
1661
|
let vmi = undefined;
|
|
1855
1662
|
function getDatalist() {
|
|
1856
|
-
let interval = 0;
|
|
1857
1663
|
return vm.dataList.map((dd) => {
|
|
1858
1664
|
var _a;
|
|
1859
1665
|
return [
|
|
1860
|
-
{
|
|
1861
|
-
key: (() => {
|
|
1862
|
-
clearInterval(interval);
|
|
1863
|
-
if (!vm.dataList.find((dd) => {
|
|
1864
|
-
return !dd.checked;
|
|
1865
|
-
})) {
|
|
1866
|
-
interval = setTimeout(() => {
|
|
1867
|
-
ApiUser.getFCM({
|
|
1868
|
-
page: vmi.page - 1,
|
|
1869
|
-
limit: 100000,
|
|
1870
|
-
search: vm.query || undefined,
|
|
1871
|
-
}).then((data) => {
|
|
1872
|
-
callback(data.response.data);
|
|
1873
|
-
});
|
|
1874
|
-
}, 10);
|
|
1875
|
-
}
|
|
1876
|
-
return EditorElem.checkBoxOnly({
|
|
1877
|
-
gvc: gvc,
|
|
1878
|
-
def: !vm.dataList.find((dd) => {
|
|
1879
|
-
return !dd.checked;
|
|
1880
|
-
}),
|
|
1881
|
-
callback: (result) => {
|
|
1882
|
-
vm.dataList.map((dd) => {
|
|
1883
|
-
dd.checked = result;
|
|
1884
|
-
});
|
|
1885
|
-
vmi.data = getDatalist();
|
|
1886
|
-
vmi.callback();
|
|
1887
|
-
gvc.notifyDataChange(filterID);
|
|
1888
|
-
callback(vm.dataList.filter((dd) => {
|
|
1889
|
-
return dd.checked;
|
|
1890
|
-
}));
|
|
1891
|
-
},
|
|
1892
|
-
});
|
|
1893
|
-
})(),
|
|
1894
|
-
value: EditorElem.checkBoxOnly({
|
|
1895
|
-
gvc: gvc,
|
|
1896
|
-
def: dd.checked,
|
|
1897
|
-
callback: (result) => {
|
|
1898
|
-
dd.checked = result;
|
|
1899
|
-
vmi.data = getDatalist();
|
|
1900
|
-
vmi.callback();
|
|
1901
|
-
gvc.notifyDataChange(filterID);
|
|
1902
|
-
callback(vm.dataList.filter((dd) => {
|
|
1903
|
-
return dd.checked;
|
|
1904
|
-
}));
|
|
1905
|
-
},
|
|
1906
|
-
style: 'height:25px;',
|
|
1907
|
-
}),
|
|
1908
|
-
},
|
|
1909
1666
|
{
|
|
1910
1667
|
key: '用戶ID',
|
|
1911
1668
|
value: `<span class="fs-7">${(_a = dd.userID) !== null && _a !== void 0 ? _a : '尚未登入'}</span>`,
|
|
@@ -1926,106 +1683,80 @@ export class BgSNS {
|
|
|
1926
1683
|
${BgWidget.title('已訂閱裝置')}
|
|
1927
1684
|
<div class="flex-fill"></div>
|
|
1928
1685
|
</div>
|
|
1929
|
-
${BgWidget.container(BgWidget.mainCard(
|
|
1930
|
-
gvc
|
|
1931
|
-
getData: (vmk) => {
|
|
1932
|
-
vmi = vmk;
|
|
1933
|
-
ApiUser.getFCM({
|
|
1934
|
-
page: vmi.page - 1,
|
|
1935
|
-
limit: 20,
|
|
1936
|
-
search: vm.query || undefined,
|
|
1937
|
-
}).then((data) => {
|
|
1938
|
-
vmi.pageSize = Math.ceil(data.response.total / 20);
|
|
1939
|
-
vm.dataList = data.response.data;
|
|
1940
|
-
vmi.data = getDatalist();
|
|
1941
|
-
vmi.loading = false;
|
|
1942
|
-
vmi.callback();
|
|
1943
|
-
if (type === 'select') {
|
|
1944
|
-
callback(vm.dataList.filter((dd) => {
|
|
1945
|
-
return dd.checked;
|
|
1946
|
-
}));
|
|
1947
|
-
}
|
|
1948
|
-
});
|
|
1949
|
-
},
|
|
1950
|
-
rowClick: (data, index) => {
|
|
1951
|
-
vm.dataList[index].checked = !vm.dataList[index].checked;
|
|
1952
|
-
vmi.data = getDatalist();
|
|
1953
|
-
vmi.callback();
|
|
1954
|
-
gvc.notifyDataChange(filterID);
|
|
1955
|
-
callback(vm.dataList.filter((dd) => {
|
|
1956
|
-
return dd.checked;
|
|
1957
|
-
}));
|
|
1958
|
-
},
|
|
1959
|
-
filter: html `
|
|
1960
|
-
${BgWidget.searchPlace(gvc.event((e, event) => {
|
|
1686
|
+
${BgWidget.container(BgWidget.mainCard([
|
|
1687
|
+
BgWidget.searchPlace(gvc.event((e, event) => {
|
|
1961
1688
|
vm.query = e.value;
|
|
1962
1689
|
gvc.notifyDataChange(id);
|
|
1963
|
-
}), vm.query || '', '搜尋信箱或者標籤')
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1690
|
+
}), vm.query || '', '搜尋信箱或者標籤'),
|
|
1691
|
+
BgWidget.tableV3({
|
|
1692
|
+
gvc: gvc,
|
|
1693
|
+
getData: (vmk) => {
|
|
1694
|
+
vmi = vmk;
|
|
1695
|
+
const limit = 20;
|
|
1696
|
+
ApiUser.getFCM({
|
|
1697
|
+
page: vmi.page - 1,
|
|
1698
|
+
limit: limit,
|
|
1699
|
+
search: vm.query || undefined,
|
|
1700
|
+
}).then((data) => {
|
|
1701
|
+
vm.dataList = data.response.data;
|
|
1702
|
+
vmi.pageSize = Math.ceil(data.response.total / limit);
|
|
1703
|
+
vmi.originalData = vm.dataList;
|
|
1704
|
+
vmi.tableData = getDatalist();
|
|
1705
|
+
vmi.loading = false;
|
|
1706
|
+
vmi.callback();
|
|
1707
|
+
if (type === 'select') {
|
|
1708
|
+
callback(vm.dataList.filter((dd) => {
|
|
1970
1709
|
return dd.checked;
|
|
1971
|
-
}))
|
|
1972
|
-
return ``;
|
|
1710
|
+
}));
|
|
1973
1711
|
}
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
1712
|
+
});
|
|
1713
|
+
},
|
|
1714
|
+
rowClick: (data, index) => {
|
|
1715
|
+
vm.dataList[index].checked = !vm.dataList[index].checked;
|
|
1716
|
+
vmi.data = getDatalist();
|
|
1717
|
+
vmi.callback();
|
|
1718
|
+
gvc.notifyDataChange(filterID);
|
|
1719
|
+
callback(vm.dataList.filter((dd) => {
|
|
1720
|
+
return dd.checked;
|
|
1721
|
+
}));
|
|
1722
|
+
},
|
|
1723
|
+
filter: [
|
|
1724
|
+
{
|
|
1725
|
+
name: '批量移除',
|
|
1726
|
+
option: false,
|
|
1727
|
+
event: () => {
|
|
1728
|
+
dialog.checkYesOrNot({
|
|
1729
|
+
text: '是否確認刪除所選項目?',
|
|
1730
|
+
callback: (response) => {
|
|
1731
|
+
if (response) {
|
|
1732
|
+
dialog.dataLoading({ visible: true });
|
|
1733
|
+
ApiUser.deleteSubscribe({
|
|
1734
|
+
email: vm.dataList
|
|
1735
|
+
.filter((dd) => {
|
|
1736
|
+
return dd.checked;
|
|
1737
|
+
})
|
|
1738
|
+
.map((dd) => {
|
|
1739
|
+
return dd.email;
|
|
1740
|
+
})
|
|
1741
|
+
.join(`,`),
|
|
1742
|
+
}).then((res) => {
|
|
1743
|
+
dialog.dataLoading({ visible: false });
|
|
1744
|
+
if (res.result) {
|
|
1745
|
+
vm.dataList = undefined;
|
|
1746
|
+
gvc.notifyDataChange(id);
|
|
1747
|
+
}
|
|
1748
|
+
else {
|
|
1749
|
+
dialog.errorMessage({ text: '刪除失敗' });
|
|
1750
|
+
}
|
|
2007
1751
|
});
|
|
2008
|
-
}
|
|
2009
|
-
|
|
1752
|
+
}
|
|
1753
|
+
},
|
|
2010
1754
|
});
|
|
2011
|
-
}
|
|
2012
|
-
},
|
|
2013
|
-
divCreate: () => {
|
|
2014
|
-
return {
|
|
2015
|
-
class: `d-flex align-items-center p-2 py-3 ${!vm.dataList ||
|
|
2016
|
-
!vm.dataList.find((dd) => {
|
|
2017
|
-
return dd.checked;
|
|
2018
|
-
}) ||
|
|
2019
|
-
type === 'select'
|
|
2020
|
-
? `d-none`
|
|
2021
|
-
: ``}`,
|
|
2022
|
-
style: ``,
|
|
2023
|
-
};
|
|
1755
|
+
},
|
|
2024
1756
|
},
|
|
2025
|
-
|
|
2026
|
-
})
|
|
2027
|
-
|
|
2028
|
-
})))}
|
|
1757
|
+
],
|
|
1758
|
+
}),
|
|
1759
|
+
].join('')))}
|
|
2029
1760
|
`, BgWidget.getContainerWidth());
|
|
2030
1761
|
},
|
|
2031
1762
|
divCreate: {
|
|
@@ -2059,220 +1790,170 @@ export class BgSNS {
|
|
|
2059
1790
|
vm.type = 'add';
|
|
2060
1791
|
}))}
|
|
2061
1792
|
</div>
|
|
2062
|
-
${BgWidget.container(BgWidget.mainCard(
|
|
2063
|
-
gvc
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
key: '發送推播',
|
|
2113
|
-
value: html `
|
|
2114
|
-
<button
|
|
2115
|
-
class="btn btn-primary-c px-4"
|
|
2116
|
-
style="width:20px !important;height: 30px;"
|
|
2117
|
-
onclick="${gvc.event((e, event) => {
|
|
2118
|
-
event.stopPropagation();
|
|
2119
|
-
gvc.glitter.innerDialog((gvc) => {
|
|
2120
|
-
let dataList = [];
|
|
2121
|
-
return html `
|
|
2122
|
-
<div style="max-height: calc(100vh - 100px);overflow-y: auto;">
|
|
2123
|
-
${BgWidget.container(BgWidget.card([
|
|
2124
|
-
html `
|
|
2125
|
-
<div class="d-flex w-100 align-items-center mb-3 ">
|
|
2126
|
-
${BgWidget.goBack(gvc.event(() => {
|
|
2127
|
-
gvc.closeDialog();
|
|
2128
|
-
}))}
|
|
2129
|
-
${BgWidget.title(`選擇群發對象`)}
|
|
2130
|
-
<div class="flex-fill"></div>
|
|
2131
|
-
<button
|
|
2132
|
-
class="btn bt_c39 me-2"
|
|
2133
|
-
style="height:38px;font-size: 14px;"
|
|
2134
|
-
onclick="${gvc.event(() => {
|
|
2135
|
-
const dialog = new ShareDialog(gvc.glitter);
|
|
2136
|
-
dialog.dataLoading({
|
|
2137
|
-
text: '發送中...',
|
|
2138
|
-
visible: true,
|
|
2139
|
-
});
|
|
2140
|
-
ApiFcm.send({
|
|
2141
|
-
device_token: ['all'],
|
|
2142
|
-
title: dd.content.title,
|
|
2143
|
-
content: dd.content.content,
|
|
2144
|
-
link: dd.content.link,
|
|
2145
|
-
}).then(() => {
|
|
2146
|
-
dialog.dataLoading({ visible: false });
|
|
2147
|
-
dialog.successMessage({ text: `發送成功` });
|
|
2148
|
-
});
|
|
2149
|
-
})}"
|
|
2150
|
-
>
|
|
2151
|
-
發送給所有用戶
|
|
2152
|
-
</button>
|
|
2153
|
-
<button
|
|
2154
|
-
class="btn bt_c39"
|
|
2155
|
-
style="height:38px;font-size: 14px;"
|
|
2156
|
-
onclick="${gvc.event(() => {
|
|
2157
|
-
const dialog = new ShareDialog(gvc.glitter);
|
|
2158
|
-
if (dataList.length > 0) {
|
|
1793
|
+
${BgWidget.container(BgWidget.mainCard([
|
|
1794
|
+
BgWidget.searchPlace(gvc.event((e, event) => {
|
|
1795
|
+
vm.query = e.value;
|
|
1796
|
+
gvc.notifyDataChange(id);
|
|
1797
|
+
}), vm.query || '', '搜尋所有信件內容'),
|
|
1798
|
+
BgWidget.tableV3({
|
|
1799
|
+
gvc: gvc,
|
|
1800
|
+
getData: (vmi) => {
|
|
1801
|
+
const limit = 20;
|
|
1802
|
+
ApiPost.getManagerPost({
|
|
1803
|
+
page: vmi.page - 1,
|
|
1804
|
+
limit: limit,
|
|
1805
|
+
search: vm.query ? [`title->${vm.query}`] : undefined,
|
|
1806
|
+
type: 'notify-message-config',
|
|
1807
|
+
}).then((data) => {
|
|
1808
|
+
function getDatalist() {
|
|
1809
|
+
return data.response.data.map((dd) => {
|
|
1810
|
+
return [
|
|
1811
|
+
{
|
|
1812
|
+
key: '推播標題',
|
|
1813
|
+
value: `<span class="fs-7">${dd.content.title}</span>`,
|
|
1814
|
+
},
|
|
1815
|
+
{
|
|
1816
|
+
key: '推播內文',
|
|
1817
|
+
value: `<span class="fs-7">${Tool.truncateString(dd.content.content.replace(/<[^>]*>/g, ''), 30)}</span>`,
|
|
1818
|
+
},
|
|
1819
|
+
{
|
|
1820
|
+
key: '發送推播',
|
|
1821
|
+
value: html ` <button
|
|
1822
|
+
class="btn btn-primary-c px-4"
|
|
1823
|
+
style="width:20px !important;height: 30px;"
|
|
1824
|
+
onclick="${gvc.event((e, event) => {
|
|
1825
|
+
event.stopPropagation();
|
|
1826
|
+
gvc.glitter.innerDialog((gvc) => {
|
|
1827
|
+
let dataList = [];
|
|
1828
|
+
return html `
|
|
1829
|
+
<div style="max-height: calc(100vh - 100px);overflow-y: auto;">
|
|
1830
|
+
${BgWidget.container(BgWidget.card([
|
|
1831
|
+
html `
|
|
1832
|
+
<div class="d-flex w-100 align-items-center mb-3 ">
|
|
1833
|
+
${BgWidget.goBack(gvc.event(() => {
|
|
1834
|
+
gvc.closeDialog();
|
|
1835
|
+
}))}
|
|
1836
|
+
${BgWidget.title(`選擇群發對象`)}
|
|
1837
|
+
<div class="flex-fill"></div>
|
|
1838
|
+
<button
|
|
1839
|
+
class="btn bt_c39 me-2"
|
|
1840
|
+
style="height:38px;font-size: 14px;"
|
|
1841
|
+
onclick="${gvc.event(() => {
|
|
1842
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
2159
1843
|
dialog.dataLoading({
|
|
2160
1844
|
text: '發送中...',
|
|
2161
1845
|
visible: true,
|
|
2162
1846
|
});
|
|
2163
1847
|
ApiFcm.send({
|
|
2164
|
-
device_token:
|
|
2165
|
-
return dd.deviceToken;
|
|
2166
|
-
}),
|
|
1848
|
+
device_token: ['all'],
|
|
2167
1849
|
title: dd.content.title,
|
|
2168
1850
|
content: dd.content.content,
|
|
2169
1851
|
link: dd.content.link,
|
|
2170
1852
|
}).then(() => {
|
|
2171
1853
|
dialog.dataLoading({ visible: false });
|
|
2172
|
-
dialog.successMessage({ text:
|
|
1854
|
+
dialog.successMessage({ text: `發送成功` });
|
|
2173
1855
|
});
|
|
2174
|
-
}
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
}
|
|
2200
|
-
vmi.data = getDatalist();
|
|
2201
|
-
vmi.loading = false;
|
|
2202
|
-
vmi.callback();
|
|
2203
|
-
});
|
|
2204
|
-
},
|
|
2205
|
-
rowClick: (data, index) => {
|
|
2206
|
-
vm.data = vm.dataList[index].content;
|
|
2207
|
-
vm.type = 'replace';
|
|
2208
|
-
},
|
|
2209
|
-
filter: html ` ${BgWidget.searchPlace(gvc.event((e, event) => {
|
|
2210
|
-
vm.query = e.value;
|
|
2211
|
-
gvc.notifyDataChange(id);
|
|
2212
|
-
}), vm.query || '', '搜尋所有信件內容')}
|
|
2213
|
-
${gvc.bindView(() => {
|
|
2214
|
-
return {
|
|
2215
|
-
bind: filterID,
|
|
2216
|
-
view: () => {
|
|
2217
|
-
if (!vm.dataList ||
|
|
2218
|
-
!vm.dataList.find((dd) => {
|
|
2219
|
-
return dd.checked;
|
|
2220
|
-
})) {
|
|
2221
|
-
return ``;
|
|
2222
|
-
}
|
|
2223
|
-
else {
|
|
2224
|
-
const dialog = new ShareDialog(gvc.glitter);
|
|
2225
|
-
const selCount = vm.dataList.filter((dd) => dd.checked).length;
|
|
2226
|
-
return BgWidget.selNavbar({
|
|
2227
|
-
count: selCount,
|
|
2228
|
-
buttonList: [
|
|
2229
|
-
BgWidget.selEventButton('批量移除', gvc.event(() => {
|
|
2230
|
-
dialog.checkYesOrNot({
|
|
2231
|
-
text: '是否確認刪除所選項目?',
|
|
2232
|
-
callback: (response) => {
|
|
2233
|
-
if (response) {
|
|
2234
|
-
dialog.dataLoading({ visible: true });
|
|
2235
|
-
ApiPost.delete({
|
|
2236
|
-
id: vm.dataList
|
|
2237
|
-
.filter((dd) => {
|
|
2238
|
-
return dd.checked;
|
|
2239
|
-
})
|
|
2240
|
-
.map((dd) => {
|
|
2241
|
-
return dd.id;
|
|
2242
|
-
})
|
|
2243
|
-
.join(`,`),
|
|
2244
|
-
}).then((res) => {
|
|
2245
|
-
dialog.dataLoading({ visible: false });
|
|
2246
|
-
if (res.result) {
|
|
2247
|
-
vm.dataList = undefined;
|
|
2248
|
-
gvc.notifyDataChange(id);
|
|
1856
|
+
})}"
|
|
1857
|
+
>
|
|
1858
|
+
發送給所有用戶
|
|
1859
|
+
</button>
|
|
1860
|
+
<button
|
|
1861
|
+
class="btn bt_c39"
|
|
1862
|
+
style="height:38px;font-size: 14px;"
|
|
1863
|
+
onclick="${gvc.event(() => {
|
|
1864
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
1865
|
+
if (dataList.length > 0) {
|
|
1866
|
+
dialog.dataLoading({
|
|
1867
|
+
text: '發送中...',
|
|
1868
|
+
visible: true,
|
|
1869
|
+
});
|
|
1870
|
+
ApiFcm.send({
|
|
1871
|
+
device_token: dataList.map((dd) => {
|
|
1872
|
+
return dd.deviceToken;
|
|
1873
|
+
}),
|
|
1874
|
+
title: dd.content.title,
|
|
1875
|
+
content: dd.content.content,
|
|
1876
|
+
link: dd.content.link,
|
|
1877
|
+
}).then(() => {
|
|
1878
|
+
dialog.dataLoading({ visible: false });
|
|
1879
|
+
dialog.successMessage({ text: '發送成功' });
|
|
1880
|
+
});
|
|
2249
1881
|
}
|
|
2250
1882
|
else {
|
|
2251
|
-
dialog.errorMessage({ text: '
|
|
1883
|
+
dialog.errorMessage({ text: '請選擇發送對象' });
|
|
2252
1884
|
}
|
|
2253
|
-
})
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
1885
|
+
})}"
|
|
1886
|
+
>
|
|
1887
|
+
確認並發送
|
|
1888
|
+
</button>
|
|
1889
|
+
</div>
|
|
1890
|
+
` +
|
|
1891
|
+
BgSNS.fcmDevice(gvc, 'select', (data) => {
|
|
1892
|
+
dataList = data;
|
|
1893
|
+
}),
|
|
1894
|
+
].join('')), 900)}
|
|
1895
|
+
<div></div>
|
|
1896
|
+
</div>
|
|
1897
|
+
`;
|
|
1898
|
+
}, 'email');
|
|
1899
|
+
})}"
|
|
1900
|
+
>
|
|
1901
|
+
<i class="fa-sharp fa-regular fa-paper-plane-top"></i>
|
|
1902
|
+
</button>`,
|
|
1903
|
+
},
|
|
1904
|
+
];
|
|
2259
1905
|
});
|
|
2260
1906
|
}
|
|
1907
|
+
vm.dataList = data.response.data;
|
|
1908
|
+
vmi.pageSize = Math.ceil(data.response.total / limit);
|
|
1909
|
+
vmi.originalData = vm.dataList;
|
|
1910
|
+
vmi.tableData = getDatalist();
|
|
1911
|
+
vmi.loading = false;
|
|
1912
|
+
vmi.callback();
|
|
1913
|
+
});
|
|
1914
|
+
},
|
|
1915
|
+
rowClick: (data, index) => {
|
|
1916
|
+
vm.data = vm.dataList[index].content;
|
|
1917
|
+
vm.type = 'replace';
|
|
1918
|
+
},
|
|
1919
|
+
filter: [
|
|
1920
|
+
{
|
|
1921
|
+
name: '批量移除',
|
|
1922
|
+
option: false,
|
|
1923
|
+
event: () => {
|
|
1924
|
+
const dialog = new ShareDialog(glitter);
|
|
1925
|
+
dialog.checkYesOrNot({
|
|
1926
|
+
text: '是否確認刪除所選項目?',
|
|
1927
|
+
callback: (response) => {
|
|
1928
|
+
if (response) {
|
|
1929
|
+
dialog.dataLoading({ visible: true });
|
|
1930
|
+
ApiPost.delete({
|
|
1931
|
+
id: vm.dataList
|
|
1932
|
+
.filter((dd) => {
|
|
1933
|
+
return dd.checked;
|
|
1934
|
+
})
|
|
1935
|
+
.map((dd) => {
|
|
1936
|
+
return dd.id;
|
|
1937
|
+
})
|
|
1938
|
+
.join(`,`),
|
|
1939
|
+
}).then((res) => {
|
|
1940
|
+
dialog.dataLoading({ visible: false });
|
|
1941
|
+
if (res.result) {
|
|
1942
|
+
vm.dataList = undefined;
|
|
1943
|
+
gvc.notifyDataChange(id);
|
|
1944
|
+
}
|
|
1945
|
+
else {
|
|
1946
|
+
dialog.errorMessage({ text: '刪除失敗' });
|
|
1947
|
+
}
|
|
1948
|
+
});
|
|
1949
|
+
}
|
|
1950
|
+
},
|
|
1951
|
+
});
|
|
1952
|
+
},
|
|
2261
1953
|
},
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
!vm.dataList.find((dd) => {
|
|
2266
|
-
return dd.checked;
|
|
2267
|
-
})
|
|
2268
|
-
? `d-none`
|
|
2269
|
-
: ``}`,
|
|
2270
|
-
style: ``,
|
|
2271
|
-
};
|
|
2272
|
-
},
|
|
2273
|
-
};
|
|
2274
|
-
})}`,
|
|
2275
|
-
})))}
|
|
1954
|
+
],
|
|
1955
|
+
}),
|
|
1956
|
+
].join('')))}
|
|
2276
1957
|
`, BgWidget.getContainerWidth());
|
|
2277
1958
|
}
|
|
2278
1959
|
else if (vm.type == 'replace') {
|
|
@@ -2293,8 +1974,7 @@ export class BgSNS {
|
|
|
2293
1974
|
};
|
|
2294
1975
|
});
|
|
2295
1976
|
}
|
|
2296
|
-
static rebackMessage(gvc, type = 'list', callback = () => {
|
|
2297
|
-
}) {
|
|
1977
|
+
static rebackMessage(gvc, type = 'list', callback = () => { }) {
|
|
2298
1978
|
const vm = {
|
|
2299
1979
|
type: 'list',
|
|
2300
1980
|
data: {
|
|
@@ -2502,8 +2182,7 @@ export class BgSNS {
|
|
|
2502
2182
|
},
|
|
2503
2183
|
},
|
|
2504
2184
|
],
|
|
2505
|
-
refresh: () => {
|
|
2506
|
-
},
|
|
2185
|
+
refresh: () => { },
|
|
2507
2186
|
formData: vm.data.content,
|
|
2508
2187
|
})}`)}
|
|
2509
2188
|
`, 800);
|
|
@@ -2618,8 +2297,7 @@ export class BgSNS {
|
|
|
2618
2297
|
};
|
|
2619
2298
|
});
|
|
2620
2299
|
}
|
|
2621
|
-
static customerMessage(gvc, type = 'list', callback = () => {
|
|
2622
|
-
}) {
|
|
2300
|
+
static customerMessage(gvc, type = 'list', callback = () => { }) {
|
|
2623
2301
|
const vm = {
|
|
2624
2302
|
type: 'list',
|
|
2625
2303
|
data: {
|
|
@@ -2823,8 +2501,7 @@ export class BgSNS {
|
|
|
2823
2501
|
},
|
|
2824
2502
|
},
|
|
2825
2503
|
],
|
|
2826
|
-
refresh: () => {
|
|
2827
|
-
},
|
|
2504
|
+
refresh: () => { },
|
|
2828
2505
|
formData: vm.data.content,
|
|
2829
2506
|
})}`)}
|
|
2830
2507
|
`, 800);
|
|
@@ -2834,9 +2511,9 @@ export class BgSNS {
|
|
|
2834
2511
|
${BgWidget.title('客服訊息')}
|
|
2835
2512
|
<div class="flex-fill"></div>
|
|
2836
2513
|
<button
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2514
|
+
class="btn hoverBtn me-2 px-3"
|
|
2515
|
+
style="height:35px !important;font-size: 14px;color:black;border:1px solid black;"
|
|
2516
|
+
onclick="${gvc.event(() => {
|
|
2840
2517
|
EditorElem.openEditorDialog(gvc, (gvc) => {
|
|
2841
2518
|
const saasConfig = window.saasConfig;
|
|
2842
2519
|
const id = gvc.glitter.getUUID();
|
|
@@ -2869,7 +2546,7 @@ export class BgSNS {
|
|
|
2869
2546
|
},
|
|
2870
2547
|
input: {
|
|
2871
2548
|
class: '',
|
|
2872
|
-
style: ''
|
|
2549
|
+
style: '',
|
|
2873
2550
|
},
|
|
2874
2551
|
container: {
|
|
2875
2552
|
class: '',
|
|
@@ -2936,13 +2613,12 @@ export class BgSNS {
|
|
|
2936
2613
|
},
|
|
2937
2614
|
};
|
|
2938
2615
|
}),
|
|
2939
|
-
html `
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
onclick="${gvc.event(() => {
|
|
2616
|
+
html ` <div class="d-flex">
|
|
2617
|
+
<div class="flex-fill"></div>
|
|
2618
|
+
<div
|
|
2619
|
+
class=" btn-primary-c btn my-2 me-2"
|
|
2620
|
+
style="margin-left: 10px;height:35px;"
|
|
2621
|
+
onclick="${gvc.event(() => {
|
|
2946
2622
|
dialog.dataLoading({ visible: true });
|
|
2947
2623
|
ApiUser.setPublicConfig({
|
|
2948
2624
|
key: `robot_auto_reply`,
|
|
@@ -2953,13 +2629,12 @@ export class BgSNS {
|
|
|
2953
2629
|
dialog.successMessage({ text: '設定成功' });
|
|
2954
2630
|
});
|
|
2955
2631
|
})}"
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2632
|
+
>
|
|
2633
|
+
儲存設定
|
|
2634
|
+
</div>
|
|
2635
|
+
</div>`,
|
|
2960
2636
|
].join('');
|
|
2961
|
-
}, () => {
|
|
2962
|
-
}, 500, '自訂表單');
|
|
2637
|
+
}, () => { }, 500, '自訂表單');
|
|
2963
2638
|
})}"
|
|
2964
2639
|
>
|
|
2965
2640
|
<i class="fa-regular fa-gear me-2 "></i>
|
|
@@ -3009,14 +2684,14 @@ export class BgSNS {
|
|
|
3009
2684
|
filter: html `
|
|
3010
2685
|
<div style="height:50px;" class="w-100 border-bottom ">
|
|
3011
2686
|
<input
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
2687
|
+
class="form-control h-100 "
|
|
2688
|
+
style="border: none;"
|
|
2689
|
+
placeholder="搜尋用戶名稱"
|
|
2690
|
+
onchange="${gvc.event((e, event) => {
|
|
3016
2691
|
vm.query = e.value;
|
|
3017
2692
|
gvc.notifyDataChange(id);
|
|
3018
2693
|
})}"
|
|
3019
|
-
|
|
2694
|
+
value="${vm.query || ''}"
|
|
3020
2695
|
/>
|
|
3021
2696
|
</div>
|
|
3022
2697
|
${gvc.bindView(() => {
|