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.
- package/hwq81jngms.json +1 -0
- package/lhygmbqjwr.json +1 -0
- package/lowcode/Entry.js +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/cms-plugin/filter-options.js +1 -3
- package/lowcode/cms-plugin/filter-options.ts +1 -3
- package/lowcode/cms-plugin/module/product-excel.js +537 -0
- package/lowcode/cms-plugin/module/product-excel.ts +652 -0
- package/lowcode/cms-plugin/shopping-allowance-manager.js +12 -5
- package/lowcode/cms-plugin/shopping-allowance-manager.ts +12 -5
- package/lowcode/cms-plugin/shopping-finance-setting.js +0 -7
- package/lowcode/cms-plugin/shopping-finance-setting.ts +8 -8
- package/lowcode/cms-plugin/shopping-invoice-manager.js +5 -1
- package/lowcode/cms-plugin/shopping-invoice-manager.ts +5 -2
- package/lowcode/cms-plugin/shopping-order-manager.js +8 -0
- package/lowcode/cms-plugin/shopping-order-manager.ts +8 -0
- package/lowcode/cms-plugin/shopping-product-setting.js +61 -638
- package/lowcode/cms-plugin/shopping-product-setting.ts +67 -790
- package/lowcode/jspage/main.ts +0 -1
- package/lowcode/public-components/checkout/index.js +62 -21
- package/lowcode/public-components/checkout/index.ts +64 -21
- package/lowcode/public-components/checkout/index_.js +1724 -412
- package/lowcode/public-components/checkout/index_.ts +2032 -704
- package/lowcode/public-components/product/pd-class.js +51 -1
- package/lowcode/public-components/product/pd-class.ts +55 -2
- package/lowcode/public-components/product/product-detail.js +1 -1
- package/lowcode/public-components/product/product-detail.ts +7 -3
- package/lowcode/public-components/product/product-list.js +55 -0
- package/lowcode/public-components/product/product-list.ts +62 -1
- package/lowcode/public-components/public/ad.js +14 -0
- package/lowcode/public-components/public/ad.ts +15 -0
- package/nmj1s3fc0x.json +1 -0
- package/package.json +7 -4
- package/src/api-public/controllers/shop.js +16 -0
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +27 -3
- package/src/api-public/services/EcInvoice.js +18 -12
- package/src/api-public/services/EcInvoice.js.map +1 -1
- package/src/api-public/services/EcInvoice.ts +19 -14
- package/src/api-public/services/financial-service.d.ts +49 -1
- package/src/api-public/services/financial-service.js +226 -1
- package/src/api-public/services/financial-service.js.map +1 -1
- package/src/api-public/services/financial-service.ts +282 -1
- package/src/api-public/services/shopping.d.ts +2 -2
- package/src/api-public/services/shopping.js +9 -9
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +28 -28
- package/src/helper/glitter-util.d.ts +0 -1
- package/src/helper/glitter-util.js.map +1 -5
- package/src/index.js +108 -89
- package/src/index.js.map +1 -1
- package/src/index.ts +424 -397
- package/y7x8oegu36.json +1 -0
- package/zgp27fxdah.json +1 -0
package/lowcode/jspage/main.ts
CHANGED
|
@@ -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
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
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
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
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
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
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
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
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
|
}
|