ts-glitter 14.2.8 → 14.3.0
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/cjbt8743y0.json +1 -0
- package/lowcode/Entry.js +29 -9
- package/lowcode/Entry.ts +28 -9
- package/lowcode/backend-manager/bg-recommend.js +4 -6
- package/lowcode/backend-manager/bg-recommend.ts +4 -6
- package/lowcode/cms-plugin/member-setting.js +36 -2
- package/lowcode/cms-plugin/member-setting.ts +36 -1
- package/lowcode/cms-plugin/shopping-rebate-setting.js +21 -6
- package/lowcode/cms-plugin/shopping-rebate-setting.ts +24 -8
- package/lowcode/glitter-base/route/wallet.js +11 -0
- package/lowcode/glitter-base/route/wallet.ts +14 -2
- package/lowcode/glitterBundle/plugins/editor-elem.js +32 -11
- package/lowcode/glitterBundle/plugins/editor-elem.ts +42 -12
- package/lowcode/public-components/checkout/index.js +35 -27
- package/lowcode/public-components/checkout/index.ts +111 -106
- package/lowcode/public-components/product/product-detail.js +182 -171
- package/lowcode/public-components/product/product-detail.ts +214 -196
- package/lowcode/public-components/user-manager/um-class.js +234 -193
- package/lowcode/public-components/user-manager/um-class.ts +230 -189
- package/lowcode/public-components/user-manager/um-rebate.js +13 -8
- package/lowcode/public-components/user-manager/um-rebate.ts +17 -12
- package/lowcode/public-components/user-manager/um-voucher.js +3 -3
- package/lowcode/public-components/user-manager/um-voucher.ts +3 -3
- package/package.json +1 -1
- package/src/api-public/controllers/ai-chat.js.map +1 -1
- package/src/api-public/controllers/app-release.js.map +1 -1
- package/src/api-public/controllers/article.js.map +1 -1
- package/src/api-public/controllers/post.js.map +1 -1
- package/src/api-public/controllers/shop.js +23 -12
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +36 -36
- package/src/api-public/controllers/user.js.map +1 -1
- package/src/api-public/services/EcInvoice.js.map +5 -1
- package/src/api-public/services/ai-robot.js.map +1 -1
- package/src/api-public/services/financial-service.d.ts +1 -0
- package/src/api-public/services/financial-service.js.map +1 -1
- package/src/api-public/services/post.js.map +1 -1
- package/src/api-public/services/rebate.d.ts +1 -0
- package/src/api-public/services/rebate.js +15 -0
- package/src/api-public/services/rebate.js.map +1 -1
- package/src/api-public/services/rebate.ts +21 -5
- package/src/api-public/services/shopping.js +0 -3
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +0 -4
- package/src/index.js +9 -4
- package/src/index.js.map +5 -1
- package/src/index.ts +7 -1
- package/src/services/template.js.map +1 -1
|
@@ -2059,7 +2059,12 @@ ${obj.gvc.bindView(() => {
|
|
|
2059
2059
|
readonly?: boolean;
|
|
2060
2060
|
}) {
|
|
2061
2061
|
const viewId = obj.gvc.glitter.getUUID();
|
|
2062
|
-
const def = () => ({
|
|
2062
|
+
const def = () => ({
|
|
2063
|
+
gvc: obj.gvc,
|
|
2064
|
+
num: obj.default,
|
|
2065
|
+
min: obj.min,
|
|
2066
|
+
max: obj.max,
|
|
2067
|
+
});
|
|
2063
2068
|
return html`${obj.title ? EditorElem.h3(obj.title) : ``}
|
|
2064
2069
|
<div class="d-flex align-items-center">
|
|
2065
2070
|
${obj.gvc.bindView({
|
|
@@ -2071,7 +2076,7 @@ ${obj.gvc.bindView(() => {
|
|
|
2071
2076
|
type="number"
|
|
2072
2077
|
placeholder="${obj.placeHolder}"
|
|
2073
2078
|
onchange="${obj.gvc.event((e) => {
|
|
2074
|
-
const n = this.
|
|
2079
|
+
const n = this.floatInterval({
|
|
2075
2080
|
...def(),
|
|
2076
2081
|
num: e.value,
|
|
2077
2082
|
});
|
|
@@ -2079,14 +2084,14 @@ ${obj.gvc.bindView(() => {
|
|
|
2079
2084
|
obj.callback(n);
|
|
2080
2085
|
obj.gvc.notifyDataChange(viewId);
|
|
2081
2086
|
})}"
|
|
2082
|
-
value="${obj.default !== undefined ? this.
|
|
2087
|
+
value="${obj.default !== undefined ? this.floatInterval(def()) : ''}"
|
|
2083
2088
|
${obj.readonly ? `readonly` : ``}
|
|
2084
2089
|
/>`;
|
|
2085
2090
|
},
|
|
2086
2091
|
divCreate: { class: 'w-100' },
|
|
2087
2092
|
onCreate: () => {
|
|
2088
2093
|
if (!this.checkNumberMinMax(def())) {
|
|
2089
|
-
obj.callback(this.
|
|
2094
|
+
obj.callback(this.floatInterval(def()));
|
|
2090
2095
|
}
|
|
2091
2096
|
},
|
|
2092
2097
|
})}
|
|
@@ -2094,8 +2099,38 @@ ${obj.gvc.bindView(() => {
|
|
|
2094
2099
|
</div> `;
|
|
2095
2100
|
}
|
|
2096
2101
|
|
|
2097
|
-
public static
|
|
2102
|
+
public static floatInterval(obj: { gvc: GVC; num: number | string; min?: number; max?: number; precision?: number }): number {
|
|
2103
|
+
const dialog = new ShareDialog(obj.gvc.glitter);
|
|
2104
|
+
let n = parseFloat(`${obj.num}`);
|
|
2105
|
+
|
|
2106
|
+
// 驗證是否為有效數字
|
|
2107
|
+
if (isNaN(n)) {
|
|
2108
|
+
dialog.errorMessage({ text: '請輸入數字' });
|
|
2109
|
+
}
|
|
2110
|
+
|
|
2111
|
+
// 限制小數位數(如果指定了 precision)
|
|
2112
|
+
if (obj.precision !== undefined && obj.precision >= 0) {
|
|
2113
|
+
n = parseFloat(n.toFixed(obj.precision));
|
|
2114
|
+
}
|
|
2115
|
+
|
|
2116
|
+
// 檢查範圍
|
|
2117
|
+
if (obj.max !== undefined && n > obj.max) {
|
|
2118
|
+
return obj.max;
|
|
2119
|
+
}
|
|
2120
|
+
if (obj.min !== undefined && n < obj.min) {
|
|
2121
|
+
return obj.min;
|
|
2122
|
+
}
|
|
2123
|
+
|
|
2124
|
+
return n;
|
|
2125
|
+
}
|
|
2126
|
+
|
|
2127
|
+
public static numberInterval(obj: { gvc: GVC; num: number | string; min?: number; max?: number }): number {
|
|
2128
|
+
const dialog = new ShareDialog(obj.gvc.glitter);
|
|
2098
2129
|
const n = parseInt(`${obj.num}`, 10);
|
|
2130
|
+
|
|
2131
|
+
if (isNaN(n)) {
|
|
2132
|
+
dialog.errorMessage({ text: '請輸入數字' });
|
|
2133
|
+
}
|
|
2099
2134
|
if (obj.max !== undefined && n > obj.max) {
|
|
2100
2135
|
return obj.max;
|
|
2101
2136
|
}
|
|
@@ -2453,17 +2488,12 @@ ${obj.gvc.bindView(() => {
|
|
|
2453
2488
|
public static editerDialog(par: { gvc: GVC; dialog: (gvc: GVC) => string; width?: string; editTitle?: string; callback?: () => void }) {
|
|
2454
2489
|
return html` <button
|
|
2455
2490
|
type="button"
|
|
2456
|
-
class="btn btn-primary-c
|
|
2457
|
-
style=""
|
|
2491
|
+
class="btn btn-primary-c w-100"
|
|
2458
2492
|
onclick="${par.gvc.event(() => {
|
|
2459
2493
|
const gvc = par.gvc;
|
|
2460
2494
|
NormalPageEditor.toggle({
|
|
2461
2495
|
visible: true,
|
|
2462
|
-
view: `
|
|
2463
|
-
<div class="p-2"
|
|
2464
|
-
style="overflow-y:auto;">
|
|
2465
|
-
${par.dialog(gvc)}
|
|
2466
|
-
</div>`,
|
|
2496
|
+
view: html` <div class="p-2" style="overflow-y:auto;">${par.dialog(gvc)}</div>`,
|
|
2467
2497
|
title: par.editTitle || '',
|
|
2468
2498
|
});
|
|
2469
2499
|
par.callback && (NormalPageEditor.closeEvent = par.callback);
|
|
@@ -18,6 +18,7 @@ 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
20
|
import { Ad } from "../public/ad.js";
|
|
21
|
+
import { ApiWallet } from '../../glitter-base/route/wallet.js';
|
|
21
22
|
const html = String.raw;
|
|
22
23
|
const css = String.raw;
|
|
23
24
|
export class CheckoutIndex {
|
|
@@ -952,6 +953,9 @@ export class CheckoutIndex {
|
|
|
952
953
|
"bank_user": "陳女士",
|
|
953
954
|
"bank_account": "888800004567"
|
|
954
955
|
}
|
|
956
|
+
},
|
|
957
|
+
rebateConfig: {
|
|
958
|
+
title: '購物金'
|
|
955
959
|
}
|
|
956
960
|
};
|
|
957
961
|
const noImageURL = 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg';
|
|
@@ -1392,16 +1396,22 @@ export class CheckoutIndex {
|
|
|
1392
1396
|
}));
|
|
1393
1397
|
})).then((data) => {
|
|
1394
1398
|
vm.cartData = data;
|
|
1395
|
-
|
|
1396
|
-
{
|
|
1397
|
-
|
|
1398
|
-
}
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1399
|
+
ApiWallet.getRebateConfig({ type: 'me' }).then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
1400
|
+
if (res.result && res.response.data) {
|
|
1401
|
+
vm.rebateConfig = res.response.data;
|
|
1402
|
+
}
|
|
1403
|
+
vm.rebateConfig.title = CheckInput.isEmpty(vm.rebateConfig.title) ? '購物金' : vm.rebateConfig.title;
|
|
1404
|
+
gvc.addMtScript([
|
|
1405
|
+
{
|
|
1406
|
+
src: `https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js`,
|
|
1407
|
+
},
|
|
1408
|
+
], () => {
|
|
1409
|
+
loadings.page = false;
|
|
1410
|
+
dialog.dataLoading({ visible: false });
|
|
1411
|
+
gvc.notifyDataChange(['js-cart-count', ids.page]);
|
|
1412
|
+
}, () => {
|
|
1413
|
+
});
|
|
1414
|
+
}));
|
|
1405
1415
|
});
|
|
1406
1416
|
}
|
|
1407
1417
|
else {
|
|
@@ -1900,7 +1910,7 @@ export class CheckoutIndex {
|
|
|
1900
1910
|
let tempRebate = 0;
|
|
1901
1911
|
const dialog = new ShareDialog(gvc.glitter);
|
|
1902
1912
|
return `<div class="${gClass(['price-row', 'text-2'])}">
|
|
1903
|
-
|
|
1913
|
+
<div>${vm.rebateConfig.title}折抵</div>
|
|
1904
1914
|
<div>- NT. ${vm.cartData.use_rebate.toLocaleString()}</div>
|
|
1905
1915
|
</div>
|
|
1906
1916
|
|
|
@@ -1914,7 +1924,7 @@ export class CheckoutIndex {
|
|
|
1914
1924
|
>
|
|
1915
1925
|
<input
|
|
1916
1926
|
class="flex-fill ${gClass('group-input')}"
|
|
1917
|
-
placeholder="
|
|
1927
|
+
placeholder="請輸入${vm.rebateConfig.title}"
|
|
1918
1928
|
style="${document.body.clientWidth < 800 ? `width:calc(100% - 150px) !important;` : ``}"
|
|
1919
1929
|
value="${vm.cartData.use_rebate || ''}"
|
|
1920
1930
|
onchange="${gvc.event((e, event) => {
|
|
@@ -1941,20 +1951,18 @@ export class CheckoutIndex {
|
|
|
1941
1951
|
}));
|
|
1942
1952
|
});
|
|
1943
1953
|
const limit = vm.cartData.total - vm.cartData.shipment_fee + vm.cartData.use_rebate;
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
});
|
|
1954
|
+
if (sum === 0) {
|
|
1955
|
+
dialog.errorMessage({ text: `您的 ${vm.rebateConfig.title} 為 0 點,無法折抵` });
|
|
1956
|
+
return;
|
|
1957
|
+
}
|
|
1949
1958
|
if (tempRebate > Math.min(sum, limit)) {
|
|
1950
1959
|
dialog.errorMessage({ text: `請輸入 0 到 ${Math.min(sum, limit)} 的數值` });
|
|
1960
|
+
return;
|
|
1951
1961
|
}
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
});
|
|
1957
|
-
}
|
|
1962
|
+
ApiCart.setCart((cartItem) => {
|
|
1963
|
+
cartItem.use_rebate = tempRebate;
|
|
1964
|
+
refreshCartData();
|
|
1965
|
+
});
|
|
1958
1966
|
}))}">
|
|
1959
1967
|
套用
|
|
1960
1968
|
</div>
|
|
@@ -1984,13 +1992,13 @@ export class CheckoutIndex {
|
|
|
1984
1992
|
}
|
|
1985
1993
|
const info = vm.cartData.useRebateInfo;
|
|
1986
1994
|
if (info.condition) {
|
|
1987
|
-
return `還差$ ${info.condition.toLocaleString()}
|
|
1995
|
+
return `還差$ ${info.condition.toLocaleString()} 即可使用 ${vm.rebateConfig.title} 折抵`;
|
|
1988
1996
|
}
|
|
1989
1997
|
if (info.limit) {
|
|
1990
|
-
return `您目前剩餘 ${sum || 0}
|
|
1998
|
+
return `您目前剩餘 ${sum || 0} 點 ${vm.rebateConfig.title}<br />此份訂單最多可折抵 ${info.limit.toLocaleString()} 點 ${vm.rebateConfig.title}`;
|
|
1991
1999
|
}
|
|
1992
2000
|
else {
|
|
1993
|
-
return `您目前剩餘 ${sum || 0}
|
|
2001
|
+
return `您目前剩餘 ${sum || 0} 點 ${vm.rebateConfig.title}`;
|
|
1994
2002
|
}
|
|
1995
2003
|
})
|
|
1996
2004
|
};
|
|
@@ -2417,7 +2425,7 @@ export class CheckoutIndex {
|
|
|
2417
2425
|
].join('');
|
|
2418
2426
|
}
|
|
2419
2427
|
catch (e) {
|
|
2420
|
-
console.
|
|
2428
|
+
console.error(e);
|
|
2421
2429
|
return ``;
|
|
2422
2430
|
}
|
|
2423
2431
|
})()}
|
|
@@ -14,6 +14,7 @@ import {Voucher as OriginVoucher, VoucherContent} from '../user-manager/um-vouch
|
|
|
14
14
|
import {PdClass} from "../product/pd-class.js";
|
|
15
15
|
import * as vm from "node:vm";
|
|
16
16
|
import {Ad} from "../public/ad.js";
|
|
17
|
+
import { ApiWallet } from '../../glitter-base/route/wallet.js';
|
|
17
18
|
|
|
18
19
|
const html = String.raw;
|
|
19
20
|
const css = String.raw;
|
|
@@ -958,7 +959,10 @@ export class CheckoutIndex {
|
|
|
958
959
|
"bank_user": "陳女士",
|
|
959
960
|
"bank_account": "888800004567"
|
|
960
961
|
}
|
|
961
|
-
}
|
|
962
|
+
}as any,
|
|
963
|
+
rebateConfig: {
|
|
964
|
+
title: '購物金'
|
|
965
|
+
} as any
|
|
962
966
|
};
|
|
963
967
|
const noImageURL = 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg';
|
|
964
968
|
const classPrefix = Tool.randomString(6);
|
|
@@ -1436,22 +1440,29 @@ export class CheckoutIndex {
|
|
|
1436
1440
|
});
|
|
1437
1441
|
}).then((data) => {
|
|
1438
1442
|
vm.cartData = data;
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
src: `https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js`,
|
|
1443
|
-
},
|
|
1444
|
-
],
|
|
1445
|
-
() => {
|
|
1446
|
-
loadings.page = false;
|
|
1447
|
-
dialog.dataLoading({visible: false})
|
|
1448
|
-
gvc.notifyDataChange(['js-cart-count', ids.page])
|
|
1449
|
-
},
|
|
1450
|
-
() => {
|
|
1443
|
+
ApiWallet.getRebateConfig({ type: 'me' }).then(async (res) => {
|
|
1444
|
+
if (res.result && res.response.data) {
|
|
1445
|
+
vm.rebateConfig = res.response.data;
|
|
1451
1446
|
}
|
|
1452
|
-
|
|
1447
|
+
vm.rebateConfig.title = CheckInput.isEmpty(vm.rebateConfig.title) ? '購物金' : vm.rebateConfig.title;
|
|
1448
|
+
gvc.addMtScript(
|
|
1449
|
+
[
|
|
1450
|
+
{
|
|
1451
|
+
src: `https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js`,
|
|
1452
|
+
},
|
|
1453
|
+
],
|
|
1454
|
+
() => {
|
|
1455
|
+
loadings.page = false;
|
|
1456
|
+
dialog.dataLoading({visible:false})
|
|
1457
|
+
gvc.notifyDataChange(['js-cart-count', ids.page])
|
|
1458
|
+
},
|
|
1459
|
+
() => {
|
|
1460
|
+
}
|
|
1461
|
+
);
|
|
1462
|
+
})
|
|
1463
|
+
|
|
1453
1464
|
});
|
|
1454
|
-
}
|
|
1465
|
+
}else{
|
|
1455
1466
|
gvc.addMtScript(
|
|
1456
1467
|
[
|
|
1457
1468
|
{
|
|
@@ -1996,7 +2007,7 @@ function getBadgeClass(){
|
|
|
1996
2007
|
let tempRebate: number = 0;
|
|
1997
2008
|
const dialog = new ShareDialog(gvc.glitter);
|
|
1998
2009
|
return `<div class="${gClass(['price-row', 'text-2'])}">
|
|
1999
|
-
|
|
2010
|
+
<div>${vm.rebateConfig.title}折抵</div>
|
|
2000
2011
|
<div>- NT. ${vm.cartData.use_rebate.toLocaleString()}</div>
|
|
2001
2012
|
</div>
|
|
2002
2013
|
|
|
@@ -2010,8 +2021,8 @@ function getBadgeClass(){
|
|
|
2010
2021
|
>
|
|
2011
2022
|
<input
|
|
2012
2023
|
class="flex-fill ${gClass('group-input')}"
|
|
2013
|
-
placeholder="
|
|
2014
|
-
style="${document.body.clientWidth
|
|
2024
|
+
placeholder="請輸入${vm.rebateConfig.title}"
|
|
2025
|
+
style="${document.body.clientWidth<800 ? `width:calc(100% - 150px) !important;`:``}"
|
|
2015
2026
|
value="${vm.cartData.use_rebate || ''}"
|
|
2016
2027
|
onchange="${gvc.event((e, event) => {
|
|
2017
2028
|
if (CheckInput.isNumberString(e.value)) {
|
|
@@ -2035,24 +2046,19 @@ function getBadgeClass(){
|
|
|
2035
2046
|
})
|
|
2036
2047
|
});
|
|
2037
2048
|
const limit = vm.cartData.total - vm.cartData.shipment_fee + vm.cartData.use_rebate;
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
// if (subtotal > 0 && useRebate >= 0 && subtotal >= useRebate && remainRebate >= useRebate) {
|
|
2042
|
-
|
|
2043
|
-
console.log({
|
|
2044
|
-
total: vm.cartData.total,
|
|
2045
|
-
use_rebate: vm.cartData.use_rebate,
|
|
2046
|
-
shipment_fee: vm.cartData.shipment_fee,
|
|
2047
|
-
})
|
|
2048
|
-
if (tempRebate > Math.min(sum, limit)) {
|
|
2049
|
-
dialog.errorMessage({text: `請輸入 0 到 ${Math.min(sum, limit)} 的數值`})
|
|
2050
|
-
} else {
|
|
2051
|
-
ApiCart.setCart((cartItem) => {
|
|
2052
|
-
cartItem.use_rebate = tempRebate
|
|
2053
|
-
refreshCartData()
|
|
2054
|
-
})
|
|
2049
|
+
if(sum === 0){
|
|
2050
|
+
dialog.errorMessage({text: `您的 ${vm.rebateConfig.title} 為 0 點,無法折抵` })
|
|
2051
|
+
return;
|
|
2055
2052
|
}
|
|
2053
|
+
if(tempRebate > Math.min(sum, limit) ){
|
|
2054
|
+
dialog.errorMessage({text: `請輸入 0 到 ${ Math.min(sum, limit) } 的數值` })
|
|
2055
|
+
return;
|
|
2056
|
+
}
|
|
2057
|
+
|
|
2058
|
+
ApiCart.setCart((cartItem)=>{
|
|
2059
|
+
cartItem.use_rebate=tempRebate
|
|
2060
|
+
refreshCartData()
|
|
2061
|
+
})
|
|
2056
2062
|
})}">
|
|
2057
2063
|
套用
|
|
2058
2064
|
</div>
|
|
@@ -2080,17 +2086,16 @@ function getBadgeClass(){
|
|
|
2080
2086
|
return '';
|
|
2081
2087
|
}
|
|
2082
2088
|
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
}
|
|
2087
|
-
if (info.limit) {
|
|
2088
|
-
return `您目前剩餘 ${sum || 0} 點購物金<br />此份訂單最多可折抵 ${info.limit.toLocaleString()} 點購物金`
|
|
2089
|
-
} else {
|
|
2090
|
-
return `您目前剩餘 ${sum || 0} 點購物金`
|
|
2091
|
-
}
|
|
2089
|
+
const info = vm.cartData.useRebateInfo;
|
|
2090
|
+
if(info.condition){
|
|
2091
|
+
return `還差$ ${info.condition.toLocaleString()} 即可使用 ${vm.rebateConfig.title} 折抵`
|
|
2092
2092
|
}
|
|
2093
|
-
|
|
2093
|
+
if(info.limit){
|
|
2094
|
+
return `您目前剩餘 ${sum || 0} 點 ${vm.rebateConfig.title}<br />此份訂單最多可折抵 ${info.limit.toLocaleString()} 點 ${vm.rebateConfig.title}`
|
|
2095
|
+
}else{
|
|
2096
|
+
return `您目前剩餘 ${sum || 0} 點 ${vm.rebateConfig.title}`
|
|
2097
|
+
}
|
|
2098
|
+
}}
|
|
2094
2099
|
})
|
|
2095
2100
|
})()}
|
|
2096
2101
|
</div>`
|
|
@@ -2468,67 +2473,67 @@ function getBadgeClass(){
|
|
|
2468
2473
|
})()}</span>
|
|
2469
2474
|
</button>
|
|
2470
2475
|
</div>
|
|
2471
|
-
${(()
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2476
|
+
${(()=>{
|
|
2477
|
+
try {
|
|
2478
|
+
vm.cartData.user_info.custom_form_delivery=vm.cartData.user_info.custom_form_delivery??{};
|
|
2479
|
+
const form_array = JSON.parse(JSON.stringify(this.getShipmentMethod(vm.cartData).find((dd:any)=>{
|
|
2480
|
+
return vm.cartData.user_info.shipment === dd.value
|
|
2481
|
+
}).form));
|
|
2482
|
+
form_array.map((dd: any) => {
|
|
2483
|
+
dd.col = '4';
|
|
2484
|
+
dd.form_config.title_style = {
|
|
2485
|
+
list: [
|
|
2486
|
+
{
|
|
2487
|
+
class: gClass('label') + ' mb-2',
|
|
2488
|
+
style: 'return `color:${glitter.share.globalValue[`theme_color.0.title`]} !important;font-size:16px !important;`',
|
|
2489
|
+
stylist: [],
|
|
2490
|
+
dataType: 'code',
|
|
2491
|
+
style_from: 'code',
|
|
2492
|
+
classDataType: 'static',
|
|
2493
|
+
},
|
|
2494
|
+
],
|
|
2495
|
+
class: 'form-label',
|
|
2496
|
+
style: 'font-size: 20px;font-style: normal;font-weight: 400;line-height: 140%; color:#393939 !important;',
|
|
2497
|
+
stylist: [],
|
|
2498
|
+
version: 'v2',
|
|
2499
|
+
dataType: 'static',
|
|
2500
|
+
style_from: 'code',
|
|
2501
|
+
classDataType: 'static',
|
|
2502
|
+
};
|
|
2503
|
+
dd.form_config.input_style = {
|
|
2504
|
+
list: [
|
|
2505
|
+
{
|
|
2506
|
+
class: gClass('input'),
|
|
2507
|
+
style: 'return `border-radius: ${widget.formData.radius}px !important;`',
|
|
2508
|
+
stylist: [],
|
|
2509
|
+
dataType: 'code',
|
|
2510
|
+
style_from: 'code',
|
|
2511
|
+
classDataType: 'static',
|
|
2512
|
+
},
|
|
2513
|
+
],
|
|
2514
|
+
class: ' mb-3',
|
|
2515
|
+
style: 'background: #FFF;',
|
|
2516
|
+
stylist: [],
|
|
2517
|
+
version: 'v2',
|
|
2518
|
+
dataType: 'static',
|
|
2519
|
+
style_from: 'code',
|
|
2520
|
+
classDataType: 'static',
|
|
2521
|
+
};
|
|
2522
|
+
});
|
|
2523
|
+
return [
|
|
2524
|
+
FormWidget.editorView({
|
|
2525
|
+
gvc: gvc,
|
|
2526
|
+
array: form_array,
|
|
2527
|
+
refresh: () => {
|
|
2528
|
+
this.storeLocalData(vm.cartData)
|
|
2529
|
+
},
|
|
2530
|
+
formData: vm.cartData.user_info.custom_form_delivery,
|
|
2531
|
+
})
|
|
2532
|
+
].join('');
|
|
2533
|
+
}catch (e) {
|
|
2534
|
+
console.error(e)
|
|
2535
|
+
return ``
|
|
2536
|
+
}
|
|
2532
2537
|
})()}
|
|
2533
2538
|
</div>
|
|
2534
2539
|
</section>
|