ts-glitter 17.8.4 → 17.8.5
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
CHANGED
|
@@ -89,7 +89,7 @@ export class Entry {
|
|
|
89
89
|
}
|
|
90
90
|
window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : clockF();
|
|
91
91
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
92
|
-
glitter.share.editerVersion = 'V_17.8.
|
|
92
|
+
glitter.share.editerVersion = 'V_17.8.5';
|
|
93
93
|
glitter.share.start = new Date();
|
|
94
94
|
const vm = {
|
|
95
95
|
appConfig: [],
|
package/lowcode/Entry.ts
CHANGED
|
@@ -90,7 +90,7 @@ export class Entry {
|
|
|
90
90
|
}
|
|
91
91
|
(window as any).renderClock = (window as any).renderClock ?? clockF();
|
|
92
92
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
93
|
-
glitter.share.editerVersion = 'V_17.8.
|
|
93
|
+
glitter.share.editerVersion = 'V_17.8.5';
|
|
94
94
|
glitter.share.start = new Date();
|
|
95
95
|
const vm: {
|
|
96
96
|
appConfig: any;
|
|
@@ -126,22 +126,34 @@ export class ShoppingSettingBasic {
|
|
|
126
126
|
preview_image: '',
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
-
if (postMD.product_category === 'kitchen'
|
|
130
|
-
postMD.variants.
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
return d2
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
129
|
+
if (postMD.product_category === 'kitchen') {
|
|
130
|
+
if (postMD.variants.length > 1) {
|
|
131
|
+
postMD.variants.map((dd) => {
|
|
132
|
+
var _a, _b, _c, _d;
|
|
133
|
+
dd.compare_price = 0;
|
|
134
|
+
dd.sale_price = dd.spec.map((d1, index) => {
|
|
135
|
+
var _a;
|
|
136
|
+
return parseInt((_a = postMD.specs[index].option.find((d2) => {
|
|
137
|
+
return d2.title === d1;
|
|
138
|
+
}).price) !== null && _a !== void 0 ? _a : "0", 10);
|
|
139
|
+
}).reduce((acc, cur) => acc + cur, 0);
|
|
140
|
+
dd.weight = parseFloat((_a = postMD.weight) !== null && _a !== void 0 ? _a : '0');
|
|
141
|
+
dd.v_height = parseFloat((_b = postMD.v_height) !== null && _b !== void 0 ? _b : '0');
|
|
142
|
+
dd.v_width = parseFloat((_c = postMD.v_width) !== null && _c !== void 0 ? _c : '0');
|
|
143
|
+
dd.v_length = parseFloat((_d = postMD.v_length) !== null && _d !== void 0 ? _d : '0');
|
|
144
|
+
dd.shipment_type = postMD.shipment_type;
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
postMD.variants.map((dd) => {
|
|
149
|
+
var _a, _b, _c, _d;
|
|
150
|
+
dd.weight = parseFloat((_a = postMD.weight) !== null && _a !== void 0 ? _a : '0');
|
|
151
|
+
dd.v_height = parseFloat((_b = postMD.v_height) !== null && _b !== void 0 ? _b : '0');
|
|
152
|
+
dd.v_width = parseFloat((_c = postMD.v_width) !== null && _c !== void 0 ? _c : '0');
|
|
153
|
+
dd.v_length = parseFloat((_d = postMD.v_length) !== null && _d !== void 0 ? _d : '0');
|
|
154
|
+
dd.shipment_type = postMD.shipment_type;
|
|
155
|
+
});
|
|
156
|
+
}
|
|
145
157
|
}
|
|
146
158
|
postMD.variants.map((dd) => {
|
|
147
159
|
dd.checked = undefined;
|
|
@@ -1210,7 +1222,7 @@ export class ShoppingSettingBasic {
|
|
|
1210
1222
|
},
|
|
1211
1223
|
};
|
|
1212
1224
|
})),
|
|
1213
|
-
(postMD.variants.length > 1)
|
|
1225
|
+
(postMD.variants.length > 1 || (postMD.product_category === 'kitchen'))
|
|
1214
1226
|
? (() => {
|
|
1215
1227
|
var _a;
|
|
1216
1228
|
if (postMD.product_category === 'kitchen') {
|
|
@@ -1320,59 +1332,61 @@ export class ShoppingSettingBasic {
|
|
|
1320
1332
|
</div>
|
|
1321
1333
|
</div>
|
|
1322
1334
|
`));
|
|
1323
|
-
|
|
1335
|
+
if (postMD.variants.length > 1) {
|
|
1336
|
+
map_.push(BgWidget.mainCard(`
|
|
1324
1337
|
<div class="d-flex flex-column" style="font-size: 16px;font-weight: 700;color:#393939;${postMD.shopee_id ? `` : `margin-bottom: 10px;`}">組合費用
|
|
1325
1338
|
${BgWidget.grayNote('購買金額為用戶選擇的選項價格去進行加總,如未輸入庫存數量則不追蹤庫存')}
|
|
1326
1339
|
</div>
|
|
1327
1340
|
|
|
1328
1341
|
` + obj.gvc.bindView(() => {
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1342
|
+
const vm = {
|
|
1343
|
+
id: obj.gvc.glitter.getUUID()
|
|
1344
|
+
};
|
|
1345
|
+
return {
|
|
1346
|
+
bind: vm.id,
|
|
1347
|
+
view: () => {
|
|
1348
|
+
console.log(`postMD.specs==>`, postMD.specs);
|
|
1349
|
+
return html `
|
|
1337
1350
|
<div class="w-100 d-flex align-items-center border-bottom py-2 border-top">
|
|
1338
1351
|
<div class="fw-500" style="flex:1;">名稱</div>
|
|
1339
1352
|
<div class="fw-500" style="flex:1;">價格</div>
|
|
1340
1353
|
<div class="fw-500" style="flex:1;">庫存</div>
|
|
1341
1354
|
</div>
|
|
1342
1355
|
` + postMD.specs.map((dd) => {
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1356
|
+
return dd.option.map((d1) => {
|
|
1357
|
+
var _a;
|
|
1358
|
+
d1.price = (_a = d1.price) !== null && _a !== void 0 ? _a : 0;
|
|
1359
|
+
return `<div class="w-100 d-flex align-items-center py-2">
|
|
1347
1360
|
<div class="fw-500" style="flex:1;">${dd.title} / ${d1.title}</div>
|
|
1348
1361
|
<div class="fw-50 pe-3" style="flex:1;">${BgWidget.editeInput({
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1362
|
+
gvc: gvc,
|
|
1363
|
+
title: '',
|
|
1364
|
+
default: `${d1.price}`,
|
|
1365
|
+
callback: (text) => {
|
|
1366
|
+
d1.price = parseInt(text, 10);
|
|
1367
|
+
updateVariants();
|
|
1368
|
+
},
|
|
1369
|
+
placeHolder: '價格',
|
|
1370
|
+
type: 'number'
|
|
1371
|
+
})}</div>
|
|
1359
1372
|
<div class="fw-50 " style="flex:1;">${BgWidget.editeInput({
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1373
|
+
gvc: gvc,
|
|
1374
|
+
title: '',
|
|
1375
|
+
default: `${d1.stock}`,
|
|
1376
|
+
callback: (text) => {
|
|
1377
|
+
d1.stock = text;
|
|
1378
|
+
},
|
|
1379
|
+
placeHolder: '不追蹤庫存',
|
|
1380
|
+
type: 'number'
|
|
1381
|
+
})}</div>
|
|
1369
1382
|
</div>`;
|
|
1383
|
+
}).join('');
|
|
1370
1384
|
}).join('');
|
|
1371
|
-
}
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
};
|
|
1375
|
-
}
|
|
1385
|
+
},
|
|
1386
|
+
divCreate: {}
|
|
1387
|
+
};
|
|
1388
|
+
})));
|
|
1389
|
+
}
|
|
1376
1390
|
return map_.join(BgWidget.mbContainer(18));
|
|
1377
1391
|
}
|
|
1378
1392
|
else {
|
|
@@ -146,20 +146,31 @@ export class ShoppingSettingBasic {
|
|
|
146
146
|
preview_image: '',
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
|
-
if (postMD.product_category === 'kitchen'
|
|
150
|
-
postMD.variants.
|
|
151
|
-
dd
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
return d2
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
149
|
+
if (postMD.product_category === 'kitchen') {
|
|
150
|
+
if(postMD.variants.length>1){
|
|
151
|
+
postMD.variants.map((dd) => {
|
|
152
|
+
dd.compare_price=0
|
|
153
|
+
dd.sale_price = dd.spec.map((d1, index) => {
|
|
154
|
+
return parseInt(postMD.specs[index].option.find((d2:any) => {
|
|
155
|
+
return d2.title === d1
|
|
156
|
+
}).price ?? "0",10)
|
|
157
|
+
}).reduce((acc, cur) => acc + cur, 0);
|
|
158
|
+
dd.weight=parseFloat(postMD.weight ?? '0');
|
|
159
|
+
dd.v_height=parseFloat(postMD.v_height ?? '0');
|
|
160
|
+
dd.v_width=parseFloat(postMD.v_width ?? '0');
|
|
161
|
+
dd.v_length=parseFloat(postMD.v_length ?? '0');
|
|
162
|
+
(dd.shipment_type as any)=postMD.shipment_type!!
|
|
163
|
+
})
|
|
164
|
+
}else{
|
|
165
|
+
postMD.variants.map((dd) => {
|
|
166
|
+
dd.weight=parseFloat(postMD.weight ?? '0');
|
|
167
|
+
dd.v_height=parseFloat(postMD.v_height ?? '0');
|
|
168
|
+
dd.v_width=parseFloat(postMD.v_width ?? '0');
|
|
169
|
+
dd.v_length=parseFloat(postMD.v_length ?? '0');
|
|
170
|
+
(dd.shipment_type as any)=postMD.shipment_type!!
|
|
171
|
+
})
|
|
172
|
+
}
|
|
173
|
+
|
|
163
174
|
}
|
|
164
175
|
|
|
165
176
|
postMD.variants.map((dd: any) => {
|
|
@@ -1345,7 +1356,7 @@ export class ShoppingSettingBasic {
|
|
|
1345
1356
|
};
|
|
1346
1357
|
})
|
|
1347
1358
|
),
|
|
1348
|
-
(postMD.variants.length > 1)
|
|
1359
|
+
(postMD.variants.length > 1 || (postMD.product_category === 'kitchen'))
|
|
1349
1360
|
? (() => {
|
|
1350
1361
|
if (postMD.product_category === 'kitchen') {
|
|
1351
1362
|
let map_:string[]=[]
|
|
@@ -1461,62 +1472,64 @@ export class ShoppingSettingBasic {
|
|
|
1461
1472
|
</div>
|
|
1462
1473
|
</div>
|
|
1463
1474
|
`))
|
|
1464
|
-
|
|
1475
|
+
if(postMD.variants.length>1){
|
|
1476
|
+
map_.push(BgWidget.mainCard(`
|
|
1465
1477
|
<div class="d-flex flex-column" style="font-size: 16px;font-weight: 700;color:#393939;${(postMD as any).shopee_id ? `` : `margin-bottom: 10px;`}">組合費用
|
|
1466
1478
|
${BgWidget.grayNote('購買金額為用戶選擇的選項價格去進行加總,如未輸入庫存數量則不追蹤庫存')}
|
|
1467
1479
|
</div>
|
|
1468
1480
|
|
|
1469
1481
|
` + obj.gvc.bindView(() => {
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1482
|
+
const vm = {
|
|
1483
|
+
id: obj.gvc.glitter.getUUID()
|
|
1484
|
+
}
|
|
1485
|
+
return {
|
|
1486
|
+
bind: vm.id,
|
|
1487
|
+
view: () => {
|
|
1488
|
+
console.log(`postMD.specs==>`, postMD.specs)
|
|
1489
|
+
return html`
|
|
1478
1490
|
<div class="w-100 d-flex align-items-center border-bottom py-2 border-top">
|
|
1479
1491
|
<div class="fw-500" style="flex:1;">名稱</div>
|
|
1480
1492
|
<div class="fw-500" style="flex:1;">價格</div>
|
|
1481
1493
|
<div class="fw-500" style="flex:1;">庫存</div>
|
|
1482
1494
|
</div>
|
|
1483
1495
|
` + postMD.specs.map((dd) => {
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1496
|
+
return dd.option.map((d1: any) => {
|
|
1497
|
+
d1.price = d1.price ?? 0;
|
|
1498
|
+
return `<div class="w-100 d-flex align-items-center py-2">
|
|
1487
1499
|
<div class="fw-500" style="flex:1;">${dd.title} / ${d1.title}</div>
|
|
1488
1500
|
<div class="fw-50 pe-3" style="flex:1;">${
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
+
BgWidget.editeInput({
|
|
1502
|
+
gvc: gvc,
|
|
1503
|
+
title: '',
|
|
1504
|
+
default: `${d1.price}`,
|
|
1505
|
+
callback: (text) => {
|
|
1506
|
+
d1.price = parseInt(text,10);
|
|
1507
|
+
updateVariants()
|
|
1508
|
+
},
|
|
1509
|
+
placeHolder: '價格',
|
|
1510
|
+
type: 'number'
|
|
1511
|
+
})
|
|
1512
|
+
}</div>
|
|
1501
1513
|
<div class="fw-50 " style="flex:1;">${
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1514
|
+
BgWidget.editeInput({
|
|
1515
|
+
gvc: gvc,
|
|
1516
|
+
title: '',
|
|
1517
|
+
default: `${d1.stock}`,
|
|
1518
|
+
callback: (text) => {
|
|
1519
|
+
d1.stock = text;
|
|
1520
|
+
},
|
|
1521
|
+
placeHolder: '不追蹤庫存',
|
|
1522
|
+
type: 'number'
|
|
1523
|
+
})
|
|
1524
|
+
}</div>
|
|
1513
1525
|
</div>`
|
|
1526
|
+
}).join('')
|
|
1514
1527
|
}).join('')
|
|
1515
|
-
}
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
}
|
|
1519
|
-
}
|
|
1528
|
+
},
|
|
1529
|
+
divCreate: {}
|
|
1530
|
+
}
|
|
1531
|
+
})))
|
|
1532
|
+
}
|
|
1520
1533
|
return map_.join(BgWidget.mbContainer(18))
|
|
1521
1534
|
} else {
|
|
1522
1535
|
return BgWidget.mainCard(
|