ts-glitter 22.5.7 → 22.5.8
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 +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/backend-manager/bg-product.js +13 -13
- package/lowcode/backend-manager/bg-product.ts +13 -13
- package/lowcode/backend-manager/bg-shopping.js +8 -13
- package/lowcode/backend-manager/bg-shopping.ts +8 -15
- package/lowcode/backend-manager/bg-widget.js +62 -49
- package/lowcode/backend-manager/bg-widget.ts +129 -93
- package/lowcode/cms-plugin/POS-setting.js +30 -9
- package/lowcode/cms-plugin/POS-setting.ts +49 -16
- package/lowcode/cms-plugin/cms-router.js +27 -21
- package/lowcode/cms-plugin/cms-router.ts +116 -101
- package/lowcode/cms-plugin/filter-options.js +25 -17
- package/lowcode/cms-plugin/filter-options.ts +27 -17
- package/lowcode/cms-plugin/module/product-excel.js +2 -0
- package/lowcode/cms-plugin/module/product-excel.ts +2 -0
- package/lowcode/cms-plugin/module/product-setting.js +13 -12
- package/lowcode/cms-plugin/module/product-setting.ts +26 -23
- package/lowcode/cms-plugin/order/order-module.js +91 -68
- package/lowcode/cms-plugin/order/order-module.ts +105 -73
- package/lowcode/cms-plugin/pos-checkout-setting.js +46 -39
- package/lowcode/cms-plugin/pos-checkout-setting.ts +237 -227
- package/lowcode/cms-plugin/pos-config-setting.js +25 -23
- package/lowcode/cms-plugin/pos-config-setting.ts +35 -32
- package/lowcode/cms-plugin/pos-pages/payment-function.js +253 -139
- package/lowcode/cms-plugin/pos-pages/payment-function.ts +405 -279
- package/lowcode/cms-plugin/pos-pages/payment-page.js +348 -267
- package/lowcode/cms-plugin/pos-pages/payment-page.ts +378 -296
- package/lowcode/cms-plugin/pos-pages/pos-function.js +76 -19
- package/lowcode/cms-plugin/pos-pages/pos-function.ts +84 -19
- package/lowcode/cms-plugin/shopping-discount-setting.js +2 -2
- package/lowcode/cms-plugin/shopping-discount-setting.ts +2 -2
- package/lowcode/cms-plugin/shopping-finance-setting.js +1590 -1701
- package/lowcode/cms-plugin/shopping-finance-setting.ts +1967 -2011
- package/lowcode/cms-plugin/shopping-order-manager.js +74 -62
- package/lowcode/cms-plugin/shopping-order-manager.ts +119 -85
- package/lowcode/cms-plugin/shopping-product-text.js +874 -531
- package/lowcode/cms-plugin/shopping-product-text.ts +1656 -1305
- package/lowcode/cms-plugin/shopping-setting-basic.js +152 -124
- package/lowcode/cms-plugin/shopping-setting-basic.ts +315 -247
- package/lowcode/css/editor.css +3 -2
- package/lowcode/glitter-base/global/language.js +5 -3
- package/lowcode/glitter-base/global/language.ts +8 -6
- package/lowcode/glitter-base/global/payment-config.js +6 -0
- package/lowcode/glitter-base/global/payment-config.ts +6 -3
- package/lowcode/public-components/product/pd-class.js +1 -3
- package/lowcode/public-components/product/pd-class.ts +1 -3
- package/lowcode/public-components/user-manager/um-order.js +2 -1
- package/lowcode/public-components/user-manager/um-order.ts +2 -1
- package/package.json +1 -1
- package/src/api-public/controllers/index.js +14 -3
- package/src/api-public/controllers/index.js.map +1 -1
- package/src/api-public/controllers/index.ts +16 -3
- package/src/api-public/controllers/shop.js +14 -7
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +14 -8
- package/src/api-public/services/data-analyze.d.ts +1 -1
- package/src/api-public/services/ezpay/tool.d.ts +0 -1
- package/src/api-public/services/financial-serviceV2.js +7 -17
- package/src/api-public/services/financial-serviceV2.js.map +1 -1
- package/src/api-public/services/shopee.js.map +1 -1
- package/src/api-public/services/updated-table-checked.js +20 -0
- package/src/api-public/services/updated-table-checked.js.map +1 -1
- package/src/api-public/services/updated-table-checked.ts +21 -0
- package/src/app-project/serverless/src/modules/database.d.ts +1 -1
- package/src/app-project/serverless/src/modules/redis.d.ts +1 -1
- package/src/helper/glitter-util.d.ts +0 -1
- package/src/index.js +3 -3
- package/src/index.js.map +13 -1
- package/src/modules/tool.d.ts +2 -0
- package/src/modules/tool.js +7 -0
- package/src/modules/tool.js.map +1 -1
- package/src/modules/tool.ts +7 -0
- package/src/seo-config.js +3 -3
- package/src/seo-config.js.map +9 -1
- package/src/services/private_config.js +11 -0
- package/src/services/private_config.js.map +1 -1
- package/src/services/private_config.ts +11 -0
- package/src/services/saas-table-check.js +12 -0
- package/src/services/saas-table-check.js.map +1 -1
- package/src/services/saas-table-check.ts +12 -0
- package/src/services/ses.js +3 -4
- package/src/services/ses.js.map +1 -1
|
@@ -905,111 +905,112 @@ export class ShoppingSettingBasic {
|
|
|
905
905
|
}
|
|
906
906
|
|
|
907
907
|
function drawProductImageBlock() {
|
|
908
|
-
return BgWidget.mainCard(
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
908
|
+
return BgWidget.mainCard(
|
|
909
|
+
html`<!--繪製商品圖片展示區塊-->
|
|
910
|
+
<div
|
|
911
|
+
class="d-flex align-items-center justify-content-between"
|
|
912
|
+
style="color: #393939;font-size: 16px;font-weight: 700;margin-bottom: 18px;"
|
|
913
|
+
>
|
|
914
|
+
<div class="d-flex align-items-center">圖片${BgWidget.languageInsignia(sel_lan(), 'margin-left:5px;')}</div>
|
|
915
|
+
<div class="d-flex align-items-center gap-2">
|
|
916
|
+
${BgWidget.customButton({
|
|
917
|
+
button: {
|
|
918
|
+
color: 'black',
|
|
919
|
+
size: 'sm',
|
|
920
|
+
},
|
|
921
|
+
text: {
|
|
922
|
+
name: '上傳圖片',
|
|
923
|
+
},
|
|
924
|
+
event: gvc.event(() => {
|
|
925
|
+
EditorElem.uploadFileFunction({
|
|
926
|
+
gvc: gvc,
|
|
927
|
+
callback: (images: any) => {
|
|
928
|
+
const addImage = (urlArray: string[]) => {
|
|
929
|
+
if (urlArray.length > 0) {
|
|
930
|
+
language_data.preview_image.push(...urlArray);
|
|
931
|
+
saveImageLib(urlArray);
|
|
932
|
+
obj.gvc.notifyDataChange('image_view');
|
|
933
|
+
} else {
|
|
934
|
+
dialog.errorMessage({ text: '請選擇至少一張圖片' });
|
|
935
|
+
}
|
|
936
|
+
};
|
|
937
|
+
addImage(images);
|
|
938
|
+
},
|
|
939
|
+
type: `image/*`,
|
|
940
|
+
return_array: true,
|
|
941
|
+
multiple: true,
|
|
942
|
+
});
|
|
943
|
+
}),
|
|
944
|
+
})}
|
|
945
|
+
${BgWidget.customButton({
|
|
946
|
+
button: {
|
|
947
|
+
color: 'black',
|
|
948
|
+
size: 'sm',
|
|
949
|
+
},
|
|
950
|
+
text: {
|
|
951
|
+
name: '從圖片庫選取',
|
|
952
|
+
},
|
|
953
|
+
event: gvc.event(() => {
|
|
954
|
+
imageLibrary.selectImageLibrary(
|
|
955
|
+
gvc,
|
|
956
|
+
urlArray => {
|
|
928
957
|
if (urlArray.length > 0) {
|
|
929
|
-
language_data.preview_image.push(
|
|
930
|
-
|
|
958
|
+
language_data.preview_image.push(
|
|
959
|
+
...urlArray.map((data: any) => {
|
|
960
|
+
return data.data;
|
|
961
|
+
})
|
|
962
|
+
);
|
|
931
963
|
obj.gvc.notifyDataChange('image_view');
|
|
932
964
|
} else {
|
|
933
965
|
dialog.errorMessage({ text: '請選擇至少一張圖片' });
|
|
934
966
|
}
|
|
935
|
-
}
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
})
|
|
942
|
-
})
|
|
943
|
-
|
|
944
|
-
${BgWidget.customButton({
|
|
945
|
-
button: {
|
|
946
|
-
color: 'black',
|
|
947
|
-
size: 'sm',
|
|
948
|
-
},
|
|
949
|
-
text: {
|
|
950
|
-
name: '從圖片庫選取',
|
|
951
|
-
},
|
|
952
|
-
event: gvc.event(() => {
|
|
953
|
-
imageLibrary.selectImageLibrary(
|
|
954
|
-
gvc,
|
|
955
|
-
urlArray => {
|
|
956
|
-
if (urlArray.length > 0) {
|
|
957
|
-
language_data.preview_image.push(
|
|
958
|
-
...urlArray.map((data: any) => {
|
|
959
|
-
return data.data;
|
|
960
|
-
})
|
|
961
|
-
);
|
|
962
|
-
obj.gvc.notifyDataChange('image_view');
|
|
963
|
-
} else {
|
|
964
|
-
dialog.errorMessage({ text: '請選擇至少一張圖片' });
|
|
965
|
-
}
|
|
966
|
-
},
|
|
967
|
-
html` <div class="d-flex flex-column" style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;">
|
|
968
|
-
圖片庫
|
|
969
|
-
</div>`,
|
|
970
|
-
{ mul: true }
|
|
971
|
-
);
|
|
972
|
-
}),
|
|
973
|
-
})}
|
|
967
|
+
},
|
|
968
|
+
html` <div class="d-flex flex-column" style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;">
|
|
969
|
+
圖片庫
|
|
970
|
+
</div>`,
|
|
971
|
+
{ mul: true }
|
|
972
|
+
);
|
|
973
|
+
}),
|
|
974
|
+
})}
|
|
975
|
+
</div>
|
|
974
976
|
</div>
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
}
|
|
995
|
-
|
|
996
|
-
|
|
977
|
+
${obj.gvc.bindView(() => {
|
|
978
|
+
return {
|
|
979
|
+
bind: 'image_view',
|
|
980
|
+
view: () => {
|
|
981
|
+
return (
|
|
982
|
+
html` <div class="my-2"></div>` +
|
|
983
|
+
EditorElem.flexMediaManagerV2({
|
|
984
|
+
gvc: obj.gvc,
|
|
985
|
+
data: language_data.preview_image,
|
|
986
|
+
event: {
|
|
987
|
+
delete: (index: number) => {
|
|
988
|
+
postMD.variants.forEach((variant: any) => {
|
|
989
|
+
if (variant.preview_image === language_data.preview_image[index]) {
|
|
990
|
+
variant.preview_image = language_data.preview_image[0] ?? BgWidget.noImageURL;
|
|
991
|
+
}
|
|
992
|
+
if (variant[`preview_image_${vm.language}`] === language_data.preview_image[index]) {
|
|
993
|
+
variant[`preview_image_${vm.language}`] =
|
|
994
|
+
language_data.preview_image[0] ?? BgWidget.noImageURL;
|
|
995
|
+
}
|
|
996
|
+
});
|
|
997
|
+
ShoppingSettingBasic.updateVariants(gvc, postMD, shipment_config, variantsViewID, obj);
|
|
998
|
+
},
|
|
997
999
|
},
|
|
998
|
-
}
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
}
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1008
|
-
`);
|
|
1000
|
+
})
|
|
1001
|
+
);
|
|
1002
|
+
},
|
|
1003
|
+
divCreate: {
|
|
1004
|
+
class: `d-flex w-100`,
|
|
1005
|
+
style: `overflow-y:scroll;height:180px;`,
|
|
1006
|
+
},
|
|
1007
|
+
};
|
|
1008
|
+
})} `
|
|
1009
|
+
);
|
|
1009
1010
|
}
|
|
1010
1011
|
|
|
1011
1012
|
function drawReserveLocations() {
|
|
1012
|
-
if (postMD.product_category === 'reserve') {
|
|
1013
|
+
if (postMD.product_category === 'reserve' && undefined) {
|
|
1013
1014
|
function getStockStore() {
|
|
1014
1015
|
ApiUser.getPublicConfig('store_manager', 'manager').then((storeData: any) => {
|
|
1015
1016
|
if (storeData.result) {
|
|
@@ -1186,32 +1187,33 @@ export class ShoppingSettingBasic {
|
|
|
1186
1187
|
`;
|
|
1187
1188
|
}
|
|
1188
1189
|
|
|
1189
|
-
return BgWidget.mainCard(
|
|
1190
|
-
|
|
1191
|
-
<div class="d-flex
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1190
|
+
return BgWidget.mainCard(
|
|
1191
|
+
html`<!--繪製預約門市選擇區塊-->
|
|
1192
|
+
<div class="d-flex flex-column" style="gap:18px;">
|
|
1193
|
+
<div class="d-flex align-items-center">
|
|
1194
|
+
服務地點${BgWidget.languageInsignia(sel_lan(), 'margin-left:5px;')}
|
|
1195
|
+
</div>
|
|
1196
|
+
<div class="d-flex flex-wrap" style="gap:12px;">
|
|
1197
|
+
${stockList.length == 0
|
|
1198
|
+
? html` <div class="w-100 d-flex align-items-center justify-content-center tx_gray_16">
|
|
1199
|
+
尚未設置門市,請前往POS實體門市>門市設定
|
|
1200
|
+
</div>`
|
|
1201
|
+
: postMD.reserve_locations.map(drawLocation).join('')}
|
|
1202
|
+
</div>
|
|
1203
|
+
<div
|
|
1204
|
+
class="d-flex justify-content-center align-items-center cursor_pointer"
|
|
1205
|
+
style="gap:4px;color: #36B;"
|
|
1206
|
+
onclick="${gvc.event(() => {
|
|
1207
|
+
popoutSelectLocation(newStoreList => {
|
|
1208
|
+
postMD.reserve_locations = newStoreList;
|
|
1209
|
+
gvc.notifyDataChange(section_ID.reserve_locations);
|
|
1210
|
+
});
|
|
1211
|
+
})}"
|
|
1212
|
+
>
|
|
1213
|
+
新增服務地點 <i class="fa-solid fa-plus"></i>
|
|
1214
|
+
</div>
|
|
1215
|
+
</div> `
|
|
1216
|
+
);
|
|
1215
1217
|
},
|
|
1216
1218
|
divCreate: {},
|
|
1217
1219
|
});
|
|
@@ -1226,23 +1228,24 @@ export class ShoppingSettingBasic {
|
|
|
1226
1228
|
return gvc.bindView({
|
|
1227
1229
|
bind: section_ID.store_product_config_panel,
|
|
1228
1230
|
view: () => {
|
|
1229
|
-
return BgWidget.mainCard(
|
|
1230
|
-
|
|
1231
|
-
<div class="
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1231
|
+
return BgWidget.mainCard(
|
|
1232
|
+
html`<!--繪製單一門市的商品配置面板-->
|
|
1233
|
+
<div class="d-flex flex-column">
|
|
1234
|
+
<div class="tx_700">依門市管理</div>
|
|
1235
|
+
<div class="tx_gray_14">其他門市將預設套用此門市的設定,如需修改,請切換至對應門市進行調整</div>
|
|
1236
|
+
</div>
|
|
1237
|
+
${BgWidget.select({
|
|
1238
|
+
default: postMD.reserve_locations[0].id,
|
|
1239
|
+
gvc: gvc,
|
|
1240
|
+
options: postMD.reserve_locations.map(location => {
|
|
1241
|
+
return {
|
|
1242
|
+
value: location.name,
|
|
1243
|
+
key: location.id,
|
|
1244
|
+
};
|
|
1245
|
+
}),
|
|
1246
|
+
callback(value: any): void {},
|
|
1247
|
+
})} `
|
|
1248
|
+
);
|
|
1246
1249
|
},
|
|
1247
1250
|
divCreate: {},
|
|
1248
1251
|
});
|
|
@@ -1258,14 +1261,15 @@ export class ShoppingSettingBasic {
|
|
|
1258
1261
|
if (postMD.variants.length === 1) {
|
|
1259
1262
|
try {
|
|
1260
1263
|
(postMD.variants[0] as any).editable = true;
|
|
1261
|
-
return
|
|
1262
|
-
<!-- 繪製 編輯商品規格編輯區塊-->
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1264
|
+
return (
|
|
1265
|
+
html` <!-- 繪製 編輯商品規格編輯區塊--> ` +
|
|
1266
|
+
ShoppingProductSetting.editProductSpec({
|
|
1267
|
+
vm: obj.vm,
|
|
1268
|
+
defData: postMD,
|
|
1269
|
+
gvc: gvc,
|
|
1270
|
+
single: true,
|
|
1271
|
+
})
|
|
1272
|
+
);
|
|
1269
1273
|
} catch (e) {
|
|
1270
1274
|
console.error(e);
|
|
1271
1275
|
return '';
|
|
@@ -1298,7 +1302,7 @@ export class ShoppingSettingBasic {
|
|
|
1298
1302
|
dataList: [{ obj: createPage, key: 'page' }],
|
|
1299
1303
|
view: () => {
|
|
1300
1304
|
let returnHTML = html`
|
|
1301
|
-
<!-- 繪製商品規格列表區塊-->
|
|
1305
|
+
<!-- 繪製商品規格列表區塊-->
|
|
1302
1306
|
<div
|
|
1303
1307
|
class="d-flex align-items-center justify-content-between"
|
|
1304
1308
|
style="font-size: 16px;font-weight: 700;"
|
|
@@ -1955,34 +1959,46 @@ export class ShoppingSettingBasic {
|
|
|
1955
1959
|
: '';
|
|
1956
1960
|
}
|
|
1957
1961
|
|
|
1958
|
-
function drawReservationSettings(){
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
+
function drawReservationSettings() {
|
|
1963
|
+
if (postMD.product_category === 'reserve' && undefined) {
|
|
1964
|
+
function drawTitle(title: string, subTitle: string, inputKey: string) {
|
|
1965
|
+
return html`
|
|
1966
|
+
<div class="d-flex flex-column w-100">
|
|
1962
1967
|
<div class="tx_700 ">${title}</div>
|
|
1963
|
-
${subTitle
|
|
1964
|
-
|
|
1965
|
-
|
|
1968
|
+
${subTitle
|
|
1969
|
+
? html`<div class="tx_gray_14" style="margin: 4px 0 8px 0;">${subTitle}</div>`
|
|
1970
|
+
: html`<div style="height: 18px;"></div>`}
|
|
1966
1971
|
<div class="d-flex" style="gap: 18px;">
|
|
1967
|
-
<div
|
|
1968
|
-
|
|
1972
|
+
<div
|
|
1973
|
+
class="d-flex flex-fill align-items-center"
|
|
1974
|
+
style="height: 40px;padding: 0 18px;border-radius: 10px;border: 1px solid #DDD;"
|
|
1975
|
+
>
|
|
1976
|
+
<input class="border-0 h-100 flex-fill" />
|
|
1969
1977
|
<div class="tx_gray_14 ms-auto">小時</div>
|
|
1970
1978
|
</div>
|
|
1971
|
-
<div
|
|
1972
|
-
|
|
1979
|
+
<div
|
|
1980
|
+
class="d-flex flex-fill align-items-center"
|
|
1981
|
+
style="height: 40px;padding: 0 18px;border-radius: 10px;border: 1px solid #DDD;"
|
|
1982
|
+
>
|
|
1983
|
+
<input class="border-0 h-100 flex-fill" />
|
|
1973
1984
|
<div class="tx_gray_14 ms-auto">分鐘</div>
|
|
1974
1985
|
</div>
|
|
1975
1986
|
</div>
|
|
1976
1987
|
</div>
|
|
1977
|
-
|
|
1988
|
+
`;
|
|
1989
|
+
}
|
|
1990
|
+
return BgWidget.mainCard(html`
|
|
1991
|
+
${drawTitle('預設服務時長', '', 'defaultServiceDuration')}
|
|
1992
|
+
<div class="tx_700">預設服務時長</div>
|
|
1993
|
+
`);
|
|
1978
1994
|
}
|
|
1979
1995
|
return ``
|
|
1980
|
-
return BgWidget.mainCard(html`
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
`)
|
|
1996
|
+
// return BgWidget.mainCard(html`
|
|
1997
|
+
// ${drawTitle("預設服務時長" , "" , "defaultServiceDuration")}
|
|
1998
|
+
// <div class="tx_700">
|
|
1999
|
+
// 預設服務時長
|
|
2000
|
+
// </div>
|
|
2001
|
+
// `)
|
|
1986
2002
|
}
|
|
1987
2003
|
|
|
1988
2004
|
ShoppingSettingBasic.updateVariants(gvc, postMD, shipment_config, variantsViewID, obj);
|
|
@@ -3369,53 +3385,110 @@ export class ShoppingSettingBasic {
|
|
|
3369
3385
|
};
|
|
3370
3386
|
})()
|
|
3371
3387
|
)}
|
|
3372
|
-
${
|
|
3373
|
-
.filter(
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
value
|
|
3389
|
-
min
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
gvc
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3388
|
+
${(() => {
|
|
3389
|
+
const fieldsToDisplay = ['sale_price', 'stock'].filter(
|
|
3390
|
+
field => {
|
|
3391
|
+
return (
|
|
3392
|
+
field === 'sale_price' ||
|
|
3393
|
+
document.body.clientWidth > 768
|
|
3394
|
+
);
|
|
3395
|
+
}
|
|
3396
|
+
);
|
|
3397
|
+
|
|
3398
|
+
const renderFields = fieldsToDisplay.map(
|
|
3399
|
+
(field, index) => {
|
|
3400
|
+
// 建立輸入欄位
|
|
3401
|
+
const inputProps = {
|
|
3402
|
+
style:
|
|
3403
|
+
'width: 100%;height: 40px;padding: 0px 18px;border-radius: 10px;border: 1px solid #DDD;background: #FFF;',
|
|
3404
|
+
value: (data as any)[field] ?? 0,
|
|
3405
|
+
min: '0',
|
|
3406
|
+
readonly: index === 1 ? 'readonly' : '',
|
|
3407
|
+
};
|
|
3408
|
+
|
|
3409
|
+
// 處理點擊事件 - 庫存編輯對話框
|
|
3410
|
+
const clickHandler =
|
|
3411
|
+
index === 1
|
|
3412
|
+
? gvc.event(() => {
|
|
3413
|
+
ProductSetting.showBatchEditDialog({
|
|
3414
|
+
gvc: gvc,
|
|
3415
|
+
postMD: postMD,
|
|
3416
|
+
selected: postMD.variants,
|
|
3417
|
+
callback: () => {
|
|
3418
|
+
gvc.notifyDataChange(vm.id);
|
|
3419
|
+
},
|
|
3420
|
+
});
|
|
3421
|
+
})
|
|
3422
|
+
: '';
|
|
3423
|
+
|
|
3424
|
+
// 處理輸入驗證 - 只允許數字
|
|
3425
|
+
const inputHandler = gvc.event(e => {
|
|
3426
|
+
const regex = /^[0-9]*$/;
|
|
3427
|
+
if (!regex.test(e.value)) {
|
|
3428
|
+
e.value = e.value
|
|
3429
|
+
.replace(/[^0-9]/g, '')
|
|
3430
|
+
.replace(/e/gi, '');
|
|
3431
|
+
}
|
|
3432
|
+
});
|
|
3433
|
+
|
|
3434
|
+
// 處理變更事件 - 更新數據
|
|
3435
|
+
const changeHandler = gvc.event(e => {
|
|
3436
|
+
(data as any)[field] = e.value;
|
|
3437
|
+
gvc.notifyDataChange(vm.id);
|
|
3438
|
+
});
|
|
3439
|
+
|
|
3440
|
+
// 組合輸入欄位HTML
|
|
3441
|
+
const inputHTML = html`
|
|
3442
|
+
<input
|
|
3443
|
+
style="${inputProps.style}"
|
|
3444
|
+
value="${inputProps.value}"
|
|
3445
|
+
min="${inputProps.min}"
|
|
3446
|
+
${inputProps.readonly}
|
|
3447
|
+
onclick="${clickHandler}"
|
|
3448
|
+
oninput="${inputHandler}"
|
|
3449
|
+
onchange="${changeHandler}"
|
|
3450
|
+
/>
|
|
3451
|
+
`;
|
|
3452
|
+
|
|
3453
|
+
// 如果是庫存且不顯示庫存不足,則顯示破折號
|
|
3454
|
+
if (
|
|
3455
|
+
field === 'stock' &&
|
|
3456
|
+
data.show_understocking === 'false'
|
|
3457
|
+
) {
|
|
3458
|
+
return html`
|
|
3459
|
+
<div
|
|
3460
|
+
class="text-center px-1"
|
|
3461
|
+
style="color: #393939; font-size: 14px; font-weight: 400; cursor: pointer;
|
|
3462
|
+
width: ${document.body.clientWidth > 800
|
|
3463
|
+
? '17.5%;'
|
|
3464
|
+
: 'auto; max-width:140px;'}"
|
|
3465
|
+
onclick="${clickHandler}"
|
|
3466
|
+
>
|
|
3467
|
+
不追蹤庫存
|
|
3468
|
+
</div>
|
|
3469
|
+
`;
|
|
3470
|
+
}
|
|
3471
|
+
|
|
3472
|
+
// 返回欄位容器
|
|
3473
|
+
return html`
|
|
3474
|
+
<div
|
|
3475
|
+
class="text-center px-1"
|
|
3476
|
+
style="color:#393939;font-size: 16px;font-weight: 400;width: ${document
|
|
3477
|
+
.body.clientWidth > 800
|
|
3478
|
+
? '17.5%;'
|
|
3479
|
+
: 'auto;max-width:140px;'}"
|
|
3480
|
+
>
|
|
3481
|
+
${inputHTML}
|
|
3482
|
+
</div>
|
|
3483
|
+
`;
|
|
3484
|
+
}
|
|
3485
|
+
);
|
|
3486
|
+
|
|
3487
|
+
// 最終返回所有欄位的HTML字串
|
|
3488
|
+
const fieldsHtml = renderFields.join('');
|
|
3489
|
+
|
|
3490
|
+
return fieldsHtml;
|
|
3491
|
+
})()}
|
|
3419
3492
|
<div
|
|
3420
3493
|
class="d-none d-sm-block"
|
|
3421
3494
|
style="color:#393939;font-size: 16px;font-weight: 400;width: 20%;"
|
|
@@ -3619,16 +3692,17 @@ ${language_data.seo.content ?? ''}</textarea
|
|
|
3619
3692
|
postMD.active_schedule = original;
|
|
3620
3693
|
},
|
|
3621
3694
|
innerHTML: gvc => {
|
|
3622
|
-
return html` <div class="d-flex flex-column gap-
|
|
3695
|
+
return html` <div class="d-flex flex-column gap-2">
|
|
3623
3696
|
${BgWidget.grayNote(
|
|
3624
|
-
html
|
|
3697
|
+
html`系統會根據所設定的時間,自動將${cat_title}上架或下架`,
|
|
3698
|
+
'margin-bottom: 8px;'
|
|
3625
3699
|
)}
|
|
3626
3700
|
<div
|
|
3627
|
-
class="d-flex
|
|
3701
|
+
class="d-flex ${document.body.clientWidth < 768 ? 'flex-column' : ''}"
|
|
3628
3702
|
style="gap: 12px"
|
|
3629
3703
|
>
|
|
3630
3704
|
<div class="d-flex flex-column">
|
|
3631
|
-
<span class="tx_normal me-2"
|
|
3705
|
+
<span class="tx_normal me-2">上架時間</span>
|
|
3632
3706
|
${BgWidget.editeInput({
|
|
3633
3707
|
gvc: gvc,
|
|
3634
3708
|
title: '',
|
|
@@ -3642,7 +3716,7 @@ ${language_data.seo.content ?? ''}</textarea
|
|
|
3642
3716
|
})}
|
|
3643
3717
|
</div>
|
|
3644
3718
|
<div class="d-flex flex-column">
|
|
3645
|
-
<span class="tx_normal me-2"
|
|
3719
|
+
<span class="tx_normal me-2"> </span>
|
|
3646
3720
|
${BgWidget.editeInput({
|
|
3647
3721
|
gvc: gvc,
|
|
3648
3722
|
title: '',
|
|
@@ -3665,39 +3739,33 @@ ${language_data.seo.content ?? ''}</textarea
|
|
|
3665
3739
|
},
|
|
3666
3740
|
{
|
|
3667
3741
|
key: 'withEnd',
|
|
3668
|
-
name: '
|
|
3742
|
+
name: '下架時間',
|
|
3669
3743
|
innerHtml: html` <div
|
|
3670
|
-
class="d-flex
|
|
3744
|
+
class="d-flex ${document.body.clientWidth < 768 ? 'flex-column' : ''}"
|
|
3671
3745
|
style="gap: 12px"
|
|
3672
3746
|
>
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
placeHolder: '',
|
|
3696
|
-
callback: text => {
|
|
3697
|
-
postMD.active_schedule.endTime = text;
|
|
3698
|
-
},
|
|
3699
|
-
})}
|
|
3700
|
-
</div>
|
|
3747
|
+
${BgWidget.editeInput({
|
|
3748
|
+
gvc: gvc,
|
|
3749
|
+
title: '',
|
|
3750
|
+
type: 'date',
|
|
3751
|
+
style: inputStyle,
|
|
3752
|
+
default: `${original.endDate ?? ''}`,
|
|
3753
|
+
placeHolder: '',
|
|
3754
|
+
callback: text => {
|
|
3755
|
+
postMD.active_schedule.endDate = text;
|
|
3756
|
+
},
|
|
3757
|
+
})}
|
|
3758
|
+
${BgWidget.editeInput({
|
|
3759
|
+
gvc: gvc,
|
|
3760
|
+
title: '',
|
|
3761
|
+
type: 'time',
|
|
3762
|
+
style: inputStyle,
|
|
3763
|
+
default: `${original.endTime ?? ''}`,
|
|
3764
|
+
placeHolder: '',
|
|
3765
|
+
callback: text => {
|
|
3766
|
+
postMD.active_schedule.endTime = text;
|
|
3767
|
+
},
|
|
3768
|
+
})}
|
|
3701
3769
|
</div>`,
|
|
3702
3770
|
},
|
|
3703
3771
|
],
|