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,265 +9,275 @@ import { Currency } from '../../glitter-base/global/currency.js';
|
|
|
9
9
|
const html = String.raw;
|
|
10
10
|
|
|
11
11
|
interface ProductSEO {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
title: string;
|
|
13
|
+
domain: string;
|
|
14
|
+
content: string;
|
|
15
|
+
keywords: string;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
interface SpecOption {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
title: string;
|
|
20
|
+
expand?: boolean;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
interface ProductSpec {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
title: string;
|
|
25
|
+
option: SpecOption[];
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
interface Token {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
exp: number;
|
|
30
|
+
iat: number;
|
|
31
|
+
userID: number;
|
|
32
|
+
account: string;
|
|
33
|
+
userData: Record<string, unknown>;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
interface Variant {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
37
|
+
sku: string;
|
|
38
|
+
cost: number;
|
|
39
|
+
spec: string[];
|
|
40
|
+
type: string;
|
|
41
|
+
stock: number;
|
|
42
|
+
profit: number;
|
|
43
|
+
weight: string;
|
|
44
|
+
barcode: string;
|
|
45
|
+
v_width: number;
|
|
46
|
+
editable: boolean;
|
|
47
|
+
v_height: number;
|
|
48
|
+
v_length: number;
|
|
49
|
+
product_id: number;
|
|
50
|
+
sale_price: number;
|
|
51
|
+
compare_price: number;
|
|
52
|
+
preview_image: string;
|
|
53
|
+
shipment_type: string;
|
|
54
|
+
shipment_weight: number;
|
|
55
|
+
show_understocking: string;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
interface ProductType {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
product: boolean;
|
|
60
|
+
giveaway: boolean;
|
|
61
|
+
addProduct: boolean;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
interface ProductContent {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
65
|
+
id: number;
|
|
66
|
+
seo: ProductSEO;
|
|
67
|
+
type: string;
|
|
68
|
+
specs: ProductSpec[];
|
|
69
|
+
title: string;
|
|
70
|
+
token: Token;
|
|
71
|
+
status: string;
|
|
72
|
+
content: string;
|
|
73
|
+
visible: string;
|
|
74
|
+
template: string;
|
|
75
|
+
variants: Variant[];
|
|
76
|
+
hideIndex: string;
|
|
77
|
+
max_price: number;
|
|
78
|
+
min_price: number;
|
|
79
|
+
collection: any[];
|
|
80
|
+
productType: ProductType;
|
|
81
|
+
content_json: any[];
|
|
82
|
+
in_wish_list: boolean;
|
|
83
|
+
content_array: any[];
|
|
84
|
+
preview_image: string[];
|
|
85
|
+
relative_product: any[];
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
interface Product {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
89
|
+
id: number;
|
|
90
|
+
userID: number;
|
|
91
|
+
content: ProductContent;
|
|
92
|
+
created_time: string;
|
|
93
|
+
updated_time: string;
|
|
94
|
+
status: number;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
export class UMWishList {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
98
|
+
static main(gvc: GVC, widget: any, subData: any) {
|
|
99
|
+
const glitter = gvc.glitter;
|
|
100
|
+
const vm = {
|
|
101
|
+
dataList: [] as Product[],
|
|
102
|
+
};
|
|
103
|
+
const ids = {
|
|
104
|
+
view: glitter.getUUID(),
|
|
105
|
+
};
|
|
106
|
+
const loadings = {
|
|
107
|
+
view: true,
|
|
108
|
+
};
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
let changePage = (index: string, type: 'page' | 'home', subData: any) => {};
|
|
111
|
+
gvc.glitter.getModule(new URL('./official_event/page/change-page.js', gvc.glitter.root_path).href, cl => {
|
|
112
|
+
changePage = cl.changePage;
|
|
113
|
+
});
|
|
114
|
+
gvc.addMtScript(
|
|
115
|
+
[{ src: `${gvc.glitter.root_path}/jslib/lottie-player.js` }],
|
|
116
|
+
() => {
|
|
117
|
+
ApiShop.getWishList().then(async res => {
|
|
118
|
+
if (res.result && res.response.data) {
|
|
119
|
+
vm.dataList = res.response.data;
|
|
120
|
+
} else {
|
|
121
|
+
vm.dataList = [];
|
|
122
|
+
}
|
|
123
|
+
loadings.view = false;
|
|
124
|
+
gvc.notifyDataChange(ids.view);
|
|
113
125
|
});
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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
|
-
|
|
126
|
+
},
|
|
127
|
+
() => {}
|
|
128
|
+
);
|
|
129
|
+
return gvc.bindView({
|
|
130
|
+
bind: ids.view,
|
|
131
|
+
view: () => {
|
|
132
|
+
if (loadings.view) {
|
|
133
|
+
return UmClass.spinner();
|
|
134
|
+
} else {
|
|
135
|
+
return html`
|
|
136
|
+
<div class="row mx-auto p-0">
|
|
137
|
+
<div class="w-100 align-items-center d-flex py-3 pb-lg-3 pt-lg-0" style="gap:10px;">
|
|
138
|
+
<div
|
|
139
|
+
class="d-none d-lg-flex"
|
|
140
|
+
style="background: #FF9705;background: #FF9705;width:4px;height: 20px;"
|
|
141
|
+
onclick="${gvc.event(() => {
|
|
142
|
+
gvc.glitter.getModule(
|
|
143
|
+
new URL(gvc.glitter.root_path + 'official_event/page/change-page.js', import.meta.url).href,
|
|
144
|
+
cl => {
|
|
145
|
+
cl.changePage('account_userinfo', 'home', {});
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
})}"
|
|
149
|
+
></div>
|
|
150
|
+
<div
|
|
151
|
+
class="d-flex d-lg-none align-items-center justify-content-center"
|
|
152
|
+
style="width:20px;height: 20px;"
|
|
153
|
+
onclick="${gvc.event(() => {
|
|
154
|
+
gvc.glitter.getModule(
|
|
155
|
+
new URL(gvc.glitter.root_path + 'official_event/page/change-page.js', import.meta.url).href,
|
|
156
|
+
cl => {
|
|
157
|
+
cl.changePage('account_userinfo', 'home', {});
|
|
158
|
+
}
|
|
159
|
+
);
|
|
160
|
+
})}"
|
|
161
|
+
>
|
|
162
|
+
<i class="fa-solid fa-angle-left fs-4"></i>
|
|
163
|
+
</div>
|
|
164
|
+
<div class="um-info-title fw-bold " style="font-size: 24px;">${Language.text('wishlist')}</div>
|
|
165
|
+
</div>
|
|
166
|
+
<div class="col-12" style="min-height: 500px;">
|
|
167
|
+
<div class="mx-auto orderList pt-3 mb-4 row">
|
|
168
|
+
${(() => {
|
|
169
|
+
if (vm.dataList.length === 0) {
|
|
170
|
+
return html`<div
|
|
171
|
+
class="d-flex align-items-center justify-content-center flex-column w-100 mx-auto"
|
|
172
|
+
>
|
|
173
|
+
<lottie-player
|
|
174
|
+
style="max-width: 100%;width: 300px;"
|
|
175
|
+
src="https://assets10.lottiefiles.com/packages/lf20_rc6CDU.json"
|
|
176
|
+
speed="1"
|
|
177
|
+
loop="true"
|
|
178
|
+
background="transparent"
|
|
179
|
+
></lottie-player>
|
|
180
|
+
<span class="mb-5 fs-5">${Language.text('no_items_added')}</span>
|
|
181
|
+
</div>`;
|
|
182
|
+
}
|
|
183
|
+
return vm.dataList
|
|
184
|
+
.map((item, index) => {
|
|
185
|
+
return html` <div
|
|
186
|
+
class="col-6 col-md-3 px-1 px-md-2"
|
|
187
|
+
gvc-prod-id="${item.id}"
|
|
188
|
+
onclick="${gvc.event(() => {
|
|
189
|
+
let path = '';
|
|
190
|
+
if (!(item.content.seo && item.content.seo.domain)) {
|
|
191
|
+
glitter.setUrlParameter('product_id', subData.id);
|
|
192
|
+
path = 'products';
|
|
193
|
+
} else {
|
|
194
|
+
glitter.setUrlParameter('product_id', undefined);
|
|
195
|
+
path = `products/${item.content.seo.domain}`;
|
|
196
|
+
}
|
|
197
|
+
changePage(path, 'page', {});
|
|
198
|
+
})}"
|
|
199
|
+
>
|
|
200
|
+
<div class="card mb-3" style="cursor: pointer">
|
|
201
|
+
<div class="card-img">
|
|
202
|
+
<div
|
|
203
|
+
class="um-icon-container"
|
|
204
|
+
onclick="${gvc.event((e, event) => {
|
|
205
|
+
event.stopPropagation();
|
|
206
|
+
if (CheckInput.isEmpty(GlobalUser.token)) {
|
|
207
|
+
changePage('login', 'page', {});
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
ApiShop.deleteWishList(`${item.id}`).then(async () => {
|
|
211
|
+
UmClass.jumpAlert({
|
|
212
|
+
gvc,
|
|
213
|
+
text: Language.text('delete_success'),
|
|
214
|
+
justify: 'top',
|
|
215
|
+
align: 'center',
|
|
216
|
+
});
|
|
217
|
+
vm.dataList.splice(index, 1);
|
|
218
|
+
gvc.notifyDataChange(ids.view);
|
|
219
|
+
});
|
|
220
|
+
})}"
|
|
221
|
+
>
|
|
222
|
+
<i class="fa-solid fa-xmark"></i>
|
|
223
|
+
</div>
|
|
224
|
+
<div
|
|
225
|
+
class="card-img-top um-img-bgr"
|
|
226
|
+
style="background-image: url('${(() => {
|
|
227
|
+
if (item.content.preview_image[0]) {
|
|
228
|
+
return item.content.preview_image[0];
|
|
229
|
+
}
|
|
230
|
+
return 'https://jmva.or.jp/wp-content/uploads/2018/07/noimage.png';
|
|
231
|
+
})()}');"
|
|
232
|
+
></div>
|
|
154
233
|
</div>
|
|
155
|
-
<div class="
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
<span class="mb-5 fs-5">${Language.text('no_items_added')}</span>
|
|
168
|
-
</div>`;
|
|
169
|
-
}
|
|
170
|
-
return vm.dataList
|
|
171
|
-
.map((item,index) => {
|
|
172
|
-
return html` <div
|
|
173
|
-
class="col-6 col-md-3 px-1 px-md-2"
|
|
174
|
-
gvc-prod-id="${item.id}"
|
|
175
|
-
onclick="${gvc.event(() => {
|
|
176
|
-
let path = '';
|
|
177
|
-
if (!(item.content.seo && item.content.seo.domain)) {
|
|
178
|
-
glitter.setUrlParameter('product_id', subData.id);
|
|
179
|
-
path = 'products';
|
|
180
|
-
} else {
|
|
181
|
-
glitter.setUrlParameter('product_id', undefined);
|
|
182
|
-
path = `products/${item.content.seo.domain}`;
|
|
183
|
-
}
|
|
184
|
-
changePage(path, 'page', {});
|
|
185
|
-
})}"
|
|
186
|
-
>
|
|
187
|
-
<div class="card mb-3" style="cursor: pointer">
|
|
188
|
-
<div class="card-img">
|
|
189
|
-
<div
|
|
190
|
-
class="um-icon-container"
|
|
191
|
-
onclick="${gvc.event((e, event) => {
|
|
192
|
-
event.stopPropagation();
|
|
193
|
-
if (CheckInput.isEmpty(GlobalUser.token)) {
|
|
194
|
-
changePage('login', 'page', {});
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
ApiShop.deleteWishList(`${item.id}`).then(async () => {
|
|
198
|
-
UmClass.jumpAlert({
|
|
199
|
-
gvc,
|
|
200
|
-
text: Language.text('delete_success'),
|
|
201
|
-
justify: 'top',
|
|
202
|
-
align: 'center',
|
|
203
|
-
});
|
|
204
|
-
vm.dataList.splice(index, 1);
|
|
205
|
-
gvc.notifyDataChange(ids.view);
|
|
206
|
-
});
|
|
207
|
-
})}"
|
|
208
|
-
>
|
|
209
|
-
<i class="fa-solid fa-xmark"></i>
|
|
210
|
-
</div>
|
|
211
|
-
<div
|
|
212
|
-
class="card-img-top um-img-bgr"
|
|
213
|
-
style="background-image: url('${(() => {
|
|
214
|
-
if (item.content.preview_image[0]) {
|
|
215
|
-
return item.content.preview_image[0];
|
|
216
|
-
}
|
|
217
|
-
return 'https://jmva.or.jp/wp-content/uploads/2018/07/noimage.png';
|
|
218
|
-
})()}');"
|
|
219
|
-
></div>
|
|
220
|
-
</div>
|
|
221
|
-
<div class="card-body text-start p-2">
|
|
222
|
-
<div class="fs-6 um-card-title mb-1">${item.content.title}</div>
|
|
223
|
-
<div class="d-flex align-items-center gap-1">
|
|
224
|
-
<div class="fs-6 fw-500 card-sale-price mb-1">
|
|
225
|
-
${(() => {
|
|
226
|
-
const minPrice = Math.min(
|
|
227
|
-
...item.content.variants.map((dd) => {
|
|
228
|
-
return dd.sale_price;
|
|
229
|
-
})
|
|
230
|
-
);
|
|
231
|
-
return `NT.$ ${minPrice.toLocaleString()}`;
|
|
232
|
-
})()}
|
|
233
|
-
</div>
|
|
234
|
-
${(() => {
|
|
235
|
-
const minPrice = Math.min(
|
|
236
|
-
...item.content.variants.map((dd: { sale_price: number }) => {
|
|
237
|
-
return dd.sale_price;
|
|
238
|
-
})
|
|
239
|
-
);
|
|
240
|
-
const comparePrice =
|
|
241
|
-
(
|
|
242
|
-
item.content.variants.find((dd: { sale_price: number }) => {
|
|
243
|
-
return dd.sale_price === minPrice;
|
|
244
|
-
}) ?? {}
|
|
245
|
-
).compare_price ?? 0;
|
|
246
|
-
if (comparePrice > 0 && minPrice < comparePrice) {
|
|
247
|
-
return html`<div class="text-decoration-line-through card-cost-price mb-1">${Currency.convertCurrencyText(comparePrice)}</div>`;
|
|
248
|
-
}
|
|
249
|
-
return '';
|
|
250
|
-
})()}
|
|
251
|
-
</div>
|
|
252
|
-
</div>
|
|
253
|
-
</div>
|
|
254
|
-
</div>`;
|
|
255
|
-
})
|
|
256
|
-
.join('');
|
|
257
|
-
})()}
|
|
234
|
+
<div class="card-body text-start p-2">
|
|
235
|
+
<div class="fs-6 um-card-title mb-1">${item.content.title}</div>
|
|
236
|
+
<div class="d-flex align-items-center gap-1">
|
|
237
|
+
<div class="fs-6 fw-500 card-sale-price mb-1">
|
|
238
|
+
${(() => {
|
|
239
|
+
const minPrice = Math.min(
|
|
240
|
+
...item.content.variants.map(dd => {
|
|
241
|
+
return dd.sale_price;
|
|
242
|
+
})
|
|
243
|
+
);
|
|
244
|
+
return `NT.$ ${minPrice.toLocaleString()}`;
|
|
245
|
+
})()}
|
|
258
246
|
</div>
|
|
247
|
+
${(() => {
|
|
248
|
+
const minPrice = Math.min(
|
|
249
|
+
...item.content.variants.map((dd: { sale_price: number }) => {
|
|
250
|
+
return dd.sale_price;
|
|
251
|
+
})
|
|
252
|
+
);
|
|
253
|
+
const comparePrice =
|
|
254
|
+
(
|
|
255
|
+
item.content.variants.find((dd: { sale_price: number }) => {
|
|
256
|
+
return dd.sale_price === minPrice;
|
|
257
|
+
}) ?? {}
|
|
258
|
+
).compare_price ?? 0;
|
|
259
|
+
if (comparePrice > 0 && minPrice < comparePrice) {
|
|
260
|
+
return html`<div class="text-decoration-line-through card-cost-price mb-1">
|
|
261
|
+
${Currency.convertCurrencyText(comparePrice)}
|
|
262
|
+
</div>`;
|
|
263
|
+
}
|
|
264
|
+
return '';
|
|
265
|
+
})()}
|
|
266
|
+
</div>
|
|
259
267
|
</div>
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
}
|
|
270
|
-
|
|
268
|
+
</div>
|
|
269
|
+
</div>`;
|
|
270
|
+
})
|
|
271
|
+
.join('');
|
|
272
|
+
})()}
|
|
273
|
+
</div>
|
|
274
|
+
</div>
|
|
275
|
+
</div>
|
|
276
|
+
`;
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
});
|
|
280
|
+
}
|
|
271
281
|
}
|
|
272
282
|
|
|
273
283
|
(window as any).glitter.setModule(import.meta.url, UMWishList);
|
package/package.json
CHANGED
|
@@ -92,6 +92,23 @@ router.post('/syncStock', async (req, resp) => {
|
|
|
92
92
|
return response_1.default.fail(resp, err);
|
|
93
93
|
}
|
|
94
94
|
});
|
|
95
|
+
router.post('/getOrderList', async (req, resp) => {
|
|
96
|
+
try {
|
|
97
|
+
if (await ut_permission_js_1.UtPermission.isManager(req)) {
|
|
98
|
+
shopee_1.Shopee.getItemProgress.push(req.get('g-app'));
|
|
99
|
+
const itemList = new shopee_1.Shopee(req.get('g-app'), req.body.token).getOrderList(req.body.start, req.body.end);
|
|
100
|
+
return response_1.default.succ(resp, {
|
|
101
|
+
result: true
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
throw exception_1.default.BadRequestError('BAD_REQUEST', 'No permission.', null);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
catch (err) {
|
|
109
|
+
return response_1.default.fail(resp, err);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
95
112
|
['post', 'get'].map((dd) => {
|
|
96
113
|
router[dd]('/stock-hook', async (req, resp) => {
|
|
97
114
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shopee.js","sourceRoot":"","sources":["shopee.ts"],"names":[],"mappings":";;;;AAAA,sDAAyC;AACzC,sEAA8C;AAC9C,wEAAgD;AAChD,gEAAyD;AAIzD,+CAA0C;AAE1C,MAAM,MAAM,GAAmB,iBAAO,CAAC,MAAM,EAAE,CAAC;AAIhD,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,GAAoB,EAAE,IAAsB,EAAE,EAAE;IACnE,IAAI,CAAC;IACL,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACX,OAAO,kBAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACpC,CAAC;AACL,CAAC,CAAC,CAAC;AACH,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,GAAoB,EAAE,IAAsB,EAAE,EAAE;IAC3E,IAAI,CAAC;QACD,OAAO,kBAAQ,CAAC,IAAI,CAChB,IAAI,EACJ;YACI,QAAQ,EAAC,IAAI,eAAM,CAAC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A;QACH,CAAC;aAAI,CAAC;YACJ,MAAM,mBAAS,CAAC,eAAe,CAAC,aAAa,EAAE,gBAAgB,EAAE,IAAI,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,kBAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAClC,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,CAAC,MAAM,EAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAC,EAAE;IACpB,MAAc,CAAC,EAAE,CAAC,CAAC,aAAa,EAAE,KAAK,EAAE,GAAoB,EAAE,IAAsB,EAAE,EAAE;QACtF,IAAI,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAC,GAAG,CAAC,IAAI,CAAC,CAAA;YAC3C,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAC,GAAG,CAAC,KAAK,CAAC,CAAA;YAC7C,OAAO,kBAAQ,CAAC,IAAI,CAChB,IAAI,EACJ;gBACI,QAAQ,EAAG,IAAI;gBACf,UAAU,EAAG,EAAE;aAClB,CACJ,CAAA;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,OAAO,kBAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACpC,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAA;AApJF,iBAAS,MAAM,CAAC"}
|
|
@@ -29,6 +29,18 @@ router.post('/getAuth', async (req: express.Request, resp: express.Response) =>
|
|
|
29
29
|
return response.fail(resp, err);
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
|
+
// router.post('/getOrderAuth', async (req: express.Request, resp: express.Response) => {
|
|
33
|
+
// try {
|
|
34
|
+
// return response.succ(
|
|
35
|
+
// resp,
|
|
36
|
+
// {
|
|
37
|
+
// "result":new Shopee(req.get('g-app') as string, req.body.token).generateAuth(req.body.redirect)
|
|
38
|
+
// }
|
|
39
|
+
// )
|
|
40
|
+
// } catch (err) {
|
|
41
|
+
// return response.fail(resp, err);
|
|
42
|
+
// }
|
|
43
|
+
// });
|
|
32
44
|
router.post('/getToken', async (req: express.Request, resp: express.Response) => {
|
|
33
45
|
try {
|
|
34
46
|
if(await UtPermission.isManager(req)){
|
|
@@ -108,6 +120,26 @@ router.post('/syncStock', async (req: express.Request, resp: express.Response) =
|
|
|
108
120
|
return response.fail(resp, err);
|
|
109
121
|
}
|
|
110
122
|
});
|
|
123
|
+
router.post('/getOrderList', async (req: express.Request, resp: express.Response) => {
|
|
124
|
+
try {
|
|
125
|
+
if(await UtPermission.isManager(req)){
|
|
126
|
+
//把同步中的toggle開啟
|
|
127
|
+
Shopee.getItemProgress.push(req.get('g-app') as string)
|
|
128
|
+
const itemList = new Shopee(req.get('g-app') as string, req.body.token).getOrderList(req.body.start, req.body.end);
|
|
129
|
+
|
|
130
|
+
return response.succ(
|
|
131
|
+
resp,
|
|
132
|
+
{
|
|
133
|
+
result:true
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
}else{
|
|
137
|
+
throw exception.BadRequestError('BAD_REQUEST', 'No permission.', null);
|
|
138
|
+
}
|
|
139
|
+
} catch (err) {
|
|
140
|
+
return response.fail(resp, err);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
111
143
|
|
|
112
144
|
['post','get'].map((dd)=>{
|
|
113
145
|
(router as any)[dd]('/stock-hook', async (req: express.Request, resp: express.Response) => {
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|