ts-glitter 14.3.9 → 14.4.2

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.
Files changed (51) hide show
  1. package/lowcode/Entry.js +1 -1
  2. package/lowcode/Entry.ts +1 -1
  3. package/lowcode/backend-manager/bg-product.js +22 -20
  4. package/lowcode/backend-manager/bg-product.ts +85 -73
  5. package/lowcode/backend-manager/bg-recommend.js +31 -28
  6. package/lowcode/backend-manager/bg-recommend.ts +31 -28
  7. package/lowcode/cms-plugin/ai-message.ts +2 -1
  8. package/lowcode/cms-plugin/filter-options.js +6 -4
  9. package/lowcode/cms-plugin/filter-options.ts +8 -6
  10. package/lowcode/cms-plugin/module/product-excel.js +35 -14
  11. package/lowcode/cms-plugin/module/product-excel.ts +40 -15
  12. package/lowcode/cms-plugin/shopping-discount-setting.js +1 -1
  13. package/lowcode/cms-plugin/shopping-discount-setting.ts +5 -2
  14. package/lowcode/cms-plugin/shopping-invoice-manager.js +0 -1
  15. package/lowcode/cms-plugin/shopping-invoice-manager.ts +0 -1
  16. package/lowcode/cms-plugin/shopping-product-setting.js +265 -160
  17. package/lowcode/cms-plugin/shopping-product-setting.ts +295 -297
  18. package/lowcode/cms-plugin/shopping-product-stock.js +12 -16
  19. package/lowcode/cms-plugin/shopping-product-stock.ts +29 -35
  20. package/lowcode/glitter-base/route/shopping.js +25 -4
  21. package/lowcode/glitter-base/route/shopping.ts +52 -44
  22. package/lowcode/glitterBundle/html-component/widget.js +0 -3
  23. package/lowcode/glitterBundle/html-component/widget.ts +3 -3
  24. package/lowcode/public-components/blogs/blogs-01.js +138 -1
  25. package/lowcode/public-components/blogs/blogs-01.ts +142 -2
  26. package/lowcode/public-components/checkout/index.js +3 -2
  27. package/lowcode/public-components/checkout/index.ts +16 -3
  28. package/lowcode/public-components/product/product-detail.js +1 -0
  29. package/lowcode/public-components/product/product-detail.ts +1 -0
  30. package/lowcode/public-components/product/product-list.js +1 -0
  31. package/lowcode/public-components/product/product-list.ts +1 -0
  32. package/lowcode/public-components/user-manager/um-class.js +2 -2
  33. package/lowcode/public-components/user-manager/um-class.ts +2 -2
  34. package/lowcode/public-components/user-manager/um-rebate.js +18 -18
  35. package/lowcode/public-components/user-manager/um-rebate.ts +39 -38
  36. package/package.json +1 -1
  37. package/src/api-public/controllers/shop.js +18 -0
  38. package/src/api-public/controllers/shop.js.map +1 -1
  39. package/src/api-public/controllers/shop.ts +17 -1
  40. package/src/api-public/services/financial-service.d.ts +16 -0
  41. package/src/api-public/services/financial-service.js +70 -3
  42. package/src/api-public/services/financial-service.js.map +1 -1
  43. package/src/api-public/services/financial-service.ts +89 -4
  44. package/src/api-public/services/recommend.js +14 -0
  45. package/src/api-public/services/recommend.js.map +1 -1
  46. package/src/api-public/services/recommend.ts +15 -0
  47. package/src/api-public/services/shopping.d.ts +35 -0
  48. package/src/api-public/services/shopping.js +97 -9
  49. package/src/api-public/services/shopping.js.map +1 -1
  50. package/src/api-public/services/shopping.ts +136 -20
  51. package/src/services/template.js.map +1 -1
@@ -1,5 +1,145 @@
1
+ import {GlobalUser} from "../../glitter-base/global/global-user.js";
2
+ import {ApiUser} from "../../api/user.js";
3
+ import {ShareDialog} from "../../glitterBundle/dialog/ShareDialog.js";
4
+ import {GVC} from "../../glitterBundle/GVController.js";
5
+ import {UmClass} from "../user-manager/um-class.js";
6
+
1
7
  export class Blogs01 {
2
- static main(){
8
+ static main(gvc: GVC, subData: any) {
9
+ if (subData.content.generator !== 'page_editor') {
10
+ return subData.content.text;
11
+ } else {
12
+ console.log(`subData.content==>`, subData.content.show_auth)
13
+
14
+ function startRender() {
15
+ //隱形賣場和一頁商店,預設加入購物車
16
+ if (subData.content.relative_data && ["shopping", "hidden"].includes(subData.content.page_type) && (localStorage.getItem('block-refresh-cart') !== 'true')) {
17
+ subData.content.relative_data.map((dd: any) => {
18
+ const key = [dd.product_id].concat(dd.variant.spec).join('-')
19
+ const cart = gvc.glitter.share.ApiCart.cart;
20
+ const line_item = cart.line_items.find((dd: any) => {
21
+ return `${dd.id}-${dd.spec.join('-')}` === key
22
+ })
23
+ let cle: any[] = [];
24
+ cart.line_items.map((dd: any) => {
25
+ if (!cle.find((d1) => {
26
+ return `${dd.id}-${dd.spec.join('-')}` === `${d1.id}-${d1.spec.join('-')}`
27
+ })) {
28
+ cle.push(dd)
29
+ }
30
+ });
31
+ cart.line_items = cle;
32
+ if (!line_item) {
33
+ cart.line_items.push({
34
+ id: dd.product_id,
35
+ spec: dd.variant.spec,
36
+ count: 1
37
+ })
38
+ }
39
+ gvc.glitter.share.ApiCart.cart = cart
40
+ })
41
+ } else {
42
+ localStorage.setItem('block-refresh-cart', 'false')
43
+ }
44
+ return new gvc.glitter.htmlGenerate(subData.content.config, [], subData.content).render(gvc, {
45
+ class: `w-100`,
46
+ style: `position:relative;`,
47
+ containerID: gvc.glitter.getUUID(),
48
+ tag: gvc.glitter.getUUID(),
49
+ jsFinish: () => {
50
+ },
51
+ onCreate: () => {
52
+
53
+ },
54
+ document: document
55
+ }, {})
56
+ }
3
57
 
58
+ //判斷是隱形賣場決定是否可見
59
+ if (subData.content.page_type === 'hidden') {
60
+ if (subData.content.show_auth.auth === 'all') {
61
+ return startRender()
62
+ } else if (subData.content.show_auth.auth === "password") {
63
+ if (localStorage.getItem('password_to_see_' + subData.content.tag) === subData.content.show_auth.value) {
64
+ return startRender()
65
+ }
66
+ return gvc.bindView(() => {
67
+ const rid = gvc.glitter.getUUID()
68
+ return {
69
+ bind: rid,
70
+ view: () => {
71
+ return ``
72
+ },
73
+ divCreate: {
74
+ option: [
75
+ {key: 'id', value: rid}
76
+ ]
77
+ },
78
+ onCreate: () => {
79
+ function checkPwd() {
80
+ const pwd = window.prompt('請輸入網站密碼', '');
81
+ localStorage.setItem('password_to_see_' + subData.content.tag, pwd ?? '');
82
+ if (subData.content.show_auth.value === pwd) {
83
+ document.querySelector(`#${rid}`)!.outerHTML = startRender()
84
+ } else {
85
+ const dialog = new ShareDialog(gvc.glitter)
86
+ dialog.checkYesOrNot({
87
+ text: '網站密碼輸入錯誤', callback: () => {
88
+ gvc.glitter.closeDiaLog()
89
+ checkPwd()
90
+ }
91
+ })
92
+ }
93
+ }
94
+ checkPwd()
95
+ }
96
+ }
97
+ })
98
+ }else if(subData.content.show_auth.auth === "member_type"){
99
+ return gvc.bindView(() => {
100
+ const rid = gvc.glitter.getUUID()
101
+ return {
102
+ bind: rid,
103
+ view: () => {
104
+ return ``
105
+ },
106
+ divCreate: {
107
+ option: [
108
+ {key: 'id', value: rid}
109
+ ]
110
+ },
111
+ onCreate: () => {
112
+ const dialog=new ShareDialog(gvc.glitter)
113
+ UmClass.getUserData(gvc).then((resp: any) => {
114
+ try {
115
+ const mem = resp.member.find((d:any) => {
116
+ return d.trigger;
117
+ });
118
+ if(subData.content.show_auth.value.includes(mem.id)){
119
+ document.querySelector(`#${rid}`)!.outerHTML = startRender()
120
+ }else{
121
+ dialog.errorMessage({text:'無訪問權限'})
122
+ gvc.glitter.href='/index'
123
+ }
124
+ } catch (e) {
125
+ dialog.errorMessage({text:'無訪問權限'})
126
+ gvc.glitter.href='/index'
127
+ }
128
+ })
129
+ }
130
+ }
131
+ })
132
+
133
+ }else{
134
+ return startRender()
135
+ }
136
+ // ApiUser
137
+ } else {
138
+ return startRender()
139
+ }
140
+
141
+ }
4
142
  }
5
- }
143
+ }
144
+
145
+ (window as any).glitter.setModule(import.meta.url, Blogs01);
@@ -3118,11 +3118,13 @@ export class CheckoutIndex {
3118
3118
  give_away: ApiCart.cart.give_away
3119
3119
  }).then((res) => {
3120
3120
  dialog.dataLoading({ visible: false });
3121
+ console.log("res -- ", res);
3121
3122
  if (res.response.off_line || res.response.is_free) {
3122
3123
  ApiCart.clearCart();
3123
3124
  location.href = res.response.return_url;
3124
3125
  }
3125
3126
  else {
3127
+ ApiCart.clearCart();
3126
3128
  if (res.response.approveLink) {
3127
3129
  location.href = res.response.approveLink;
3128
3130
  }
@@ -3131,7 +3133,6 @@ export class CheckoutIndex {
3131
3133
  $('body').append(`<div id="${id}" style="display: none;">${res.response.form}</div>`);
3132
3134
  document.querySelector(`#${id} #submit`).click();
3133
3135
  }
3134
- ApiCart.clearCart();
3135
3136
  }
3136
3137
  });
3137
3138
  }))}" style="width:200px;">
@@ -3262,7 +3263,7 @@ export class CheckoutIndex {
3262
3263
  }).map((dd) => {
3263
3264
  gift += dd.count;
3264
3265
  });
3265
- return gift < gift_need;
3266
+ return false && gift < gift_need;
3266
3267
  })()) {
3267
3268
  widget.event('error', { title: '請選擇「贈品」' });
3268
3269
  }
@@ -1357,6 +1357,7 @@ export class CheckoutIndex {
1357
1357
 
1358
1358
 
1359
1359
  function refreshCartData() {
1360
+
1360
1361
  const dialog = new ShareDialog(gvc.glitter)
1361
1362
  dialog.dataLoading({visible: true})
1362
1363
  const beta = false
@@ -3242,11 +3243,24 @@ function getBadgeClass(){
3242
3243
  give_away: ApiCart.cart.give_away
3243
3244
  }).then((res) => {
3244
3245
  dialog.dataLoading({visible:false})
3246
+ console.log("res -- " , res)
3245
3247
 
3246
3248
  if (res.response.off_line || res.response.is_free) {
3247
3249
  ApiCart.clearCart()
3248
3250
  location.href = res.response.return_url;
3249
3251
  } else {
3252
+ //todo 如果他是linepay的key值
3253
+ // if (res.response.form.returnCode == "0000"){
3254
+ // console.log("res.response.form.info.paymentUrl.web -- " , res.response.form.info.paymentUrl.web)
3255
+ // location.href = res.response.form.info.paymentUrl.web;
3256
+ // todo 手機跳轉用這個
3257
+ // location.href = res.response.form.info.paymentUrl.app;
3258
+ // }
3259
+ // // todo if 他是paypal的key值 上面應該有select之類的值傳進來 然後做轉址
3260
+ // if (res.response.form.approveLink || 付款方式是PayPal){
3261
+ // location.href = res.response.form.approveLink;
3262
+ // }else{
3263
+ ApiCart.clearCart()
3250
3264
  // todo if 他是paypal的key值 上面應該有select之類的
3251
3265
  if (res.response.approveLink){
3252
3266
  location.href = res.response.approveLink;
@@ -3255,8 +3269,6 @@ function getBadgeClass(){
3255
3269
  $('body').append(`<div id="${id}" style="display: none;">${res.response.form}</div>`);
3256
3270
  (document.querySelector(`#${id} #submit`) as any).click();
3257
3271
  }
3258
-
3259
- ApiCart.clearCart()
3260
3272
  }
3261
3273
  })
3262
3274
  })}" style="width:200px;">
@@ -3391,7 +3403,8 @@ function getBadgeClass(){
3391
3403
  }).map((dd:any)=>{
3392
3404
  gift+=dd.count
3393
3405
  })
3394
- return gift<gift_need
3406
+ // todo 刪掉
3407
+ return false &&gift<gift_need
3395
3408
  })()
3396
3409
  ) {
3397
3410
  widget.event('error', {title: '請選擇「贈品」'});
@@ -298,6 +298,7 @@ export class ProductDetail {
298
298
  minPrice: '',
299
299
  domain: decodeURIComponent(title),
300
300
  status: 'active',
301
+ schedule: true,
301
302
  orderBy: '',
302
303
  with_hide_index: 'true',
303
304
  show_hidden: true,
@@ -340,6 +340,7 @@ export class ProductDetail {
340
340
  minPrice: '',
341
341
  domain: decodeURIComponent(title),
342
342
  status: 'active',
343
+ schedule: true,
343
344
  orderBy: '',
344
345
  with_hide_index: 'true',
345
346
  show_hidden: true,
@@ -282,6 +282,7 @@ export class ProductList {
282
282
  minPrice: minPrice,
283
283
  search: titleMatch,
284
284
  status: 'active',
285
+ schedule: true,
285
286
  orderBy: orderBy,
286
287
  with_hide_index: 'false',
287
288
  id_list: gvc.glitter.getUrlParameter('ai-search') || undefined,
@@ -456,6 +456,7 @@ export class ProductList {
456
456
  minPrice: minPrice as string,
457
457
  search: titleMatch as string,
458
458
  status: 'active',
459
+ schedule: true,
459
460
  orderBy: orderBy as string,
460
461
  with_hide_index: 'false',
461
462
  id_list: gvc.glitter.getUrlParameter('ai-search') || undefined,
@@ -216,14 +216,14 @@ export class UmClass {
216
216
  })
217
217
  .join('');
218
218
  return html ` <div class="account-section">
219
- <div class="section-title mb-4 mt-0 pt-lg-3 um-nav-title">我的帳號</div>
219
+ <div class="section-title mb-4 mt-0 pt-lg-3 um-nav-title px-2">我的帳號</div>
220
220
  ${document.body.clientWidth > 768
221
221
  ? html ` <div class="mx-auto mt-3 um-nav-container">
222
222
  <div class="account-options d-flex gap-3">${buttonHTML}</div>
223
223
  </div>`
224
224
  : html ` <div class="account-navigation w-100">
225
225
  <nav class="nav-links mb-3 mb-md-0">
226
- <div class="nav-options d-flex flex-wrap um-nav-mobile-tags-container px-2">${buttonHTML}</div>
226
+ <div class="nav-options d-flex flex-wrap um-nav-mobile-tags-container px-0">${buttonHTML}</div>
227
227
  </nav>
228
228
  </div>`}
229
229
  </div>`;
@@ -209,14 +209,14 @@ export class UmClass {
209
209
 
210
210
 
211
211
  return html` <div class="account-section">
212
- <div class="section-title mb-4 mt-0 pt-lg-3 um-nav-title">我的帳號</div>
212
+ <div class="section-title mb-4 mt-0 pt-lg-3 um-nav-title px-2">我的帳號</div>
213
213
  ${document.body.clientWidth > 768
214
214
  ? html` <div class="mx-auto mt-3 um-nav-container">
215
215
  <div class="account-options d-flex gap-3">${buttonHTML}</div>
216
216
  </div>`
217
217
  : html` <div class="account-navigation w-100">
218
218
  <nav class="nav-links mb-3 mb-md-0">
219
- <div class="nav-options d-flex flex-wrap um-nav-mobile-tags-container px-2">${buttonHTML}</div>
219
+ <div class="nav-options d-flex flex-wrap um-nav-mobile-tags-container px-0">${buttonHTML}</div>
220
220
  </nav>
221
221
  </div>`}
222
222
  </div>`;
@@ -48,11 +48,11 @@ export class UMRebate {
48
48
  <div class="fa-duotone fa-coins fs-1 d-flex align-items-center justify-content-center"></div>
49
49
  <div class="${isWebsite ? '' : 'd-flex align-items-center gap-2'}">
50
50
  <div class="fw-500 fs-6">現有${vm.rebateConfig.title}</div>
51
- <div class="fw-bold mt-0 mt-md-1 mb-1 um-rb-amount">${vm.amount}</div>
51
+ <div class="fw-bold mt-0 mt-md-1 mb-1 um-rb-amount">${vm.amount.toLocaleString()}</div>
52
52
  </div>
53
53
  </div>
54
54
  <div class="d-flex align-items-center">
55
- <div class="d-flex align-items-center gap-3">${vm.oldestText}</div>
55
+ <div class="d-flex align-items-center gap-3">${vm.oldestText.replace(`@{{rebate_title}}`, vm.rebateConfig.title)}</div>
56
56
  </div>
57
57
  </div>
58
58
  <div class="col-12 mt-2" style="min-height: 500px;">
@@ -61,11 +61,11 @@ export class UMRebate {
61
61
  if (vm.dataList.length === 0) {
62
62
  return html `<div class="d-flex align-items-center justify-content-center flex-column w-100 mx-auto">
63
63
  <lottie-player
64
- style="max-width: 100%;width: 300px;"
65
- src="https://assets10.lottiefiles.com/packages/lf20_rc6CDU.json"
66
- speed="1"
67
- loop="true"
68
- background="transparent"
64
+ style="max-width: 100%;width: 300px;"
65
+ src="https://assets10.lottiefiles.com/packages/lf20_rc6CDU.json"
66
+ speed="1"
67
+ loop="true"
68
+ background="transparent"
69
69
  ></lottie-player>
70
70
  <span class="mb-5 fs-5">目前沒有取得${vm.rebateConfig.title}呦</span>
71
71
  </div>`;
@@ -139,12 +139,12 @@ export class UMRebate {
139
139
  ${vm.dataList
140
140
  .map((item) => {
141
141
  return html `<div class="w-100 d-sm-flex py-5 um-td-bar">
142
- ${formatText(item)
142
+ ${formatText(item)
143
143
  .map((dd, index) => {
144
144
  return html `<div class="um-td" style="flex: ${flexList[index]}">${dd}</div>`;
145
145
  })
146
146
  .join('')}
147
- </div>`;
147
+ </div>`;
148
148
  })
149
149
  .join('')}
150
150
  `;
@@ -153,12 +153,12 @@ export class UMRebate {
153
153
  ${vm.dataList
154
154
  .map((item) => {
155
155
  return html `<div class="um-mobile-area">
156
- ${formatText(item)
156
+ ${formatText(item)
157
157
  .map((dd, index) => {
158
158
  return html `<div class="um-mobile-text">${header[index].title}: ${dd}</div>`;
159
159
  })
160
160
  .join('')}
161
- </div>`;
161
+ </div>`;
162
162
  })
163
163
  .join('')}
164
164
  </div> `;
@@ -176,6 +176,7 @@ export class UMRebate {
176
176
  if (loadings.view) {
177
177
  gvc.addMtScript([{ src: `https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js` }], () => {
178
178
  Promise.all([
179
+ UmClass.getRebateInfo(),
179
180
  new Promise((resolve) => {
180
181
  ApiShop.getRebate({}).then((res) => __awaiter(this, void 0, void 0, function* () {
181
182
  if (res.result && res.response.sum) {
@@ -199,7 +200,7 @@ export class UMRebate {
199
200
  if (!(oldest.remain && oldest.deadline)) {
200
201
  resolve('');
201
202
  }
202
- resolve(html `您尚有 ${oldest.remain} 元${vm.rebateConfig.title}<br />將於 ${glitter.ut.dateFormat(new Date(oldest.deadline), 'yyyy/MM/dd hh:mm')} 到期`);
203
+ resolve(html `您尚有 ${oldest.remain.toLocaleString('')} @{{rebate_title}}<br/>將於 ${glitter.ut.dateFormat(new Date(oldest.deadline), 'yyyy/MM/dd hh:mm')} 到期`);
203
204
  }));
204
205
  }),
205
206
  new Promise((resolve) => {
@@ -215,13 +216,12 @@ export class UMRebate {
215
216
  resolve([]);
216
217
  }
217
218
  }));
218
- }),
219
- UmClass.getRebateInfo(),
219
+ })
220
220
  ]).then((dataList) => {
221
- vm.amount = dataList[0];
222
- vm.oldestText = dataList[1];
223
- vm.dataList = dataList[2];
224
- vm.rebateConfig = dataList[3];
221
+ vm.rebateConfig = dataList[0];
222
+ vm.amount = dataList[1];
223
+ vm.oldestText = dataList[2];
224
+ vm.dataList = dataList[3];
225
225
  loadings.view = false;
226
226
  gvc.notifyDataChange(ids.view);
227
227
  });
@@ -63,11 +63,11 @@ export class UMRebate {
63
63
  <div class="fa-duotone fa-coins fs-1 d-flex align-items-center justify-content-center"></div>
64
64
  <div class="${isWebsite ? '' : 'd-flex align-items-center gap-2'}">
65
65
  <div class="fw-500 fs-6">現有${vm.rebateConfig.title}</div>
66
- <div class="fw-bold mt-0 mt-md-1 mb-1 um-rb-amount">${vm.amount}</div>
66
+ <div class="fw-bold mt-0 mt-md-1 mb-1 um-rb-amount">${vm.amount.toLocaleString()}</div>
67
67
  </div>
68
68
  </div>
69
69
  <div class="d-flex align-items-center">
70
- <div class="d-flex align-items-center gap-3">${vm.oldestText}</div>
70
+ <div class="d-flex align-items-center gap-3">${vm.oldestText.replace(`@{{rebate_title}}`,vm.rebateConfig.title)}</div>
71
71
  </div>
72
72
  </div>
73
73
  <div class="col-12 mt-2" style="min-height: 500px;">
@@ -76,11 +76,11 @@ export class UMRebate {
76
76
  if (vm.dataList.length === 0) {
77
77
  return html`<div class="d-flex align-items-center justify-content-center flex-column w-100 mx-auto">
78
78
  <lottie-player
79
- style="max-width: 100%;width: 300px;"
80
- src="https://assets10.lottiefiles.com/packages/lf20_rc6CDU.json"
81
- speed="1"
82
- loop="true"
83
- background="transparent"
79
+ style="max-width: 100%;width: 300px;"
80
+ src="https://assets10.lottiefiles.com/packages/lf20_rc6CDU.json"
81
+ speed="1"
82
+ loop="true"
83
+ background="transparent"
84
84
  ></lottie-player>
85
85
  <span class="mb-5 fs-5">目前沒有取得${vm.rebateConfig.title}呦</span>
86
86
  </div>`;
@@ -153,37 +153,37 @@ export class UMRebate {
153
153
  return html`
154
154
  <div class="w-100 d-sm-flex py-4 um-th-bar">
155
155
  ${header
156
- .map((item, index) => {
157
- return html`<div class="um-th" style="flex: ${flexList[index]};">${item.title}</div>`;
158
- })
159
- .join('')}
156
+ .map((item, index) => {
157
+ return html`<div class="um-th" style="flex: ${flexList[index]};">${item.title}</div>`;
158
+ })
159
+ .join('')}
160
160
  </div>
161
161
  ${vm.dataList
162
- .map((item) => {
163
- return html`<div class="w-100 d-sm-flex py-5 um-td-bar">
164
- ${formatText(item)
165
- .map((dd, index) => {
166
- return html`<div class="um-td" style="flex: ${flexList[index]}">${dd}</div>`;
167
- })
168
- .join('')}
169
- </div>`;
170
- })
171
- .join('')}
162
+ .map((item) => {
163
+ return html`<div class="w-100 d-sm-flex py-5 um-td-bar">
164
+ ${formatText(item)
165
+ .map((dd, index) => {
166
+ return html`<div class="um-td" style="flex: ${flexList[index]}">${dd}</div>`;
167
+ })
168
+ .join('')}
169
+ </div>`;
170
+ })
171
+ .join('')}
172
172
  `;
173
173
  }
174
174
 
175
175
  return html`<div class="w-100 d-sm-none mb-3 s162413">
176
176
  ${vm.dataList
177
- .map((item) => {
178
- return html`<div class="um-mobile-area">
179
- ${formatText(item)
180
- .map((dd, index) => {
181
- return html`<div class="um-mobile-text">${header[index].title}: ${dd}</div>`;
182
- })
183
- .join('')}
184
- </div>`;
185
- })
186
- .join('')}
177
+ .map((item) => {
178
+ return html`<div class="um-mobile-area">
179
+ ${formatText(item)
180
+ .map((dd, index) => {
181
+ return html`<div class="um-mobile-text">${header[index].title}: ${dd}</div>`;
182
+ })
183
+ .join('')}
184
+ </div>`;
185
+ })
186
+ .join('')}
187
187
  </div> `;
188
188
  })()}
189
189
  </div>
@@ -201,6 +201,7 @@ export class UMRebate {
201
201
  [{ src: `https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js` }],
202
202
  () => {
203
203
  Promise.all([
204
+ UmClass.getRebateInfo(),
204
205
  new Promise<number>((resolve) => {
205
206
  ApiShop.getRebate({}).then(async (res) => {
206
207
  if (res.result && res.response.sum) {
@@ -223,7 +224,7 @@ export class UMRebate {
223
224
  if (!(oldest.remain && oldest.deadline)) {
224
225
  resolve('');
225
226
  }
226
- resolve(html`您尚有 ${oldest.remain} 元${vm.rebateConfig.title}<br />將於 ${glitter.ut.dateFormat(new Date(oldest.deadline), 'yyyy/MM/dd hh:mm')} 到期`);
227
+ resolve(html`您尚有 ${oldest.remain.toLocaleString('')} @{{rebate_title}}<br/>將於 ${glitter.ut.dateFormat(new Date(oldest.deadline), 'yyyy/MM/dd hh:mm')} 到期`);
227
228
  });
228
229
  }),
229
230
  new Promise<RebateInfo[]>((resolve) => {
@@ -238,13 +239,13 @@ export class UMRebate {
238
239
  resolve([]);
239
240
  }
240
241
  });
241
- }),
242
- UmClass.getRebateInfo(),
242
+ })
243
243
  ]).then((dataList) => {
244
- vm.amount = dataList[0];
245
- vm.oldestText = dataList[1];
246
- vm.dataList = dataList[2];
247
- vm.rebateConfig = dataList[3];
244
+ vm.rebateConfig = dataList[0];
245
+ vm.amount = dataList[1];
246
+ vm.oldestText = dataList[2];
247
+ vm.dataList = dataList[3];
248
+
248
249
  loadings.view = false;
249
250
  gvc.notifyDataChange(ids.view);
250
251
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-glitter",
3
- "version": "14.3.9",
3
+ "version": "14.4.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -504,7 +504,11 @@ router.delete('/voucher', async (req, resp) => {
504
504
  });
505
505
  async function redirect_link(req, resp) {
506
506
  try {
507
+ console.log(`req.query=>`, req.query);
507
508
  let return_url = new URL((await redis_js_1.default.getValue(req.query.return)));
509
+ if (req.query.LinePay && req.query.LinePay === 'true') {
510
+ await new shopping_1.Shopping(req.query.appName).releaseCheckout(1, req.query.orderID);
511
+ }
508
512
  if (req.query.payment && req.query.payment == 'true') {
509
513
  const check_id = await redis_js_1.default.getValue(`paypal` + req.query.orderID);
510
514
  const keyData = (await private_config_js_1.Private_config.getConfig({
@@ -771,6 +775,7 @@ router.get('/product', async (req, resp) => {
771
775
  min_price: req.query.min_price,
772
776
  max_price: req.query.max_price,
773
777
  status: req.query.status,
778
+ schedule: req.query.schedule,
774
779
  id_list: req.query.id_list,
775
780
  order_by: (() => {
776
781
  switch (req.query.order_by) {
@@ -809,6 +814,19 @@ router.get('/product', async (req, resp) => {
809
814
  return response_1.default.fail(resp, err);
810
815
  }
811
816
  });
817
+ router.get('/product/domain', async (req, resp) => {
818
+ try {
819
+ const shopping = await new shopping_1.Shopping(req.get('g-app'), req.body.token).getDomain({
820
+ id: req.query.id,
821
+ search: req.query.search,
822
+ domain: req.query.domain,
823
+ });
824
+ return response_1.default.succ(resp, shopping);
825
+ }
826
+ catch (err) {
827
+ return response_1.default.fail(resp, err);
828
+ }
829
+ });
812
830
  router.get('/product/variants', async (req, resp) => {
813
831
  var _a, _b;
814
832
  try {