ts-glitter 14.2.5 → 14.2.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.
Files changed (54) hide show
  1. package/hwq81jngms.json +1 -0
  2. package/lhygmbqjwr.json +1 -0
  3. package/lowcode/Entry.js +1 -1
  4. package/lowcode/Entry.ts +1 -1
  5. package/lowcode/cms-plugin/filter-options.js +1 -3
  6. package/lowcode/cms-plugin/filter-options.ts +1 -3
  7. package/lowcode/cms-plugin/module/product-excel.js +537 -0
  8. package/lowcode/cms-plugin/module/product-excel.ts +652 -0
  9. package/lowcode/cms-plugin/shopping-allowance-manager.js +12 -5
  10. package/lowcode/cms-plugin/shopping-allowance-manager.ts +12 -5
  11. package/lowcode/cms-plugin/shopping-finance-setting.js +0 -7
  12. package/lowcode/cms-plugin/shopping-finance-setting.ts +8 -8
  13. package/lowcode/cms-plugin/shopping-invoice-manager.js +5 -1
  14. package/lowcode/cms-plugin/shopping-invoice-manager.ts +5 -2
  15. package/lowcode/cms-plugin/shopping-order-manager.js +8 -0
  16. package/lowcode/cms-plugin/shopping-order-manager.ts +8 -0
  17. package/lowcode/cms-plugin/shopping-product-setting.js +61 -638
  18. package/lowcode/cms-plugin/shopping-product-setting.ts +67 -790
  19. package/lowcode/jspage/main.ts +0 -1
  20. package/lowcode/public-components/checkout/index.js +62 -21
  21. package/lowcode/public-components/checkout/index.ts +64 -21
  22. package/lowcode/public-components/checkout/index_.js +1724 -412
  23. package/lowcode/public-components/checkout/index_.ts +2032 -704
  24. package/lowcode/public-components/product/pd-class.js +51 -1
  25. package/lowcode/public-components/product/pd-class.ts +55 -2
  26. package/lowcode/public-components/product/product-detail.js +1 -1
  27. package/lowcode/public-components/product/product-detail.ts +7 -3
  28. package/lowcode/public-components/product/product-list.js +55 -0
  29. package/lowcode/public-components/product/product-list.ts +62 -1
  30. package/lowcode/public-components/public/ad.js +14 -0
  31. package/lowcode/public-components/public/ad.ts +15 -0
  32. package/nmj1s3fc0x.json +1 -0
  33. package/package.json +7 -4
  34. package/src/api-public/controllers/shop.js +16 -0
  35. package/src/api-public/controllers/shop.js.map +1 -1
  36. package/src/api-public/controllers/shop.ts +27 -3
  37. package/src/api-public/services/EcInvoice.js +18 -12
  38. package/src/api-public/services/EcInvoice.js.map +1 -1
  39. package/src/api-public/services/EcInvoice.ts +19 -14
  40. package/src/api-public/services/financial-service.d.ts +49 -1
  41. package/src/api-public/services/financial-service.js +226 -1
  42. package/src/api-public/services/financial-service.js.map +1 -1
  43. package/src/api-public/services/financial-service.ts +282 -1
  44. package/src/api-public/services/shopping.d.ts +2 -2
  45. package/src/api-public/services/shopping.js +9 -9
  46. package/src/api-public/services/shopping.js.map +1 -1
  47. package/src/api-public/services/shopping.ts +28 -28
  48. package/src/helper/glitter-util.d.ts +0 -1
  49. package/src/helper/glitter-util.js.map +1 -5
  50. package/src/index.js +108 -89
  51. package/src/index.js.map +1 -1
  52. package/src/index.ts +424 -397
  53. package/y7x8oegu36.json +1 -0
  54. package/zgp27fxdah.json +1 -0
@@ -37,7 +37,6 @@ const html = String.raw;
37
37
  //
38
38
  const editorContainerID = `HtmlEditorContainer`;
39
39
  init(import.meta.url, (gvc, glitter, gBundle) => {
40
-
41
40
  glitter.share.loading_dialog = (new ShareDialog(gvc.glitter))
42
41
 
43
42
  const css = String.raw;
@@ -17,6 +17,7 @@ import { ApiUser } from "../../glitter-base/route/user.js";
17
17
  import { FormWidget } from "../../official_view_component/official/form.js";
18
18
  import { ShareDialog } from "../../glitterBundle/dialog/ShareDialog.js";
19
19
  import { PdClass } from "../product/pd-class.js";
20
+ import { Ad } from "../public/ad.js";
20
21
  const html = String.raw;
21
22
  const css = String.raw;
22
23
  export class CheckoutIndex {
@@ -1593,7 +1594,7 @@ export class CheckoutIndex {
1593
1594
  ${vm.cartData.voucherList.filter((dd) => {
1594
1595
  return dd.bind.find((d2) => {
1595
1596
  return d2.id === item.id;
1596
- }) && dd.reBackType !== 'giveaway';
1597
+ }) && (dd.reBackType !== 'giveaway') && (dd.reBackType !== 'add_on_items');
1597
1598
  }).map((dd) => {
1598
1599
  return `<div class="fs-6 w-100 " ><i class="fa-solid fa-tickets-perforated me-2"></i>${dd.title}</div>`;
1599
1600
  }).join('<div class="my-1"></div>')}
@@ -3108,14 +3109,20 @@ export class CheckoutIndex {
3108
3109
  distribution_code: ApiCart.cart.distribution_code,
3109
3110
  give_away: ApiCart.cart.give_away
3110
3111
  }).then((res) => {
3112
+ dialog.dataLoading({ visible: false });
3111
3113
  if (res.response.off_line || res.response.is_free) {
3112
3114
  ApiCart.clearCart();
3113
3115
  location.href = res.response.return_url;
3114
3116
  }
3115
3117
  else {
3116
- const id = gvc.glitter.getUUID();
3117
- $('body').append(`<div id="${id}" style="display: none;">${res.response.form}</div>`);
3118
- document.querySelector(`#${id} #submit`).click();
3118
+ if (res.response.form.approveLink) {
3119
+ location.href = res.response.form.approveLink;
3120
+ }
3121
+ else {
3122
+ const id = gvc.glitter.getUUID();
3123
+ $('body').append(`<div id="${id}" style="display: none;">${res.response.form}</div>`);
3124
+ document.querySelector(`#${id} #submit`).click();
3125
+ }
3119
3126
  ApiCart.clearCart();
3120
3127
  }
3121
3128
  });
@@ -3134,6 +3141,31 @@ export class CheckoutIndex {
3134
3141
  },
3135
3142
  divCreate: {},
3136
3143
  onCreate: () => {
3144
+ Ad.gtagEvent('view_cart', {
3145
+ currency: 'TWD',
3146
+ value: vm.cartData.total,
3147
+ items: vm.cartData.lineItems.map((item) => {
3148
+ return {
3149
+ item_id: item.id,
3150
+ item_name: item.title,
3151
+ item_variant: item.spec.join('-'),
3152
+ price: item.sale_price,
3153
+ quantity: item.count,
3154
+ discount: item.discount_price,
3155
+ };
3156
+ }),
3157
+ });
3158
+ Ad.fbqEvent('AddPaymentInfo', {
3159
+ value: vm.cartData.total,
3160
+ currency: 'TWD',
3161
+ contents: vm.cartData.lineItems.map((item) => {
3162
+ return {
3163
+ id: item.id,
3164
+ quantity: item.count,
3165
+ };
3166
+ }),
3167
+ content_ids: vm.cartData.lineItems.map((item) => item.id),
3168
+ });
3137
3169
  },
3138
3170
  };
3139
3171
  })());
@@ -3226,23 +3258,32 @@ export class CheckoutIndex {
3226
3258
  checkString(subData.phone, '收件人電話', 'phone');
3227
3259
  checkString(subData.email, '收件人信箱', 'email');
3228
3260
  if (pass) {
3229
- if (window.gtag) {
3230
- window.gtag('event', 'begin_checkout', {
3231
- currency: 'TWD',
3232
- value: cartData.total,
3233
- coupon: (_a = cartData.code) !== null && _a !== void 0 ? _a : '',
3234
- items: cartData.lineItems.map((item) => {
3235
- return {
3236
- item_id: item.id,
3237
- item_name: item.title,
3238
- item_variant: item.spec.join('-'),
3239
- price: item.sale_price,
3240
- quantity: item.count,
3241
- discount: item.discount_price,
3242
- };
3243
- }),
3244
- });
3245
- }
3261
+ Ad.gtagEvent('begin_checkout', {
3262
+ currency: 'TWD',
3263
+ value: cartData.total,
3264
+ coupon: (_a = cartData.code) !== null && _a !== void 0 ? _a : '',
3265
+ items: cartData.lineItems.map((item) => {
3266
+ return {
3267
+ item_id: item.id,
3268
+ item_name: item.title,
3269
+ item_variant: item.spec.join('-'),
3270
+ price: item.sale_price,
3271
+ quantity: item.count,
3272
+ discount: item.discount_price,
3273
+ };
3274
+ }),
3275
+ });
3276
+ Ad.fbqEvent('Purchase', {
3277
+ value: cartData.total,
3278
+ currency: 'TWD',
3279
+ contents: cartData.lineItems.map((item) => {
3280
+ return {
3281
+ id: item.id,
3282
+ quantity: item.count,
3283
+ };
3284
+ }),
3285
+ content_type: 'product',
3286
+ });
3246
3287
  resolve(subData);
3247
3288
  }
3248
3289
  }
@@ -13,6 +13,7 @@ import {ShareDialog} from "../../glitterBundle/dialog/ShareDialog.js";
13
13
  import {Voucher as OriginVoucher, VoucherContent} from '../user-manager/um-voucher.js'
14
14
  import {PdClass} from "../product/pd-class.js";
15
15
  import * as vm from "node:vm";
16
+ import {Ad} from "../public/ad.js";
16
17
 
17
18
  const html = String.raw;
18
19
  const css = String.raw;
@@ -1652,7 +1653,7 @@ function getBadgeClass(){
1652
1653
  ${vm.cartData.voucherList.filter((dd: any) => {
1653
1654
  return dd.bind.find((d2: any) => {
1654
1655
  return d2.id === item.id
1655
- }) && dd.reBackType!=='giveaway'
1656
+ }) && (dd.reBackType!=='giveaway') && (dd.reBackType!=='add_on_items')
1656
1657
  }).map((dd: any) => {
1657
1658
  return `<div class="fs-6 w-100 " ><i class="fa-solid fa-tickets-perforated me-2"></i>${dd.title}</div>`
1658
1659
  }).join('<div class="my-1"></div>')}
@@ -3236,13 +3237,21 @@ function getBadgeClass(){
3236
3237
  distribution_code: ApiCart.cart.distribution_code,
3237
3238
  give_away: ApiCart.cart.give_away
3238
3239
  }).then((res) => {
3240
+ dialog.dataLoading({visible:false})
3241
+
3239
3242
  if (res.response.off_line || res.response.is_free) {
3240
3243
  ApiCart.clearCart()
3241
3244
  location.href = res.response.return_url;
3242
3245
  } else {
3243
- const id = gvc.glitter.getUUID();
3244
- $('body').append(`<div id="${id}" style="display: none;">${res.response.form}</div>`);
3245
- (document.querySelector(`#${id} #submit`) as any).click();
3246
+ // todo if 他是paypal的key值 上面應該有select之類的
3247
+ if (res.response.form.approveLink){
3248
+ location.href = res.response.form.approveLink;
3249
+ }else{
3250
+ const id = gvc.glitter.getUUID();
3251
+ $('body').append(`<div id="${id}" style="display: none;">${res.response.form}</div>`);
3252
+ (document.querySelector(`#${id} #submit`) as any).click();
3253
+ }
3254
+
3246
3255
  ApiCart.clearCart()
3247
3256
  }
3248
3257
  })
@@ -3260,6 +3269,31 @@ function getBadgeClass(){
3260
3269
  },
3261
3270
  divCreate: {},
3262
3271
  onCreate: () => {
3272
+ Ad.gtagEvent('view_cart', {
3273
+ currency: 'TWD',
3274
+ value: vm.cartData.total,
3275
+ items: vm.cartData.lineItems.map((item: any) => {
3276
+ return {
3277
+ item_id: item.id,
3278
+ item_name: item.title,
3279
+ item_variant: item.spec.join('-'),
3280
+ price: item.sale_price,
3281
+ quantity: item.count,
3282
+ discount: item.discount_price,
3283
+ };
3284
+ }),
3285
+ });
3286
+ Ad.fbqEvent('AddPaymentInfo', {
3287
+ value: vm.cartData.total,
3288
+ currency: 'TWD',
3289
+ contents: vm.cartData.lineItems.map((item: any) => {
3290
+ return {
3291
+ id: item.id,
3292
+ quantity: item.count,
3293
+ };
3294
+ }),
3295
+ content_ids: vm.cartData.lineItems.map((item: any) => item.id),
3296
+ });
3263
3297
  },
3264
3298
  };
3265
3299
  })()
@@ -3358,23 +3392,32 @@ function getBadgeClass(){
3358
3392
  checkString(subData.phone, '收件人電話', 'phone');
3359
3393
  checkString(subData.email, '收件人信箱', 'email');
3360
3394
  if (pass) {
3361
- if ((window as any).gtag) {
3362
- (window as any).gtag('event', 'begin_checkout', {
3363
- currency: 'TWD',
3364
- value: cartData.total,
3365
- coupon: cartData.code ?? '',
3366
- items: cartData.lineItems.map((item: any) => {
3367
- return {
3368
- item_id: item.id,
3369
- item_name: item.title,
3370
- item_variant: item.spec.join('-'),
3371
- price: item.sale_price,
3372
- quantity: item.count,
3373
- discount: item.discount_price,
3374
- };
3375
- }),
3376
- });
3377
- }
3395
+ Ad.gtagEvent('begin_checkout', {
3396
+ currency: 'TWD',
3397
+ value: cartData.total,
3398
+ coupon: cartData.code ?? '',
3399
+ items: cartData.lineItems.map((item: any) => {
3400
+ return {
3401
+ item_id: item.id,
3402
+ item_name: item.title,
3403
+ item_variant: item.spec.join('-'),
3404
+ price: item.sale_price,
3405
+ quantity: item.count,
3406
+ discount: item.discount_price,
3407
+ };
3408
+ }),
3409
+ });
3410
+ Ad.fbqEvent('Purchase', {
3411
+ value: cartData.total,
3412
+ currency: 'TWD',
3413
+ contents: cartData.lineItems.map((item: any) => {
3414
+ return {
3415
+ id: item.id,
3416
+ quantity: item.count,
3417
+ };
3418
+ }),
3419
+ content_type: 'product',
3420
+ });
3378
3421
  resolve(subData);
3379
3422
  }
3380
3423
  }