ts-glitter 21.7.5 → 21.7.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/cms-plugin/auto-reply.js +2 -1
- package/lowcode/cms-plugin/auto-reply.ts +2 -2
- package/lowcode/cms-plugin/line-auto-reply.js +5 -1
- package/lowcode/cms-plugin/line-auto-reply.ts +5 -1
- package/lowcode/cms-plugin/sns-auto-reply.js +32 -31
- package/lowcode/cms-plugin/sns-auto-reply.ts +414 -411
- package/package.json +1 -1
- package/src/api-public/services/checkout-event.js +28 -26
- package/src/api-public/services/checkout-event.js.map +1 -1
- package/src/api-public/services/checkout-event.ts +3 -1
|
@@ -9,427 +9,430 @@ import { ShareDialog } from '../glitterBundle/dialog/ShareDialog.js';
|
|
|
9
9
|
const html = String.raw;
|
|
10
10
|
|
|
11
11
|
export class AutoReply {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
public static maxSize = 160;
|
|
13
|
+
public static longSMS = 153;
|
|
14
|
+
public static ticket = 15;
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
16
|
+
public static main(gvc: GVC, widget: any) {
|
|
17
|
+
const vm: {
|
|
18
|
+
type: 'list' | 'replace';
|
|
19
|
+
data: any;
|
|
20
|
+
dataList: any;
|
|
21
|
+
query?: string;
|
|
22
|
+
tag: string;
|
|
23
|
+
userData: any;
|
|
24
|
+
} = {
|
|
25
|
+
type: 'list',
|
|
26
|
+
data: {},
|
|
27
|
+
dataList: undefined,
|
|
28
|
+
tag: '',
|
|
29
|
+
query: '',
|
|
30
|
+
userData: {
|
|
31
|
+
userName: '',
|
|
32
|
+
password: '',
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
const glitter = gvc.glitter;
|
|
36
|
+
const id = glitter.getUUID();
|
|
37
|
+
return gvc.bindView(() => {
|
|
38
|
+
return {
|
|
39
|
+
bind: id,
|
|
40
|
+
view: () => {
|
|
41
|
+
if (vm.type === 'replace') {
|
|
42
|
+
return AutoReply.autoSendEmail(
|
|
43
|
+
gvc,
|
|
44
|
+
vm.tag,
|
|
45
|
+
() => {
|
|
46
|
+
vm.type = 'list';
|
|
47
|
+
gvc.notifyDataChange(id);
|
|
48
|
+
},
|
|
49
|
+
widget
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
let vmi: any = undefined;
|
|
53
|
+
|
|
54
|
+
function getDatalist() {
|
|
55
|
+
return vm.dataList.map((dd: any) => {
|
|
56
|
+
return [
|
|
57
|
+
{
|
|
58
|
+
key: '發送時間',
|
|
59
|
+
value: dd.tag_name,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
key: '標題',
|
|
63
|
+
value: Tool.truncateString(dd.title, 40),
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
key: '最後更新時間',
|
|
67
|
+
value: dd.updated_time ? gvc.glitter.ut.dateFormat(dd.updated_time, 'yyyy-MM-dd') : '系統預設',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
key: '狀態',
|
|
71
|
+
value: gvc.bindView(() => {
|
|
72
|
+
const id2 = gvc.glitter.getUUID();
|
|
73
|
+
return {
|
|
74
|
+
bind: id2,
|
|
75
|
+
view: () => {
|
|
76
|
+
return BgWidget.switchTextButton(
|
|
77
|
+
gvc,
|
|
78
|
+
dd.toggle,
|
|
79
|
+
{
|
|
80
|
+
left: dd.toggle ? '啟用' : '關閉',
|
|
81
|
+
},
|
|
82
|
+
() => {
|
|
83
|
+
ApiUser.getPublicConfig(dd.tag, 'manager').then(res => {
|
|
84
|
+
dd.toggle = !dd.toggle;
|
|
85
|
+
res.response.value = res.response.value || {};
|
|
86
|
+
res.response.value.updated_time = new Date();
|
|
87
|
+
res.response.value.toggle = dd.toggle;
|
|
88
|
+
ApiUser.setPublicConfig({
|
|
89
|
+
key: dd.tag,
|
|
90
|
+
value: res.response.value,
|
|
91
|
+
user_id: 'manager',
|
|
92
|
+
}).then(() => {
|
|
93
|
+
gvc.notifyDataChange(id2);
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
}
|
|
50
97
|
);
|
|
51
|
-
|
|
52
|
-
|
|
98
|
+
},
|
|
99
|
+
divCreate: {
|
|
100
|
+
elem: 'div',
|
|
101
|
+
style: 'gap:4px;',
|
|
102
|
+
class: 'd-flex',
|
|
103
|
+
option: [
|
|
104
|
+
{
|
|
105
|
+
key: 'onclick',
|
|
106
|
+
value: gvc.event((e, event) => {
|
|
107
|
+
event.stopPropagation();
|
|
108
|
+
}),
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
}),
|
|
114
|
+
},
|
|
115
|
+
];
|
|
116
|
+
});
|
|
117
|
+
}
|
|
53
118
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
res.response.value = res.response.value || {};
|
|
86
|
-
res.response.value.updated_time = new Date();
|
|
87
|
-
res.response.value.toggle = dd.toggle;
|
|
88
|
-
ApiUser.setPublicConfig({
|
|
89
|
-
key: dd.tag,
|
|
90
|
-
value: res.response.value,
|
|
91
|
-
user_id: 'manager',
|
|
92
|
-
}).then(() => {
|
|
93
|
-
gvc.notifyDataChange(id2);
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
);
|
|
98
|
-
},
|
|
99
|
-
divCreate: {
|
|
100
|
-
elem: 'div',
|
|
101
|
-
style: 'gap:4px;',
|
|
102
|
-
class: 'd-flex',
|
|
103
|
-
option: [
|
|
104
|
-
{
|
|
105
|
-
key: 'onclick',
|
|
106
|
-
value: gvc.event((e, event) => {
|
|
107
|
-
event.stopPropagation();
|
|
108
|
-
}),
|
|
109
|
-
},
|
|
110
|
-
],
|
|
111
|
-
},
|
|
112
|
-
};
|
|
113
|
-
}),
|
|
114
|
-
},
|
|
115
|
-
];
|
|
116
|
-
});
|
|
119
|
+
return BgWidget.container(html`
|
|
120
|
+
<div class="title-container">
|
|
121
|
+
${BgWidget.title('自動寄送簡訊')}
|
|
122
|
+
<div class="flex-fill"></div>
|
|
123
|
+
</div>
|
|
124
|
+
${BgWidget.container(
|
|
125
|
+
BgWidget.mainCard(
|
|
126
|
+
BgWidget.tableV3({
|
|
127
|
+
gvc: gvc,
|
|
128
|
+
getData: async vmk => {
|
|
129
|
+
const appData = await ApiUser.getPublicConfig('store-information', 'manager');
|
|
130
|
+
vmi = vmk;
|
|
131
|
+
vmi.pageSize = Math.ceil(1);
|
|
132
|
+
vm.dataList = [
|
|
133
|
+
'auto-sns-shipment-arrival',
|
|
134
|
+
'auto-sns-shipment',
|
|
135
|
+
'auto-sns-payment-successful',
|
|
136
|
+
'auto-sns-order-create',
|
|
137
|
+
'sns-proof-purchase',
|
|
138
|
+
'auto-sns-birthday',
|
|
139
|
+
'auto-phone-verify',
|
|
140
|
+
'auto-sns-order-cancel-success',
|
|
141
|
+
];
|
|
142
|
+
let index = 0;
|
|
143
|
+
for (const b of vm.dataList) {
|
|
144
|
+
vm.dataList[index] = await AutoReply.getDefCompare(b);
|
|
145
|
+
vm.dataList[index].title = vm.dataList[index].title.replace(
|
|
146
|
+
/@\{\{app_name\}\}/g,
|
|
147
|
+
(appData.response.value && appData.response.value.shop_name) || '商店名稱'
|
|
148
|
+
);
|
|
149
|
+
index++;
|
|
117
150
|
}
|
|
151
|
+
vmi.pageSize = 1;
|
|
152
|
+
vmi.originalData = vm.dataList;
|
|
153
|
+
vmi.tableData = getDatalist();
|
|
154
|
+
vmi.loading = false;
|
|
155
|
+
vmi.callback();
|
|
156
|
+
},
|
|
157
|
+
rowClick: (data, index) => {
|
|
158
|
+
vm.tag = vm.dataList[index].tag;
|
|
159
|
+
vm.type = 'replace';
|
|
160
|
+
gvc.notifyDataChange(id);
|
|
161
|
+
},
|
|
162
|
+
filter: [],
|
|
163
|
+
})
|
|
164
|
+
)
|
|
165
|
+
)}
|
|
166
|
+
${BgWidget.mbContainer(240)}
|
|
167
|
+
`);
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
});
|
|
171
|
+
}
|
|
118
172
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
vm.type = 'replace';
|
|
160
|
-
gvc.notifyDataChange(id);
|
|
161
|
-
},
|
|
162
|
-
filter: [],
|
|
163
|
-
})
|
|
164
|
-
)
|
|
165
|
-
)}
|
|
166
|
-
${BgWidget.mbContainer(240)}
|
|
167
|
-
`
|
|
168
|
-
);
|
|
173
|
+
public static autoSendEmail(gvc: GVC, tag: string, back: () => void, widget: any) {
|
|
174
|
+
let vm: {
|
|
175
|
+
data: any;
|
|
176
|
+
loading: boolean;
|
|
177
|
+
} = {
|
|
178
|
+
data: '',
|
|
179
|
+
loading: false,
|
|
180
|
+
};
|
|
181
|
+
const that = this;
|
|
182
|
+
let pointCount = 1;
|
|
183
|
+
return html` ${BgWidget.container(
|
|
184
|
+
[
|
|
185
|
+
html` <div class="title-container">
|
|
186
|
+
${BgWidget.goBack(
|
|
187
|
+
gvc.event(() => {
|
|
188
|
+
back();
|
|
189
|
+
})
|
|
190
|
+
)}${BgWidget.title(
|
|
191
|
+
(() => {
|
|
192
|
+
const vm = {
|
|
193
|
+
id: gvc.glitter.getUUID(),
|
|
194
|
+
loading: true,
|
|
195
|
+
name: '簡訊設定',
|
|
196
|
+
};
|
|
197
|
+
return gvc.bindView({
|
|
198
|
+
bind: vm.id,
|
|
199
|
+
view: () => (vm.loading ? '' : vm.name),
|
|
200
|
+
divCreate: {},
|
|
201
|
+
onCreate: () => {
|
|
202
|
+
if (vm.loading) {
|
|
203
|
+
new Promise(resolve => {
|
|
204
|
+
AutoReply.getDefCompare(tag).then(dd => resolve(dd));
|
|
205
|
+
}).then((res: any) => {
|
|
206
|
+
if (res && res.tag_name) {
|
|
207
|
+
vm.name = res.tag_name;
|
|
208
|
+
}
|
|
209
|
+
vm.loading = false;
|
|
210
|
+
gvc.notifyDataChange(vm.id);
|
|
211
|
+
});
|
|
212
|
+
}
|
|
169
213
|
},
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
EditorElem.editeInput({
|
|
237
|
-
gvc: gvc,
|
|
238
|
-
title: '寄件者名稱',
|
|
239
|
-
default: vm.data.name || '',
|
|
240
|
-
callback: (text) => {
|
|
241
|
-
vm.data.name = text;
|
|
242
|
-
},
|
|
243
|
-
placeHolder: '請輸入寄件者名稱',
|
|
244
|
-
}),
|
|
245
|
-
html`
|
|
246
|
-
<div class="d-flex w-100 align-items-center justify-content-between p-0 my-2">
|
|
247
|
-
<div class="d-flex align-items-center gap-2">
|
|
248
|
-
${EditorElem.h3('簡訊內文')}
|
|
249
|
-
${document.body.clientWidth > 768
|
|
250
|
-
? BgWidget.grayNote(`預計每則簡訊花費${pointCount * this.ticket}點`, 'margin-top: 0.25em;')
|
|
251
|
-
: html` <div style="margin-top: 0.25em;">
|
|
252
|
-
${BgWidget.iconButton({
|
|
253
|
-
icon: 'info',
|
|
254
|
-
event: gvc.event(() => {
|
|
255
|
-
BgWidget.jumpAlert({
|
|
256
|
-
gvc,
|
|
257
|
-
text: `預計每則簡訊花費${pointCount * this.ticket}點`,
|
|
258
|
-
justify: 'top',
|
|
259
|
-
align: 'center',
|
|
260
|
-
width: 200,
|
|
261
|
-
});
|
|
262
|
-
}),
|
|
263
|
-
})}
|
|
264
|
-
</div>`}
|
|
265
|
-
</div>
|
|
266
|
-
<div>${BgWidget.aiChatButton({ gvc, select: 'writer' })}</div>
|
|
267
|
-
</div>
|
|
268
|
-
`,
|
|
269
|
-
EditorElem.editeText({
|
|
270
|
-
gvc: gvc,
|
|
271
|
-
title: '',
|
|
272
|
-
default: vm.data.content || '',
|
|
273
|
-
placeHolder: '',
|
|
274
|
-
callback: (text) => {
|
|
275
|
-
vm.data.content = text;
|
|
276
|
-
let totalSize = 0;
|
|
214
|
+
});
|
|
215
|
+
})()
|
|
216
|
+
)}
|
|
217
|
+
</div>`,
|
|
218
|
+
BgWidget.mbContainer(24),
|
|
219
|
+
BgWidget.alertInfo(
|
|
220
|
+
'可使用模板字串,簡訊將在寄送時自動填入相關數值',
|
|
221
|
+
['商家名稱:@{{app_name}}', '訂單號碼:@{{訂單號碼}}', '會員姓名:@{{user_name}}'],
|
|
222
|
+
{
|
|
223
|
+
class: 'mb-3',
|
|
224
|
+
style: '',
|
|
225
|
+
}
|
|
226
|
+
),
|
|
227
|
+
BgWidget.mainCard(
|
|
228
|
+
gvc.bindView(() => {
|
|
229
|
+
const id = gvc.glitter.getUUID();
|
|
230
|
+
AutoReply.getDefCompare(tag).then(dd => {
|
|
231
|
+
vm.data = dd;
|
|
232
|
+
vm.loading = false;
|
|
233
|
+
gvc.notifyDataChange(id);
|
|
234
|
+
});
|
|
235
|
+
return {
|
|
236
|
+
bind: id,
|
|
237
|
+
view: () => {
|
|
238
|
+
return [
|
|
239
|
+
EditorElem.editeInput({
|
|
240
|
+
gvc: gvc,
|
|
241
|
+
title: '寄件者名稱',
|
|
242
|
+
default: vm.data.name || '',
|
|
243
|
+
callback: text => {
|
|
244
|
+
vm.data.name = text;
|
|
245
|
+
},
|
|
246
|
+
placeHolder: '請輸入寄件者名稱',
|
|
247
|
+
}),
|
|
248
|
+
html`
|
|
249
|
+
<div class="d-flex w-100 align-items-center justify-content-between p-0 my-2">
|
|
250
|
+
<div class="d-flex align-items-center gap-2">
|
|
251
|
+
${EditorElem.h3('簡訊內文')}
|
|
252
|
+
${document.body.clientWidth > 768
|
|
253
|
+
? BgWidget.grayNote(`預計每則簡訊花費${pointCount * this.ticket}點`, 'margin-top: 0.25em;')
|
|
254
|
+
: html` <div style="margin-top: 0.25em;">
|
|
255
|
+
${BgWidget.iconButton({
|
|
256
|
+
icon: 'info',
|
|
257
|
+
event: gvc.event(() => {
|
|
258
|
+
BgWidget.jumpAlert({
|
|
259
|
+
gvc,
|
|
260
|
+
text: `預計每則簡訊花費${pointCount * this.ticket}點`,
|
|
261
|
+
justify: 'top',
|
|
262
|
+
align: 'center',
|
|
263
|
+
width: 200,
|
|
264
|
+
});
|
|
265
|
+
}),
|
|
266
|
+
})}
|
|
267
|
+
</div>`}
|
|
268
|
+
</div>
|
|
269
|
+
<div>${BgWidget.aiChatButton({ gvc, select: 'writer' })}</div>
|
|
270
|
+
</div>
|
|
271
|
+
`,
|
|
272
|
+
EditorElem.editeText({
|
|
273
|
+
gvc: gvc,
|
|
274
|
+
title: '',
|
|
275
|
+
default: vm.data.content || '',
|
|
276
|
+
placeHolder: '',
|
|
277
|
+
callback: text => {
|
|
278
|
+
vm.data.content = text;
|
|
279
|
+
let totalSize = 0;
|
|
277
280
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
281
|
+
for (let i = 0; i < text.length; i++) {
|
|
282
|
+
const char = text[i];
|
|
283
|
+
// 判斷是否為中文或全形字符(Unicode範圍包含中文)
|
|
284
|
+
if (/[\u4e00-\u9fa5\uFF00-\uFFEF]/.test(char)) {
|
|
285
|
+
totalSize += 2; // 中文或全形字符佔2個單位
|
|
286
|
+
} else {
|
|
287
|
+
totalSize += 1; // 英文或半形字符佔1個單位
|
|
288
|
+
}
|
|
289
|
+
}
|
|
287
290
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
291
|
+
if (totalSize < this.maxSize) {
|
|
292
|
+
pointCount = 1;
|
|
293
|
+
} else {
|
|
294
|
+
pointCount = Math.ceil(totalSize / this.longSMS);
|
|
295
|
+
}
|
|
296
|
+
gvc.notifyDataChange(id);
|
|
297
|
+
},
|
|
298
|
+
}),
|
|
299
|
+
].join('');
|
|
300
|
+
},
|
|
301
|
+
};
|
|
302
|
+
})
|
|
303
|
+
),
|
|
304
|
+
BgWidget.mbContainer(240),
|
|
305
|
+
html` <div class="update-bar-container">
|
|
306
|
+
${BgWidget.cancel(
|
|
307
|
+
gvc.event(() => {
|
|
308
|
+
back();
|
|
309
|
+
})
|
|
310
|
+
)}
|
|
311
|
+
${BgWidget.save(
|
|
312
|
+
gvc.event(() => {
|
|
313
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
314
|
+
dialog.checkYesOrNot({
|
|
315
|
+
callback: select => {
|
|
316
|
+
if (select) {
|
|
317
|
+
dialog.dataLoading({ visible: true, text: '儲存中' });
|
|
318
|
+
vm.data.updated_time = new Date();
|
|
319
|
+
ApiUser.setPublicConfig({
|
|
320
|
+
key: tag,
|
|
321
|
+
value: vm.data,
|
|
322
|
+
user_id: 'manager',
|
|
323
|
+
}).then(() => {
|
|
324
|
+
setTimeout(() => {
|
|
325
|
+
dialog.dataLoading({ visible: false });
|
|
326
|
+
dialog.successMessage({ text: '儲存成功' });
|
|
327
|
+
}, 1000);
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
text: `確認無誤後將儲存`,
|
|
332
|
+
});
|
|
333
|
+
})
|
|
334
|
+
)}
|
|
335
|
+
</div>`,
|
|
336
|
+
].join('')
|
|
337
|
+
)}`;
|
|
338
|
+
}
|
|
336
339
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
}
|
|
431
|
-
return b;
|
|
340
|
+
public static async getDefCompare(tag: string) {
|
|
341
|
+
const dataList: any = [
|
|
342
|
+
{
|
|
343
|
+
tag: 'auto-phone-verify',
|
|
344
|
+
tag_name: '電話認證',
|
|
345
|
+
name: '@{{app_name}}',
|
|
346
|
+
title: '[@{{app_name}}] 帳號認證通知',
|
|
347
|
+
content: '嗨!歡迎加入 @{{app_name}},請輸入驗證碼「 @{{code}} 」。請於一分鐘內輸入並完成驗證。',
|
|
348
|
+
toggle: true,
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
tag: 'auto-sns-shipment',
|
|
352
|
+
tag_name: '商品出貨',
|
|
353
|
+
name: '@{{app_name}}',
|
|
354
|
+
title: '[@{{app_name}}] #@{{訂單號碼}} 送貨狀態 更新為: 出貨中',
|
|
355
|
+
content: '[@{{app_name}}] #@{{訂單號碼}} 送貨狀態 更新為: 出貨中',
|
|
356
|
+
toggle: true,
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
tag: 'auto-sns-shipment-arrival',
|
|
360
|
+
tag_name: '商品到貨',
|
|
361
|
+
name: '@{{app_name}}',
|
|
362
|
+
title: '[@{{app_name}}] #@{{訂單號碼}} 送貨狀態 更新為: 已到達',
|
|
363
|
+
content: '[@{{app_name}}] #@{{訂單號碼}} 送貨狀態 更新為: 已到達',
|
|
364
|
+
toggle: true,
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
tag: 'auto-sns-order-create',
|
|
368
|
+
tag_name: '訂單成立',
|
|
369
|
+
name: '@{{app_name}}',
|
|
370
|
+
title: '[@{{app_name}}] 您的訂單 #@{{訂單號碼}} 已成立',
|
|
371
|
+
content: '[@{{app_name}}] 您的訂單 #@{{訂單號碼}} 已成立',
|
|
372
|
+
toggle: true,
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
tag: 'auto-sns-payment-successful',
|
|
376
|
+
tag_name: '訂單付款成功',
|
|
377
|
+
name: '@{{app_name}}',
|
|
378
|
+
title: '[@{{app_name}}] #@{{訂單號碼}} 付款狀態 更新為: 已付款',
|
|
379
|
+
content: '[@{{app_name}}] #@{{訂單號碼}} 付款狀態 更新為: 已付款',
|
|
380
|
+
toggle: true,
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
tag: 'sns-proof-purchase',
|
|
384
|
+
tag_name: '訂單待核款',
|
|
385
|
+
name: '@{{app_name}}',
|
|
386
|
+
title: '[@{{app_name}}] 您的訂單 #@{{訂單號碼}} 已進入待核款',
|
|
387
|
+
content: '[@{{app_name}}] 您的訂單 #@{{訂單號碼}} 已進入待核款',
|
|
388
|
+
toggle: true,
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
tag: 'auto-sns-order-cancel-success',
|
|
392
|
+
tag_name: '取消訂單成功',
|
|
393
|
+
name: '@{{app_name}}',
|
|
394
|
+
title: '[@{{app_name}}] 您已成功取消訂單 #@{{訂單號碼}}',
|
|
395
|
+
content: '[@{{app_name}}] 您已成功取消訂單 #@{{訂單號碼}}',
|
|
396
|
+
toggle: true,
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
tag: 'auto-sns-order-cancel-false',
|
|
400
|
+
tag_name: '取消訂單失敗',
|
|
401
|
+
name: '@{{app_name}}',
|
|
402
|
+
title: '[@{{app_name}}] 取消訂單申請 #@{{訂單號碼}} 已失敗',
|
|
403
|
+
content: '[@{{app_name}}] 取消訂單申請 #@{{訂單號碼}} 已失敗',
|
|
404
|
+
toggle: true,
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
tag: 'auto-sns-birthday',
|
|
408
|
+
tag_name: '生日祝福',
|
|
409
|
+
name: '@{{app_name}}',
|
|
410
|
+
title: '[@{{app_name}}] [@{{user_name}}] 今天是您一年一度的大日子!祝您生日快樂!',
|
|
411
|
+
content: '[@{{app_name}}] [@{{user_name}}] 今天是您一年一度的大日子!祝您生日快樂!',
|
|
412
|
+
toggle: true,
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
tag: 'auto-sns-welcome',
|
|
416
|
+
tag_name: '歡迎信件',
|
|
417
|
+
name: '@{{app_name}}',
|
|
418
|
+
title: '[@{{app_name}}] 歡迎您加入@{{app_name}}! 最豐富的選品商店',
|
|
419
|
+
content: '[@{{app_name}}] 歡迎您加入@{{app_name}}! 最豐富的選品商店',
|
|
420
|
+
toggle: true,
|
|
421
|
+
},
|
|
422
|
+
];
|
|
423
|
+
const keyData = await ApiUser.getPublicConfig(tag, 'manager');
|
|
424
|
+
const b = dataList.find((dd: any) => {
|
|
425
|
+
return dd.tag === tag;
|
|
426
|
+
})!;
|
|
427
|
+
if (keyData.response.value) {
|
|
428
|
+
b.title = keyData.response.value.title || b.title;
|
|
429
|
+
b.toggle = keyData.response.value.toggle ?? true;
|
|
430
|
+
b.content = keyData.response.value.content || b.content;
|
|
431
|
+
b.name = keyData.response.value.name || b.name;
|
|
432
|
+
b.updated_time = keyData.response.value.updated_time && new Date(keyData.response.value.updated_time);
|
|
432
433
|
}
|
|
434
|
+
return b;
|
|
435
|
+
}
|
|
433
436
|
}
|
|
434
437
|
|
|
435
438
|
(window as any).glitter.setModule(import.meta.url, AutoReply);
|