ts-glitter 21.5.2 → 21.5.4
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/account-info.js +79 -67
- package/lowcode/cms-plugin/account-info.ts +327 -311
- package/lowcode/cms-plugin/information/information-module.ts +3 -1
- package/lowcode/cms-plugin/list-header-option.js +1 -0
- package/lowcode/cms-plugin/list-header-option.ts +1 -0
- package/lowcode/cms-plugin/shopping-information.js +468 -0
- package/lowcode/cms-plugin/shopping-information.ts +557 -0
- package/lowcode/cms-plugin/shopping-market-shopee.js +283 -231
- package/lowcode/cms-plugin/shopping-market-shopee.ts +401 -361
- package/lowcode/cms-plugin/shopping-order-manager.js +16 -4
- package/lowcode/cms-plugin/shopping-order-manager.ts +18 -3
- package/lowcode/glitter-base/global/language.js +4 -1
- package/lowcode/glitter-base/global/language.ts +4 -2
- package/lowcode/glitter-base/route/shopee.js +48 -11
- package/lowcode/glitter-base/route/shopee.ts +119 -80
- package/lowcode/glitterBundle/plugins/html-render.js +121 -90
- package/lowcode/glitterBundle/plugins/html-render.ts +367 -318
- package/lowcode/modules/image-library.js +2 -3
- package/lowcode/modules/image-library.ts +21 -7
- package/lowcode/public-components/checkout/index.js +90 -41
- package/lowcode/public-components/checkout/index.ts +101 -49
- package/lowcode/public-components/footer/footer-initial.js +11 -2
- package/lowcode/public-components/footer/footer-initial.ts +29 -18
- package/lowcode/public-components/headers/header-class.js +47 -35
- package/lowcode/public-components/headers/header-class.ts +54 -38
- package/lowcode/public-components/headers/sy-02.js +1 -1
- package/lowcode/public-components/headers/sy-02.ts +1 -1
- package/lowcode/public-components/headers/sy-03.js +1 -1
- package/lowcode/public-components/headers/sy-03.ts +1 -1
- package/lowcode/public-components/headers/sy-04.js +1 -1
- package/lowcode/public-components/headers/sy-04.ts +1 -1
- package/lowcode/public-components/headers/sy-05.js +1 -2
- package/lowcode/public-components/headers/sy-05.ts +1 -1
- package/lowcode/public-components/layout-plugin/social-links-01.js +122 -3
- package/lowcode/public-components/layout-plugin/social-links-01.ts +135 -10
- package/lowcode/public-components/product/pd-card-01.js +23 -14
- package/lowcode/public-components/product/pd-card-01.ts +25 -14
- package/lowcode/public-components/product/pd-card-02.js +23 -16
- package/lowcode/public-components/product/pd-card-02.ts +25 -16
- package/lowcode/public-components/product/pd-card-03.js +25 -16
- package/lowcode/public-components/product/pd-card-03.ts +27 -16
- package/lowcode/public-components/product/pd-class.js +1 -1
- package/lowcode/public-components/product/pd-class.ts +1 -1
- package/lowcode/public-components/terms-related/index.js +13 -2
- package/lowcode/public-components/terms-related/index.ts +15 -2
- package/lowcode/public-components/user-manager/um-class.js +490 -501
- package/lowcode/public-components/user-manager/um-class.ts +872 -882
- package/lowcode/public-components/user-manager/um-info.js +41 -40
- package/lowcode/public-components/user-manager/um-info.ts +54 -56
- package/lowcode/public-components/user-manager/um-login.js +10 -13
- package/lowcode/public-components/user-manager/um-login.ts +15 -23
- package/lowcode/public-components/user-manager/um-orderlist.js +60 -51
- package/lowcode/public-components/user-manager/um-orderlist.ts +289 -275
- package/lowcode/public-components/user-manager/um-rebate.js +104 -82
- package/lowcode/public-components/user-manager/um-rebate.ts +294 -267
- package/lowcode/public-components/user-manager/um-receive.js +582 -0
- package/lowcode/public-components/user-manager/um-receive.ts +599 -0
- package/lowcode/public-components/user-manager/um-wishlist.js +72 -68
- package/lowcode/public-components/user-manager/um-wishlist.ts +240 -230
- package/package.json +1 -1
- package/src/api-public/controllers/shopee.js +17 -0
- package/src/api-public/controllers/shopee.js.map +1 -1
- package/src/api-public/controllers/shopee.ts +32 -0
- package/src/api-public/services/monitor.d.ts +1 -0
- package/src/api-public/services/post.js +17 -7
- package/src/api-public/services/post.js.map +1 -1
- package/src/api-public/services/rebate.js +2 -11
- package/src/api-public/services/rebate.js.map +1 -1
- package/src/api-public/services/rebate.ts +5 -12
- package/src/api-public/services/shopee.d.ts +23 -2
- package/src/api-public/services/shopee.js +230 -111
- package/src/api-public/services/shopee.js.map +1 -1
- package/src/api-public/services/shopee.ts +1012 -838
- package/src/api-public/services/user.js +2 -2
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +3 -3
- package/src/index.js +17 -7
- package/src/index.js.map +1 -1
- package/src/modules/tool.d.ts +4 -4
- package/src/modules/tool.js +2 -1
- package/src/modules/tool.js.map +1 -1
- package/src/services/backend-service.js +17 -7
- package/src/services/backend-service.js.map +1 -1
- package/src/services/template.d.ts +1 -1
- package/src/services/template.js +24 -18
- package/src/services/template.js.map +1 -1
- package/src/services/template.ts +34 -37
|
@@ -9,296 +9,323 @@ import { Language } from '../../glitter-base/global/language.js';
|
|
|
9
9
|
const html = String.raw;
|
|
10
10
|
|
|
11
11
|
interface UserData {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
name: string;
|
|
13
|
+
birth: string;
|
|
14
|
+
email: string;
|
|
15
|
+
phone: string;
|
|
16
|
+
repeatPwd: string;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
interface RebateInfo {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
20
|
+
id: number;
|
|
21
|
+
orderID: string;
|
|
22
|
+
userID: number;
|
|
23
|
+
money: number;
|
|
24
|
+
remain: number;
|
|
25
|
+
status: number;
|
|
26
|
+
note: string;
|
|
27
|
+
created_time: string;
|
|
28
|
+
deadline: string;
|
|
29
|
+
userData: UserData;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export class UMRebate {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
let changePage = (index: string, type: 'page' | 'home', subData: any) => {};
|
|
52
|
-
gvc.glitter.getModule(new URL('./official_event/page/change-page.js', gvc.glitter.root_path).href, (cl) => {
|
|
53
|
-
changePage = cl.changePage;
|
|
54
|
-
});
|
|
33
|
+
static main(gvc: GVC, widget: any, subData: any) {
|
|
34
|
+
const glitter = gvc.glitter;
|
|
35
|
+
if (glitter.getUrlParameter('page') === 'voucher-list') {
|
|
36
|
+
return UMVoucher.main(gvc, widget, subData);
|
|
37
|
+
}
|
|
38
|
+
const vm = {
|
|
39
|
+
dataList: [] as RebateInfo[],
|
|
40
|
+
amount: 0,
|
|
41
|
+
oldestText: '',
|
|
42
|
+
rebateConfig: {} as any,
|
|
43
|
+
};
|
|
44
|
+
const ids = {
|
|
45
|
+
view: glitter.getUUID(),
|
|
46
|
+
};
|
|
47
|
+
const loadings = {
|
|
48
|
+
view: true,
|
|
49
|
+
};
|
|
55
50
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
return UmClass.spinner();
|
|
61
|
-
} else {
|
|
62
|
-
const isWebsite = document.body.clientWidth > 768;
|
|
63
|
-
vm.rebateConfig.title = CheckInput.isEmpty(vm.rebateConfig.title) ? Language.text('shopping_credit') : vm.rebateConfig.title;
|
|
64
|
-
return html`
|
|
65
|
-
<div class="mx-auto p-0">
|
|
66
|
-
<div class="w-100 align-items-center d-flex py-3 pb-lg-3 pt-lg-0" style="gap:10px;">
|
|
51
|
+
let changePage = (index: string, type: 'page' | 'home', subData: any) => {};
|
|
52
|
+
gvc.glitter.getModule(new URL('./official_event/page/change-page.js', gvc.glitter.root_path).href, cl => {
|
|
53
|
+
changePage = cl.changePage;
|
|
54
|
+
});
|
|
67
55
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
56
|
+
return gvc.bindView({
|
|
57
|
+
bind: ids.view,
|
|
58
|
+
view: () => {
|
|
59
|
+
if (loadings.view) {
|
|
60
|
+
return UmClass.spinner();
|
|
61
|
+
} else {
|
|
62
|
+
const isWebsite = document.body.clientWidth > 768;
|
|
63
|
+
vm.rebateConfig.title = CheckInput.isEmpty(vm.rebateConfig.title)
|
|
64
|
+
? Language.text('shopping_credit')
|
|
65
|
+
: vm.rebateConfig.title;
|
|
66
|
+
return html`
|
|
67
|
+
<div class="mx-auto p-0">
|
|
68
|
+
<div class="w-100 align-items-center d-flex py-3 pb-lg-3 pt-lg-0" style="gap:10px;">
|
|
69
|
+
<div
|
|
70
|
+
class="d-none d-lg-flex"
|
|
71
|
+
style="background: #FF9705;background: #FF9705;width:4px;height: 20px;"
|
|
72
|
+
onclick="${gvc.event(() => {
|
|
73
|
+
gvc.glitter.getModule(
|
|
74
|
+
new URL(gvc.glitter.root_path + 'official_event/page/change-page.js', import.meta.url).href,
|
|
75
|
+
cl => {
|
|
76
|
+
cl.changePage('account_userinfo', 'home', {});
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
})}"
|
|
80
|
+
></div>
|
|
81
|
+
<div
|
|
82
|
+
class="d-flex d-lg-none align-items-center justify-content-center"
|
|
83
|
+
style="width:20px;height: 20px;"
|
|
84
|
+
onclick="${gvc.event(() => {
|
|
85
|
+
gvc.glitter.getModule(
|
|
86
|
+
new URL(gvc.glitter.root_path + 'official_event/page/change-page.js', import.meta.url).href,
|
|
87
|
+
cl => {
|
|
88
|
+
cl.changePage('account_userinfo', 'home', {});
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
})}"
|
|
92
|
+
>
|
|
93
|
+
<i class="fa-solid fa-angle-left fs-4"></i>
|
|
94
|
+
</div>
|
|
95
|
+
<div class="um-info-title fw-bold " style="font-size: 24px;">
|
|
96
|
+
${`${Language.text('my')}${glitter.share.rebateConfig.title || Language.text('shopping_credit')}`}
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
<div class="col-12 p-4 px-lg-5 mx-auto d-flex um-rb-bgr ${isWebsite ? '' : 'flex-column'}">
|
|
100
|
+
<div class="d-flex ${isWebsite ? 'gap-4' : 'gap-3'}">
|
|
101
|
+
<div class="fa-duotone fa-coins fs-1 d-flex align-items-center justify-content-center"></div>
|
|
102
|
+
<div class="${isWebsite ? '' : 'd-flex align-items-center gap-2'}">
|
|
103
|
+
<div class="fw-500 fs-6">${vm.rebateConfig.title}</div>
|
|
104
|
+
<div class="fw-bold mt-0 mt-md-1 mb-1 um-rb-amount">${vm.amount.toLocaleString()}</div>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
<div class="d-flex align-items-center">
|
|
108
|
+
<div class="d-flex align-items-center gap-3">
|
|
109
|
+
${vm.oldestText.replace(`@{{rebate_title}}`, vm.rebateConfig.title)}
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
<div class="col-12 mt-2" style="min-height: 500px;">
|
|
114
|
+
<div class="mx-auto orderList pt-md-3 mb-4">
|
|
115
|
+
${(() => {
|
|
116
|
+
if (vm.dataList.length === 0) {
|
|
117
|
+
return html`<div
|
|
118
|
+
class="d-flex align-items-center justify-content-center flex-column w-100 mx-auto"
|
|
119
|
+
>
|
|
120
|
+
<lottie-player
|
|
121
|
+
style="max-width: 100%;width: 300px;"
|
|
122
|
+
src="https://assets10.lottiefiles.com/packages/lf20_rc6CDU.json"
|
|
123
|
+
speed="1"
|
|
124
|
+
loop="true"
|
|
125
|
+
background="transparent"
|
|
126
|
+
></lottie-player>
|
|
127
|
+
<span class="mb-5 fs-5">${Language.text('no_current_obtain')} ${vm.rebateConfig.title}</span>
|
|
128
|
+
</div>`;
|
|
129
|
+
}
|
|
109
130
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
131
|
+
const header = [
|
|
132
|
+
{
|
|
133
|
+
title: Language.text('creation_date'),
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
title: Language.text('expiration_date'),
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
title: Language.text('source'),
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
title: Language.text('received_amount'),
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
title: Language.text('balance'),
|
|
146
|
+
},
|
|
147
|
+
];
|
|
127
148
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
149
|
+
function threeDayLater(deadlineString: string) {
|
|
150
|
+
// 取得當前時間的 Date 物件
|
|
151
|
+
var now = new Date();
|
|
131
152
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
153
|
+
// 取得距今三天後的日期
|
|
154
|
+
var date = new Date();
|
|
155
|
+
date.setDate(now.getDate() + 3);
|
|
135
156
|
|
|
136
|
-
|
|
137
|
-
|
|
157
|
+
// 將 item.deadline 轉換為 Date 物件
|
|
158
|
+
var deadline = new Date(deadlineString);
|
|
138
159
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
160
|
+
// 比較 deadline 是否在距今三天後之前
|
|
161
|
+
return deadline <= date && deadline > now;
|
|
162
|
+
}
|
|
142
163
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
changePage('order_detail', 'page', {});
|
|
165
|
-
}),
|
|
166
|
-
'font-size: 16px;'
|
|
167
|
-
);
|
|
164
|
+
function formatText(item: RebateInfo) {
|
|
165
|
+
return [
|
|
166
|
+
glitter.ut.dateFormat(new Date(item.created_time), 'yyyy/MM/dd hh:mm'),
|
|
167
|
+
(() => {
|
|
168
|
+
if (item.money <= 0) {
|
|
169
|
+
return '-';
|
|
170
|
+
} else if (item.deadline.includes('2999')) {
|
|
171
|
+
return Language.text('no_expiry');
|
|
172
|
+
} else {
|
|
173
|
+
return html`${glitter.ut.dateFormat(new Date(item.deadline), 'yyyy/MM/dd hh:mm')}
|
|
174
|
+
${threeDayLater(item.deadline) && item.remain && item.remain > 0
|
|
175
|
+
? html`<span class="badge bg-faded-danger text-danger ms-1"
|
|
176
|
+
>${Language.text('about_to_expire')}</span
|
|
177
|
+
>`
|
|
178
|
+
: ''}`;
|
|
179
|
+
}
|
|
180
|
+
})(),
|
|
181
|
+
(() => {
|
|
182
|
+
if (!item.orderID) {
|
|
183
|
+
return item.note || `${Language.text('manual_adjustment')} ${vm.rebateConfig.title}`;
|
|
184
|
+
}
|
|
168
185
|
|
|
169
|
-
|
|
170
|
-
|
|
186
|
+
const orderLink = UmClass.style_components.blueNote(
|
|
187
|
+
`#${item.orderID}`,
|
|
188
|
+
gvc.event(() => {
|
|
189
|
+
gvc.glitter.setUrlParameter('cart_token', item.orderID);
|
|
190
|
+
changePage('order_detail', 'page', {});
|
|
191
|
+
}),
|
|
192
|
+
'font-size: 16px;'
|
|
193
|
+
);
|
|
171
194
|
|
|
172
|
-
|
|
173
|
-
} else {
|
|
174
|
-
return (
|
|
175
|
-
item.note ||
|
|
176
|
-
`${Language.text('manual_adjustment')} ${vm.rebateConfig.title}`
|
|
177
|
-
);
|
|
178
|
-
}
|
|
179
|
-
})(),
|
|
180
|
-
item.money.toLocaleString(),
|
|
181
|
-
item.money > 0 ? item.remain.toLocaleString() : '-',
|
|
182
|
-
];
|
|
183
|
-
}
|
|
195
|
+
const moneyText = item.money > 0 ? Language.text('obtain') : Language.text('use');
|
|
184
196
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
return html`<div class="w-100 d-sm-flex py-5 um-td-bar">
|
|
198
|
-
${formatText(item)
|
|
199
|
-
.map((dd, index) => {
|
|
200
|
-
return html`<div class="um-td" style="flex: ${flexList[index]};font-size:16px;word-break: break-word;">${dd}</div>`;
|
|
201
|
-
})
|
|
202
|
-
.join('')}
|
|
203
|
-
</div>`;
|
|
204
|
-
})
|
|
205
|
-
.join('')}
|
|
206
|
-
`;
|
|
207
|
-
}
|
|
197
|
+
return `${Language.text('order')}「${orderLink}」${moneyText} ${vm.rebateConfig.title}`;
|
|
198
|
+
})(),
|
|
199
|
+
html`<span class="fw-bold ${item.money > 0 ? 'text-success' : 'text-danger'}"
|
|
200
|
+
>${item.money.toLocaleString()}</span
|
|
201
|
+
>`,
|
|
202
|
+
item.money > 0
|
|
203
|
+
? html`<span class="fw-bold ${item.remain > 0 ? 'text-success' : ''}"
|
|
204
|
+
>${item.remain.toLocaleString()}</span
|
|
205
|
+
>`
|
|
206
|
+
: '-',
|
|
207
|
+
];
|
|
208
|
+
}
|
|
208
209
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
</div>`;
|
|
219
|
-
})
|
|
220
|
-
.join('')}
|
|
221
|
-
</div> `;
|
|
222
|
-
})()}
|
|
223
|
-
</div>
|
|
224
|
-
</div>
|
|
210
|
+
if (isWebsite) {
|
|
211
|
+
const flexList = [0.8, 0.8, 1.8, 0.6, 0.4];
|
|
212
|
+
return html`
|
|
213
|
+
<div class="w-100 d-sm-flex py-4 um-th-bar">
|
|
214
|
+
${header
|
|
215
|
+
.map((item, index) => {
|
|
216
|
+
return html`<div class="um-th" style="flex: ${flexList[index]};">${item.title}</div>`;
|
|
217
|
+
})
|
|
218
|
+
.join('')}
|
|
225
219
|
</div>
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
resolve(0);
|
|
245
|
-
}
|
|
246
|
-
});
|
|
247
|
-
}),
|
|
248
|
-
new Promise<string>((resolve) => {
|
|
249
|
-
ApiWallet.getRebate({
|
|
250
|
-
type: 'me',
|
|
251
|
-
limit: 10000,
|
|
252
|
-
page: 0,
|
|
253
|
-
}).then(async (res) => {
|
|
254
|
-
if (!(res.result && res.response.oldest)) {
|
|
255
|
-
resolve('');
|
|
256
|
-
}
|
|
257
|
-
const oldest = res.response.oldest;
|
|
258
|
-
if (!(oldest.remain && oldest.deadline)) {
|
|
259
|
-
resolve('');
|
|
260
|
-
}
|
|
220
|
+
${vm.dataList
|
|
221
|
+
.map(item => {
|
|
222
|
+
return html`<div class="w-100 d-sm-flex py-5 um-td-bar">
|
|
223
|
+
${formatText(item)
|
|
224
|
+
.map((dd, index) => {
|
|
225
|
+
return html`<div
|
|
226
|
+
class="um-td"
|
|
227
|
+
style="flex: ${flexList[index]};font-size:16px;word-break: break-word;"
|
|
228
|
+
>
|
|
229
|
+
${dd}
|
|
230
|
+
</div>`;
|
|
231
|
+
})
|
|
232
|
+
.join('')}
|
|
233
|
+
</div>`;
|
|
234
|
+
})
|
|
235
|
+
.join('')}
|
|
236
|
+
`;
|
|
237
|
+
}
|
|
261
238
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
239
|
+
return html`<div class="w-100 d-sm-none mb-3 s162413">
|
|
240
|
+
${vm.dataList
|
|
241
|
+
.map(item => {
|
|
242
|
+
return html`<div class="um-mobile-area">
|
|
243
|
+
${formatText(item)
|
|
244
|
+
.map((dd, index) => {
|
|
245
|
+
return html`<div class="um-mobile-text">${header[index].title}: ${dd}</div>`;
|
|
246
|
+
})
|
|
247
|
+
.join('')}
|
|
248
|
+
</div>`;
|
|
249
|
+
})
|
|
250
|
+
.join('')}
|
|
251
|
+
</div> `;
|
|
252
|
+
})()}
|
|
253
|
+
</div>
|
|
254
|
+
</div>
|
|
255
|
+
</div>
|
|
256
|
+
`;
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
onCreate: () => {
|
|
260
|
+
if (loadings.view) {
|
|
261
|
+
gvc.addMtScript(
|
|
262
|
+
[{ src: `${gvc.glitter.root_path}/jslib/lottie-player.js` }],
|
|
263
|
+
() => {
|
|
264
|
+
Promise.all([
|
|
265
|
+
UmClass.getRebateInfo(),
|
|
266
|
+
new Promise<number>(resolve => {
|
|
267
|
+
ApiShop.getRebate({}).then(async res => {
|
|
268
|
+
if (res.result && res.response.sum) {
|
|
269
|
+
resolve(res.response.sum);
|
|
270
|
+
} else {
|
|
271
|
+
resolve(0);
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
}),
|
|
275
|
+
new Promise<string>(resolve => {
|
|
276
|
+
ApiWallet.getRebate({
|
|
277
|
+
type: 'me',
|
|
278
|
+
limit: 10000,
|
|
279
|
+
page: 0,
|
|
280
|
+
}).then(async res => {
|
|
281
|
+
if (!(res.result && res.response.oldest)) {
|
|
282
|
+
resolve('');
|
|
283
|
+
}
|
|
284
|
+
const oldest = res.response.oldest;
|
|
285
|
+
if (!(oldest.remain && oldest.deadline)) {
|
|
286
|
+
resolve('');
|
|
287
|
+
}
|
|
269
288
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
page: 0,
|
|
278
|
-
}).then(async (res) => {
|
|
279
|
-
if (res.result && res.response.data) {
|
|
280
|
-
resolve(res.response.data);
|
|
281
|
-
} else {
|
|
282
|
-
resolve([]);
|
|
283
|
-
}
|
|
284
|
-
});
|
|
285
|
-
}),
|
|
286
|
-
]).then((dataList) => {
|
|
287
|
-
vm.rebateConfig = dataList[0];
|
|
288
|
-
vm.amount = dataList[1];
|
|
289
|
-
vm.oldestText = dataList[2];
|
|
290
|
-
vm.dataList = dataList[3];
|
|
289
|
+
const remainStr = oldest.remain.toLocaleString();
|
|
290
|
+
const endDate = glitter.ut.dateFormat(new Date(oldest.deadline), 'yyyy/MM/dd hh:mm');
|
|
291
|
+
const text = {
|
|
292
|
+
'zh-TW': `您尚有 ${remainStr} @{{rebate_title}} <br />將於 ${endDate} 到期`,
|
|
293
|
+
'zh-CN': `您还有 ${remainStr} @{{rebate_title}} <br />将于 ${endDate} 到期`,
|
|
294
|
+
'en-US': `You have ${remainStr} @{{rebate_title}} <br />expiring on ${endDate}`,
|
|
295
|
+
} as any;
|
|
291
296
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
297
|
+
resolve(text[Language.getLanguage()]);
|
|
298
|
+
});
|
|
299
|
+
}),
|
|
300
|
+
new Promise<RebateInfo[]>(resolve => {
|
|
301
|
+
ApiWallet.getRebate({
|
|
302
|
+
type: 'me',
|
|
303
|
+
limit: 10000,
|
|
304
|
+
page: 0,
|
|
305
|
+
}).then(async res => {
|
|
306
|
+
if (res.result && res.response.data) {
|
|
307
|
+
resolve(res.response.data);
|
|
308
|
+
} else {
|
|
309
|
+
resolve([]);
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
}),
|
|
313
|
+
]).then(dataList => {
|
|
314
|
+
vm.rebateConfig = dataList[0];
|
|
315
|
+
vm.amount = dataList[1];
|
|
316
|
+
vm.oldestText = dataList[2];
|
|
317
|
+
vm.dataList = dataList[3];
|
|
318
|
+
|
|
319
|
+
loadings.view = false;
|
|
320
|
+
gvc.notifyDataChange(ids.view);
|
|
321
|
+
});
|
|
299
322
|
},
|
|
300
|
-
|
|
301
|
-
|
|
323
|
+
() => {}
|
|
324
|
+
);
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
});
|
|
328
|
+
}
|
|
302
329
|
}
|
|
303
330
|
|
|
304
331
|
(window as any).glitter.setModule(import.meta.url, UMRebate);
|