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
|
@@ -7,30 +7,31 @@ 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 { SmsPointsApi } from
|
|
12
|
-
import { ShareDialog } from
|
|
13
|
-
import { ApiUser } from
|
|
14
|
-
import { AiPointsApi } from
|
|
10
|
+
import { BgWidget } from '../backend-manager/bg-widget.js';
|
|
11
|
+
import { SmsPointsApi } from '../glitter-base/route/sms-points-api.js';
|
|
12
|
+
import { ShareDialog } from '../glitterBundle/dialog/ShareDialog.js';
|
|
13
|
+
import { ApiUser } from '../glitter-base/route/user.js';
|
|
14
|
+
import { AiPointsApi } from '../glitter-base/route/ai-points-api.js';
|
|
15
15
|
const html = String.raw;
|
|
16
16
|
export class SmsPoints {
|
|
17
17
|
static main(gvc) {
|
|
18
|
-
return [
|
|
18
|
+
return [
|
|
19
|
+
BgWidget.container([
|
|
19
20
|
BgWidget.mainCard([
|
|
20
21
|
BgWidget.title('SMS Points'),
|
|
21
|
-
BgWidget.grayNote([`*透過SMS Points來進行手機簡訊發送`, `*1塊台幣可以換取10點SMS Points`, `*最少儲值金額500元`, `*SMS Points購買後無法退費,請購買前瞭解會員權益需知`]
|
|
22
|
+
BgWidget.grayNote([`*透過SMS Points來進行手機簡訊發送`, `*1塊台幣可以換取10點SMS Points`, `*最少儲值金額500元`, `*SMS Points購買後無法退費,請購買前瞭解會員權益需知`]
|
|
23
|
+
.map((dd) => {
|
|
22
24
|
return `<div style="letter-spacing: 1.2px;">${dd}</div>`;
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
<div class="d-flex align-items-center rounded-3" style="height:35px;width:100%;max-width: 500px;">
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<div class="bgf6 d-flex align-items-center flex-fill h-100 ps-3 pe-2">${gvc.bindView(() => {
|
|
25
|
+
})
|
|
26
|
+
.join('')),
|
|
27
|
+
html ` <div class="d-flex align-items-center rounded-3" style="height:35px;width:100%;max-width: 500px;">
|
|
28
|
+
<div style="height:100%;background:var(--main-black-hover)" class="d-flex align-items-center justify-content-center text-white px-3">目前 SMS Points</div>
|
|
29
|
+
<div class="bgf6 d-flex align-items-center flex-fill h-100 ps-3 pe-2">
|
|
30
|
+
${gvc.bindView(() => {
|
|
30
31
|
const id = gvc.glitter.getUUID();
|
|
31
32
|
const vm = {
|
|
32
33
|
loading: true,
|
|
33
|
-
sum: 0
|
|
34
|
+
sum: 0,
|
|
34
35
|
};
|
|
35
36
|
SmsPointsApi.getSum({}).then((res) => {
|
|
36
37
|
vm.sum = parseInt(res.response.sum, 10);
|
|
@@ -46,17 +47,19 @@ export class SmsPoints {
|
|
|
46
47
|
else {
|
|
47
48
|
return `${vm.sum.toLocaleString()}`;
|
|
48
49
|
}
|
|
49
|
-
}
|
|
50
|
+
},
|
|
50
51
|
};
|
|
51
52
|
})}
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
<div class="flex-fill"></div>
|
|
54
|
+
${BgWidget.blueNote('儲值', gvc.event(() => {
|
|
54
55
|
SmsPoints.store(gvc);
|
|
55
56
|
}))}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
].join(`<div class="my-2"></div>`))
|
|
59
|
-
].join(''), BgWidget.getContainerWidth()),
|
|
57
|
+
</div>
|
|
58
|
+
</div>`,
|
|
59
|
+
].join(`<div class="my-2"></div>`)),
|
|
60
|
+
].join(''), BgWidget.getContainerWidth()),
|
|
61
|
+
SmsPoints.walletList(gvc),
|
|
62
|
+
].join('');
|
|
60
63
|
}
|
|
61
64
|
static walletList(gvc) {
|
|
62
65
|
const glitter = gvc.glitter;
|
|
@@ -65,7 +68,7 @@ export class SmsPoints {
|
|
|
65
68
|
data: {},
|
|
66
69
|
dataList: undefined,
|
|
67
70
|
query: '',
|
|
68
|
-
select: 'all'
|
|
71
|
+
select: 'all',
|
|
69
72
|
};
|
|
70
73
|
const filterID = gvc.glitter.getUUID();
|
|
71
74
|
return gvc.bindView(() => {
|
|
@@ -80,35 +83,34 @@ export class SmsPoints {
|
|
|
80
83
|
view: () => {
|
|
81
84
|
if (vm.type === 'list') {
|
|
82
85
|
return BgWidget.container(BgWidget.card(html `
|
|
83
|
-
|
|
86
|
+
${BgWidget.tab([
|
|
84
87
|
{ title: '紀錄總覽', key: 'all' },
|
|
85
88
|
{ title: '使用紀錄', key: 'cost' },
|
|
86
|
-
{ title: '儲值紀錄', key: 'income' }
|
|
89
|
+
{ title: '儲值紀錄', key: 'income' },
|
|
87
90
|
], gvc, vm.select, (text) => {
|
|
88
91
|
vm.select = text;
|
|
89
92
|
gvc.notifyDataChange(id);
|
|
90
93
|
})}
|
|
91
|
-
|
|
92
|
-
|
|
94
|
+
<div class="border-bottom mb-2 w-100"></div>
|
|
95
|
+
${BgWidget.tableV3({
|
|
93
96
|
gvc: gvc,
|
|
94
97
|
getData: (vmi) => {
|
|
98
|
+
const limit = 20;
|
|
95
99
|
SmsPointsApi.get({
|
|
96
100
|
page: vmi.page - 1,
|
|
97
|
-
limit:
|
|
101
|
+
limit: limit,
|
|
98
102
|
search: vm.query || undefined,
|
|
99
103
|
type: (() => {
|
|
100
104
|
switch (vm.select) {
|
|
101
|
-
case
|
|
105
|
+
case 'all':
|
|
102
106
|
return undefined;
|
|
103
|
-
case
|
|
107
|
+
case 'cost':
|
|
104
108
|
return 'minus';
|
|
105
|
-
case
|
|
109
|
+
case 'income':
|
|
106
110
|
return 'plus';
|
|
107
111
|
}
|
|
108
|
-
})()
|
|
112
|
+
})(),
|
|
109
113
|
}).then((data) => {
|
|
110
|
-
vmi.pageSize = Math.ceil(data.response.total / 20);
|
|
111
|
-
vm.dataList = data.response.data;
|
|
112
114
|
function getDatalist() {
|
|
113
115
|
return data.response.data.map((dd) => {
|
|
114
116
|
var _a;
|
|
@@ -136,16 +138,18 @@ export class SmsPoints {
|
|
|
136
138
|
];
|
|
137
139
|
});
|
|
138
140
|
}
|
|
139
|
-
|
|
141
|
+
vm.dataList = data.response.data;
|
|
142
|
+
vmi.pageSize = Math.ceil(data.response.total / limit);
|
|
143
|
+
vmi.originalData = vm.dataList;
|
|
144
|
+
vmi.tableData = getDatalist();
|
|
140
145
|
vmi.loading = false;
|
|
141
146
|
vmi.callback();
|
|
142
147
|
});
|
|
143
148
|
},
|
|
144
|
-
rowClick: (data, index) => {
|
|
145
|
-
|
|
146
|
-
filter: ``
|
|
149
|
+
rowClick: (data, index) => { },
|
|
150
|
+
filter: [],
|
|
147
151
|
})}
|
|
148
|
-
|
|
152
|
+
`), BgWidget.getContainerWidth());
|
|
149
153
|
}
|
|
150
154
|
else if (vm.type == 'replace') {
|
|
151
155
|
return ``;
|
|
@@ -155,8 +159,8 @@ export class SmsPoints {
|
|
|
155
159
|
}
|
|
156
160
|
},
|
|
157
161
|
divCreate: {
|
|
158
|
-
class: `mt-n4
|
|
159
|
-
}
|
|
162
|
+
class: `mt-n4`,
|
|
163
|
+
},
|
|
160
164
|
};
|
|
161
165
|
});
|
|
162
166
|
}
|
|
@@ -172,11 +176,11 @@ export class SmsPoints {
|
|
|
172
176
|
email: '',
|
|
173
177
|
invoice_type: 'me',
|
|
174
178
|
company: '',
|
|
175
|
-
gui_number: ''
|
|
176
|
-
}
|
|
179
|
+
gui_number: '',
|
|
180
|
+
},
|
|
177
181
|
};
|
|
178
182
|
vm.user_info.email = vm.user_info.email || '';
|
|
179
|
-
const dd =
|
|
183
|
+
const dd = yield ApiUser.getPublicConfig('ai-points-store', 'manager');
|
|
180
184
|
if (dd.response.value) {
|
|
181
185
|
vm.user_info = dd.response.value;
|
|
182
186
|
}
|
|
@@ -196,13 +200,13 @@ export class SmsPoints {
|
|
|
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) {
|
|
205
|
-
return [BgWidget.greenNote(`此次儲值可獲得
|
|
209
|
+
return [BgWidget.greenNote(`此次儲值可獲得AI Points『 ${(vm.total * 10).toLocaleString()} 』`)];
|
|
206
210
|
}
|
|
207
211
|
else {
|
|
208
212
|
return [];
|
|
@@ -210,7 +214,8 @@ export class SmsPoints {
|
|
|
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 SmsPoints {
|
|
|
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
228
|
`<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 SmsPoints {
|
|
|
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 = '';
|
|
@@ -298,14 +314,13 @@ export class SmsPoints {
|
|
|
298
314
|
user_id: 'manager',
|
|
299
315
|
});
|
|
300
316
|
vm.note = {
|
|
301
|
-
invoice_data: vm.user_info
|
|
317
|
+
invoice_data: vm.user_info,
|
|
302
318
|
};
|
|
303
319
|
dialog.dataLoading({ visible: true });
|
|
304
320
|
if (gvc.glitter.deviceType === gvc.glitter.deviceTypeEnum.Ios) {
|
|
305
|
-
gvc.glitter.runJsInterFace(
|
|
306
|
-
total: `sms_${vm.total}
|
|
321
|
+
gvc.glitter.runJsInterFace('in_app_product', {
|
|
322
|
+
total: `sms_${vm.total}`,
|
|
307
323
|
}, (res) => __awaiter(this, void 0, void 0, function* () {
|
|
308
|
-
console.log(`res.receipt_data=>`, res.receipt_data);
|
|
309
324
|
if (res.receipt_data) {
|
|
310
325
|
yield AiPointsApi.apple_webhook(res.receipt_data);
|
|
311
326
|
window.parent.location.reload();
|
|
@@ -329,8 +344,9 @@ export class SmsPoints {
|
|
|
329
344
|
}
|
|
330
345
|
}));
|
|
331
346
|
}
|
|
332
|
-
})))
|
|
333
|
-
|
|
347
|
+
}))),
|
|
348
|
+
].join('');
|
|
349
|
+
},
|
|
334
350
|
});
|
|
335
351
|
return;
|
|
336
352
|
});
|