ts-glitter 13.3.5 → 13.3.7
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 +3 -0
- package/lowcode/jspage/main.ts +3 -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
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import {GVC} from '../glitterBundle/GVController.js';
|
|
2
|
-
import {BgWidget} from './bg-widget.js';
|
|
3
|
-
import {ApiUser} from '../glitter-base/route/user.js';
|
|
4
|
-
import {EditorElem} from '../glitterBundle/plugins/editor-elem.js';
|
|
5
|
-
import {ShareDialog} from '../glitterBundle/dialog/ShareDialog.js';
|
|
6
|
-
import {ApiPost} from '../glitter-base/route/post.js';
|
|
7
|
-
import {ApiFcm} from '../glitter-base/route/fcm.js';
|
|
8
|
-
import {FormWidget} from '../official_view_component/official/form.js';
|
|
9
|
-
import {Chat} from '../glitter-base/route/chat.js';
|
|
10
|
-
import {FilterOptions} from '../cms-plugin/filter-options.js';
|
|
11
|
-
import {ShoppingDiscountSetting} from '../cms-plugin/shopping-discount-setting.js';
|
|
12
|
-
import {ApiSmtp} from '../glitter-base/route/smtp.js';
|
|
13
|
-
import {BgListComponent} from './bg-list-component.js';
|
|
14
|
-
import {Tool} from '../modules/tool.js';
|
|
15
|
-
import {ApiWallet} from
|
|
16
|
-
import {ApiSns} from
|
|
1
|
+
import { GVC } from '../glitterBundle/GVController.js';
|
|
2
|
+
import { BgWidget } from './bg-widget.js';
|
|
3
|
+
import { ApiUser } from '../glitter-base/route/user.js';
|
|
4
|
+
import { EditorElem } from '../glitterBundle/plugins/editor-elem.js';
|
|
5
|
+
import { ShareDialog } from '../glitterBundle/dialog/ShareDialog.js';
|
|
6
|
+
import { ApiPost } from '../glitter-base/route/post.js';
|
|
7
|
+
import { ApiFcm } from '../glitter-base/route/fcm.js';
|
|
8
|
+
import { FormWidget } from '../official_view_component/official/form.js';
|
|
9
|
+
import { Chat } from '../glitter-base/route/chat.js';
|
|
10
|
+
import { FilterOptions } from '../cms-plugin/filter-options.js';
|
|
11
|
+
import { ShoppingDiscountSetting } from '../cms-plugin/shopping-discount-setting.js';
|
|
12
|
+
import { ApiSmtp } from '../glitter-base/route/smtp.js';
|
|
13
|
+
import { BgListComponent } from './bg-list-component.js';
|
|
14
|
+
import { Tool } from '../modules/tool.js';
|
|
15
|
+
import { ApiWallet } from '../glitter-base/route/wallet.js';
|
|
16
|
+
import { ApiSns } from '../glitter-base/route/sms.js';
|
|
17
17
|
|
|
18
18
|
const html = String.raw;
|
|
19
19
|
|
|
20
20
|
interface EmailObject {
|
|
21
21
|
id: number;
|
|
22
22
|
email: string;
|
|
23
|
-
phone:string
|
|
23
|
+
phone: string;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export type PostData = {
|
|
@@ -45,8 +45,7 @@ export class BgSNS {
|
|
|
45
45
|
public static longSMS = 153;
|
|
46
46
|
public static ticket = 15;
|
|
47
47
|
|
|
48
|
-
public static email(gvc: GVC, type: 'list' | 'select' = 'list', callback: (select: any) => void = () => {
|
|
49
|
-
}) {
|
|
48
|
+
public static email(gvc: GVC, type: 'list' | 'select' = 'list', callback: (select: any) => void = () => {}) {
|
|
50
49
|
const vm: {
|
|
51
50
|
type: 'list' | 'replace';
|
|
52
51
|
data: any;
|
|
@@ -58,7 +57,7 @@ export class BgSNS {
|
|
|
58
57
|
id: 61,
|
|
59
58
|
userID: 549313940,
|
|
60
59
|
account: 'jianzhi.wang@homee.ai',
|
|
61
|
-
userData: {name: '王建智', email: 'jianzhi.wang@homee.ai', phone: '0978028739'},
|
|
60
|
+
userData: { name: '王建智', email: 'jianzhi.wang@homee.ai', phone: '0978028739' },
|
|
62
61
|
created_time: '2023-11-26T02:14:09.000Z',
|
|
63
62
|
role: 0,
|
|
64
63
|
company: null,
|
|
@@ -77,64 +76,8 @@ export class BgSNS {
|
|
|
77
76
|
let vmi: any = undefined;
|
|
78
77
|
|
|
79
78
|
function getDatalist() {
|
|
80
|
-
let interval: any = 0;
|
|
81
79
|
return vm.dataList.map((dd: any) => {
|
|
82
80
|
return [
|
|
83
|
-
{
|
|
84
|
-
key: (() => {
|
|
85
|
-
clearInterval(interval);
|
|
86
|
-
if (
|
|
87
|
-
!vm.dataList.find((dd: any) => {
|
|
88
|
-
return !dd.checked;
|
|
89
|
-
})
|
|
90
|
-
) {
|
|
91
|
-
interval = setTimeout(() => {
|
|
92
|
-
ApiUser.getSubScribe({
|
|
93
|
-
page: vmi.page - 1,
|
|
94
|
-
limit: 100000,
|
|
95
|
-
search: vm.query || undefined,
|
|
96
|
-
}).then((data) => {
|
|
97
|
-
callback(data.response.data);
|
|
98
|
-
});
|
|
99
|
-
}, 10);
|
|
100
|
-
}
|
|
101
|
-
return EditorElem.checkBoxOnly({
|
|
102
|
-
gvc: gvc,
|
|
103
|
-
def: !vm.dataList.find((dd: any) => {
|
|
104
|
-
return !dd.checked;
|
|
105
|
-
}),
|
|
106
|
-
callback: (result) => {
|
|
107
|
-
vm.dataList.map((dd: any) => {
|
|
108
|
-
dd.checked = result;
|
|
109
|
-
});
|
|
110
|
-
vmi.data = getDatalist();
|
|
111
|
-
vmi.callback();
|
|
112
|
-
gvc.notifyDataChange(filterID);
|
|
113
|
-
callback(
|
|
114
|
-
vm.dataList.filter((dd: any) => {
|
|
115
|
-
return dd.checked;
|
|
116
|
-
})
|
|
117
|
-
);
|
|
118
|
-
},
|
|
119
|
-
});
|
|
120
|
-
})(),
|
|
121
|
-
value: EditorElem.checkBoxOnly({
|
|
122
|
-
gvc: gvc,
|
|
123
|
-
def: dd.checked,
|
|
124
|
-
callback: (result) => {
|
|
125
|
-
dd.checked = result;
|
|
126
|
-
vmi.data = getDatalist();
|
|
127
|
-
vmi.callback();
|
|
128
|
-
gvc.notifyDataChange(filterID);
|
|
129
|
-
callback(
|
|
130
|
-
vm.dataList.filter((dd: any) => {
|
|
131
|
-
return dd.checked;
|
|
132
|
-
})
|
|
133
|
-
);
|
|
134
|
-
},
|
|
135
|
-
style: 'height:25px;',
|
|
136
|
-
}),
|
|
137
|
-
},
|
|
138
81
|
{
|
|
139
82
|
key: '註冊信箱',
|
|
140
83
|
value: `<span class="fs-7">${dd.email}</span>`,
|
|
@@ -149,120 +92,81 @@ export class BgSNS {
|
|
|
149
92
|
|
|
150
93
|
return BgWidget.container(
|
|
151
94
|
BgWidget.mainCard(
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
95
|
+
[
|
|
96
|
+
BgWidget.searchPlace(
|
|
97
|
+
gvc.event((e) => {
|
|
98
|
+
vm.query = e.value;
|
|
99
|
+
gvc.notifyDataChange(id);
|
|
100
|
+
}),
|
|
101
|
+
vm.query || '',
|
|
102
|
+
'搜尋信箱或標籤'
|
|
103
|
+
),
|
|
104
|
+
BgWidget.tableV3({
|
|
105
|
+
gvc: gvc,
|
|
106
|
+
getData: (vmk) => {
|
|
107
|
+
vmi = vmk;
|
|
108
|
+
const limit = 20;
|
|
109
|
+
ApiUser.getSubScribe({
|
|
110
|
+
page: vmi.page - 1,
|
|
111
|
+
limit: limit,
|
|
112
|
+
search: vm.query || undefined,
|
|
113
|
+
filter: { account: 'no' },
|
|
114
|
+
}).then((data) => {
|
|
115
|
+
vm.dataList = data.response.data;
|
|
116
|
+
vmi.pageSize = Math.ceil(data.response.total / limit);
|
|
117
|
+
vmi.originalData = vm.dataList;
|
|
118
|
+
vmi.tableData = getDatalist();
|
|
119
|
+
vmi.loading = false;
|
|
120
|
+
vmi.callback();
|
|
121
|
+
if (type === 'select') {
|
|
122
|
+
callback(
|
|
123
|
+
vm.dataList.filter((dd: any) => {
|
|
124
|
+
return dd.checked;
|
|
125
|
+
})
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
},
|
|
130
|
+
rowClick: (data, index) => {
|
|
131
|
+
vm.dataList[index].checked = !vm.dataList[index].checked;
|
|
164
132
|
vmi.data = getDatalist();
|
|
165
|
-
vmi.loading = false;
|
|
166
133
|
vmi.callback();
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
bind: filterID,
|
|
199
|
-
view: () => {
|
|
200
|
-
if (
|
|
201
|
-
!vm.dataList ||
|
|
202
|
-
!vm.dataList.find((dd: any) => {
|
|
203
|
-
return dd.checked;
|
|
204
|
-
})
|
|
205
|
-
) {
|
|
206
|
-
return ``;
|
|
207
|
-
} else {
|
|
208
|
-
const dialog = new ShareDialog(gvc.glitter);
|
|
209
|
-
const selCount = vm.dataList.filter((dd: any) => dd.checked).length;
|
|
210
|
-
return BgWidget.selNavbar({
|
|
211
|
-
count: selCount,
|
|
212
|
-
buttonList: [
|
|
213
|
-
BgWidget.selEventButton(
|
|
214
|
-
'批量移除',
|
|
215
|
-
gvc.event(() => {
|
|
216
|
-
dialog.checkYesOrNot({
|
|
217
|
-
text: '是否確認刪除所選項目?',
|
|
218
|
-
callback: (response) => {
|
|
219
|
-
if (response) {
|
|
220
|
-
dialog.dataLoading({visible: true});
|
|
221
|
-
ApiUser.deleteSubscribe({
|
|
222
|
-
email: vm.dataList
|
|
223
|
-
.filter((dd: any) => {
|
|
224
|
-
return dd.checked;
|
|
225
|
-
})
|
|
226
|
-
.map((dd: any) => {
|
|
227
|
-
return dd.email;
|
|
228
|
-
})
|
|
229
|
-
.join(`,`),
|
|
230
|
-
}).then((res) => {
|
|
231
|
-
dialog.dataLoading({visible: false});
|
|
232
|
-
if (res.result) {
|
|
233
|
-
vm.dataList = undefined;
|
|
234
|
-
gvc.notifyDataChange(id);
|
|
235
|
-
} else {
|
|
236
|
-
dialog.errorMessage({text: '刪除失敗'});
|
|
237
|
-
}
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
},
|
|
241
|
-
});
|
|
242
|
-
})
|
|
243
|
-
),
|
|
244
|
-
],
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
},
|
|
248
|
-
divCreate: () => {
|
|
249
|
-
return {
|
|
250
|
-
class: `d-flex align-items-center p-2 py-3 ${
|
|
251
|
-
!vm.dataList ||
|
|
252
|
-
!vm.dataList.find((dd: any) => {
|
|
253
|
-
return dd.checked;
|
|
254
|
-
}) ||
|
|
255
|
-
type === 'select'
|
|
256
|
-
? `d-none`
|
|
257
|
-
: ``
|
|
258
|
-
}`,
|
|
259
|
-
style: ``,
|
|
260
|
-
};
|
|
134
|
+
gvc.notifyDataChange(filterID);
|
|
135
|
+
callback(
|
|
136
|
+
vm.dataList.filter((dd: any) => {
|
|
137
|
+
return dd.checked;
|
|
138
|
+
})
|
|
139
|
+
);
|
|
140
|
+
},
|
|
141
|
+
filter: [
|
|
142
|
+
{
|
|
143
|
+
name: '批量移除',
|
|
144
|
+
event: (checkedData) => {
|
|
145
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
146
|
+
dialog.checkYesOrNot({
|
|
147
|
+
text: '是否確認刪除所選項目?',
|
|
148
|
+
callback: (response) => {
|
|
149
|
+
if (response) {
|
|
150
|
+
dialog.dataLoading({ visible: true });
|
|
151
|
+
ApiUser.deleteSubscribe({
|
|
152
|
+
email: checkedData.map((dd: any) => dd.email).join(`,`),
|
|
153
|
+
}).then((res) => {
|
|
154
|
+
dialog.dataLoading({ visible: false });
|
|
155
|
+
if (res.result) {
|
|
156
|
+
vm.dataList = undefined;
|
|
157
|
+
gvc.notifyDataChange(id);
|
|
158
|
+
} else {
|
|
159
|
+
dialog.errorMessage({ text: '刪除失敗' });
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
});
|
|
261
165
|
},
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
}),
|
|
169
|
+
].join('')
|
|
266
170
|
),
|
|
267
171
|
type === 'select' ? 850 : BgWidget.getContainerWidth(),
|
|
268
172
|
'padding: 0;'
|
|
@@ -290,7 +194,7 @@ export class BgSNS {
|
|
|
290
194
|
const filterID = glitter.getUUID();
|
|
291
195
|
return {
|
|
292
196
|
bind: id,
|
|
293
|
-
dataList: [{obj: vm, key: 'type'}],
|
|
197
|
+
dataList: [{ obj: vm, key: 'type' }],
|
|
294
198
|
view: () => {
|
|
295
199
|
if (vm.type === 'list') {
|
|
296
200
|
return BgWidget.container(
|
|
@@ -299,156 +203,92 @@ export class BgSNS {
|
|
|
299
203
|
${BgWidget.title('簡訊定型文')}
|
|
300
204
|
<div class="flex-fill"></div>
|
|
301
205
|
${BgWidget.darkButton(
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
206
|
+
'新增',
|
|
207
|
+
gvc.event(() => {
|
|
208
|
+
vm.data = undefined;
|
|
209
|
+
vm.type = 'add';
|
|
210
|
+
})
|
|
307
211
|
)}
|
|
308
212
|
</div>
|
|
309
213
|
${BgWidget.container(
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
dd.checked = result;
|
|
345
|
-
vmi.data = getDatalist();
|
|
346
|
-
vmi.callback();
|
|
347
|
-
gvc.notifyDataChange(filterID);
|
|
348
|
-
},
|
|
349
|
-
style: 'height:25px;',
|
|
350
|
-
}),
|
|
351
|
-
},
|
|
352
|
-
{
|
|
353
|
-
key: '標題',
|
|
354
|
-
value: html`<span
|
|
355
|
-
class="fs-7">${dd.content.title}</span>`,
|
|
356
|
-
},
|
|
357
|
-
{
|
|
358
|
-
key: '最後更新時間',
|
|
359
|
-
value: dd.updated_time ? gvc.glitter.ut.dateFormat(new Date(dd.updated_time), 'yyyy-MM-dd') : '無',
|
|
360
|
-
},
|
|
361
|
-
];
|
|
362
|
-
});
|
|
363
|
-
}
|
|
214
|
+
BgWidget.mainCard(
|
|
215
|
+
[
|
|
216
|
+
BgWidget.searchPlace(
|
|
217
|
+
gvc.event((e) => {
|
|
218
|
+
vm.query = e.value;
|
|
219
|
+
gvc.notifyDataChange(id);
|
|
220
|
+
}),
|
|
221
|
+
vm.query || '',
|
|
222
|
+
'搜尋所有信件內容'
|
|
223
|
+
),
|
|
224
|
+
BgWidget.tableV3({
|
|
225
|
+
gvc: gvc,
|
|
226
|
+
getData: (vmi) => {
|
|
227
|
+
const limit = 20;
|
|
228
|
+
ApiPost.getManagerPost({
|
|
229
|
+
page: vmi.page - 1,
|
|
230
|
+
limit: limit,
|
|
231
|
+
search: vm.query ? [`title->${vm.query}`] : undefined,
|
|
232
|
+
type: 'notify-sns-config',
|
|
233
|
+
}).then((data) => {
|
|
234
|
+
function getDatalist() {
|
|
235
|
+
return data.response.data.map((dd: any) => {
|
|
236
|
+
return [
|
|
237
|
+
{
|
|
238
|
+
key: '標題',
|
|
239
|
+
value: html`<span class="fs-7">${dd.content.title}</span>`,
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
key: '最後更新時間',
|
|
243
|
+
value: dd.updated_time ? gvc.glitter.ut.dateFormat(new Date(dd.updated_time), 'yyyy-MM-dd') : '無',
|
|
244
|
+
},
|
|
245
|
+
];
|
|
246
|
+
});
|
|
247
|
+
}
|
|
364
248
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
249
|
+
vm.dataList = data.response.data;
|
|
250
|
+
vmi.pageSize = Math.ceil(data.response.total / limit);
|
|
251
|
+
vmi.originalData = vm.dataList;
|
|
252
|
+
vmi.tableData = getDatalist();
|
|
253
|
+
vmi.loading = false;
|
|
254
|
+
vmi.callback();
|
|
255
|
+
});
|
|
256
|
+
},
|
|
257
|
+
rowClick: (data, index) => {
|
|
258
|
+
vm.data = vm.dataList[index].content;
|
|
259
|
+
vm.type = 'replace';
|
|
260
|
+
},
|
|
261
|
+
filter: [
|
|
262
|
+
{
|
|
263
|
+
name: '批量移除',
|
|
264
|
+
option: false,
|
|
265
|
+
event: (checkedData) => {
|
|
266
|
+
const dialog = new ShareDialog(glitter);
|
|
267
|
+
dialog.checkYesOrNot({
|
|
268
|
+
text: '是否確認刪除所選項目?',
|
|
269
|
+
callback: (response) => {
|
|
270
|
+
if (response) {
|
|
271
|
+
dialog.dataLoading({ visible: true });
|
|
272
|
+
ApiPost.delete({
|
|
273
|
+
id: checkedData.map((dd: any) => dd.id).join(`,`),
|
|
274
|
+
}).then((res) => {
|
|
275
|
+
dialog.dataLoading({ visible: false });
|
|
276
|
+
if (res.result) {
|
|
277
|
+
vm.dataList = undefined;
|
|
278
|
+
gvc.notifyDataChange(id);
|
|
279
|
+
} else {
|
|
280
|
+
dialog.errorMessage({ text: '刪除失敗' });
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
});
|
|
286
|
+
},
|
|
374
287
|
},
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
}),
|
|
380
|
-
vm.query || '',
|
|
381
|
-
'搜尋所有信件內容'
|
|
382
|
-
)}
|
|
383
|
-
${gvc.bindView(() => {
|
|
384
|
-
return {
|
|
385
|
-
bind: filterID,
|
|
386
|
-
view: () => {
|
|
387
|
-
if (
|
|
388
|
-
!vm.dataList ||
|
|
389
|
-
!vm.dataList.find((dd: any) => {
|
|
390
|
-
return dd.checked;
|
|
391
|
-
})
|
|
392
|
-
) {
|
|
393
|
-
return ``;
|
|
394
|
-
} else {
|
|
395
|
-
const dialog = new ShareDialog(gvc.glitter);
|
|
396
|
-
const selCount = vm.dataList.filter((dd: any) => dd.checked).length;
|
|
397
|
-
return BgWidget.selNavbar({
|
|
398
|
-
count: selCount,
|
|
399
|
-
buttonList: [
|
|
400
|
-
BgWidget.selEventButton(
|
|
401
|
-
'批量移除',
|
|
402
|
-
gvc.event(() => {
|
|
403
|
-
dialog.checkYesOrNot({
|
|
404
|
-
text: '是否確認刪除所選項目?',
|
|
405
|
-
callback: (response) => {
|
|
406
|
-
if (response) {
|
|
407
|
-
dialog.dataLoading({visible: true});
|
|
408
|
-
ApiPost.delete({
|
|
409
|
-
id: vm.dataList
|
|
410
|
-
.filter((dd: any) => {
|
|
411
|
-
return dd.checked;
|
|
412
|
-
})
|
|
413
|
-
.map((dd: any) => {
|
|
414
|
-
return dd.id;
|
|
415
|
-
})
|
|
416
|
-
.join(`,`),
|
|
417
|
-
}).then((res) => {
|
|
418
|
-
dialog.dataLoading({visible: false});
|
|
419
|
-
if (res.result) {
|
|
420
|
-
vm.dataList = undefined;
|
|
421
|
-
gvc.notifyDataChange(id);
|
|
422
|
-
} else {
|
|
423
|
-
dialog.errorMessage({text: '刪除失敗'});
|
|
424
|
-
}
|
|
425
|
-
});
|
|
426
|
-
}
|
|
427
|
-
},
|
|
428
|
-
});
|
|
429
|
-
})
|
|
430
|
-
),
|
|
431
|
-
],
|
|
432
|
-
});
|
|
433
|
-
}
|
|
434
|
-
},
|
|
435
|
-
divCreate: () => {
|
|
436
|
-
return {
|
|
437
|
-
class: `d-flex align-items-center p-2 py-3 ${
|
|
438
|
-
!vm.dataList ||
|
|
439
|
-
!vm.dataList.find((dd: any) => {
|
|
440
|
-
return dd.checked;
|
|
441
|
-
})
|
|
442
|
-
? `d-none`
|
|
443
|
-
: ``
|
|
444
|
-
}`,
|
|
445
|
-
style: ``,
|
|
446
|
-
};
|
|
447
|
-
},
|
|
448
|
-
};
|
|
449
|
-
})}`,
|
|
450
|
-
})
|
|
451
|
-
)
|
|
288
|
+
],
|
|
289
|
+
}),
|
|
290
|
+
].join('')
|
|
291
|
+
)
|
|
452
292
|
)}
|
|
453
293
|
${BgWidget.mbContainer(120)}
|
|
454
294
|
`,
|
|
@@ -498,7 +338,7 @@ export class BgSNS {
|
|
|
498
338
|
vm.filter = ListComp.getFilterObject();
|
|
499
339
|
return {
|
|
500
340
|
bind: vm.id,
|
|
501
|
-
dataList: [{obj: vm, key: 'type'}],
|
|
341
|
+
dataList: [{ obj: vm, key: 'type' }],
|
|
502
342
|
view: () => {
|
|
503
343
|
if (vm.type === 'list') {
|
|
504
344
|
return BgWidget.container(
|
|
@@ -508,181 +348,156 @@ export class BgSNS {
|
|
|
508
348
|
<div class="flex-fill"></div>
|
|
509
349
|
</div>
|
|
510
350
|
${BgWidget.container(
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
351
|
+
BgWidget.mainCard(
|
|
352
|
+
[
|
|
353
|
+
(() => {
|
|
354
|
+
const id = glitter.getUUID();
|
|
355
|
+
return gvc.bindView({
|
|
356
|
+
bind: id,
|
|
357
|
+
view: () => {
|
|
358
|
+
const filterList = [
|
|
359
|
+
BgWidget.selectFilter({
|
|
360
|
+
gvc,
|
|
361
|
+
callback: (value: any) => {
|
|
362
|
+
vm.queryType = value;
|
|
363
|
+
gvc.notifyDataChange(vm.tableId);
|
|
364
|
+
gvc.notifyDataChange(id);
|
|
365
|
+
},
|
|
366
|
+
default: vm.queryType || 'email',
|
|
367
|
+
options: FilterOptions.snsSelect,
|
|
368
|
+
}),
|
|
369
|
+
BgWidget.searchFilter(
|
|
370
|
+
gvc.event((e) => {
|
|
371
|
+
vm.query = e.value;
|
|
372
|
+
gvc.notifyDataChange(vm.tableId);
|
|
373
|
+
gvc.notifyDataChange(id);
|
|
374
|
+
}),
|
|
375
|
+
vm.query || '',
|
|
376
|
+
'搜尋所有信件內容'
|
|
377
|
+
),
|
|
378
|
+
BgWidget.funnelFilter({
|
|
379
|
+
gvc,
|
|
380
|
+
callback: () => {
|
|
381
|
+
return ListComp.showRightMenu(FilterOptions.snsFunnel);
|
|
382
|
+
},
|
|
383
|
+
}),
|
|
384
|
+
];
|
|
545
385
|
|
|
546
|
-
|
|
386
|
+
const filterTags = ListComp.getFilterTags(FilterOptions.snsFunnel);
|
|
547
387
|
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
value: html`<span
|
|
611
|
-
class="fs-7"
|
|
612
|
-
>${(() => {
|
|
613
|
-
if (!dd.content.sendGroup) {
|
|
614
|
-
return '沒有群組';
|
|
615
|
-
}
|
|
616
|
-
const lengthLimit = 25;
|
|
617
|
-
const tagList = [];
|
|
618
|
-
for (const group of dd.content.sendGroup) {
|
|
619
|
-
const tagLength = tagList.join('').length;
|
|
620
|
-
if (tagLength + group.length > lengthLimit) {
|
|
621
|
-
tagList.push(Tool.truncateString(group, tagLength));
|
|
622
|
-
break;
|
|
623
|
-
} else {
|
|
624
|
-
tagList.push(group);
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
return tagList.join(
|
|
628
|
-
html`<span
|
|
629
|
-
class="badge fs-7 mx-1 px-1"
|
|
630
|
-
style="color: #393939; background: #FFD5D0;"
|
|
631
|
-
>${dd.content.boolean === 'and' ? '且' : '或'}</span
|
|
632
|
-
>`
|
|
633
|
-
);
|
|
634
|
-
})()}</span
|
|
635
|
-
>`,
|
|
636
|
-
},
|
|
637
|
-
{
|
|
638
|
-
key: '寄送時間',
|
|
639
|
-
value: dd.trigger_time ? gvc.glitter.ut.dateFormat(new Date(dd.trigger_time), 'yyyy-MM-dd hh:mm') : '無',
|
|
640
|
-
},
|
|
641
|
-
{
|
|
642
|
-
key: '寄送狀態',
|
|
643
|
-
value: (() => {
|
|
644
|
-
switch (dd.status) {
|
|
645
|
-
case 0:
|
|
646
|
-
return html`
|
|
647
|
-
<div class="badge fs-7"
|
|
648
|
-
style="color: #393939; background: #ffd6a4;">
|
|
649
|
-
尚未寄送
|
|
650
|
-
</div>`;
|
|
651
|
-
case 1:
|
|
652
|
-
return html`
|
|
653
|
-
<div class="badge fs-7"
|
|
654
|
-
style="color: #393939; background: #0000000f;">
|
|
655
|
-
已寄出
|
|
656
|
-
</div>`;
|
|
657
|
-
case 2:
|
|
658
|
-
return html`
|
|
659
|
-
<div class="badge fs-7"
|
|
660
|
-
style="color: #393939; background: #0000000f;">
|
|
661
|
-
取消預約
|
|
662
|
-
</div>`;
|
|
388
|
+
if (document.body.clientWidth < 768) {
|
|
389
|
+
// 手機版
|
|
390
|
+
return html` <div style="display: flex; align-items: center; gap: 10px; width: 100%; justify-content: space-between">
|
|
391
|
+
<div>${filterList[0]}</div>
|
|
392
|
+
<div style="display: flex;">
|
|
393
|
+
<div class="me-2">${filterList[2]}</div>
|
|
394
|
+
</div>
|
|
395
|
+
</div>
|
|
396
|
+
<div style="display: flex; margin-top: 8px;">${filterList[1]}</div>
|
|
397
|
+
<div>${filterTags}</div>`;
|
|
398
|
+
} else {
|
|
399
|
+
// 電腦版
|
|
400
|
+
return html` <div style="display: flex; align-items: center; gap: 10px;">${filterList.join('')}</div>
|
|
401
|
+
<div>${filterTags}</div>`;
|
|
402
|
+
}
|
|
403
|
+
},
|
|
404
|
+
});
|
|
405
|
+
})(),
|
|
406
|
+
gvc.bindView({
|
|
407
|
+
bind: vm.tableId,
|
|
408
|
+
view: () => {
|
|
409
|
+
return BgWidget.tableV3({
|
|
410
|
+
gvc: gvc,
|
|
411
|
+
getData: (vmi) => {
|
|
412
|
+
const limit = 20;
|
|
413
|
+
ApiSns.history({
|
|
414
|
+
page: vmi.page - 1,
|
|
415
|
+
limit: limit,
|
|
416
|
+
search: vm.query ?? '',
|
|
417
|
+
searchType: vm.queryType ?? 'email',
|
|
418
|
+
sendTime: undefined,
|
|
419
|
+
status: vm.filter.status,
|
|
420
|
+
mailType: vm.filter.mailType,
|
|
421
|
+
}).then((data) => {
|
|
422
|
+
if (data.result) {
|
|
423
|
+
function getDatalist() {
|
|
424
|
+
return data.response.data.map((dd: { content: PostData; status: number; trigger_time: string }) => {
|
|
425
|
+
return [
|
|
426
|
+
{
|
|
427
|
+
key: '寄件類型',
|
|
428
|
+
value: html`<span class="fs-7">${dd.content.typeName}</span>`,
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
key: '標題',
|
|
432
|
+
value: html`<span class="fs-7">${Tool.truncateString(`${dd.content.title}`, 25)}</span>`,
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
key: '收件群組',
|
|
436
|
+
value: html`<span class="fs-7"
|
|
437
|
+
>${(() => {
|
|
438
|
+
if (!dd.content.sendGroup) {
|
|
439
|
+
return '沒有群組';
|
|
440
|
+
}
|
|
441
|
+
const lengthLimit = 25;
|
|
442
|
+
const tagList = [];
|
|
443
|
+
for (const group of dd.content.sendGroup) {
|
|
444
|
+
const tagLength = tagList.join('').length;
|
|
445
|
+
if (tagLength + group.length > lengthLimit) {
|
|
446
|
+
tagList.push(Tool.truncateString(group, tagLength));
|
|
447
|
+
break;
|
|
448
|
+
} else {
|
|
449
|
+
tagList.push(group);
|
|
663
450
|
}
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
451
|
+
}
|
|
452
|
+
return tagList.join(
|
|
453
|
+
html`<span class="badge fs-7 mx-1 px-1" style="color: #393939; background: #FFD5D0;"
|
|
454
|
+
>${dd.content.boolean === 'and' ? '且' : '或'}</span
|
|
455
|
+
>`
|
|
456
|
+
);
|
|
457
|
+
})()}</span
|
|
458
|
+
>`,
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
key: '寄送時間',
|
|
462
|
+
value: dd.trigger_time ? gvc.glitter.ut.dateFormat(new Date(dd.trigger_time), 'yyyy-MM-dd hh:mm') : '無',
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
key: '寄送狀態',
|
|
466
|
+
value: (() => {
|
|
467
|
+
switch (dd.status) {
|
|
468
|
+
case 0:
|
|
469
|
+
return html` <div class="badge fs-7" style="color: #393939; background: #ffd6a4;">尚未寄送</div>`;
|
|
470
|
+
case 1:
|
|
471
|
+
return html` <div class="badge fs-7" style="color: #393939; background: #0000000f;">已寄出</div>`;
|
|
472
|
+
case 2:
|
|
473
|
+
return html` <div class="badge fs-7" style="color: #393939; background: #0000000f;">取消預約</div>`;
|
|
474
|
+
}
|
|
475
|
+
})(),
|
|
476
|
+
},
|
|
477
|
+
];
|
|
478
|
+
});
|
|
479
|
+
}
|
|
669
480
|
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
vm.dataList[index].content.status = vm.dataList[index].status;
|
|
678
|
-
vm.data = vm.dataList[index].content;
|
|
679
|
-
vm.type = 'replace';
|
|
680
|
-
},
|
|
481
|
+
vm.dataList = data.response.data;
|
|
482
|
+
vmi.pageSize = Math.ceil(data.response.total / limit);
|
|
483
|
+
vmi.originalData = vm.dataList;
|
|
484
|
+
vmi.tableData = getDatalist();
|
|
485
|
+
vmi.loading = false;
|
|
486
|
+
vmi.callback();
|
|
487
|
+
}
|
|
681
488
|
});
|
|
682
489
|
},
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
490
|
+
rowClick: (data, index) => {
|
|
491
|
+
vm.dataList[index].content.status = vm.dataList[index].status;
|
|
492
|
+
vm.data = vm.dataList[index].content;
|
|
493
|
+
vm.type = 'replace';
|
|
494
|
+
},
|
|
495
|
+
filter: [],
|
|
496
|
+
});
|
|
497
|
+
},
|
|
498
|
+
}),
|
|
499
|
+
].join('')
|
|
500
|
+
)
|
|
686
501
|
)}
|
|
687
502
|
${BgWidget.mbContainer(120)}
|
|
688
503
|
`,
|
|
@@ -721,268 +536,249 @@ export class BgSNS {
|
|
|
721
536
|
html`
|
|
722
537
|
<div class="d-flex w-100 align-items-center">
|
|
723
538
|
${BgWidget.goBack(
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
539
|
+
gvc.event(() => {
|
|
540
|
+
vm.type = 'list';
|
|
541
|
+
})
|
|
727
542
|
)}
|
|
728
543
|
${BgWidget.title(obj.readonly ? '簡訊詳細內容' : '編輯簡訊定型文')}
|
|
729
544
|
<div class="flex-fill"></div>
|
|
730
545
|
${obj.readonly
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
case 1:
|
|
744
|
-
return html`
|
|
745
|
-
<div class="badge fs-7 me-1"
|
|
746
|
-
style="color: #393939; background: #0000000f;">已寄出
|
|
747
|
-
</div>`;
|
|
748
|
-
}
|
|
749
|
-
})(),
|
|
750
|
-
].join('')
|
|
751
|
-
: ''}
|
|
546
|
+
? [
|
|
547
|
+
html` <div class="badge fs-7 me-2" style="color: #393939; background: #0000000f;">${vm.data.typeName}</div>`,
|
|
548
|
+
(() => {
|
|
549
|
+
switch (vm.data.status) {
|
|
550
|
+
case 0:
|
|
551
|
+
return html` <div class="badge fs-7 me-1" style="color: #393939; background: #ffd6a4;">尚未寄送</div>`;
|
|
552
|
+
case 1:
|
|
553
|
+
return html` <div class="badge fs-7 me-1" style="color: #393939; background: #0000000f;">已寄出</div>`;
|
|
554
|
+
}
|
|
555
|
+
})(),
|
|
556
|
+
].join('')
|
|
557
|
+
: ''}
|
|
752
558
|
</div>
|
|
753
559
|
${BgWidget.mbContainer(18)}
|
|
754
560
|
${BgWidget.container(
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
const phoneHTML = vm.data.phone.map((str: string) => html`
|
|
765
|
-
<div class="c_filter_tag">${str}</div>`);
|
|
766
|
-
htmlList = htmlList.concat([
|
|
767
|
-
BgWidget.mainCard(
|
|
768
|
-
html`
|
|
769
|
-
<div class="tx_normal fw-normal">篩選條件</div>
|
|
770
|
-
<div class="c_filter_container">
|
|
771
|
-
${sendGroupHTML.length === 0
|
|
772
|
-
? '沒有群組'
|
|
773
|
-
: sendGroupHTML.join(html`<span
|
|
774
|
-
class="badge fs-7 px-1"
|
|
775
|
-
style="color: #393939; background: #FFD5D0;"
|
|
776
|
-
>${vm.data.boolean === 'and' ? '且' : '或'}</span
|
|
777
|
-
>`)}
|
|
778
|
-
</div>
|
|
779
|
-
`
|
|
780
|
-
),
|
|
781
|
-
BgWidget.mainCard(html`
|
|
782
|
-
<div class="tx_normal fw-normal">電話號碼</div>
|
|
783
|
-
<div class="c_filter_container">${phoneHTML.join('')}</div>
|
|
784
|
-
`),
|
|
785
|
-
BgWidget.mainCard(html`
|
|
786
|
-
<div class="tx_700 mb-3">發送時間</div>
|
|
787
|
-
${EditorElem.radio({
|
|
788
|
-
gvc: gvc,
|
|
789
|
-
title: '',
|
|
790
|
-
def: vm.data.sendTime === undefined ? 'now' : 'set',
|
|
791
|
-
array: [
|
|
792
|
-
{
|
|
793
|
-
title: '立即發送',
|
|
794
|
-
value: 'now',
|
|
795
|
-
},
|
|
796
|
-
{
|
|
797
|
-
title: '排定發送時間',
|
|
798
|
-
value: 'set',
|
|
799
|
-
innerHtml: html`
|
|
800
|
-
<div class="d-flex mt-3 ${document.body.clientWidth < 768 ? 'flex-column' : ''}"
|
|
801
|
-
style="gap: 12px">
|
|
802
|
-
${EditorElem.editeInput({
|
|
803
|
-
gvc: gvc,
|
|
804
|
-
title: '',
|
|
805
|
-
type: 'date',
|
|
806
|
-
style: inputStyle,
|
|
807
|
-
default: vm.data.sendTime ? vm.data.sendTime.date : '',
|
|
808
|
-
placeHolder: '',
|
|
809
|
-
callback: () => {
|
|
810
|
-
},
|
|
811
|
-
readonly: true,
|
|
812
|
-
})}
|
|
813
|
-
${EditorElem.editeInput({
|
|
814
|
-
gvc: gvc,
|
|
815
|
-
title: '',
|
|
816
|
-
type: 'time',
|
|
817
|
-
style: inputStyle,
|
|
818
|
-
default: vm.data.sendTime ? vm.data.sendTime.time : '',
|
|
819
|
-
placeHolder: '',
|
|
820
|
-
callback: () => {
|
|
821
|
-
},
|
|
822
|
-
readonly: true,
|
|
823
|
-
})}
|
|
824
|
-
</div>`,
|
|
825
|
-
},
|
|
826
|
-
],
|
|
827
|
-
callback: () => {
|
|
828
|
-
},
|
|
829
|
-
readonly: true,
|
|
830
|
-
})}`),
|
|
831
|
-
]);
|
|
832
|
-
}
|
|
561
|
+
obj.gvc.bindView(() => {
|
|
562
|
+
const bi = obj.gvc.glitter.getUUID();
|
|
563
|
+
return {
|
|
564
|
+
bind: bi,
|
|
565
|
+
view: () => {
|
|
566
|
+
let htmlList: string[] = [];
|
|
567
|
+
if (obj.readonly) {
|
|
568
|
+
const sendGroupHTML = (vm.data.sendGroup ?? []).map((str: string) => html` <div class="c_filter_tag">${str}</div>`);
|
|
569
|
+
const phoneHTML = vm.data.phone.map((str: string) => html` <div class="c_filter_tag">${str}</div>`);
|
|
833
570
|
htmlList = htmlList.concat([
|
|
834
571
|
BgWidget.mainCard(
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
<div class="d-flex align-items-center my-3">
|
|
846
|
-
<div class="tx_normal fw-normal me-2">簡訊內文</div>
|
|
847
|
-
${gvc.bindView(()=>{
|
|
848
|
-
return {
|
|
849
|
-
bind:'total_count',
|
|
850
|
-
view:()=>{
|
|
851
|
-
return `<div class="d-flex align-items-end ms-3" style="font-size: 12px;color: #8D8D8D">預計每則簡訊花費${pointCount*this.ticket}點</div>`
|
|
852
|
-
}
|
|
853
|
-
}
|
|
854
|
-
})}
|
|
855
|
-
</div>
|
|
856
|
-
${EditorElem.editeText({
|
|
857
|
-
gvc: gvc,
|
|
858
|
-
title: "",
|
|
859
|
-
readonly:true,
|
|
860
|
-
default: postData.content || "",
|
|
861
|
-
placeHolder: "",
|
|
862
|
-
callback: (text) => {
|
|
863
|
-
postData.content = text;
|
|
864
|
-
let totalSize = 0;
|
|
865
|
-
|
|
866
|
-
for (let i = 0; i < text.length; i++) {
|
|
867
|
-
const char = text[i];
|
|
868
|
-
// 判斷是否為中文或全形字符(Unicode範圍包含中文)
|
|
869
|
-
if (/[\u4e00-\u9fa5\uFF00-\uFFEF]/.test(char)) {
|
|
870
|
-
totalSize += 2; // 中文或全形字符佔2個單位
|
|
871
|
-
} else {
|
|
872
|
-
totalSize += 1; // 英文或半形字符佔1個單位
|
|
873
|
-
}
|
|
874
|
-
}
|
|
875
|
-
|
|
876
|
-
if (totalSize < this.maxSize) {
|
|
877
|
-
pointCount = 1;
|
|
878
|
-
} else {
|
|
879
|
-
pointCount = Math.ceil(totalSize / this.longSMS);
|
|
880
|
-
}
|
|
881
|
-
gvc.notifyDataChange('total_count')
|
|
882
|
-
|
|
883
|
-
}
|
|
884
|
-
})}`
|
|
572
|
+
html`
|
|
573
|
+
<div class="tx_normal fw-normal">篩選條件</div>
|
|
574
|
+
<div class="c_filter_container">
|
|
575
|
+
${sendGroupHTML.length === 0
|
|
576
|
+
? '沒有群組'
|
|
577
|
+
: sendGroupHTML.join(html`<span class="badge fs-7 px-1" style="color: #393939; background: #FFD5D0;"
|
|
578
|
+
>${vm.data.boolean === 'and' ? '且' : '或'}</span
|
|
579
|
+
>`)}
|
|
580
|
+
</div>
|
|
581
|
+
`
|
|
885
582
|
),
|
|
583
|
+
BgWidget.mainCard(html`
|
|
584
|
+
<div class="tx_normal fw-normal">電話號碼</div>
|
|
585
|
+
<div class="c_filter_container">${phoneHTML.join('')}</div>
|
|
586
|
+
`),
|
|
587
|
+
BgWidget.mainCard(html` <div class="tx_700 mb-3">發送時間</div>
|
|
588
|
+
${EditorElem.radio({
|
|
589
|
+
gvc: gvc,
|
|
590
|
+
title: '',
|
|
591
|
+
def: vm.data.sendTime === undefined ? 'now' : 'set',
|
|
592
|
+
array: [
|
|
593
|
+
{
|
|
594
|
+
title: '立即發送',
|
|
595
|
+
value: 'now',
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
title: '排定發送時間',
|
|
599
|
+
value: 'set',
|
|
600
|
+
innerHtml: html` <div class="d-flex mt-3 ${document.body.clientWidth < 768 ? 'flex-column' : ''}" style="gap: 12px">
|
|
601
|
+
${EditorElem.editeInput({
|
|
602
|
+
gvc: gvc,
|
|
603
|
+
title: '',
|
|
604
|
+
type: 'date',
|
|
605
|
+
style: inputStyle,
|
|
606
|
+
default: vm.data.sendTime ? vm.data.sendTime.date : '',
|
|
607
|
+
placeHolder: '',
|
|
608
|
+
callback: () => {},
|
|
609
|
+
readonly: true,
|
|
610
|
+
})}
|
|
611
|
+
${EditorElem.editeInput({
|
|
612
|
+
gvc: gvc,
|
|
613
|
+
title: '',
|
|
614
|
+
type: 'time',
|
|
615
|
+
style: inputStyle,
|
|
616
|
+
default: vm.data.sendTime ? vm.data.sendTime.time : '',
|
|
617
|
+
placeHolder: '',
|
|
618
|
+
callback: () => {},
|
|
619
|
+
readonly: true,
|
|
620
|
+
})}
|
|
621
|
+
</div>`,
|
|
622
|
+
},
|
|
623
|
+
],
|
|
624
|
+
callback: () => {},
|
|
625
|
+
readonly: true,
|
|
626
|
+
})}`),
|
|
886
627
|
]);
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
628
|
+
}
|
|
629
|
+
htmlList = htmlList.concat([
|
|
630
|
+
BgWidget.mainCard(
|
|
631
|
+
html` ${BgWidget.editeInput({
|
|
632
|
+
gvc: gvc,
|
|
633
|
+
title: '簡訊主題',
|
|
634
|
+
default: postData.title,
|
|
635
|
+
placeHolder: '請輸入簡訊主題',
|
|
636
|
+
callback: (text) => {
|
|
637
|
+
postData.title = text;
|
|
638
|
+
},
|
|
639
|
+
})}
|
|
640
|
+
<div class="d-flex align-items-center my-3">
|
|
641
|
+
<div class="tx_normal fw-normal me-2">簡訊內文</div>
|
|
642
|
+
${gvc.bindView(() => {
|
|
643
|
+
return {
|
|
644
|
+
bind: 'total_count',
|
|
645
|
+
view: () => {
|
|
646
|
+
return `<div class="d-flex align-items-end ms-3" style="font-size: 12px;color: #8D8D8D">預計每則簡訊花費${
|
|
647
|
+
pointCount * this.ticket
|
|
648
|
+
}點</div>`;
|
|
649
|
+
},
|
|
650
|
+
};
|
|
651
|
+
})}
|
|
652
|
+
</div>
|
|
653
|
+
${EditorElem.editeText({
|
|
654
|
+
gvc: gvc,
|
|
655
|
+
title: '',
|
|
656
|
+
readonly: true,
|
|
657
|
+
default: postData.content || '',
|
|
658
|
+
placeHolder: '',
|
|
659
|
+
callback: (text) => {
|
|
660
|
+
postData.content = text;
|
|
661
|
+
let totalSize = 0;
|
|
662
|
+
|
|
663
|
+
for (let i = 0; i < text.length; i++) {
|
|
664
|
+
const char = text[i];
|
|
665
|
+
// 判斷是否為中文或全形字符(Unicode範圍包含中文)
|
|
666
|
+
if (/[\u4e00-\u9fa5\uFF00-\uFFEF]/.test(char)) {
|
|
667
|
+
totalSize += 2; // 中文或全形字符佔2個單位
|
|
668
|
+
} else {
|
|
669
|
+
totalSize += 1; // 英文或半形字符佔1個單位
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
if (totalSize < this.maxSize) {
|
|
674
|
+
pointCount = 1;
|
|
675
|
+
} else {
|
|
676
|
+
pointCount = Math.ceil(totalSize / this.longSMS);
|
|
677
|
+
}
|
|
678
|
+
gvc.notifyDataChange('total_count');
|
|
679
|
+
},
|
|
680
|
+
})}`
|
|
681
|
+
),
|
|
682
|
+
]);
|
|
683
|
+
return htmlList.filter((str) => str.length > 0).join(BgWidget.mbContainer(16));
|
|
684
|
+
},
|
|
685
|
+
divCreate: {},
|
|
686
|
+
};
|
|
687
|
+
}),
|
|
688
|
+
BgWidget.getContainerWidth(),
|
|
689
|
+
'padding: 0 !important; margin: 0 !important;'
|
|
894
690
|
)}
|
|
895
691
|
${BgWidget.mbContainer(240)}
|
|
896
692
|
<div class="update-bar-container">
|
|
897
693
|
${obj.type === 'replace' && !obj.readonly
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
694
|
+
? BgWidget.danger(
|
|
695
|
+
obj.gvc.event(() => {
|
|
696
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
697
|
+
dialog.checkYesOrNot({
|
|
698
|
+
text: '是否確認刪除此信件樣式?',
|
|
699
|
+
callback: (response) => {
|
|
700
|
+
if (response) {
|
|
701
|
+
dialog.dataLoading({ visible: true });
|
|
702
|
+
ApiPost.delete({
|
|
703
|
+
id: postData.id,
|
|
704
|
+
}).then((res) => {
|
|
705
|
+
dialog.dataLoading({ visible: false });
|
|
706
|
+
if (res.result) {
|
|
707
|
+
dialog.successMessage({ text: '刪除成功' });
|
|
708
|
+
vm.type = 'list';
|
|
709
|
+
} else {
|
|
710
|
+
dialog.errorMessage({ text: '刪除失敗' });
|
|
711
|
+
}
|
|
712
|
+
});
|
|
713
|
+
}
|
|
714
|
+
},
|
|
715
|
+
});
|
|
716
|
+
})
|
|
717
|
+
)
|
|
718
|
+
: ''}
|
|
923
719
|
${BgWidget.danger(
|
|
924
720
|
gvc.event(() => {
|
|
925
721
|
const dialog = new ShareDialog(gvc.glitter);
|
|
926
|
-
dialog.dataLoading({text: '取消預約中', visible: true});
|
|
722
|
+
dialog.dataLoading({ text: '取消預約中', visible: true });
|
|
927
723
|
ApiSns.delete({
|
|
928
|
-
id: vm.data.name
|
|
929
|
-
}).then(r =>{
|
|
930
|
-
console.log(
|
|
931
|
-
dialog.dataLoading({visible: false});
|
|
724
|
+
id: vm.data.name,
|
|
725
|
+
}).then((r) => {
|
|
726
|
+
console.log('res -- ', r);
|
|
727
|
+
dialog.dataLoading({ visible: false });
|
|
932
728
|
if (r.result) {
|
|
933
729
|
vm.status = 'list';
|
|
934
|
-
dialog.successMessage({text: '上傳成功'});
|
|
730
|
+
dialog.successMessage({ text: '上傳成功' });
|
|
935
731
|
} else {
|
|
936
|
-
dialog.errorMessage({text: '上傳失敗'});
|
|
732
|
+
dialog.errorMessage({ text: '上傳失敗' });
|
|
937
733
|
}
|
|
938
|
-
})
|
|
734
|
+
});
|
|
939
735
|
}),
|
|
940
736
|
obj.readonly ? '取消預約' : undefined
|
|
941
737
|
)}
|
|
942
738
|
${BgWidget.cancel(
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
739
|
+
gvc.event(() => {
|
|
740
|
+
vm.type = 'list';
|
|
741
|
+
}),
|
|
742
|
+
obj.readonly ? '關閉' : undefined
|
|
947
743
|
)}
|
|
948
744
|
${obj.readonly
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
745
|
+
? ''
|
|
746
|
+
: BgWidget.save(
|
|
747
|
+
gvc.event(() => {
|
|
748
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
749
|
+
if (obj.type === 'replace') {
|
|
750
|
+
dialog.dataLoading({ text: '變更簡訊中', visible: true });
|
|
751
|
+
ApiPost.put({
|
|
752
|
+
postData: postData,
|
|
753
|
+
token: (window.parent as any).saasConfig.config.token,
|
|
754
|
+
type: 'manager',
|
|
755
|
+
}).then((re) => {
|
|
756
|
+
dialog.dataLoading({ visible: false });
|
|
757
|
+
if (re.result) {
|
|
758
|
+
vm.status = 'list';
|
|
759
|
+
dialog.successMessage({ text: '上傳成功' });
|
|
760
|
+
} else {
|
|
761
|
+
dialog.errorMessage({ text: '上傳失敗' });
|
|
762
|
+
}
|
|
763
|
+
});
|
|
764
|
+
} else {
|
|
765
|
+
dialog.dataLoading({ text: '新增簡訊', visible: true });
|
|
766
|
+
ApiPost.post({
|
|
767
|
+
postData: postData,
|
|
768
|
+
token: (window.parent as any).saasConfig.config.token,
|
|
769
|
+
type: 'manager',
|
|
770
|
+
}).then((re) => {
|
|
771
|
+
dialog.dataLoading({ visible: false });
|
|
772
|
+
if (re.result) {
|
|
773
|
+
vm.type = 'list';
|
|
774
|
+
dialog.successMessage({ text: '上傳成功' });
|
|
775
|
+
} else {
|
|
776
|
+
dialog.errorMessage({ text: '上傳失敗' });
|
|
777
|
+
}
|
|
778
|
+
});
|
|
779
|
+
}
|
|
780
|
+
})
|
|
781
|
+
)}
|
|
986
782
|
</div>
|
|
987
783
|
`,
|
|
988
784
|
BgWidget.getContainerWidth()
|
|
@@ -1014,7 +810,7 @@ export class BgSNS {
|
|
|
1014
810
|
name: '',
|
|
1015
811
|
title: '',
|
|
1016
812
|
content: '',
|
|
1017
|
-
sendTime: {date: startDate, time: startTime},
|
|
813
|
+
sendTime: { date: startDate, time: startTime },
|
|
1018
814
|
sendGroup: [],
|
|
1019
815
|
};
|
|
1020
816
|
|
|
@@ -1023,7 +819,7 @@ export class BgSNS {
|
|
|
1023
819
|
return await ApiUser.getPublicConfig('member_level_config', 'manager').then((res: any) => {
|
|
1024
820
|
if (res.result && res.response.value && res.response.value.levels.length > 0) {
|
|
1025
821
|
return res.response.value.levels.map((data: any) => {
|
|
1026
|
-
return {key: data.id, value: data.tag_name};
|
|
822
|
+
return { key: data.id, value: data.tag_name };
|
|
1027
823
|
});
|
|
1028
824
|
}
|
|
1029
825
|
return [];
|
|
@@ -1037,7 +833,7 @@ export class BgSNS {
|
|
|
1037
833
|
return data.type !== 'level';
|
|
1038
834
|
})
|
|
1039
835
|
.map((data: { type: string; title: string }) => {
|
|
1040
|
-
return {key: data.type, value: data.title};
|
|
836
|
+
return { key: data.type, value: data.title };
|
|
1041
837
|
});
|
|
1042
838
|
}
|
|
1043
839
|
return [];
|
|
@@ -1079,9 +875,9 @@ export class BgSNS {
|
|
|
1079
875
|
|
|
1080
876
|
const index = postData.tagList.findIndex((data) => data.tag === postData.tag);
|
|
1081
877
|
if (index === -1) {
|
|
1082
|
-
postData.tagList.push({tag: postData.tag, filter: filter, valueString});
|
|
878
|
+
postData.tagList.push({ tag: postData.tag, filter: filter, valueString });
|
|
1083
879
|
} else {
|
|
1084
|
-
postData.tagList[index] = {tag: postData.tag, filter: filter, valueString};
|
|
880
|
+
postData.tagList[index] = { tag: postData.tag, filter: filter, valueString };
|
|
1085
881
|
}
|
|
1086
882
|
}
|
|
1087
883
|
setUserList();
|
|
@@ -1105,7 +901,7 @@ export class BgSNS {
|
|
|
1105
901
|
if (frequencyMap[emailObj.id]) {
|
|
1106
902
|
frequencyMap[emailObj.id].count += 1;
|
|
1107
903
|
} else {
|
|
1108
|
-
frequencyMap[emailObj.id] = {count: 1, emailObj};
|
|
904
|
+
frequencyMap[emailObj.id] = { count: 1, emailObj };
|
|
1109
905
|
}
|
|
1110
906
|
});
|
|
1111
907
|
// 篩選出出現次數大於或等於 n 的 id
|
|
@@ -1119,7 +915,7 @@ export class BgSNS {
|
|
|
1119
915
|
function setUserList() {
|
|
1120
916
|
let n = 0;
|
|
1121
917
|
postData.userList = [];
|
|
1122
|
-
dialog.dataLoading({visible: true, text: '更新預計寄件人...'});
|
|
918
|
+
dialog.dataLoading({ visible: true, text: '更新預計寄件人...' });
|
|
1123
919
|
|
|
1124
920
|
new Promise<void>((resolve) => {
|
|
1125
921
|
const si = setInterval(() => {
|
|
@@ -1172,7 +968,7 @@ export class BgSNS {
|
|
|
1172
968
|
ApiUser.getUserListOrders({
|
|
1173
969
|
page: 0,
|
|
1174
970
|
limit: 99999,
|
|
1175
|
-
group: {type: 'level', tag: id},
|
|
971
|
+
group: { type: 'level', tag: id },
|
|
1176
972
|
}).then((data) => {
|
|
1177
973
|
data.response.data.map((user: any) => {
|
|
1178
974
|
if (user.userData.email && user.userData.phone) {
|
|
@@ -1205,7 +1001,7 @@ export class BgSNS {
|
|
|
1205
1001
|
ApiUser.getUserListOrders({
|
|
1206
1002
|
page: 0,
|
|
1207
1003
|
limit: 99999,
|
|
1208
|
-
group: {type: type},
|
|
1004
|
+
group: { type: type },
|
|
1209
1005
|
}).then((data) => {
|
|
1210
1006
|
// 加入額外的會員資料,例如有訂閱但未註冊者
|
|
1211
1007
|
let dataArray = data.response.data;
|
|
@@ -1239,7 +1035,7 @@ export class BgSNS {
|
|
|
1239
1035
|
ApiUser.getUserListOrders({
|
|
1240
1036
|
page: 0,
|
|
1241
1037
|
limit: 99999,
|
|
1242
|
-
filter: {birth: tagData.filter},
|
|
1038
|
+
filter: { birth: tagData.filter },
|
|
1243
1039
|
}).then((data) => {
|
|
1244
1040
|
data.response.data.map((user: any) => {
|
|
1245
1041
|
if (user.userData.email && user.userData.phone) {
|
|
@@ -1259,7 +1055,7 @@ export class BgSNS {
|
|
|
1259
1055
|
ApiUser.getUserListOrders({
|
|
1260
1056
|
page: 0,
|
|
1261
1057
|
limit: 99999,
|
|
1262
|
-
filter: {rebate: {key: 'moreThan', value: tagData.filter}},
|
|
1058
|
+
filter: { rebate: { key: 'moreThan', value: tagData.filter } },
|
|
1263
1059
|
}).then((data) => {
|
|
1264
1060
|
data.response.data.map((user: any) => {
|
|
1265
1061
|
if (user.userData.email && user.userData.phone) {
|
|
@@ -1279,7 +1075,7 @@ export class BgSNS {
|
|
|
1279
1075
|
}).then(() => {
|
|
1280
1076
|
postData.userList = filterEmails(postData.userList, postData.boolean, postData.boolean === 'and' ? postData.tagList.length : undefined);
|
|
1281
1077
|
|
|
1282
|
-
dialog.dataLoading({visible: false});
|
|
1078
|
+
dialog.dataLoading({ visible: false });
|
|
1283
1079
|
gvc.notifyDataChange(vm.tagsId);
|
|
1284
1080
|
});
|
|
1285
1081
|
}
|
|
@@ -1288,19 +1084,18 @@ export class BgSNS {
|
|
|
1288
1084
|
const formatName = value && value.length > 0 ? `${name}:${value}` : name;
|
|
1289
1085
|
return {
|
|
1290
1086
|
name: formatName,
|
|
1291
|
-
html: html`
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
</div>`,
|
|
1087
|
+
html: html` <div class="c_filter_tag">
|
|
1088
|
+
${formatName}
|
|
1089
|
+
<i
|
|
1090
|
+
class="fa-solid fa-xmark ms-1"
|
|
1091
|
+
style="cursor: pointer"
|
|
1092
|
+
onclick="${gvc.event(() => {
|
|
1093
|
+
postData.tagList = postData.tagList.filter((data) => data.tag !== key);
|
|
1094
|
+
setUserList();
|
|
1095
|
+
gvc.notifyDataChange(vm.tagsId);
|
|
1096
|
+
})}"
|
|
1097
|
+
></i>
|
|
1098
|
+
</div>`,
|
|
1304
1099
|
};
|
|
1305
1100
|
}
|
|
1306
1101
|
|
|
@@ -1321,103 +1116,104 @@ export class BgSNS {
|
|
|
1321
1116
|
});
|
|
1322
1117
|
postData.sendGroup = badgeList.map((item) => item.name);
|
|
1323
1118
|
return [
|
|
1324
|
-
html`
|
|
1325
|
-
<div class="tx_normal fw-normal">標籤判斷</div>
|
|
1119
|
+
html` <div class="tx_normal fw-normal">標籤判斷</div>
|
|
1326
1120
|
<div style="margin: 8px 0;">
|
|
1327
|
-
${BgWidget.switchTextButton(
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1121
|
+
${BgWidget.switchTextButton(
|
|
1122
|
+
gvc,
|
|
1123
|
+
postData.boolean === 'and',
|
|
1124
|
+
{
|
|
1125
|
+
left: '或',
|
|
1126
|
+
right: '且',
|
|
1127
|
+
},
|
|
1128
|
+
(bool) => {
|
|
1129
|
+
postData.boolean = bool ? 'and' : 'or';
|
|
1130
|
+
setUserList();
|
|
1131
|
+
gvc.notifyDataChange(vm.tagsId);
|
|
1132
|
+
}
|
|
1133
|
+
)}
|
|
1335
1134
|
</div>`,
|
|
1336
1135
|
html`
|
|
1337
1136
|
<div class="tx_normal fw-normal">預計寄件顧客人數</div>
|
|
1338
1137
|
<div style="display:flex; align-items: center; gap: 18px; margin: 8px 0;">
|
|
1339
1138
|
<div class="tx_normal">${postData.userList.length}人</div>
|
|
1340
1139
|
${BgWidget.grayButton(
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
.
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
note: item.email,
|
|
1387
|
-
};
|
|
1388
|
-
});
|
|
1389
|
-
userVM.dataList = userVM.dataList.concat(noRegisterUser);
|
|
1390
|
-
}
|
|
1391
|
-
resolve(userVM.dataList);
|
|
1140
|
+
'查看名單',
|
|
1141
|
+
gvc.event(() => {
|
|
1142
|
+
if (postData.userList.length === 0) {
|
|
1143
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
1144
|
+
dialog.infoMessage({ text: '目前無預計寄件的顧客' });
|
|
1145
|
+
return;
|
|
1146
|
+
}
|
|
1147
|
+
const userVM = {
|
|
1148
|
+
dataList: [] as { key: string; value: string; note: string }[],
|
|
1149
|
+
};
|
|
1150
|
+
BgWidget.selectDropDialog({
|
|
1151
|
+
gvc: gvc,
|
|
1152
|
+
title: '預計寄件顧客',
|
|
1153
|
+
tag: 'send_users_list',
|
|
1154
|
+
callback: () => {},
|
|
1155
|
+
default: [],
|
|
1156
|
+
api: () => {
|
|
1157
|
+
return new Promise((resolve) => {
|
|
1158
|
+
ApiUser.getUserListOrders({
|
|
1159
|
+
page: 0,
|
|
1160
|
+
limit: 99999,
|
|
1161
|
+
id: postData.userList.map((user) => user.id ?? 0).join(','),
|
|
1162
|
+
}).then((dd) => {
|
|
1163
|
+
if (dd.response.data) {
|
|
1164
|
+
userVM.dataList = dd.response.data.map((item: { userID: number; userData: { name: string; email: string } }) => {
|
|
1165
|
+
return {
|
|
1166
|
+
key: item.userID,
|
|
1167
|
+
value: item.userData.name,
|
|
1168
|
+
note: item.userData.email,
|
|
1169
|
+
};
|
|
1170
|
+
});
|
|
1171
|
+
if (postData.userList.length > userVM.dataList.length) {
|
|
1172
|
+
// 加入未註冊會員的信箱,例如有訂閱但未註冊者
|
|
1173
|
+
const noRegisterUser = postData.userList
|
|
1174
|
+
.filter((item) => {
|
|
1175
|
+
return item.id < 0 && item.email;
|
|
1176
|
+
})
|
|
1177
|
+
.map((item) => {
|
|
1178
|
+
return {
|
|
1179
|
+
key: `${item.id}`,
|
|
1180
|
+
value: '(未註冊的會員)',
|
|
1181
|
+
note: item.email,
|
|
1182
|
+
};
|
|
1183
|
+
});
|
|
1184
|
+
userVM.dataList = userVM.dataList.concat(noRegisterUser);
|
|
1392
1185
|
}
|
|
1393
|
-
|
|
1186
|
+
resolve(userVM.dataList);
|
|
1187
|
+
}
|
|
1394
1188
|
});
|
|
1395
|
-
}
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
})
|
|
1400
|
-
|
|
1189
|
+
});
|
|
1190
|
+
},
|
|
1191
|
+
style: 'width: 100%;',
|
|
1192
|
+
readonly: true,
|
|
1193
|
+
});
|
|
1194
|
+
}),
|
|
1195
|
+
{ textStyle: 'font-weight: 400;' }
|
|
1401
1196
|
)}
|
|
1402
|
-
</div>
|
|
1197
|
+
</div>
|
|
1198
|
+
`,
|
|
1403
1199
|
html`
|
|
1404
1200
|
<div class="tx_normal fw-normal">篩選條件</div>
|
|
1405
1201
|
<div class="c_filter_container">
|
|
1406
1202
|
${badgeList.length === 0
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1203
|
+
? '無'
|
|
1204
|
+
: badgeList
|
|
1205
|
+
.map((item) => {
|
|
1206
|
+
return item.html;
|
|
1207
|
+
})
|
|
1208
|
+
.join(postData.boolean === 'and' ? '且' : '或')}
|
|
1413
1209
|
</div>
|
|
1414
1210
|
`,
|
|
1415
1211
|
].join(BgWidget.mbContainer(18));
|
|
1416
1212
|
}
|
|
1417
1213
|
|
|
1418
|
-
ApiWallet.getWallet().then(r => {
|
|
1214
|
+
ApiWallet.getWallet().then((r) => {
|
|
1419
1215
|
wallet = r.response.sum;
|
|
1420
|
-
})
|
|
1216
|
+
});
|
|
1421
1217
|
return BgWidget.container(
|
|
1422
1218
|
html`
|
|
1423
1219
|
<div class="d-flex w-100 align-items-center">
|
|
@@ -1426,469 +1222,466 @@ export class BgSNS {
|
|
|
1426
1222
|
</div>
|
|
1427
1223
|
${BgWidget.mbContainer(18)}
|
|
1428
1224
|
${BgWidget.container(
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1225
|
+
gvc.bindView(() => {
|
|
1226
|
+
return {
|
|
1227
|
+
bind: vm.containerId,
|
|
1228
|
+
view: () => {
|
|
1229
|
+
return [
|
|
1230
|
+
BgWidget.mainCard(
|
|
1231
|
+
[
|
|
1232
|
+
html` <div class="tx_700">選擇收件對象</div>`,
|
|
1233
|
+
html` <div class="tx_normal fw-normal mt-3">根據</div>`,
|
|
1234
|
+
html` <div style="display: flex; ${document.body.clientWidth > 768 ? 'gap: 18px;' : 'flex-direction: column;'}">
|
|
1235
|
+
<div style="width: ${document.body.clientWidth > 768 ? '400px' : '100%'};">
|
|
1236
|
+
${BgWidget.select({
|
|
1237
|
+
gvc: gvc,
|
|
1238
|
+
default: postData.tag,
|
|
1239
|
+
callback: (key) => {
|
|
1240
|
+
postData.tag = key;
|
|
1241
|
+
vm.loading = true;
|
|
1242
|
+
gvc.notifyDataChange(vm.id);
|
|
1243
|
+
},
|
|
1244
|
+
options: FilterOptions.emailOptions,
|
|
1245
|
+
style: 'margin: 8px 0;',
|
|
1246
|
+
})}
|
|
1247
|
+
</div>
|
|
1248
|
+
<div style="width: 100%; display: flex; align-items: center;">
|
|
1249
|
+
${gvc.bindView({
|
|
1250
|
+
bind: vm.id,
|
|
1251
|
+
view: () => {
|
|
1252
|
+
const getDefault = (def: any) => {
|
|
1253
|
+
const data = postData.tagList.find((data) => data.tag === postData.tag);
|
|
1254
|
+
return data ? data.filter : def;
|
|
1255
|
+
};
|
|
1256
|
+
const callback = (value?: any) => {
|
|
1257
|
+
if (typeof value === 'string' || typeof value === 'number') {
|
|
1258
|
+
const intFiltter = parseInt(`${value}`, 10);
|
|
1259
|
+
value = intFiltter > 0 ? intFiltter : 0;
|
|
1260
|
+
if (isNaN(intFiltter) || intFiltter < 0) {
|
|
1261
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
1262
|
+
dialog.infoMessage({ text: '請輸入正整數或0' });
|
|
1263
|
+
return;
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
filterEvent(value);
|
|
1267
|
+
};
|
|
1268
|
+
switch (postData.tag) {
|
|
1269
|
+
case 'all':
|
|
1270
|
+
dialog.dataLoading({
|
|
1271
|
+
visible: true,
|
|
1272
|
+
text: '取得所有會員資料中...',
|
|
1273
|
+
});
|
|
1274
|
+
new Promise((resolve) => {
|
|
1275
|
+
ApiUser.getUserListOrders({
|
|
1276
|
+
page: 0,
|
|
1277
|
+
limit: 99999,
|
|
1278
|
+
}).then((dd) => {
|
|
1279
|
+
if (dd.response.data) {
|
|
1280
|
+
const ids: number[] = [];
|
|
1281
|
+
vm.dataList = dd.response.data
|
|
1282
|
+
.filter(
|
|
1283
|
+
(item: {
|
|
1284
|
+
userData: {
|
|
1285
|
+
email: string;
|
|
1286
|
+
};
|
|
1287
|
+
}) => {
|
|
1288
|
+
return item.userData.email && item.userData.email.length > 0;
|
|
1289
|
+
}
|
|
1290
|
+
)
|
|
1291
|
+
.map(
|
|
1292
|
+
(item: {
|
|
1293
|
+
userID: number;
|
|
1294
|
+
userData: {
|
|
1295
|
+
name: string;
|
|
1296
|
+
email: string;
|
|
1297
|
+
};
|
|
1298
|
+
}) => {
|
|
1299
|
+
ids.push(item.userID);
|
|
1300
|
+
return {
|
|
1301
|
+
key: item.userID,
|
|
1302
|
+
value: item.userData.name ?? '(尚無姓名)',
|
|
1303
|
+
note: item.userData.email,
|
|
1304
|
+
};
|
|
1305
|
+
}
|
|
1306
|
+
);
|
|
1307
|
+
resolve(ids);
|
|
1472
1308
|
}
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1309
|
+
});
|
|
1310
|
+
}).then((data) => {
|
|
1311
|
+
dialog.dataLoading({ visible: false });
|
|
1312
|
+
callback(data);
|
|
1313
|
+
});
|
|
1314
|
+
return '';
|
|
1315
|
+
case 'level':
|
|
1316
|
+
case 'group':
|
|
1317
|
+
case 'birth':
|
|
1318
|
+
return BgWidget.selectDropList({
|
|
1319
|
+
gvc: gvc,
|
|
1320
|
+
callback: callback,
|
|
1321
|
+
default: getDefault([]),
|
|
1322
|
+
options: vm.loading ? [] : vm.dataList,
|
|
1323
|
+
placeholder: vm.loading ? '資料載入中...' : undefined,
|
|
1324
|
+
style: 'margin: 8px 0; width: 100%;',
|
|
1325
|
+
});
|
|
1326
|
+
case 'customers':
|
|
1327
|
+
return BgWidget.grayButton(
|
|
1328
|
+
'點擊選取顧客',
|
|
1329
|
+
gvc.event(() => {
|
|
1330
|
+
BgWidget.selectDropDialog({
|
|
1331
|
+
gvc: gvc,
|
|
1332
|
+
title: '搜尋特定顧客',
|
|
1333
|
+
tag: 'set_send_users',
|
|
1334
|
+
updownOptions: FilterOptions.userOrderBy,
|
|
1335
|
+
callback: callback,
|
|
1336
|
+
default: getDefault([]),
|
|
1337
|
+
api: (data: { query: string; orderString: string }) => {
|
|
1338
|
+
return new Promise((resolve) => {
|
|
1339
|
+
ApiUser.getUserListOrders({
|
|
1340
|
+
page: 0,
|
|
1341
|
+
limit: 99999,
|
|
1342
|
+
search: data.query,
|
|
1343
|
+
orderString: data.orderString,
|
|
1344
|
+
}).then((dd) => {
|
|
1345
|
+
if (dd.response.data) {
|
|
1346
|
+
vm.dataList = dd.response.data
|
|
1347
|
+
.filter(
|
|
1348
|
+
(item: {
|
|
1349
|
+
userData: {
|
|
1350
|
+
email: string;
|
|
1351
|
+
};
|
|
1352
|
+
}) => {
|
|
1353
|
+
return item.userData.email && item.userData.email.length > 0;
|
|
1492
1354
|
}
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1355
|
+
)
|
|
1356
|
+
.map(
|
|
1357
|
+
(item: {
|
|
1358
|
+
userID: number;
|
|
1359
|
+
userData: {
|
|
1360
|
+
name: string;
|
|
1361
|
+
email: string;
|
|
1362
|
+
};
|
|
1363
|
+
}) => {
|
|
1364
|
+
return {
|
|
1365
|
+
key: item.userID,
|
|
1366
|
+
value: item.userData.name ?? '(尚無姓名)',
|
|
1367
|
+
note: item.userData.email,
|
|
1368
|
+
};
|
|
1501
1369
|
}
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
value: item.userData.name ?? '(尚無姓名)',
|
|
1507
|
-
note: item.userData.email,
|
|
1508
|
-
};
|
|
1509
|
-
});
|
|
1510
|
-
resolve(ids);
|
|
1511
|
-
}
|
|
1370
|
+
);
|
|
1371
|
+
resolve(vm.dataList);
|
|
1372
|
+
}
|
|
1373
|
+
});
|
|
1512
1374
|
});
|
|
1513
|
-
}
|
|
1514
|
-
|
|
1515
|
-
callback(data);
|
|
1516
|
-
});
|
|
1517
|
-
return '';
|
|
1518
|
-
case 'level':
|
|
1519
|
-
case 'group':
|
|
1520
|
-
case 'birth':
|
|
1521
|
-
return BgWidget.selectDropList({
|
|
1522
|
-
gvc: gvc,
|
|
1523
|
-
callback: callback,
|
|
1524
|
-
default: getDefault([]),
|
|
1525
|
-
options: vm.loading ? [] : vm.dataList,
|
|
1526
|
-
placeholder: vm.loading ? '資料載入中...' : undefined,
|
|
1527
|
-
style: 'margin: 8px 0; width: 100%;',
|
|
1528
|
-
});
|
|
1529
|
-
case 'customers':
|
|
1530
|
-
return BgWidget.grayButton(
|
|
1531
|
-
'點擊選取顧客',
|
|
1532
|
-
gvc.event(() => {
|
|
1533
|
-
BgWidget.selectDropDialog({
|
|
1534
|
-
gvc: gvc,
|
|
1535
|
-
title: '搜尋特定顧客',
|
|
1536
|
-
tag: 'set_send_users',
|
|
1537
|
-
updownOptions: FilterOptions.userOrderBy,
|
|
1538
|
-
callback: callback,
|
|
1539
|
-
default: getDefault([]),
|
|
1540
|
-
api: (data: {
|
|
1541
|
-
query: string;
|
|
1542
|
-
orderString: string
|
|
1543
|
-
}) => {
|
|
1544
|
-
return new Promise((resolve) => {
|
|
1545
|
-
ApiUser.getUserListOrders({
|
|
1546
|
-
page: 0,
|
|
1547
|
-
limit: 99999,
|
|
1548
|
-
search: data.query,
|
|
1549
|
-
orderString: data.orderString,
|
|
1550
|
-
}).then((dd) => {
|
|
1551
|
-
if (dd.response.data) {
|
|
1552
|
-
vm.dataList = dd.response.data
|
|
1553
|
-
.filter((item: {
|
|
1554
|
-
userData: {
|
|
1555
|
-
email: string
|
|
1556
|
-
}
|
|
1557
|
-
}) => {
|
|
1558
|
-
return item.userData.email && item.userData.email.length > 0;
|
|
1559
|
-
})
|
|
1560
|
-
.map((item: {
|
|
1561
|
-
userID: number;
|
|
1562
|
-
userData: {
|
|
1563
|
-
name: string;
|
|
1564
|
-
email: string
|
|
1565
|
-
}
|
|
1566
|
-
}) => {
|
|
1567
|
-
return {
|
|
1568
|
-
key: item.userID,
|
|
1569
|
-
value: item.userData.name ?? '(尚無姓名)',
|
|
1570
|
-
note: item.userData.email,
|
|
1571
|
-
};
|
|
1572
|
-
});
|
|
1573
|
-
resolve(vm.dataList);
|
|
1574
|
-
}
|
|
1575
|
-
});
|
|
1576
|
-
});
|
|
1577
|
-
},
|
|
1578
|
-
style: 'width: 100%;',
|
|
1579
|
-
});
|
|
1580
|
-
}),
|
|
1581
|
-
{textStyle: 'font-weight: 400;'}
|
|
1582
|
-
);
|
|
1583
|
-
case 'expiry':
|
|
1584
|
-
return BgWidget.editeInput({
|
|
1585
|
-
gvc: gvc,
|
|
1586
|
-
title: '',
|
|
1587
|
-
default: getDefault('0'),
|
|
1588
|
-
placeHolder: '請輸入剩餘多少天',
|
|
1589
|
-
callback: callback,
|
|
1590
|
-
endText: '天',
|
|
1591
|
-
});
|
|
1592
|
-
case 'remain':
|
|
1593
|
-
return BgWidget.editeInput({
|
|
1594
|
-
gvc: gvc,
|
|
1595
|
-
title: '',
|
|
1596
|
-
default: getDefault('0'),
|
|
1597
|
-
placeHolder: '請輸入大於多少',
|
|
1598
|
-
callback: callback,
|
|
1599
|
-
startText: '大於',
|
|
1600
|
-
endText: '點',
|
|
1601
|
-
});
|
|
1602
|
-
case 'uncheckout':
|
|
1603
|
-
return BgWidget.editeInput({
|
|
1604
|
-
gvc: gvc,
|
|
1605
|
-
title: '',
|
|
1606
|
-
default: getDefault('0'),
|
|
1607
|
-
placeHolder: '請輸入超過幾天未結帳',
|
|
1608
|
-
callback: callback,
|
|
1609
|
-
endText: '天',
|
|
1610
|
-
});
|
|
1611
|
-
default:
|
|
1612
|
-
return '';
|
|
1613
|
-
}
|
|
1614
|
-
},
|
|
1615
|
-
divCreate: {class: 'w-100'},
|
|
1616
|
-
onCreate: () => {
|
|
1617
|
-
if (vm.loading) {
|
|
1618
|
-
getOptions(postData.tag).then((opts) => {
|
|
1619
|
-
vm.dataList = opts as {
|
|
1620
|
-
key: string;
|
|
1621
|
-
value: string
|
|
1622
|
-
}[];
|
|
1623
|
-
vm.loading = false;
|
|
1624
|
-
gvc.notifyDataChange(vm.id);
|
|
1375
|
+
},
|
|
1376
|
+
style: 'width: 100%;',
|
|
1625
1377
|
});
|
|
1626
|
-
}
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1378
|
+
}),
|
|
1379
|
+
{ textStyle: 'font-weight: 400;' }
|
|
1380
|
+
);
|
|
1381
|
+
case 'expiry':
|
|
1382
|
+
return BgWidget.editeInput({
|
|
1383
|
+
gvc: gvc,
|
|
1384
|
+
title: '',
|
|
1385
|
+
default: getDefault('0'),
|
|
1386
|
+
placeHolder: '請輸入剩餘多少天',
|
|
1387
|
+
callback: callback,
|
|
1388
|
+
endText: '天',
|
|
1389
|
+
});
|
|
1390
|
+
case 'remain':
|
|
1391
|
+
return BgWidget.editeInput({
|
|
1392
|
+
gvc: gvc,
|
|
1393
|
+
title: '',
|
|
1394
|
+
default: getDefault('0'),
|
|
1395
|
+
placeHolder: '請輸入大於多少',
|
|
1396
|
+
callback: callback,
|
|
1397
|
+
startText: '大於',
|
|
1398
|
+
endText: '點',
|
|
1399
|
+
});
|
|
1400
|
+
case 'uncheckout':
|
|
1401
|
+
return BgWidget.editeInput({
|
|
1402
|
+
gvc: gvc,
|
|
1403
|
+
title: '',
|
|
1404
|
+
default: getDefault('0'),
|
|
1405
|
+
placeHolder: '請輸入超過幾天未結帳',
|
|
1406
|
+
callback: callback,
|
|
1407
|
+
endText: '天',
|
|
1408
|
+
});
|
|
1409
|
+
default:
|
|
1410
|
+
return '';
|
|
1411
|
+
}
|
|
1412
|
+
},
|
|
1413
|
+
divCreate: { class: 'w-100' },
|
|
1414
|
+
onCreate: () => {
|
|
1415
|
+
if (vm.loading) {
|
|
1416
|
+
getOptions(postData.tag).then((opts) => {
|
|
1417
|
+
vm.dataList = opts as {
|
|
1418
|
+
key: string;
|
|
1419
|
+
value: string;
|
|
1420
|
+
}[];
|
|
1421
|
+
vm.loading = false;
|
|
1422
|
+
gvc.notifyDataChange(vm.id);
|
|
1670
1423
|
});
|
|
1424
|
+
}
|
|
1425
|
+
},
|
|
1426
|
+
})}
|
|
1427
|
+
</div>
|
|
1428
|
+
</div>`,
|
|
1429
|
+
gvc.bindView({
|
|
1430
|
+
bind: vm.tagsId,
|
|
1431
|
+
view: () => getTagsHTML(),
|
|
1432
|
+
divCreate: { style: 'margin-top: 8px;' },
|
|
1433
|
+
}),
|
|
1434
|
+
].join('')
|
|
1435
|
+
),
|
|
1436
|
+
BgWidget.mainCard(
|
|
1437
|
+
[
|
|
1438
|
+
html` <div class="tx_700">信件內容</div>`,
|
|
1439
|
+
html` <div class="tx_normal fw-normal mt-3">信件樣式</div>`,
|
|
1440
|
+
(() => {
|
|
1441
|
+
const selectVM = {
|
|
1442
|
+
id: glitter.getUUID(),
|
|
1443
|
+
loading: true,
|
|
1444
|
+
dataList: [] as {
|
|
1445
|
+
key: string;
|
|
1446
|
+
name: string;
|
|
1447
|
+
value: string;
|
|
1448
|
+
content: string;
|
|
1449
|
+
}[],
|
|
1450
|
+
};
|
|
1451
|
+
return gvc.bindView({
|
|
1452
|
+
bind: selectVM.id,
|
|
1453
|
+
view: () => {
|
|
1454
|
+
return BgWidget.select({
|
|
1455
|
+
gvc: gvc,
|
|
1456
|
+
default: postData.name,
|
|
1457
|
+
callback: (key) => {
|
|
1458
|
+
const data = selectVM.dataList.find((data) => data.key === key && key !== 'def');
|
|
1459
|
+
postData.name = data ? data.name : '';
|
|
1460
|
+
postData.title = data ? data.value : '';
|
|
1461
|
+
postData.content = data ? data.content : '';
|
|
1462
|
+
gvc.notifyDataChange(vm.emailId);
|
|
1671
1463
|
},
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1464
|
+
options: selectVM.dataList,
|
|
1465
|
+
style: 'margin: 8px 0;',
|
|
1466
|
+
});
|
|
1467
|
+
},
|
|
1468
|
+
divCreate: {},
|
|
1469
|
+
onCreate: () => {
|
|
1470
|
+
if (selectVM.loading) {
|
|
1471
|
+
ApiPost.getManagerPost({
|
|
1472
|
+
page: 0,
|
|
1473
|
+
limit: 9999,
|
|
1474
|
+
type: 'notify-sns-config',
|
|
1475
|
+
}).then((res) => {
|
|
1476
|
+
if (res.result) {
|
|
1477
|
+
selectVM.dataList = res.response.data.map((data: any) => {
|
|
1478
|
+
data = data.content;
|
|
1479
|
+
return {
|
|
1480
|
+
key: `${data.id}`,
|
|
1481
|
+
name: data.name,
|
|
1482
|
+
value: data.title,
|
|
1483
|
+
content: data.content,
|
|
1484
|
+
};
|
|
1485
|
+
});
|
|
1486
|
+
selectVM.dataList.splice(0, 0, {
|
|
1487
|
+
key: 'default',
|
|
1488
|
+
name: '',
|
|
1489
|
+
value: '(空白樣式)',
|
|
1490
|
+
content: '',
|
|
1699
1491
|
});
|
|
1700
1492
|
}
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
)
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1493
|
+
selectVM.loading = false;
|
|
1494
|
+
gvc.notifyDataChange(selectVM.id);
|
|
1495
|
+
});
|
|
1496
|
+
}
|
|
1497
|
+
},
|
|
1498
|
+
});
|
|
1499
|
+
})(),
|
|
1500
|
+
BgWidget.editeInput({
|
|
1501
|
+
gvc: gvc,
|
|
1502
|
+
title: '簡訊主旨',
|
|
1503
|
+
default: postData.title,
|
|
1504
|
+
placeHolder: '請輸入簡訊主旨',
|
|
1505
|
+
callback: (text) => {
|
|
1506
|
+
postData.title = text;
|
|
1507
|
+
},
|
|
1508
|
+
}),
|
|
1509
|
+
gvc.bindView({
|
|
1510
|
+
bind: vm.emailId,
|
|
1511
|
+
view: () => {
|
|
1512
|
+
return [
|
|
1513
|
+
html`
|
|
1514
|
+
<div class="d-flex align-items-center mb-3">
|
|
1515
|
+
<div class="tx_normal fw-normal me-2 d-flex">簡訊內容</div>
|
|
1516
|
+
${BgWidget.selEventButton(
|
|
1517
|
+
'範例',
|
|
1518
|
+
gvc.event(() => {
|
|
1519
|
+
postData.content = defaultEmailText();
|
|
1520
|
+
gvc.notifyDataChange(vm.containerId);
|
|
1521
|
+
})
|
|
1522
|
+
)}
|
|
1523
|
+
${gvc.bindView(() => {
|
|
1524
|
+
return {
|
|
1525
|
+
bind: 'total_count',
|
|
1526
|
+
view: () => {
|
|
1527
|
+
return `<div class="d-flex align-items-end ms-3"
|
|
1733
1528
|
style="font-size: 12px;color: #8D8D8D">
|
|
1734
1529
|
預計每則簡訊花費${pointCount * this.ticket}點
|
|
1735
|
-
</div
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
for (let i = 0; i < text.length; i++) {
|
|
1750
|
-
const char = text[i];
|
|
1751
|
-
// 判斷是否為中文或全形字符(Unicode範圍包含中文)
|
|
1752
|
-
if (/[\u4e00-\u9fa5\uFF00-\uFFEF]/.test(char)) {
|
|
1753
|
-
totalSize += 2; // 中文或全形字符佔2個單位
|
|
1754
|
-
} else {
|
|
1755
|
-
totalSize += 1; // 英文或半形字符佔1個單位
|
|
1756
|
-
}
|
|
1757
|
-
}
|
|
1758
|
-
|
|
1759
|
-
if (totalSize < this.maxSize) {
|
|
1760
|
-
pointCount = 1;
|
|
1761
|
-
} else {
|
|
1762
|
-
pointCount = Math.ceil(totalSize / this.longSMS);
|
|
1763
|
-
}
|
|
1764
|
-
gvc.notifyDataChange('total_count')
|
|
1530
|
+
</div>`;
|
|
1531
|
+
},
|
|
1532
|
+
};
|
|
1533
|
+
})}
|
|
1534
|
+
</div>
|
|
1535
|
+
${EditorElem.editeText({
|
|
1536
|
+
gvc: gvc,
|
|
1537
|
+
title: '',
|
|
1538
|
+
default: postData.content || '',
|
|
1539
|
+
placeHolder: '',
|
|
1540
|
+
callback: (text) => {
|
|
1541
|
+
postData.content = text;
|
|
1542
|
+
let totalSize = 0;
|
|
1765
1543
|
|
|
1544
|
+
for (let i = 0; i < text.length; i++) {
|
|
1545
|
+
const char = text[i];
|
|
1546
|
+
// 判斷是否為中文或全形字符(Unicode範圍包含中文)
|
|
1547
|
+
if (/[\u4e00-\u9fa5\uFF00-\uFFEF]/.test(char)) {
|
|
1548
|
+
totalSize += 2; // 中文或全形字符佔2個單位
|
|
1549
|
+
} else {
|
|
1550
|
+
totalSize += 1; // 英文或半形字符佔1個單位
|
|
1766
1551
|
}
|
|
1767
|
-
}
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
if (totalSize < this.maxSize) {
|
|
1555
|
+
pointCount = 1;
|
|
1556
|
+
} else {
|
|
1557
|
+
pointCount = Math.ceil(totalSize / this.longSMS);
|
|
1558
|
+
}
|
|
1559
|
+
gvc.notifyDataChange('total_count');
|
|
1560
|
+
},
|
|
1561
|
+
})}
|
|
1562
|
+
`,
|
|
1563
|
+
].join('');
|
|
1564
|
+
},
|
|
1565
|
+
}),
|
|
1566
|
+
].join('')
|
|
1567
|
+
),
|
|
1568
|
+
BgWidget.mainCard(
|
|
1569
|
+
html` <div class="tx_700 mb-3">發送時間</div>
|
|
1570
|
+
${EditorElem.radio({
|
|
1571
|
+
gvc: gvc,
|
|
1572
|
+
title: '',
|
|
1573
|
+
def: postData.sendTime === undefined ? 'now' : 'set',
|
|
1574
|
+
array: [
|
|
1575
|
+
{
|
|
1576
|
+
title: '立即發送',
|
|
1577
|
+
value: 'now',
|
|
1578
|
+
},
|
|
1579
|
+
{
|
|
1580
|
+
title: '排定發送時間',
|
|
1581
|
+
value: 'set',
|
|
1582
|
+
innerHtml: html` <div class="d-flex mt-3 ${document.body.clientWidth < 768 ? 'flex-column' : ''}" style="gap: 12px">
|
|
1583
|
+
${EditorElem.editeInput({
|
|
1584
|
+
gvc: gvc,
|
|
1585
|
+
title: '',
|
|
1586
|
+
type: 'date',
|
|
1587
|
+
style: inputStyle,
|
|
1588
|
+
default: startDate,
|
|
1589
|
+
placeHolder: '',
|
|
1590
|
+
callback: (date) => {
|
|
1591
|
+
postData.sendTime = {
|
|
1592
|
+
date: date,
|
|
1593
|
+
time: postData.sendTime?.time ?? '',
|
|
1594
|
+
};
|
|
1595
|
+
},
|
|
1596
|
+
})}
|
|
1597
|
+
${EditorElem.editeInput({
|
|
1598
|
+
gvc: gvc,
|
|
1599
|
+
title: '',
|
|
1600
|
+
type: 'time',
|
|
1601
|
+
style: inputStyle,
|
|
1602
|
+
default: startTime,
|
|
1603
|
+
placeHolder: '',
|
|
1604
|
+
callback: (time) => {
|
|
1605
|
+
postData.sendTime = {
|
|
1606
|
+
date: postData.sendTime?.date ?? '',
|
|
1607
|
+
time: time,
|
|
1608
|
+
};
|
|
1609
|
+
},
|
|
1610
|
+
})}
|
|
1611
|
+
</div>`,
|
|
1612
|
+
},
|
|
1613
|
+
],
|
|
1614
|
+
callback: (text) => {
|
|
1615
|
+
if (text === 'now') {
|
|
1616
|
+
postData.sendTime = undefined;
|
|
1617
|
+
}
|
|
1618
|
+
if (text === 'set') {
|
|
1619
|
+
postData.sendTime = { date: startDate, time: startTime };
|
|
1620
|
+
}
|
|
1621
|
+
},
|
|
1622
|
+
})}`
|
|
1623
|
+
),
|
|
1624
|
+
].join(BgWidget.mbContainer(16));
|
|
1625
|
+
},
|
|
1626
|
+
divCreate: {},
|
|
1627
|
+
};
|
|
1628
|
+
}),
|
|
1629
|
+
BgWidget.getContainerWidth(),
|
|
1630
|
+
'padding: 0 !important; margin: 0 !important;'
|
|
1840
1631
|
)}
|
|
1841
1632
|
${BgWidget.mbContainer(240)}
|
|
1842
1633
|
<div class="update-bar-container">
|
|
1843
1634
|
${BgWidget.save(
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1635
|
+
gvc.event(() => {
|
|
1636
|
+
function isLater(dateTimeObj: { date: string; time: string }) {
|
|
1637
|
+
const currentDateTime = new Date();
|
|
1638
|
+
const { date, time } = dateTimeObj;
|
|
1639
|
+
const dateTimeString = `${date}T${time}:00`;
|
|
1640
|
+
const providedDateTime = new Date(dateTimeString);
|
|
1641
|
+
return currentDateTime > providedDateTime;
|
|
1642
|
+
}
|
|
1852
1643
|
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1644
|
+
if (postData.sendTime && isLater(postData.sendTime)) {
|
|
1645
|
+
dialog.errorMessage({ text: '排定發送的時間需大於現在時間' });
|
|
1646
|
+
return;
|
|
1647
|
+
}
|
|
1857
1648
|
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1649
|
+
if (postData.userList.length == 0) {
|
|
1650
|
+
dialog.errorMessage({ text: '請選擇發送對象' });
|
|
1651
|
+
return;
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
dialog.dataLoading({
|
|
1655
|
+
text: postData.sendTime ? '信件排定中...' : '信件發送中...',
|
|
1656
|
+
visible: true,
|
|
1657
|
+
});
|
|
1658
|
+
ApiSns.send({
|
|
1659
|
+
...postData,
|
|
1660
|
+
phone: postData.userList.map((user) => user.phone),
|
|
1661
|
+
}).then((data) => {
|
|
1662
|
+
dialog.dataLoading({ visible: false });
|
|
1663
|
+
if (data.result) {
|
|
1664
|
+
dialog.successMessage({
|
|
1665
|
+
text: postData.sendTime ? '排定成功' : '發送成功',
|
|
1666
|
+
});
|
|
1667
|
+
} else {
|
|
1668
|
+
if (data.response.message === 'No_Points') {
|
|
1669
|
+
dialog.warningMessage({
|
|
1670
|
+
text: `餘額不足是否前往儲值?`,
|
|
1671
|
+
callback: (response) => {
|
|
1672
|
+
if (response) {
|
|
1673
|
+
(window.parent as any).glitter.setUrlParameter('tab', 'sms-points');
|
|
1881
1674
|
(window.parent as any).glitter.pageConfig[0].gvc.recreateView();
|
|
1882
1675
|
}
|
|
1883
|
-
|
|
1884
|
-
}
|
|
1885
|
-
|
|
1886
|
-
}
|
|
1887
|
-
|
|
1676
|
+
},
|
|
1677
|
+
});
|
|
1678
|
+
} else {
|
|
1679
|
+
dialog.errorMessage({ text: '手動寄件失敗' });
|
|
1888
1680
|
}
|
|
1889
|
-
}
|
|
1890
|
-
})
|
|
1891
|
-
|
|
1681
|
+
}
|
|
1682
|
+
});
|
|
1683
|
+
}),
|
|
1684
|
+
'送出'
|
|
1892
1685
|
)}
|
|
1893
1686
|
</div>
|
|
1894
1687
|
`,
|
|
@@ -1919,139 +1712,137 @@ export class BgSNS {
|
|
|
1919
1712
|
html`
|
|
1920
1713
|
<div class="d-flex w-100 align-items-center">
|
|
1921
1714
|
${BgWidget.goBack(
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1715
|
+
gvc.event(() => {
|
|
1716
|
+
vm.type = 'list';
|
|
1717
|
+
})
|
|
1925
1718
|
)}
|
|
1926
1719
|
${BgWidget.title(`編輯推播通知`)}
|
|
1927
1720
|
<div class="flex-fill"></div>
|
|
1928
1721
|
</div>
|
|
1929
|
-
${BgWidget.container(html`
|
|
1930
|
-
<div class="d-flex px-0" style="gap: 10px;">
|
|
1722
|
+
${BgWidget.container(html` <div class="d-flex px-0" style="gap: 10px;">
|
|
1931
1723
|
<div style="width: 100%">
|
|
1932
1724
|
${BgWidget.mainCard(
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1725
|
+
obj.gvc.bindView(() => {
|
|
1726
|
+
const bi = obj.gvc.glitter.getUUID();
|
|
1727
|
+
return {
|
|
1728
|
+
bind: bi,
|
|
1729
|
+
view: () => {
|
|
1730
|
+
return [
|
|
1731
|
+
EditorElem.editeInput({
|
|
1732
|
+
gvc: gvc,
|
|
1733
|
+
title: '推播標題',
|
|
1734
|
+
default: postData.title,
|
|
1735
|
+
placeHolder: '請輸入推播標題',
|
|
1736
|
+
callback: (text) => {
|
|
1737
|
+
postData.title = text;
|
|
1738
|
+
},
|
|
1739
|
+
}),
|
|
1740
|
+
EditorElem.editeInput({
|
|
1741
|
+
gvc: gvc,
|
|
1742
|
+
title: '跳轉連結',
|
|
1743
|
+
default: postData.link,
|
|
1744
|
+
placeHolder: '請輸入要跳轉的連結',
|
|
1745
|
+
callback: (text) => {
|
|
1746
|
+
postData.link = text;
|
|
1747
|
+
},
|
|
1748
|
+
}),
|
|
1749
|
+
EditorElem.editeText({
|
|
1750
|
+
gvc: gvc,
|
|
1751
|
+
title: '推播主旨',
|
|
1752
|
+
default: postData.content,
|
|
1753
|
+
placeHolder: '請輸入推播內容',
|
|
1754
|
+
callback: (text) => {
|
|
1755
|
+
postData.content = text;
|
|
1756
|
+
},
|
|
1757
|
+
}),
|
|
1758
|
+
].join('');
|
|
1759
|
+
},
|
|
1760
|
+
divCreate: {},
|
|
1761
|
+
};
|
|
1762
|
+
})
|
|
1971
1763
|
)}
|
|
1972
1764
|
</div>
|
|
1973
1765
|
</div>
|
|
1974
1766
|
${obj.type === 'replace'
|
|
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
|
-
|
|
1767
|
+
? html`
|
|
1768
|
+
<div class="d-flex w-100 mt-2">
|
|
1769
|
+
<div class="flex-fill"></div>
|
|
1770
|
+
${BgWidget.redButton(
|
|
1771
|
+
'刪除樣本',
|
|
1772
|
+
obj.gvc.event(() => {
|
|
1773
|
+
const dialog = new ShareDialog(obj.gvc.glitter);
|
|
1774
|
+
dialog.checkYesOrNot({
|
|
1775
|
+
text: '是否確認刪除樣本?',
|
|
1776
|
+
callback: (response) => {
|
|
1777
|
+
if (response) {
|
|
1778
|
+
dialog.dataLoading({ visible: true });
|
|
1779
|
+
ApiPost.delete({
|
|
1780
|
+
id: postData.id,
|
|
1781
|
+
}).then((res) => {
|
|
1782
|
+
dialog.dataLoading({ visible: false });
|
|
1783
|
+
if (res.result) {
|
|
1784
|
+
vm.type = 'list';
|
|
1785
|
+
} else {
|
|
1786
|
+
dialog.errorMessage({ text: '刪除失敗' });
|
|
1787
|
+
}
|
|
1788
|
+
});
|
|
1789
|
+
}
|
|
1790
|
+
},
|
|
1791
|
+
});
|
|
1792
|
+
})
|
|
1793
|
+
)}
|
|
1794
|
+
</div>
|
|
1795
|
+
`
|
|
1796
|
+
: ``}
|
|
2005
1797
|
<div class="update-bar-container">
|
|
2006
1798
|
${BgWidget.cancel(
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
1799
|
+
gvc.event(() => {
|
|
1800
|
+
vm.type = 'list';
|
|
1801
|
+
})
|
|
2010
1802
|
)}
|
|
2011
1803
|
${BgWidget.save(
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
1804
|
+
gvc.event(() => {
|
|
1805
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
1806
|
+
if (obj.type === 'replace') {
|
|
1807
|
+
dialog.dataLoading({ text: '變更信件', visible: true });
|
|
1808
|
+
ApiPost.put({
|
|
1809
|
+
postData: postData,
|
|
1810
|
+
token: (window.parent as any).saasConfig.config.token,
|
|
1811
|
+
type: 'manager',
|
|
1812
|
+
}).then((re) => {
|
|
1813
|
+
dialog.dataLoading({ visible: false });
|
|
1814
|
+
if (re.result) {
|
|
1815
|
+
vm.status = 'list';
|
|
1816
|
+
dialog.successMessage({ text: '上傳成功' });
|
|
1817
|
+
} else {
|
|
1818
|
+
dialog.errorMessage({ text: '上傳失敗' });
|
|
1819
|
+
}
|
|
1820
|
+
});
|
|
1821
|
+
} else {
|
|
1822
|
+
dialog.dataLoading({ text: '新增信件', visible: true });
|
|
1823
|
+
ApiPost.post({
|
|
1824
|
+
postData: postData,
|
|
1825
|
+
token: (window.parent as any).saasConfig.config.token,
|
|
1826
|
+
type: 'manager',
|
|
1827
|
+
}).then((re) => {
|
|
1828
|
+
dialog.dataLoading({ visible: false });
|
|
1829
|
+
if (re.result) {
|
|
1830
|
+
vm.type = 'list';
|
|
1831
|
+
dialog.successMessage({ text: '上傳成功' });
|
|
1832
|
+
} else {
|
|
1833
|
+
dialog.errorMessage({ text: '上傳失敗' });
|
|
1834
|
+
}
|
|
1835
|
+
});
|
|
1836
|
+
}
|
|
1837
|
+
})
|
|
2046
1838
|
)}
|
|
2047
1839
|
</div>`)}
|
|
2048
1840
|
`,
|
|
2049
|
-
BgWidget.getContainerWidth({rate: {web: 0.68}})
|
|
1841
|
+
BgWidget.getContainerWidth({ rate: { web: 0.68 } })
|
|
2050
1842
|
);
|
|
2051
1843
|
}
|
|
2052
1844
|
|
|
2053
|
-
public static fcmDevice(gvc: GVC, type: 'list' | 'select' = 'list', callback: (select: any) => void = () => {
|
|
2054
|
-
}) {
|
|
1845
|
+
public static fcmDevice(gvc: GVC, type: 'list' | 'select' = 'list', callback: (select: any) => void = () => {}) {
|
|
2055
1846
|
const vm: {
|
|
2056
1847
|
type: 'list' | 'replace';
|
|
2057
1848
|
data: any;
|
|
@@ -2063,7 +1854,7 @@ export class BgSNS {
|
|
|
2063
1854
|
id: 61,
|
|
2064
1855
|
userID: 549313940,
|
|
2065
1856
|
account: 'jianzhi.wang@homee.ai',
|
|
2066
|
-
userData: {name: '王建智', email: 'jianzhi.wang@homee.ai', phone: '0978028739'},
|
|
1857
|
+
userData: { name: '王建智', email: 'jianzhi.wang@homee.ai', phone: '0978028739' },
|
|
2067
1858
|
created_time: '2023-11-26T02:14:09.000Z',
|
|
2068
1859
|
role: 0,
|
|
2069
1860
|
company: null,
|
|
@@ -2083,65 +1874,8 @@ export class BgSNS {
|
|
|
2083
1874
|
let vmi: any = undefined;
|
|
2084
1875
|
|
|
2085
1876
|
function getDatalist() {
|
|
2086
|
-
let interval: any = 0;
|
|
2087
1877
|
return vm.dataList.map((dd: any) => {
|
|
2088
1878
|
return [
|
|
2089
|
-
{
|
|
2090
|
-
key: (() => {
|
|
2091
|
-
clearInterval(interval);
|
|
2092
|
-
if (
|
|
2093
|
-
!vm.dataList.find((dd: any) => {
|
|
2094
|
-
return !dd.checked;
|
|
2095
|
-
})
|
|
2096
|
-
) {
|
|
2097
|
-
interval = setTimeout(() => {
|
|
2098
|
-
ApiUser.getFCM({
|
|
2099
|
-
page: vmi.page - 1,
|
|
2100
|
-
limit: 100000,
|
|
2101
|
-
search: vm.query || undefined,
|
|
2102
|
-
}).then((data) => {
|
|
2103
|
-
callback(data.response.data);
|
|
2104
|
-
});
|
|
2105
|
-
}, 10);
|
|
2106
|
-
}
|
|
2107
|
-
|
|
2108
|
-
return EditorElem.checkBoxOnly({
|
|
2109
|
-
gvc: gvc,
|
|
2110
|
-
def: !vm.dataList.find((dd: any) => {
|
|
2111
|
-
return !dd.checked;
|
|
2112
|
-
}),
|
|
2113
|
-
callback: (result) => {
|
|
2114
|
-
vm.dataList.map((dd: any) => {
|
|
2115
|
-
dd.checked = result;
|
|
2116
|
-
});
|
|
2117
|
-
vmi.data = getDatalist();
|
|
2118
|
-
vmi.callback();
|
|
2119
|
-
gvc.notifyDataChange(filterID);
|
|
2120
|
-
callback(
|
|
2121
|
-
vm.dataList.filter((dd: any) => {
|
|
2122
|
-
return dd.checked;
|
|
2123
|
-
})
|
|
2124
|
-
);
|
|
2125
|
-
},
|
|
2126
|
-
});
|
|
2127
|
-
})(),
|
|
2128
|
-
value: EditorElem.checkBoxOnly({
|
|
2129
|
-
gvc: gvc,
|
|
2130
|
-
def: dd.checked,
|
|
2131
|
-
callback: (result) => {
|
|
2132
|
-
dd.checked = result;
|
|
2133
|
-
vmi.data = getDatalist();
|
|
2134
|
-
vmi.callback();
|
|
2135
|
-
gvc.notifyDataChange(filterID);
|
|
2136
|
-
callback(
|
|
2137
|
-
vm.dataList.filter((dd: any) => {
|
|
2138
|
-
return dd.checked;
|
|
2139
|
-
})
|
|
2140
|
-
);
|
|
2141
|
-
},
|
|
2142
|
-
style: 'height:25px;',
|
|
2143
|
-
}),
|
|
2144
|
-
},
|
|
2145
1879
|
{
|
|
2146
1880
|
key: '用戶ID',
|
|
2147
1881
|
value: `<span class="fs-7">${dd.userID ?? '尚未登入'}</span>`,
|
|
@@ -2165,121 +1899,89 @@ export class BgSNS {
|
|
|
2165
1899
|
<div class="flex-fill"></div>
|
|
2166
1900
|
</div>
|
|
2167
1901
|
${BgWidget.container(
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
vm.dataList[index].checked = !vm.dataList[index].checked;
|
|
2194
|
-
vmi.data = getDatalist();
|
|
1902
|
+
BgWidget.mainCard(
|
|
1903
|
+
[
|
|
1904
|
+
BgWidget.searchPlace(
|
|
1905
|
+
gvc.event((e, event) => {
|
|
1906
|
+
vm.query = e.value;
|
|
1907
|
+
gvc.notifyDataChange(id);
|
|
1908
|
+
}),
|
|
1909
|
+
vm.query || '',
|
|
1910
|
+
'搜尋信箱或者標籤'
|
|
1911
|
+
),
|
|
1912
|
+
BgWidget.tableV3({
|
|
1913
|
+
gvc: gvc,
|
|
1914
|
+
getData: (vmk) => {
|
|
1915
|
+
vmi = vmk;
|
|
1916
|
+
const limit = 20;
|
|
1917
|
+
ApiUser.getFCM({
|
|
1918
|
+
page: vmi.page - 1,
|
|
1919
|
+
limit: limit,
|
|
1920
|
+
search: vm.query || undefined,
|
|
1921
|
+
}).then((data) => {
|
|
1922
|
+
vm.dataList = data.response.data;
|
|
1923
|
+
vmi.pageSize = Math.ceil(data.response.total / limit);
|
|
1924
|
+
vmi.originalData = vm.dataList;
|
|
1925
|
+
vmi.tableData = getDatalist();
|
|
1926
|
+
vmi.loading = false;
|
|
2195
1927
|
vmi.callback();
|
|
2196
|
-
|
|
2197
|
-
|
|
1928
|
+
if (type === 'select') {
|
|
1929
|
+
callback(
|
|
2198
1930
|
vm.dataList.filter((dd: any) => {
|
|
2199
1931
|
return dd.checked;
|
|
2200
1932
|
})
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
)
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
return dd.email;
|
|
2244
|
-
})
|
|
2245
|
-
.join(`,`),
|
|
2246
|
-
}).then((res) => {
|
|
2247
|
-
dialog.dataLoading({visible: false});
|
|
2248
|
-
if (res.result) {
|
|
2249
|
-
vm.dataList = undefined;
|
|
2250
|
-
gvc.notifyDataChange(id);
|
|
2251
|
-
} else {
|
|
2252
|
-
dialog.errorMessage({text: '刪除失敗'});
|
|
2253
|
-
}
|
|
2254
|
-
});
|
|
2255
|
-
}
|
|
2256
|
-
},
|
|
2257
|
-
});
|
|
2258
|
-
})
|
|
2259
|
-
),
|
|
2260
|
-
],
|
|
1933
|
+
);
|
|
1934
|
+
}
|
|
1935
|
+
});
|
|
1936
|
+
},
|
|
1937
|
+
rowClick: (data, index) => {
|
|
1938
|
+
vm.dataList[index].checked = !vm.dataList[index].checked;
|
|
1939
|
+
vmi.data = getDatalist();
|
|
1940
|
+
vmi.callback();
|
|
1941
|
+
gvc.notifyDataChange(filterID);
|
|
1942
|
+
callback(
|
|
1943
|
+
vm.dataList.filter((dd: any) => {
|
|
1944
|
+
return dd.checked;
|
|
1945
|
+
})
|
|
1946
|
+
);
|
|
1947
|
+
},
|
|
1948
|
+
filter: [
|
|
1949
|
+
{
|
|
1950
|
+
name: '批量移除',
|
|
1951
|
+
option: false,
|
|
1952
|
+
event: () => {
|
|
1953
|
+
dialog.checkYesOrNot({
|
|
1954
|
+
text: '是否確認刪除所選項目?',
|
|
1955
|
+
callback: (response) => {
|
|
1956
|
+
if (response) {
|
|
1957
|
+
dialog.dataLoading({ visible: true });
|
|
1958
|
+
ApiUser.deleteSubscribe({
|
|
1959
|
+
email: vm.dataList
|
|
1960
|
+
.filter((dd: any) => {
|
|
1961
|
+
return dd.checked;
|
|
1962
|
+
})
|
|
1963
|
+
.map((dd: any) => {
|
|
1964
|
+
return dd.email;
|
|
1965
|
+
})
|
|
1966
|
+
.join(`,`),
|
|
1967
|
+
}).then((res) => {
|
|
1968
|
+
dialog.dataLoading({ visible: false });
|
|
1969
|
+
if (res.result) {
|
|
1970
|
+
vm.dataList = undefined;
|
|
1971
|
+
gvc.notifyDataChange(id);
|
|
1972
|
+
} else {
|
|
1973
|
+
dialog.errorMessage({ text: '刪除失敗' });
|
|
1974
|
+
}
|
|
2261
1975
|
});
|
|
2262
1976
|
}
|
|
2263
|
-
},
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
type === 'select'
|
|
2272
|
-
? `d-none`
|
|
2273
|
-
: ``
|
|
2274
|
-
}`,
|
|
2275
|
-
style: ``,
|
|
2276
|
-
};
|
|
2277
|
-
},
|
|
2278
|
-
};
|
|
2279
|
-
})}
|
|
2280
|
-
`,
|
|
2281
|
-
})
|
|
2282
|
-
)
|
|
1977
|
+
},
|
|
1978
|
+
});
|
|
1979
|
+
},
|
|
1980
|
+
},
|
|
1981
|
+
],
|
|
1982
|
+
}),
|
|
1983
|
+
].join('')
|
|
1984
|
+
)
|
|
2283
1985
|
)}
|
|
2284
1986
|
`,
|
|
2285
1987
|
BgWidget.getContainerWidth()
|
|
@@ -2310,7 +2012,7 @@ export class BgSNS {
|
|
|
2310
2012
|
const filterID = glitter.getUUID();
|
|
2311
2013
|
return {
|
|
2312
2014
|
bind: id,
|
|
2313
|
-
dataList: [{obj: vm, key: 'type'}],
|
|
2015
|
+
dataList: [{ obj: vm, key: 'type' }],
|
|
2314
2016
|
view: () => {
|
|
2315
2017
|
if (vm.type === 'list') {
|
|
2316
2018
|
return BgWidget.container(
|
|
@@ -2319,247 +2021,190 @@ export class BgSNS {
|
|
|
2319
2021
|
${BgWidget.title('推播訊息管理')}
|
|
2320
2022
|
<div class="flex-fill"></div>
|
|
2321
2023
|
${BgWidget.darkButton(
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2024
|
+
'新增推播',
|
|
2025
|
+
gvc.event(() => {
|
|
2026
|
+
vm.data = undefined;
|
|
2027
|
+
vm.type = 'add';
|
|
2028
|
+
})
|
|
2327
2029
|
)}
|
|
2328
2030
|
</div>
|
|
2329
2031
|
${BgWidget.container(
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
</div>
|
|
2456
|
-
` +
|
|
2457
|
-
BgSNS.fcmDevice(gvc, 'select', (data) => {
|
|
2458
|
-
dataList = data;
|
|
2459
|
-
}),
|
|
2460
|
-
].join('')
|
|
2461
|
-
),
|
|
2462
|
-
900
|
|
2463
|
-
)}
|
|
2464
|
-
<div></div>
|
|
2465
|
-
</div>
|
|
2466
|
-
`;
|
|
2467
|
-
}, 'email');
|
|
2468
|
-
})}"
|
|
2469
|
-
>
|
|
2470
|
-
<i class="fa-sharp fa-regular fa-paper-plane-top"></i>
|
|
2471
|
-
</button>`,
|
|
2472
|
-
},
|
|
2473
|
-
];
|
|
2474
|
-
});
|
|
2475
|
-
}
|
|
2032
|
+
BgWidget.mainCard(
|
|
2033
|
+
[
|
|
2034
|
+
BgWidget.searchPlace(
|
|
2035
|
+
gvc.event((e, event) => {
|
|
2036
|
+
vm.query = e.value;
|
|
2037
|
+
gvc.notifyDataChange(id);
|
|
2038
|
+
}),
|
|
2039
|
+
vm.query || '',
|
|
2040
|
+
'搜尋所有信件內容'
|
|
2041
|
+
),
|
|
2042
|
+
BgWidget.tableV3({
|
|
2043
|
+
gvc: gvc,
|
|
2044
|
+
getData: (vmi) => {
|
|
2045
|
+
const limit = 20;
|
|
2046
|
+
ApiPost.getManagerPost({
|
|
2047
|
+
page: vmi.page - 1,
|
|
2048
|
+
limit: limit,
|
|
2049
|
+
search: vm.query ? [`title->${vm.query}`] : undefined,
|
|
2050
|
+
type: 'notify-message-config',
|
|
2051
|
+
}).then((data) => {
|
|
2052
|
+
function getDatalist() {
|
|
2053
|
+
return data.response.data.map((dd: any) => {
|
|
2054
|
+
return [
|
|
2055
|
+
{
|
|
2056
|
+
key: '推播標題',
|
|
2057
|
+
value: `<span class="fs-7">${dd.content.title}</span>`,
|
|
2058
|
+
},
|
|
2059
|
+
{
|
|
2060
|
+
key: '推播內文',
|
|
2061
|
+
value: `<span class="fs-7">${Tool.truncateString(dd.content.content.replace(/<[^>]*>/g, ''), 30)}</span>`,
|
|
2062
|
+
},
|
|
2063
|
+
{
|
|
2064
|
+
key: '發送推播',
|
|
2065
|
+
value: html` <button
|
|
2066
|
+
class="btn btn-primary-c px-4"
|
|
2067
|
+
style="width:20px !important;height: 30px;"
|
|
2068
|
+
onclick="${gvc.event((e, event) => {
|
|
2069
|
+
event.stopPropagation();
|
|
2070
|
+
gvc.glitter.innerDialog((gvc) => {
|
|
2071
|
+
let dataList: any = [];
|
|
2072
|
+
return html`
|
|
2073
|
+
<div style="max-height: calc(100vh - 100px);overflow-y: auto;">
|
|
2074
|
+
${BgWidget.container(
|
|
2075
|
+
BgWidget.card(
|
|
2076
|
+
[
|
|
2077
|
+
html`
|
|
2078
|
+
<div class="d-flex w-100 align-items-center mb-3 ">
|
|
2079
|
+
${BgWidget.goBack(
|
|
2080
|
+
gvc.event(() => {
|
|
2081
|
+
gvc.closeDialog();
|
|
2082
|
+
})
|
|
2083
|
+
)}
|
|
2084
|
+
${BgWidget.title(`選擇群發對象`)}
|
|
2085
|
+
<div class="flex-fill"></div>
|
|
2086
|
+
<button
|
|
2087
|
+
class="btn bt_c39 me-2"
|
|
2088
|
+
style="height:38px;font-size: 14px;"
|
|
2089
|
+
onclick="${gvc.event(() => {
|
|
2090
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
2091
|
+
dialog.dataLoading({
|
|
2092
|
+
text: '發送中...',
|
|
2093
|
+
visible: true,
|
|
2094
|
+
});
|
|
2095
|
+
ApiFcm.send({
|
|
2096
|
+
device_token: ['all'],
|
|
2097
|
+
title: dd.content.title,
|
|
2098
|
+
content: dd.content.content,
|
|
2099
|
+
link: dd.content.link,
|
|
2100
|
+
}).then(() => {
|
|
2101
|
+
dialog.dataLoading({ visible: false });
|
|
2102
|
+
dialog.successMessage({ text: `發送成功` });
|
|
2103
|
+
});
|
|
2104
|
+
})}"
|
|
2105
|
+
>
|
|
2106
|
+
發送給所有用戶
|
|
2107
|
+
</button>
|
|
2108
|
+
<button
|
|
2109
|
+
class="btn bt_c39"
|
|
2110
|
+
style="height:38px;font-size: 14px;"
|
|
2111
|
+
onclick="${gvc.event(() => {
|
|
2112
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
2113
|
+
if (dataList.length > 0) {
|
|
2114
|
+
dialog.dataLoading({
|
|
2115
|
+
text: '發送中...',
|
|
2116
|
+
visible: true,
|
|
2117
|
+
});
|
|
2118
|
+
ApiFcm.send({
|
|
2119
|
+
device_token: dataList.map((dd: any) => {
|
|
2120
|
+
return dd.deviceToken;
|
|
2121
|
+
}),
|
|
2122
|
+
title: dd.content.title,
|
|
2123
|
+
content: dd.content.content,
|
|
2124
|
+
link: dd.content.link,
|
|
2125
|
+
}).then(() => {
|
|
2126
|
+
dialog.dataLoading({ visible: false });
|
|
2127
|
+
dialog.successMessage({ text: '發送成功' });
|
|
2128
|
+
});
|
|
2129
|
+
} else {
|
|
2130
|
+
dialog.errorMessage({ text: '請選擇發送對象' });
|
|
2131
|
+
}
|
|
2132
|
+
})}"
|
|
2133
|
+
>
|
|
2134
|
+
確認並發送
|
|
2135
|
+
</button>
|
|
2136
|
+
</div>
|
|
2137
|
+
` +
|
|
2138
|
+
BgSNS.fcmDevice(gvc, 'select', (data) => {
|
|
2139
|
+
dataList = data;
|
|
2140
|
+
}),
|
|
2141
|
+
].join('')
|
|
2142
|
+
),
|
|
2143
|
+
900
|
|
2144
|
+
)}
|
|
2145
|
+
<div></div>
|
|
2146
|
+
</div>
|
|
2147
|
+
`;
|
|
2148
|
+
}, 'email');
|
|
2149
|
+
})}"
|
|
2150
|
+
>
|
|
2151
|
+
<i class="fa-sharp fa-regular fa-paper-plane-top"></i>
|
|
2152
|
+
</button>`,
|
|
2153
|
+
},
|
|
2154
|
+
];
|
|
2155
|
+
});
|
|
2156
|
+
}
|
|
2476
2157
|
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2158
|
+
vm.dataList = data.response.data;
|
|
2159
|
+
vmi.pageSize = Math.ceil(data.response.total / limit);
|
|
2160
|
+
vmi.originalData = vm.dataList;
|
|
2161
|
+
vmi.tableData = getDatalist();
|
|
2162
|
+
vmi.loading = false;
|
|
2163
|
+
vmi.callback();
|
|
2164
|
+
});
|
|
2165
|
+
},
|
|
2166
|
+
rowClick: (data, index) => {
|
|
2167
|
+
vm.data = vm.dataList[index].content;
|
|
2168
|
+
vm.type = 'replace';
|
|
2169
|
+
},
|
|
2170
|
+
filter: [
|
|
2171
|
+
{
|
|
2172
|
+
name: '批量移除',
|
|
2173
|
+
option: false,
|
|
2174
|
+
event: () => {
|
|
2175
|
+
const dialog = new ShareDialog(glitter);
|
|
2176
|
+
dialog.checkYesOrNot({
|
|
2177
|
+
text: '是否確認刪除所選項目?',
|
|
2178
|
+
callback: (response) => {
|
|
2179
|
+
if (response) {
|
|
2180
|
+
dialog.dataLoading({ visible: true });
|
|
2181
|
+
ApiPost.delete({
|
|
2182
|
+
id: vm.dataList
|
|
2183
|
+
.filter((dd: any) => {
|
|
2184
|
+
return dd.checked;
|
|
2185
|
+
})
|
|
2186
|
+
.map((dd: any) => {
|
|
2187
|
+
return dd.id;
|
|
2188
|
+
})
|
|
2189
|
+
.join(`,`),
|
|
2190
|
+
}).then((res) => {
|
|
2191
|
+
dialog.dataLoading({ visible: false });
|
|
2192
|
+
if (res.result) {
|
|
2193
|
+
vm.dataList = undefined;
|
|
2194
|
+
gvc.notifyDataChange(id);
|
|
2195
|
+
} else {
|
|
2196
|
+
dialog.errorMessage({ text: '刪除失敗' });
|
|
2197
|
+
}
|
|
2198
|
+
});
|
|
2199
|
+
}
|
|
2200
|
+
},
|
|
2201
|
+
});
|
|
2202
|
+
},
|
|
2485
2203
|
},
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
}),
|
|
2491
|
-
vm.query || '',
|
|
2492
|
-
'搜尋所有信件內容'
|
|
2493
|
-
)}
|
|
2494
|
-
${gvc.bindView(() => {
|
|
2495
|
-
return {
|
|
2496
|
-
bind: filterID,
|
|
2497
|
-
view: () => {
|
|
2498
|
-
if (
|
|
2499
|
-
!vm.dataList ||
|
|
2500
|
-
!vm.dataList.find((dd: any) => {
|
|
2501
|
-
return dd.checked;
|
|
2502
|
-
})
|
|
2503
|
-
) {
|
|
2504
|
-
return ``;
|
|
2505
|
-
} else {
|
|
2506
|
-
const dialog = new ShareDialog(gvc.glitter);
|
|
2507
|
-
const selCount = vm.dataList.filter((dd: any) => dd.checked).length;
|
|
2508
|
-
return BgWidget.selNavbar({
|
|
2509
|
-
count: selCount,
|
|
2510
|
-
buttonList: [
|
|
2511
|
-
BgWidget.selEventButton(
|
|
2512
|
-
'批量移除',
|
|
2513
|
-
gvc.event(() => {
|
|
2514
|
-
dialog.checkYesOrNot({
|
|
2515
|
-
text: '是否確認刪除所選項目?',
|
|
2516
|
-
callback: (response) => {
|
|
2517
|
-
if (response) {
|
|
2518
|
-
dialog.dataLoading({visible: true});
|
|
2519
|
-
ApiPost.delete({
|
|
2520
|
-
id: vm.dataList
|
|
2521
|
-
.filter((dd: any) => {
|
|
2522
|
-
return dd.checked;
|
|
2523
|
-
})
|
|
2524
|
-
.map((dd: any) => {
|
|
2525
|
-
return dd.id;
|
|
2526
|
-
})
|
|
2527
|
-
.join(`,`),
|
|
2528
|
-
}).then((res) => {
|
|
2529
|
-
dialog.dataLoading({visible: false});
|
|
2530
|
-
if (res.result) {
|
|
2531
|
-
vm.dataList = undefined;
|
|
2532
|
-
gvc.notifyDataChange(id);
|
|
2533
|
-
} else {
|
|
2534
|
-
dialog.errorMessage({text: '刪除失敗'});
|
|
2535
|
-
}
|
|
2536
|
-
});
|
|
2537
|
-
}
|
|
2538
|
-
},
|
|
2539
|
-
});
|
|
2540
|
-
})
|
|
2541
|
-
),
|
|
2542
|
-
],
|
|
2543
|
-
});
|
|
2544
|
-
}
|
|
2545
|
-
},
|
|
2546
|
-
divCreate: () => {
|
|
2547
|
-
return {
|
|
2548
|
-
class: `d-flex align-items-center p-2 py-3 ${
|
|
2549
|
-
!vm.dataList ||
|
|
2550
|
-
!vm.dataList.find((dd: any) => {
|
|
2551
|
-
return dd.checked;
|
|
2552
|
-
})
|
|
2553
|
-
? `d-none`
|
|
2554
|
-
: ``
|
|
2555
|
-
}`,
|
|
2556
|
-
style: ``,
|
|
2557
|
-
};
|
|
2558
|
-
},
|
|
2559
|
-
};
|
|
2560
|
-
})}`,
|
|
2561
|
-
})
|
|
2562
|
-
)
|
|
2204
|
+
],
|
|
2205
|
+
}),
|
|
2206
|
+
].join('')
|
|
2207
|
+
)
|
|
2563
2208
|
)}
|
|
2564
2209
|
`,
|
|
2565
2210
|
BgWidget.getContainerWidth()
|
|
@@ -2582,8 +2227,7 @@ export class BgSNS {
|
|
|
2582
2227
|
});
|
|
2583
2228
|
}
|
|
2584
2229
|
|
|
2585
|
-
public static rebackMessage(gvc: GVC, type: 'list' | 'select' = 'list', callback: (select: any) => void = () => {
|
|
2586
|
-
}) {
|
|
2230
|
+
public static rebackMessage(gvc: GVC, type: 'list' | 'select' = 'list', callback: (select: any) => void = () => {}) {
|
|
2587
2231
|
const vm: {
|
|
2588
2232
|
type: 'list' | 'replace';
|
|
2589
2233
|
data: any;
|
|
@@ -2595,7 +2239,7 @@ export class BgSNS {
|
|
|
2595
2239
|
id: 61,
|
|
2596
2240
|
userID: 549313940,
|
|
2597
2241
|
account: 'jianzhi.wang@homee.ai',
|
|
2598
|
-
userData: {name: '王建智', email: 'jianzhi.wang@homee.ai', phone: '0978028739'},
|
|
2242
|
+
userData: { name: '王建智', email: 'jianzhi.wang@homee.ai', phone: '0978028739' },
|
|
2599
2243
|
created_time: '2023-11-26T02:14:09.000Z',
|
|
2600
2244
|
role: 0,
|
|
2601
2245
|
company: null,
|
|
@@ -2698,120 +2342,119 @@ export class BgSNS {
|
|
|
2698
2342
|
html`
|
|
2699
2343
|
<div class="d-flex w-100 align-items-center mb-3 ">
|
|
2700
2344
|
${BgWidget.goBack(
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2345
|
+
gvc.event(() => {
|
|
2346
|
+
vm.type = 'list';
|
|
2347
|
+
gvc.notifyDataChange(id);
|
|
2348
|
+
})
|
|
2705
2349
|
)}
|
|
2706
2350
|
${BgWidget.title(`用戶回饋內容`)}
|
|
2707
2351
|
<div class="flex-fill"></div>
|
|
2708
2352
|
</div>
|
|
2709
2353
|
${BgWidget.card(
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
},
|
|
2354
|
+
` ${FormWidget.editorView({
|
|
2355
|
+
gvc: gvc,
|
|
2356
|
+
array: [
|
|
2357
|
+
{
|
|
2358
|
+
key: 'name',
|
|
2359
|
+
type: 'name',
|
|
2360
|
+
title: '姓名',
|
|
2361
|
+
require: 'true',
|
|
2362
|
+
readonly: 'read',
|
|
2363
|
+
style_data: {
|
|
2364
|
+
input: {
|
|
2365
|
+
class: '',
|
|
2366
|
+
style: '',
|
|
2367
|
+
},
|
|
2368
|
+
label: {
|
|
2369
|
+
class: 'form-label fs-base ',
|
|
2370
|
+
style: '',
|
|
2371
|
+
},
|
|
2372
|
+
container: {
|
|
2373
|
+
tag: 'aboutus-container',
|
|
2374
|
+
class: '',
|
|
2375
|
+
style: '',
|
|
2376
|
+
stylist: [],
|
|
2377
|
+
dataType: 'static',
|
|
2378
|
+
style_from: 'tag',
|
|
2379
|
+
classDataType: 'static',
|
|
2737
2380
|
},
|
|
2738
2381
|
},
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2382
|
+
},
|
|
2383
|
+
{
|
|
2384
|
+
key: 'email',
|
|
2385
|
+
type: 'email',
|
|
2386
|
+
title: '信箱',
|
|
2387
|
+
require: 'true',
|
|
2388
|
+
readonly: 'read',
|
|
2389
|
+
style_data: {
|
|
2390
|
+
input: {
|
|
2391
|
+
class: '',
|
|
2392
|
+
style: '',
|
|
2393
|
+
},
|
|
2394
|
+
label: {
|
|
2395
|
+
class: 'form-label fs-base ',
|
|
2396
|
+
style: '',
|
|
2397
|
+
},
|
|
2398
|
+
container: {
|
|
2399
|
+
tag: 'aboutus-container',
|
|
2400
|
+
class: '',
|
|
2401
|
+
style: '',
|
|
2402
|
+
stylist: [],
|
|
2403
|
+
style_from: 'tag',
|
|
2761
2404
|
},
|
|
2762
2405
|
},
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2406
|
+
},
|
|
2407
|
+
{
|
|
2408
|
+
key: 'title',
|
|
2409
|
+
type: 'text',
|
|
2410
|
+
title: '標題',
|
|
2411
|
+
require: 'true',
|
|
2412
|
+
readonly: 'read',
|
|
2413
|
+
style_data: {
|
|
2414
|
+
input: {
|
|
2415
|
+
class: '',
|
|
2416
|
+
style: '',
|
|
2417
|
+
},
|
|
2418
|
+
label: {
|
|
2419
|
+
class: 'form-label fs-base ',
|
|
2420
|
+
style: '',
|
|
2421
|
+
},
|
|
2422
|
+
container: {
|
|
2423
|
+
tag: 'aboutus-container',
|
|
2424
|
+
class: '',
|
|
2425
|
+
style: '',
|
|
2426
|
+
stylist: [],
|
|
2427
|
+
dataType: 'static',
|
|
2428
|
+
style_from: 'tag',
|
|
2429
|
+
classDataType: 'static',
|
|
2787
2430
|
},
|
|
2788
2431
|
},
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2432
|
+
},
|
|
2433
|
+
{
|
|
2434
|
+
key: 'content',
|
|
2435
|
+
type: 'textArea',
|
|
2436
|
+
title: '訊息',
|
|
2437
|
+
require: 'true',
|
|
2438
|
+
readonly: 'read',
|
|
2439
|
+
style_data: {
|
|
2440
|
+
input: {
|
|
2441
|
+
class: '',
|
|
2442
|
+
style: '',
|
|
2443
|
+
},
|
|
2444
|
+
label: {
|
|
2445
|
+
class: 'form-label fs-base ',
|
|
2446
|
+
style: '',
|
|
2447
|
+
},
|
|
2448
|
+
container: {
|
|
2449
|
+
class: '',
|
|
2450
|
+
style: '',
|
|
2808
2451
|
},
|
|
2809
2452
|
},
|
|
2810
|
-
],
|
|
2811
|
-
refresh: () => {
|
|
2812
2453
|
},
|
|
2813
|
-
|
|
2814
|
-
|
|
2454
|
+
],
|
|
2455
|
+
refresh: () => {},
|
|
2456
|
+
formData: vm.data.content,
|
|
2457
|
+
})}`
|
|
2815
2458
|
)}
|
|
2816
2459
|
`,
|
|
2817
2460
|
800
|
|
@@ -2839,9 +2482,9 @@ export class BgSNS {
|
|
|
2839
2482
|
vmi.callback();
|
|
2840
2483
|
if (type === 'select') {
|
|
2841
2484
|
callback(
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2485
|
+
vm.dataList.filter((dd: any) => {
|
|
2486
|
+
return dd.checked;
|
|
2487
|
+
})
|
|
2845
2488
|
);
|
|
2846
2489
|
}
|
|
2847
2490
|
});
|
|
@@ -2853,22 +2496,22 @@ export class BgSNS {
|
|
|
2853
2496
|
},
|
|
2854
2497
|
filter: html`
|
|
2855
2498
|
${BgWidget.searchPlace(
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2499
|
+
gvc.event((e, event) => {
|
|
2500
|
+
vm.query = e.value;
|
|
2501
|
+
gvc.notifyDataChange(id);
|
|
2502
|
+
}),
|
|
2503
|
+
vm.query || '',
|
|
2504
|
+
'搜尋標題'
|
|
2862
2505
|
)}
|
|
2863
2506
|
${gvc.bindView(() => {
|
|
2864
2507
|
return {
|
|
2865
2508
|
bind: filterID,
|
|
2866
2509
|
view: () => {
|
|
2867
2510
|
if (
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2511
|
+
!vm.dataList ||
|
|
2512
|
+
!vm.dataList.find((dd: any) => {
|
|
2513
|
+
return dd.checked;
|
|
2514
|
+
})
|
|
2872
2515
|
) {
|
|
2873
2516
|
return ``;
|
|
2874
2517
|
} else {
|
|
@@ -2878,35 +2521,35 @@ export class BgSNS {
|
|
|
2878
2521
|
count: selCount,
|
|
2879
2522
|
buttonList: [
|
|
2880
2523
|
BgWidget.selEventButton(
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2524
|
+
'批量移除',
|
|
2525
|
+
gvc.event(() => {
|
|
2526
|
+
dialog.checkYesOrNot({
|
|
2527
|
+
text: '是否確認刪除所選項目?',
|
|
2528
|
+
callback: (response) => {
|
|
2529
|
+
if (response) {
|
|
2530
|
+
dialog.dataLoading({ visible: true });
|
|
2531
|
+
ApiPost.deleteUserPost({
|
|
2532
|
+
id: vm.dataList
|
|
2533
|
+
.filter((dd: any) => {
|
|
2534
|
+
return dd.checked;
|
|
2535
|
+
})
|
|
2536
|
+
.map((dd: any) => {
|
|
2537
|
+
return dd.id;
|
|
2538
|
+
})
|
|
2539
|
+
.join(`,`),
|
|
2540
|
+
}).then((res) => {
|
|
2541
|
+
dialog.dataLoading({ visible: false });
|
|
2542
|
+
if (res.result) {
|
|
2543
|
+
vm.dataList = undefined;
|
|
2544
|
+
gvc.notifyDataChange(id);
|
|
2545
|
+
} else {
|
|
2546
|
+
dialog.errorMessage({ text: '刪除失敗' });
|
|
2547
|
+
}
|
|
2548
|
+
});
|
|
2549
|
+
}
|
|
2550
|
+
},
|
|
2551
|
+
});
|
|
2552
|
+
})
|
|
2910
2553
|
),
|
|
2911
2554
|
],
|
|
2912
2555
|
});
|
|
@@ -2915,13 +2558,13 @@ export class BgSNS {
|
|
|
2915
2558
|
divCreate: () => {
|
|
2916
2559
|
return {
|
|
2917
2560
|
class: `d-flex align-items-center p-2 py-3 ${
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2561
|
+
!vm.dataList ||
|
|
2562
|
+
!vm.dataList.find((dd: any) => {
|
|
2563
|
+
return dd.checked;
|
|
2564
|
+
}) ||
|
|
2565
|
+
type === 'select'
|
|
2566
|
+
? `d-none`
|
|
2567
|
+
: ``
|
|
2925
2568
|
}`,
|
|
2926
2569
|
style: ``,
|
|
2927
2570
|
};
|
|
@@ -2939,8 +2582,7 @@ export class BgSNS {
|
|
|
2939
2582
|
});
|
|
2940
2583
|
}
|
|
2941
2584
|
|
|
2942
|
-
public static customerMessage(gvc: GVC, type: 'list' | 'select' = 'list', callback: (select: any) => void = () => {
|
|
2943
|
-
}) {
|
|
2585
|
+
public static customerMessage(gvc: GVC, type: 'list' | 'select' = 'list', callback: (select: any) => void = () => {}) {
|
|
2944
2586
|
const vm: {
|
|
2945
2587
|
type: 'list' | 'replace';
|
|
2946
2588
|
data: any;
|
|
@@ -2952,7 +2594,7 @@ export class BgSNS {
|
|
|
2952
2594
|
id: 61,
|
|
2953
2595
|
userID: 549313940,
|
|
2954
2596
|
account: 'jianzhi.wang@homee.ai',
|
|
2955
|
-
userData: {name: '王建智', email: 'jianzhi.wang@homee.ai', phone: '0978028739'},
|
|
2597
|
+
userData: { name: '王建智', email: 'jianzhi.wang@homee.ai', phone: '0978028739' },
|
|
2956
2598
|
created_time: '2023-11-26T02:14:09.000Z',
|
|
2957
2599
|
role: 0,
|
|
2958
2600
|
company: null,
|
|
@@ -3052,120 +2694,119 @@ export class BgSNS {
|
|
|
3052
2694
|
html`
|
|
3053
2695
|
<div class="d-flex w-100 align-items-center mb-3 ">
|
|
3054
2696
|
${BgWidget.goBack(
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
2697
|
+
gvc.event(() => {
|
|
2698
|
+
vm.type = 'list';
|
|
2699
|
+
gvc.notifyDataChange(id);
|
|
2700
|
+
})
|
|
3059
2701
|
)}
|
|
3060
2702
|
${BgWidget.title(`客服訊息`)}
|
|
3061
2703
|
<div class="flex-fill"></div>
|
|
3062
2704
|
</div>
|
|
3063
2705
|
${BgWidget.card(
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
},
|
|
2706
|
+
` ${FormWidget.editorView({
|
|
2707
|
+
gvc: gvc,
|
|
2708
|
+
array: [
|
|
2709
|
+
{
|
|
2710
|
+
key: 'name',
|
|
2711
|
+
type: 'name',
|
|
2712
|
+
title: '姓名',
|
|
2713
|
+
require: 'true',
|
|
2714
|
+
readonly: 'read',
|
|
2715
|
+
style_data: {
|
|
2716
|
+
input: {
|
|
2717
|
+
class: '',
|
|
2718
|
+
style: '',
|
|
2719
|
+
},
|
|
2720
|
+
label: {
|
|
2721
|
+
class: 'form-label fs-base ',
|
|
2722
|
+
style: '',
|
|
2723
|
+
},
|
|
2724
|
+
container: {
|
|
2725
|
+
tag: 'aboutus-container',
|
|
2726
|
+
class: '',
|
|
2727
|
+
style: '',
|
|
2728
|
+
stylist: [],
|
|
2729
|
+
dataType: 'static',
|
|
2730
|
+
style_from: 'tag',
|
|
2731
|
+
classDataType: 'static',
|
|
3091
2732
|
},
|
|
3092
2733
|
},
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
2734
|
+
},
|
|
2735
|
+
{
|
|
2736
|
+
key: 'email',
|
|
2737
|
+
type: 'email',
|
|
2738
|
+
title: '信箱',
|
|
2739
|
+
require: 'true',
|
|
2740
|
+
readonly: 'read',
|
|
2741
|
+
style_data: {
|
|
2742
|
+
input: {
|
|
2743
|
+
class: '',
|
|
2744
|
+
style: '',
|
|
2745
|
+
},
|
|
2746
|
+
label: {
|
|
2747
|
+
class: 'form-label fs-base ',
|
|
2748
|
+
style: '',
|
|
2749
|
+
},
|
|
2750
|
+
container: {
|
|
2751
|
+
tag: 'aboutus-container',
|
|
2752
|
+
class: '',
|
|
2753
|
+
style: '',
|
|
2754
|
+
stylist: [],
|
|
2755
|
+
style_from: 'tag',
|
|
3115
2756
|
},
|
|
3116
2757
|
},
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
2758
|
+
},
|
|
2759
|
+
{
|
|
2760
|
+
key: 'title',
|
|
2761
|
+
type: 'text',
|
|
2762
|
+
title: '標題',
|
|
2763
|
+
require: 'true',
|
|
2764
|
+
readonly: 'read',
|
|
2765
|
+
style_data: {
|
|
2766
|
+
input: {
|
|
2767
|
+
class: '',
|
|
2768
|
+
style: '',
|
|
2769
|
+
},
|
|
2770
|
+
label: {
|
|
2771
|
+
class: 'form-label fs-base ',
|
|
2772
|
+
style: '',
|
|
2773
|
+
},
|
|
2774
|
+
container: {
|
|
2775
|
+
tag: 'aboutus-container',
|
|
2776
|
+
class: '',
|
|
2777
|
+
style: '',
|
|
2778
|
+
stylist: [],
|
|
2779
|
+
dataType: 'static',
|
|
2780
|
+
style_from: 'tag',
|
|
2781
|
+
classDataType: 'static',
|
|
3141
2782
|
},
|
|
3142
2783
|
},
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
2784
|
+
},
|
|
2785
|
+
{
|
|
2786
|
+
key: 'content',
|
|
2787
|
+
type: 'textArea',
|
|
2788
|
+
title: '訊息',
|
|
2789
|
+
require: 'true',
|
|
2790
|
+
readonly: 'read',
|
|
2791
|
+
style_data: {
|
|
2792
|
+
input: {
|
|
2793
|
+
class: '',
|
|
2794
|
+
style: '',
|
|
2795
|
+
},
|
|
2796
|
+
label: {
|
|
2797
|
+
class: 'form-label fs-base ',
|
|
2798
|
+
style: '',
|
|
2799
|
+
},
|
|
2800
|
+
container: {
|
|
2801
|
+
class: '',
|
|
2802
|
+
style: '',
|
|
3162
2803
|
},
|
|
3163
2804
|
},
|
|
3164
|
-
],
|
|
3165
|
-
refresh: () => {
|
|
3166
2805
|
},
|
|
3167
|
-
|
|
3168
|
-
|
|
2806
|
+
],
|
|
2807
|
+
refresh: () => {},
|
|
2808
|
+
formData: vm.data.content,
|
|
2809
|
+
})}`
|
|
3169
2810
|
)}
|
|
3170
2811
|
`,
|
|
3171
2812
|
800
|
|
@@ -3176,144 +2817,142 @@ export class BgSNS {
|
|
|
3176
2817
|
${BgWidget.title('客服訊息')}
|
|
3177
2818
|
<div class="flex-fill"></div>
|
|
3178
2819
|
<button
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
2820
|
+
class="btn hoverBtn me-2 px-3"
|
|
2821
|
+
style="height:35px !important;font-size: 14px;color:black;border:1px solid black;"
|
|
2822
|
+
onclick="${gvc.event(() => {
|
|
2823
|
+
EditorElem.openEditorDialog(
|
|
2824
|
+
gvc,
|
|
2825
|
+
(gvc) => {
|
|
2826
|
+
const saasConfig: {
|
|
2827
|
+
config: any;
|
|
2828
|
+
api: any;
|
|
2829
|
+
} = (window as any).saasConfig;
|
|
2830
|
+
const id = gvc.glitter.getUUID();
|
|
2831
|
+
let keyData = {};
|
|
2832
|
+
return [
|
|
2833
|
+
gvc.bindView(() => {
|
|
2834
|
+
ApiUser.getPublicConfig(`robot_auto_reply`, 'manager').then((data: any) => {
|
|
2835
|
+
if (data.response.value) {
|
|
2836
|
+
keyData = data.response.value;
|
|
2837
|
+
gvc.notifyDataChange(id);
|
|
2838
|
+
}
|
|
2839
|
+
});
|
|
2840
|
+
return {
|
|
2841
|
+
bind: id,
|
|
2842
|
+
view: () => {
|
|
2843
|
+
return new Promise((resolve, reject) => {
|
|
2844
|
+
resolve(
|
|
2845
|
+
FormWidget.editorView({
|
|
2846
|
+
gvc: gvc,
|
|
2847
|
+
array: [
|
|
2848
|
+
{
|
|
2849
|
+
title: '機器人問答',
|
|
2850
|
+
key: 'question',
|
|
2851
|
+
readonly: 'write',
|
|
2852
|
+
type: 'array',
|
|
2853
|
+
require: 'true',
|
|
2854
|
+
style_data: {
|
|
2855
|
+
label: {
|
|
2856
|
+
class: 'form-label fs-base ',
|
|
2857
|
+
style: '',
|
|
2858
|
+
},
|
|
2859
|
+
input: {
|
|
2860
|
+
class: '',
|
|
2861
|
+
style: '',
|
|
2862
|
+
},
|
|
2863
|
+
container: {
|
|
2864
|
+
class: '',
|
|
2865
|
+
style: '',
|
|
2866
|
+
},
|
|
2867
|
+
},
|
|
2868
|
+
referTitile: 'ask',
|
|
2869
|
+
plusBtn: '添加自動問答',
|
|
2870
|
+
formList: [
|
|
2871
|
+
{
|
|
2872
|
+
title: '問題',
|
|
2873
|
+
key: 'ask',
|
|
2874
|
+
readonly: 'write',
|
|
2875
|
+
type: 'text',
|
|
2876
|
+
require: 'true',
|
|
2877
|
+
style_data: {
|
|
2878
|
+
label: {
|
|
2879
|
+
class: 'form-label fs-base ',
|
|
2880
|
+
style: '',
|
|
2881
|
+
},
|
|
2882
|
+
input: {
|
|
2883
|
+
class: '',
|
|
2884
|
+
style: '',
|
|
2885
|
+
},
|
|
2886
|
+
container: {
|
|
2887
|
+
class: '',
|
|
2888
|
+
style: '',
|
|
3226
2889
|
},
|
|
3227
|
-
referTitile: 'ask',
|
|
3228
|
-
plusBtn: '添加自動問答',
|
|
3229
|
-
formList: [
|
|
3230
|
-
{
|
|
3231
|
-
title: '問題',
|
|
3232
|
-
key: 'ask',
|
|
3233
|
-
readonly: 'write',
|
|
3234
|
-
type: 'text',
|
|
3235
|
-
require: 'true',
|
|
3236
|
-
style_data: {
|
|
3237
|
-
label: {
|
|
3238
|
-
class: 'form-label fs-base ',
|
|
3239
|
-
style: '',
|
|
3240
|
-
},
|
|
3241
|
-
input: {
|
|
3242
|
-
class: '',
|
|
3243
|
-
style: '',
|
|
3244
|
-
},
|
|
3245
|
-
container: {
|
|
3246
|
-
class: '',
|
|
3247
|
-
style: '',
|
|
3248
|
-
},
|
|
3249
|
-
},
|
|
3250
|
-
},
|
|
3251
|
-
{
|
|
3252
|
-
title: '回應',
|
|
3253
|
-
key: 'response',
|
|
3254
|
-
readonly: 'write',
|
|
3255
|
-
type: 'textArea',
|
|
3256
|
-
require: 'true',
|
|
3257
|
-
style_data: {
|
|
3258
|
-
label: {
|
|
3259
|
-
class: 'form-label fs-base ',
|
|
3260
|
-
style: '',
|
|
3261
|
-
},
|
|
3262
|
-
input: {
|
|
3263
|
-
class: '',
|
|
3264
|
-
style: '',
|
|
3265
|
-
},
|
|
3266
|
-
container: {
|
|
3267
|
-
class: '',
|
|
3268
|
-
style: '',
|
|
3269
|
-
},
|
|
3270
|
-
},
|
|
3271
|
-
},
|
|
3272
|
-
],
|
|
3273
2890
|
},
|
|
3274
|
-
],
|
|
3275
|
-
refresh: () => {
|
|
3276
|
-
gvc.notifyDataChange(id);
|
|
3277
2891
|
},
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
}
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
}
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
2892
|
+
{
|
|
2893
|
+
title: '回應',
|
|
2894
|
+
key: 'response',
|
|
2895
|
+
readonly: 'write',
|
|
2896
|
+
type: 'textArea',
|
|
2897
|
+
require: 'true',
|
|
2898
|
+
style_data: {
|
|
2899
|
+
label: {
|
|
2900
|
+
class: 'form-label fs-base ',
|
|
2901
|
+
style: '',
|
|
2902
|
+
},
|
|
2903
|
+
input: {
|
|
2904
|
+
class: '',
|
|
2905
|
+
style: '',
|
|
2906
|
+
},
|
|
2907
|
+
container: {
|
|
2908
|
+
class: '',
|
|
2909
|
+
style: '',
|
|
2910
|
+
},
|
|
2911
|
+
},
|
|
2912
|
+
},
|
|
2913
|
+
],
|
|
2914
|
+
},
|
|
2915
|
+
],
|
|
2916
|
+
refresh: () => {
|
|
2917
|
+
gvc.notifyDataChange(id);
|
|
2918
|
+
},
|
|
2919
|
+
formData: keyData,
|
|
2920
|
+
})
|
|
2921
|
+
);
|
|
2922
|
+
});
|
|
2923
|
+
},
|
|
2924
|
+
divCreate: {
|
|
2925
|
+
class: 'p-2',
|
|
2926
|
+
},
|
|
2927
|
+
};
|
|
2928
|
+
}),
|
|
2929
|
+
html` <div class="d-flex">
|
|
2930
|
+
<div class="flex-fill"></div>
|
|
2931
|
+
<div
|
|
2932
|
+
class=" btn-primary-c btn my-2 me-2"
|
|
2933
|
+
style="margin-left: 10px;height:35px;"
|
|
2934
|
+
onclick="${gvc.event(() => {
|
|
2935
|
+
dialog.dataLoading({ visible: true });
|
|
2936
|
+
ApiUser.setPublicConfig({
|
|
2937
|
+
key: `robot_auto_reply`,
|
|
2938
|
+
value: keyData,
|
|
2939
|
+
user_id: 'manager',
|
|
2940
|
+
}).then((data: any) => {
|
|
2941
|
+
dialog.dataLoading({ visible: false });
|
|
2942
|
+
dialog.successMessage({ text: '設定成功' });
|
|
2943
|
+
});
|
|
2944
|
+
})}"
|
|
2945
|
+
>
|
|
2946
|
+
儲存設定
|
|
2947
|
+
</div>
|
|
2948
|
+
</div>`,
|
|
2949
|
+
].join('');
|
|
2950
|
+
},
|
|
2951
|
+
() => {},
|
|
2952
|
+
500,
|
|
2953
|
+
'自訂表單'
|
|
2954
|
+
);
|
|
2955
|
+
})}"
|
|
3317
2956
|
>
|
|
3318
2957
|
<i class="fa-regular fa-gear me-2 "></i>
|
|
3319
2958
|
機器人問答
|
|
@@ -3335,9 +2974,9 @@ export class BgSNS {
|
|
|
3335
2974
|
vmi.callback();
|
|
3336
2975
|
if (type === 'select') {
|
|
3337
2976
|
callback(
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
2977
|
+
vm.dataList.filter((dd: any) => {
|
|
2978
|
+
return dd.checked;
|
|
2979
|
+
})
|
|
3341
2980
|
);
|
|
3342
2981
|
}
|
|
3343
2982
|
});
|
|
@@ -3364,14 +3003,14 @@ export class BgSNS {
|
|
|
3364
3003
|
filter: html`
|
|
3365
3004
|
<div style="height:50px;" class="w-100 border-bottom ">
|
|
3366
3005
|
<input
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3006
|
+
class="form-control h-100 "
|
|
3007
|
+
style="border: none;"
|
|
3008
|
+
placeholder="搜尋用戶名稱"
|
|
3009
|
+
onchange="${gvc.event((e, event) => {
|
|
3010
|
+
vm.query = e.value;
|
|
3011
|
+
gvc.notifyDataChange(id);
|
|
3012
|
+
})}"
|
|
3013
|
+
value="${vm.query || ''}"
|
|
3375
3014
|
/>
|
|
3376
3015
|
</div>
|
|
3377
3016
|
${gvc.bindView(() => {
|
|
@@ -3379,10 +3018,10 @@ export class BgSNS {
|
|
|
3379
3018
|
bind: filterID,
|
|
3380
3019
|
view: () => {
|
|
3381
3020
|
if (
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3021
|
+
!vm.dataList ||
|
|
3022
|
+
!vm.dataList.find((dd: any) => {
|
|
3023
|
+
return dd.checked;
|
|
3024
|
+
})
|
|
3386
3025
|
) {
|
|
3387
3026
|
return ``;
|
|
3388
3027
|
} else {
|
|
@@ -3392,35 +3031,35 @@ export class BgSNS {
|
|
|
3392
3031
|
count: selCount,
|
|
3393
3032
|
buttonList: [
|
|
3394
3033
|
BgWidget.selEventButton(
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3034
|
+
'批量移除',
|
|
3035
|
+
gvc.event(() => {
|
|
3036
|
+
dialog.checkYesOrNot({
|
|
3037
|
+
text: '是否確認刪除所選項目?',
|
|
3038
|
+
callback: (response) => {
|
|
3039
|
+
if (response) {
|
|
3040
|
+
dialog.dataLoading({ visible: true });
|
|
3041
|
+
Chat.deleteChatRoom({
|
|
3042
|
+
id: vm.dataList
|
|
3043
|
+
.filter((dd: any) => {
|
|
3044
|
+
return dd.checked;
|
|
3045
|
+
})
|
|
3046
|
+
.map((dd: any) => {
|
|
3047
|
+
return dd.id;
|
|
3048
|
+
})
|
|
3049
|
+
.join(`,`),
|
|
3050
|
+
}).then((res) => {
|
|
3051
|
+
dialog.dataLoading({ visible: false });
|
|
3052
|
+
if (res.result) {
|
|
3053
|
+
vm.dataList = undefined;
|
|
3054
|
+
gvc.notifyDataChange(id);
|
|
3055
|
+
} else {
|
|
3056
|
+
dialog.errorMessage({ text: '刪除失敗' });
|
|
3057
|
+
}
|
|
3058
|
+
});
|
|
3059
|
+
}
|
|
3060
|
+
},
|
|
3061
|
+
});
|
|
3062
|
+
})
|
|
3424
3063
|
),
|
|
3425
3064
|
],
|
|
3426
3065
|
});
|
|
@@ -3429,13 +3068,13 @@ export class BgSNS {
|
|
|
3429
3068
|
divCreate: () => {
|
|
3430
3069
|
return {
|
|
3431
3070
|
class: `d-flex align-items-center p-2 py-3 ${
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3071
|
+
!vm.dataList ||
|
|
3072
|
+
!vm.dataList.find((dd: any) => {
|
|
3073
|
+
return dd.checked;
|
|
3074
|
+
}) ||
|
|
3075
|
+
type === 'select'
|
|
3076
|
+
? `d-none`
|
|
3077
|
+
: ``
|
|
3439
3078
|
}`,
|
|
3440
3079
|
style: ``,
|
|
3441
3080
|
};
|
|
@@ -3456,7 +3095,6 @@ export class BgSNS {
|
|
|
3456
3095
|
|
|
3457
3096
|
function defaultEmailText() {
|
|
3458
3097
|
return `【商店名稱】親愛的顧客,限時優惠!全館商品即日起至9月30日享85折優惠,結帳時輸入優惠代碼:SALE2024,立即享受折扣!詳情請見:https://shopnex.cc/index。`;
|
|
3459
|
-
|
|
3460
3098
|
}
|
|
3461
3099
|
|
|
3462
3100
|
(window as any).glitter.setModule(import.meta.url, BgSNS);
|