ts-glitter 13.3.4 → 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-customer-message.js +4 -2
- package/lowcode/backend-manager/bg-customer-message.ts +4 -2
- 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 +3 -4
- 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
|
@@ -7,29 +7,30 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { BgWidget } from
|
|
11
|
-
import { AiPointsApi } from
|
|
12
|
-
import { ShareDialog } from
|
|
13
|
-
import { ApiUser } from
|
|
10
|
+
import { BgWidget } from '../backend-manager/bg-widget.js';
|
|
11
|
+
import { AiPointsApi } from '../glitter-base/route/ai-points-api.js';
|
|
12
|
+
import { ShareDialog } from '../glitterBundle/dialog/ShareDialog.js';
|
|
13
|
+
import { ApiUser } from '../glitter-base/route/user.js';
|
|
14
14
|
const html = String.raw;
|
|
15
15
|
export class AiPoints {
|
|
16
16
|
static main(gvc) {
|
|
17
|
-
return [
|
|
17
|
+
return [
|
|
18
|
+
BgWidget.container([
|
|
18
19
|
BgWidget.mainCard([
|
|
19
20
|
BgWidget.title('AI Points'),
|
|
20
|
-
BgWidget.grayNote([`*透過AI Points來使用各種 AI 輔助功能`, `*1塊台幣可以換取10點AI Points`, `*最少儲值金額500元`, `*AI Points購買後無法退費,請購買前瞭解會員權益需知`]
|
|
21
|
+
BgWidget.grayNote([`*透過AI Points來使用各種 AI 輔助功能`, `*1塊台幣可以換取10點AI Points`, `*最少儲值金額500元`, `*AI Points購買後無法退費,請購買前瞭解會員權益需知`]
|
|
22
|
+
.map((dd) => {
|
|
21
23
|
return `<div style="letter-spacing: 1.2px;">${dd}</div>`;
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
<div class="d-flex align-items-center rounded-3" style="height:35px;width:100%;max-width: 500px;">
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<div class="bgf6 d-flex align-items-center flex-fill h-100 ps-3 pe-2">${gvc.bindView(() => {
|
|
24
|
+
})
|
|
25
|
+
.join('')),
|
|
26
|
+
html ` <div class="d-flex align-items-center rounded-3" style="height:35px;width:100%;max-width: 500px;">
|
|
27
|
+
<div style="height:100%;background:var(--main-black-hover)" class="d-flex align-items-center justify-content-center text-white px-3">目前 AI Points</div>
|
|
28
|
+
<div class="bgf6 d-flex align-items-center flex-fill h-100 ps-3 pe-2">
|
|
29
|
+
${gvc.bindView(() => {
|
|
29
30
|
const id = gvc.glitter.getUUID();
|
|
30
31
|
const vm = {
|
|
31
32
|
loading: true,
|
|
32
|
-
sum: 0
|
|
33
|
+
sum: 0,
|
|
33
34
|
};
|
|
34
35
|
AiPointsApi.getSum({}).then((res) => {
|
|
35
36
|
vm.sum = parseInt(res.response.sum, 10);
|
|
@@ -40,22 +41,24 @@ export class AiPoints {
|
|
|
40
41
|
bind: id,
|
|
41
42
|
view: () => {
|
|
42
43
|
if (vm.loading) {
|
|
43
|
-
return `<div class="h-100 d-flex align-items-center"><div class="spinner-border" style="height:20px;width: 20px;"></div></div>`;
|
|
44
|
+
return html `<div class="h-100 d-flex align-items-center"><div class="spinner-border" style="height:20px;width: 20px;"></div></div>`;
|
|
44
45
|
}
|
|
45
46
|
else {
|
|
46
47
|
return `${vm.sum.toLocaleString()}`;
|
|
47
48
|
}
|
|
48
|
-
}
|
|
49
|
+
},
|
|
49
50
|
};
|
|
50
51
|
})}
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
<div class="flex-fill"></div>
|
|
53
|
+
${BgWidget.blueNote('儲值', gvc.event(() => {
|
|
53
54
|
AiPoints.store(gvc);
|
|
54
55
|
}))}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
].join(`<div class="my-2"></div>`))
|
|
58
|
-
].join(''), BgWidget.getContainerWidth()),
|
|
56
|
+
</div>
|
|
57
|
+
</div>`,
|
|
58
|
+
].join(`<div class="my-2"></div>`)),
|
|
59
|
+
].join(''), BgWidget.getContainerWidth()),
|
|
60
|
+
AiPoints.walletList(gvc),
|
|
61
|
+
].join('');
|
|
59
62
|
}
|
|
60
63
|
static walletList(gvc) {
|
|
61
64
|
const glitter = gvc.glitter;
|
|
@@ -64,7 +67,7 @@ export class AiPoints {
|
|
|
64
67
|
data: {},
|
|
65
68
|
dataList: undefined,
|
|
66
69
|
query: '',
|
|
67
|
-
select: 'all'
|
|
70
|
+
select: 'all',
|
|
68
71
|
};
|
|
69
72
|
const filterID = gvc.glitter.getUUID();
|
|
70
73
|
return gvc.bindView(() => {
|
|
@@ -79,35 +82,34 @@ export class AiPoints {
|
|
|
79
82
|
view: () => {
|
|
80
83
|
if (vm.type === 'list') {
|
|
81
84
|
return BgWidget.container(BgWidget.card(html `
|
|
82
|
-
|
|
85
|
+
${BgWidget.tab([
|
|
83
86
|
{ title: '紀錄總覽', key: 'all' },
|
|
84
87
|
{ title: '使用紀錄', key: 'cost' },
|
|
85
|
-
{ title: '儲值紀錄', key: 'income' }
|
|
88
|
+
{ title: '儲值紀錄', key: 'income' },
|
|
86
89
|
], gvc, vm.select, (text) => {
|
|
87
90
|
vm.select = text;
|
|
88
91
|
gvc.notifyDataChange(id);
|
|
89
92
|
})}
|
|
90
|
-
|
|
91
|
-
|
|
93
|
+
<div class="border-bottom mb-2 w-100"></div>
|
|
94
|
+
${BgWidget.tableV3({
|
|
92
95
|
gvc: gvc,
|
|
93
96
|
getData: (vmi) => {
|
|
97
|
+
const limit = 20;
|
|
94
98
|
AiPointsApi.get({
|
|
95
99
|
page: vmi.page - 1,
|
|
96
|
-
limit:
|
|
100
|
+
limit: limit,
|
|
97
101
|
search: vm.query || undefined,
|
|
98
102
|
type: (() => {
|
|
99
103
|
switch (vm.select) {
|
|
100
|
-
case
|
|
104
|
+
case 'all':
|
|
101
105
|
return undefined;
|
|
102
|
-
case
|
|
106
|
+
case 'cost':
|
|
103
107
|
return 'minus';
|
|
104
|
-
case
|
|
108
|
+
case 'income':
|
|
105
109
|
return 'plus';
|
|
106
110
|
}
|
|
107
|
-
})()
|
|
111
|
+
})(),
|
|
108
112
|
}).then((data) => {
|
|
109
|
-
vmi.pageSize = Math.ceil(data.response.total / 20);
|
|
110
|
-
vm.dataList = data.response.data;
|
|
111
113
|
function getDatalist() {
|
|
112
114
|
return data.response.data.map((dd) => {
|
|
113
115
|
var _a;
|
|
@@ -122,7 +124,7 @@ export class AiPoints {
|
|
|
122
124
|
},
|
|
123
125
|
{
|
|
124
126
|
key: '異動金額',
|
|
125
|
-
value:
|
|
127
|
+
value: dd.money > 0 ? `<span class="fs-7 text-success">+ ${dd.money}</span>` : `<span class="fs-7 text-danger">- ${dd.money * -1}</span>`,
|
|
126
128
|
},
|
|
127
129
|
{
|
|
128
130
|
key: '異動原因',
|
|
@@ -135,16 +137,18 @@ export class AiPoints {
|
|
|
135
137
|
];
|
|
136
138
|
});
|
|
137
139
|
}
|
|
138
|
-
|
|
140
|
+
vm.dataList = data.response.data;
|
|
141
|
+
vmi.pageSize = Math.ceil(data.response.total / limit);
|
|
142
|
+
vmi.originalData = vm.dataList;
|
|
143
|
+
vmi.tableData = getDatalist();
|
|
139
144
|
vmi.loading = false;
|
|
140
145
|
vmi.callback();
|
|
141
146
|
});
|
|
142
147
|
},
|
|
143
|
-
rowClick: (
|
|
144
|
-
|
|
145
|
-
filter: ``
|
|
148
|
+
rowClick: () => { },
|
|
149
|
+
filter: [],
|
|
146
150
|
})}
|
|
147
|
-
|
|
151
|
+
`), BgWidget.getContainerWidth());
|
|
148
152
|
}
|
|
149
153
|
else if (vm.type == 'replace') {
|
|
150
154
|
return ``;
|
|
@@ -154,8 +158,8 @@ export class AiPoints {
|
|
|
154
158
|
}
|
|
155
159
|
},
|
|
156
160
|
divCreate: {
|
|
157
|
-
class: `mt-n4
|
|
158
|
-
}
|
|
161
|
+
class: `mt-n4`,
|
|
162
|
+
},
|
|
159
163
|
};
|
|
160
164
|
});
|
|
161
165
|
}
|
|
@@ -171,11 +175,11 @@ export class AiPoints {
|
|
|
171
175
|
email: '',
|
|
172
176
|
invoice_type: 'me',
|
|
173
177
|
company: '',
|
|
174
|
-
gui_number: ''
|
|
175
|
-
}
|
|
178
|
+
gui_number: '',
|
|
179
|
+
},
|
|
176
180
|
};
|
|
177
181
|
vm.user_info.email = vm.user_info.email || '';
|
|
178
|
-
const dd =
|
|
182
|
+
const dd = yield ApiUser.getPublicConfig('ai-points-store', 'manager');
|
|
179
183
|
if (dd.response.value) {
|
|
180
184
|
vm.user_info = dd.response.value;
|
|
181
185
|
}
|
|
@@ -196,9 +200,9 @@ export class AiPoints {
|
|
|
196
200
|
{ key: '500', value: '5,000點 ( NT.500 )' },
|
|
197
201
|
{ key: '1000', value: '10,000點 ( NT.1,000 )' },
|
|
198
202
|
{ key: '1500', value: '15,000點 ( NT.1,500 )' },
|
|
199
|
-
{ key: '2000', value: '20,000點 ( NT.2,000 )' }
|
|
203
|
+
{ key: '2000', value: '20,000點 ( NT.2,000 )' },
|
|
200
204
|
],
|
|
201
|
-
default: `${vm.total}
|
|
205
|
+
default: `${vm.total}`,
|
|
202
206
|
}),
|
|
203
207
|
...(() => {
|
|
204
208
|
if (vm.total) {
|
|
@@ -210,7 +214,8 @@ export class AiPoints {
|
|
|
210
214
|
})(),
|
|
211
215
|
...(() => {
|
|
212
216
|
if (gvc.glitter.deviceType !== gvc.glitter.deviceTypeEnum.Ios) {
|
|
213
|
-
return [
|
|
217
|
+
return [
|
|
218
|
+
BgWidget.editeInput({
|
|
214
219
|
gvc: gvc,
|
|
215
220
|
title: `發票寄送電子信箱`,
|
|
216
221
|
placeHolder: '請輸入發票寄送電子信箱',
|
|
@@ -218,25 +223,33 @@ export class AiPoints {
|
|
|
218
223
|
vm.user_info.email = text;
|
|
219
224
|
},
|
|
220
225
|
type: 'email',
|
|
221
|
-
default: vm.user_info.email
|
|
226
|
+
default: vm.user_info.email,
|
|
222
227
|
}),
|
|
223
|
-
`<div class="tx_normal fw-normal"
|
|
228
|
+
html `<div class="tx_normal fw-normal">發票開立方式</div>`,
|
|
224
229
|
BgWidget.select({
|
|
225
|
-
gvc: gvc,
|
|
230
|
+
gvc: gvc,
|
|
231
|
+
callback: (text) => {
|
|
226
232
|
vm.user_info.invoice_type = text;
|
|
227
233
|
gvc.recreateView();
|
|
228
|
-
},
|
|
234
|
+
},
|
|
235
|
+
options: [
|
|
229
236
|
{ key: 'me', value: '個人單位' },
|
|
230
|
-
{ key: 'company', value: '公司行號' }
|
|
231
|
-
],
|
|
237
|
+
{ key: 'company', value: '公司行號' },
|
|
238
|
+
],
|
|
239
|
+
default: vm.user_info.invoice_type,
|
|
232
240
|
}),
|
|
233
241
|
...(() => {
|
|
234
242
|
if (vm.user_info.invoice_type === 'company') {
|
|
235
243
|
return [
|
|
236
244
|
BgWidget.editeInput({
|
|
237
|
-
gvc: gvc,
|
|
245
|
+
gvc: gvc,
|
|
246
|
+
title: `發票抬頭`,
|
|
247
|
+
placeHolder: '請輸入發票抬頭',
|
|
248
|
+
callback: (text) => {
|
|
238
249
|
vm.user_info.company = text;
|
|
239
|
-
},
|
|
250
|
+
},
|
|
251
|
+
type: 'text',
|
|
252
|
+
default: `${vm.user_info.company}`,
|
|
240
253
|
}),
|
|
241
254
|
BgWidget.editeInput({
|
|
242
255
|
gvc: gvc,
|
|
@@ -246,25 +259,28 @@ export class AiPoints {
|
|
|
246
259
|
vm.user_info.gui_number = text;
|
|
247
260
|
},
|
|
248
261
|
type: 'number',
|
|
249
|
-
default: `${vm.user_info.gui_number}
|
|
250
|
-
})
|
|
262
|
+
default: `${vm.user_info.gui_number}`,
|
|
263
|
+
}),
|
|
251
264
|
];
|
|
252
265
|
}
|
|
253
266
|
else {
|
|
254
267
|
return [];
|
|
255
268
|
}
|
|
256
|
-
})()
|
|
269
|
+
})(),
|
|
270
|
+
];
|
|
257
271
|
}
|
|
258
272
|
else {
|
|
259
273
|
return [];
|
|
260
274
|
}
|
|
261
|
-
})()
|
|
275
|
+
})(),
|
|
262
276
|
].join(`<div class="my-2"></div>`)}</div>`;
|
|
263
277
|
},
|
|
264
278
|
footer_html: (gvc) => {
|
|
265
|
-
return [
|
|
279
|
+
return [
|
|
280
|
+
BgWidget.cancel(gvc.event(() => {
|
|
266
281
|
gvc.closeDialog();
|
|
267
|
-
})),
|
|
282
|
+
})),
|
|
283
|
+
BgWidget.save(gvc.event(() => __awaiter(this, void 0, void 0, function* () {
|
|
268
284
|
if (vm.user_info.invoice_type !== 'company') {
|
|
269
285
|
vm.user_info.company = '';
|
|
270
286
|
vm.user_info.gui_number = '';
|
|
@@ -297,12 +313,12 @@ export class AiPoints {
|
|
|
297
313
|
user_id: 'manager',
|
|
298
314
|
});
|
|
299
315
|
vm.note = {
|
|
300
|
-
invoice_data: vm.user_info
|
|
316
|
+
invoice_data: vm.user_info,
|
|
301
317
|
};
|
|
302
318
|
dialog.dataLoading({ visible: true });
|
|
303
319
|
if (gvc.glitter.deviceType === gvc.glitter.deviceTypeEnum.Ios) {
|
|
304
|
-
gvc.glitter.runJsInterFace(
|
|
305
|
-
total: `ai_points_${vm.total}
|
|
320
|
+
gvc.glitter.runJsInterFace('in_app_product', {
|
|
321
|
+
total: `ai_points_${vm.total}`,
|
|
306
322
|
}, (res) => __awaiter(this, void 0, void 0, function* () {
|
|
307
323
|
console.log(`res.receipt_data=>`, res.receipt_data);
|
|
308
324
|
if (res.receipt_data) {
|
|
@@ -328,8 +344,9 @@ export class AiPoints {
|
|
|
328
344
|
}
|
|
329
345
|
}));
|
|
330
346
|
}
|
|
331
|
-
})))
|
|
332
|
-
|
|
347
|
+
}))),
|
|
348
|
+
].join('');
|
|
349
|
+
},
|
|
333
350
|
});
|
|
334
351
|
return;
|
|
335
352
|
});
|