ts-glitter 21.9.2 → 21.9.6
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 +1 -1
- package/lowcode/backend-manager/bg-product.ts +2 -1
- package/lowcode/cms-plugin/app-market-install.js +97 -0
- package/lowcode/cms-plugin/app-market-install.ts +123 -0
- package/lowcode/cms-plugin/app-market-published.js +42 -0
- package/lowcode/cms-plugin/app-market-published.ts +70 -0
- package/lowcode/cms-plugin/app-market.js +286 -0
- package/lowcode/cms-plugin/app-market.ts +343 -0
- package/lowcode/cms-plugin/filter-options.js +7 -0
- package/lowcode/cms-plugin/filter-options.ts +10 -0
- package/lowcode/cms-plugin/shopping-information.js +19 -463
- package/lowcode/cms-plugin/shopping-information.ts +50 -582
- package/lowcode/css/editor.css +13 -0
- package/lowcode/glitter-base/global/language.js +6 -0
- package/lowcode/glitter-base/global/language.ts +6 -0
- package/lowcode/glitter-base/route/market.js +43 -0
- package/lowcode/glitter-base/route/market.ts +47 -0
- package/lowcode/glitter-base/route/shopping.js +15 -0
- package/lowcode/glitter-base/route/shopping.ts +24 -5
- package/lowcode/glitterBundle/dialog/dialog.js +2 -2
- package/lowcode/glitterBundle/dialog/dialog.ts +5 -5
- package/lowcode/jspage/function-page/main_editor.js +2 -2
- package/lowcode/jspage/function-page/main_editor.ts +2 -2
- package/lowcode/jspage/function-page/setting_editor.js +27 -0
- package/lowcode/jspage/function-page/setting_editor.ts +27 -0
- package/lowcode/public-components/user-manager/um-order.js +158 -60
- package/lowcode/public-components/user-manager/um-order.ts +229 -73
- package/package.json +1 -1
- package/src/api-public/controllers/app-market.d.ts +3 -0
- package/src/api-public/controllers/app-market.js +51 -0
- package/src/api-public/controllers/app-market.js.map +1 -0
- package/src/api-public/controllers/app-market.ts +59 -0
- package/src/api-public/controllers/index.js +3 -0
- package/src/api-public/controllers/index.js.map +1 -1
- package/src/api-public/controllers/index.ts +3 -0
- package/src/api-public/controllers/shop.js +38 -6
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +94 -61
- package/src/api-public/controllers/user.js +2 -2
- package/src/api-public/controllers/user.js.map +1 -1
- package/src/api-public/controllers/user.ts +2 -3
- package/src/api-public/services/app-market.d.ts +26 -0
- package/src/api-public/services/app-market.js +385 -0
- package/src/api-public/services/app-market.js.map +1 -0
- package/src/api-public/services/app-market.ts +412 -0
- package/src/api-public/services/auto-send-email.js +4 -3
- package/src/api-public/services/auto-send-email.js.map +1 -1
- package/src/api-public/services/auto-send-email.ts +3 -2
- package/src/api-public/services/checkout-event.js +7 -26
- package/src/api-public/services/checkout-event.js.map +1 -1
- package/src/api-public/services/checkout-event.ts +18 -43
- package/src/api-public/services/model/handlePaymentTransaction.js +0 -1
- package/src/api-public/services/model/handlePaymentTransaction.js.map +1 -1
- package/src/api-public/services/model/handlePaymentTransaction.ts +3 -81
- package/src/api-public/services/shopping.d.ts +1 -0
- package/src/api-public/services/shopping.js +7 -7
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +15 -59
- package/src/api-public/services/user.js +2 -2
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +2 -2
- package/src/config.d.ts +1 -0
- package/src/config.js +1 -0
- package/src/config.js.map +1 -1
- package/src/config.ts +1 -0
- package/src/public-config-initial/auto-fcm.d.ts +1 -0
- package/src/public-config-initial/auto-fcm.js +6 -4
- package/src/public-config-initial/auto-fcm.js.map +1 -1
- package/src/public-config-initial/auto-fcm.ts +14 -9
- package/src/services/app.js +7 -17
- package/src/services/app.js.map +1 -1
- package/src/services/backend-service.js +7 -17
- package/src/services/backend-service.js.map +1 -1
|
@@ -137,21 +137,22 @@ export class ShoppingInformation {
|
|
|
137
137
|
const infoModule = new InformationModule(gvc, vm, ShoppingInformation);
|
|
138
138
|
function createSection(title, description) {
|
|
139
139
|
return html `
|
|
140
|
-
<div style="color: #393939; font-size: 16px;">${title}</div>
|
|
140
|
+
<div class="d-flex" style="font-weight: 700;color: #393939; font-size: 16px;line-height: 1.4;gap: 6px;">${title}</div>
|
|
141
141
|
${description
|
|
142
|
-
? html ` <div style="color: #8D8D8D; font-size:
|
|
142
|
+
? html ` <div style="color: #8D8D8D; font-size: 14px; padding-right: 10px;">${description}</div>`
|
|
143
143
|
: ''}
|
|
144
144
|
`;
|
|
145
145
|
}
|
|
146
146
|
function createToggle(title, description, key) {
|
|
147
|
-
|
|
147
|
+
const toggleHtml = html ` <div class="cursor_pointer form-check form-switch m-0 p-0" style="min-width: 50px;">
|
|
148
148
|
<input
|
|
149
149
|
class="form-check-input m-0"
|
|
150
150
|
type="checkbox"
|
|
151
151
|
onchange="${gvc.event(() => (vm.data[key] = !vm.data[key]))}"
|
|
152
152
|
${vm.data[key] ? 'checked' : ''}
|
|
153
153
|
/>
|
|
154
|
-
</div
|
|
154
|
+
</div>`;
|
|
155
|
+
return createRow(html `<div>${title}</div>${toggleHtml}`, description, '');
|
|
155
156
|
}
|
|
156
157
|
function createSelect(title, description, key) {
|
|
157
158
|
return createRow(title, description, html ` <div class="d-flex align-items-center justify-content-center" style="min-width: 150px;">
|
|
@@ -170,9 +171,8 @@ export class ShoppingInformation {
|
|
|
170
171
|
}
|
|
171
172
|
function createRow(title, description, elem) {
|
|
172
173
|
return html `
|
|
173
|
-
${BgWidget.horizontalLine({ margin: 0.5 })}
|
|
174
174
|
<div class="d-flex align-items-center justify-content-between">
|
|
175
|
-
<div class="d-flex flex-column" style="gap:
|
|
175
|
+
<div class="d-flex flex-column" style="gap:4px;">${createSection(title, description)}</div>
|
|
176
176
|
${elem}
|
|
177
177
|
</div>
|
|
178
178
|
`;
|
|
@@ -490,10 +490,8 @@ export class ShoppingInformation {
|
|
|
490
490
|
`;
|
|
491
491
|
},
|
|
492
492
|
function: () => {
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
${createSection('網站功能', '系統將根據您勾選的項目,開放相對應的功能')}
|
|
496
|
-
${BgWidget.inlineCheckBox({
|
|
493
|
+
BgWidget.mainCard(html `
|
|
494
|
+
${BgWidget.inlineCheckBox({
|
|
497
495
|
title: '',
|
|
498
496
|
gvc,
|
|
499
497
|
def: vm.data.web_type,
|
|
@@ -509,459 +507,11 @@ export class ShoppingInformation {
|
|
|
509
507
|
},
|
|
510
508
|
type: 'multiple',
|
|
511
509
|
})}
|
|
512
|
-
${createToggle('啟用 AI 選品', '透過 AI 選品功能,用戶可以使用自然語言描述找到所需商品', 'ai_search')}
|
|
513
|
-
${GlobalUser.getPlan().id > 0
|
|
514
|
-
? createToggle('啟用聊聊功能', '啟用聊聊功能,方便客戶直接於官網前台與您聯繫,並詢問商品詳細內容', 'chat_toggle')
|
|
515
|
-
: ''}
|
|
516
|
-
${createToggle('啟用心願單功能', '方便客戶收藏並管理喜愛的商品清單,隨時查看心儀商品,提升購物體驗與轉換率', 'wishlist')}
|
|
517
|
-
${createToggle('啟用顧客評論功能', '顧客可以對您的商品進行評論', 'customer_comment')}
|
|
518
|
-
${createToggle('啟用 Cookie 聲明', '如需使用廣告追蹤行為,必須啟用 Cookie 聲明,才可發送廣告', 'cookie_check')}
|
|
519
|
-
${createToggle('顯示商品剩餘庫存', '啟用此功能,顧客會在商品頁面看到此商品剩餘的庫存數', 'stock_view')}
|
|
520
|
-
${createToggle('線上商店開放預購商品', '啟用此功能,顧客可以在線上商店的商品無庫存時,進行預購', 'pre_order_status')}
|
|
521
|
-
${createToggle('商品卡片顯示區間價格', '啟用後,若商品有多個規格、不同價位,前台商品卡片將會使用價格區間來顯示,關閉則顯示該商品規格中最低價者', 'interval_price_card')}
|
|
522
|
-
${createToggle('單獨顯示商品特價', '啟用此功能,會將含有特價的商品價格或區間,單獨使用紅字顯示,關閉則採用刪改線的方式呈現特價', 'independent_special_price')}
|
|
523
|
-
${createPickUpModeDialog('取貨號碼', '針對特店取貨功能,開啟取貨號碼功能消費者需告知商家取貨號碼並前往特店取貨')}
|
|
524
|
-
${createCheckoutModeDialog('訂單結算模式', '設定訂單結算模式,可調整顧客累積消費金額、會員等級、數據分析的統計機制')}
|
|
525
|
-
${createInvoiceModeDialog('發票開立時機', '設定發票開立的時機,可在商家想要的時間點,開立並發送訂單發票')}
|
|
526
|
-
</div>
|
|
527
510
|
`);
|
|
528
|
-
},
|
|
529
|
-
global: () => {
|
|
530
511
|
return BgWidget.mainCard(html `
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
const { language_setting } = window.parent.store_info;
|
|
535
|
-
vm.data.language_setting = language_setting;
|
|
536
|
-
function refreshLanguage() {
|
|
537
|
-
gvc.notifyDataChange([id, 'SEO']);
|
|
538
|
-
}
|
|
539
|
-
function renderLanguageOptions() {
|
|
540
|
-
return language_setting.support
|
|
541
|
-
.map((langKey) => {
|
|
542
|
-
const langMap = {
|
|
543
|
-
'en-US': '英文',
|
|
544
|
-
'zh-CN': '簡體中文',
|
|
545
|
-
'zh-TW': '繁體中文',
|
|
546
|
-
};
|
|
547
|
-
const isDefault = langKey === language_setting.def;
|
|
548
|
-
return html `
|
|
549
|
-
<div
|
|
550
|
-
class="px-3 py-1 text-white position-relative d-flex align-items-center justify-content-center"
|
|
551
|
-
style="border-radius: 20px; background: #393939; cursor: pointer; width: 100px;"
|
|
552
|
-
onclick="${gvc.event(() => {
|
|
553
|
-
BgWidget.settingDialog({
|
|
554
|
-
gvc,
|
|
555
|
-
title: '語系設定',
|
|
556
|
-
innerHTML: gvc => html `
|
|
557
|
-
<div class="w-100 d-flex align-items-center justify-content-end" style="gap:10px;">
|
|
558
|
-
${BgWidget.danger(gvc.event(() => {
|
|
559
|
-
vm.data.language_setting.support = vm.data.language_setting.support.filter((d) => d !== langKey);
|
|
560
|
-
refreshLanguage();
|
|
561
|
-
gvc.closeDialog();
|
|
562
|
-
}), '刪除語系')}
|
|
563
|
-
${BgWidget.save(gvc.event(() => {
|
|
564
|
-
vm.data.language_setting.def = langKey;
|
|
565
|
-
refreshLanguage();
|
|
566
|
-
gvc.closeDialog();
|
|
567
|
-
}), '設為預設語系')}
|
|
568
|
-
</div>
|
|
569
|
-
`,
|
|
570
|
-
footer_html: () => '',
|
|
571
|
-
width: 400,
|
|
572
|
-
});
|
|
573
|
-
})}"
|
|
574
|
-
>
|
|
575
|
-
${langMap[langKey]}
|
|
576
|
-
${isDefault
|
|
577
|
-
? html ` <div
|
|
578
|
-
class="position-absolute text-white rounded-2 px-2"
|
|
579
|
-
style="top: -12px; right: -10px; height:20px; font-size: 11px; background: #ff6c02;"
|
|
580
|
-
>
|
|
581
|
-
預設
|
|
582
|
-
</div>`
|
|
583
|
-
: ''}
|
|
584
|
-
</div>
|
|
585
|
-
`;
|
|
586
|
-
})
|
|
587
|
-
.join('');
|
|
588
|
-
}
|
|
589
|
-
function createMultiLanguage() {
|
|
590
|
-
return html `
|
|
591
|
-
<div class="d-flex flex-column mb-2" style="gap:8px;">
|
|
592
|
-
<div style="color: #393939;font-size: 16px;">
|
|
593
|
-
多國語言<span
|
|
594
|
-
class="cursor_pointer ms-1"
|
|
595
|
-
style="font-size: 13px;color:#36B;"
|
|
596
|
-
onclick="${gvc.event(() => {
|
|
597
|
-
BgWidget.selectLanguage({});
|
|
598
|
-
})}"
|
|
599
|
-
>
|
|
600
|
-
管理語言包
|
|
601
|
-
</span>
|
|
602
|
-
</div>
|
|
603
|
-
<div style="color: #8D8D8D;font-size: 13px;">初次載入時優先預設為用戶裝置所設定的語言</div>
|
|
604
|
-
<div class="d-flex mt-3" style="gap:15px;">
|
|
605
|
-
${renderLanguageOptions()}
|
|
606
|
-
${allLanguages.length !== language_setting.support.length
|
|
607
|
-
? html `
|
|
608
|
-
<div
|
|
609
|
-
class="d-flex align-items-center justify-content-center cursor_pointer"
|
|
610
|
-
style="color: #36B; font-size: 16px; font-weight: 400;"
|
|
611
|
-
onclick="${gvc.event(() => {
|
|
612
|
-
let add = '';
|
|
613
|
-
BgWidget.settingDialog({
|
|
614
|
-
gvc,
|
|
615
|
-
title: '新增語系',
|
|
616
|
-
innerHTML: gvc => {
|
|
617
|
-
const availableLanguages = [
|
|
618
|
-
{ key: 'en-US', value: '英文' },
|
|
619
|
-
{ key: 'zh-CN', value: '簡體中文' },
|
|
620
|
-
{ key: 'zh-TW', value: '繁體中文' },
|
|
621
|
-
].filter(lang => !language_setting.support.includes(lang.key));
|
|
622
|
-
add = availableLanguages[0].key;
|
|
623
|
-
return BgWidget.select({
|
|
624
|
-
gvc,
|
|
625
|
-
default: add,
|
|
626
|
-
options: availableLanguages,
|
|
627
|
-
callback: text => (add = text),
|
|
628
|
-
});
|
|
629
|
-
},
|
|
630
|
-
footer_html: (gvc) => BgWidget.save(gvc.event(() => {
|
|
631
|
-
vm.data.language_setting.support.push(add);
|
|
632
|
-
gvc.closeDialog();
|
|
633
|
-
setTimeout(refreshLanguage, 100);
|
|
634
|
-
}), '新增'),
|
|
635
|
-
width: 300,
|
|
636
|
-
});
|
|
637
|
-
})}"
|
|
638
|
-
>
|
|
639
|
-
<div>新增語系</div>
|
|
640
|
-
<div class="d-flex align-items-center justify-content-center p-2">
|
|
641
|
-
<i class="fa-solid fa-plus fs-6" style="font-size: 16px;" aria-hidden="true"></i>
|
|
642
|
-
</div>
|
|
643
|
-
</div>
|
|
644
|
-
`
|
|
645
|
-
: ''}
|
|
646
|
-
</div>
|
|
647
|
-
</div>
|
|
648
|
-
`;
|
|
649
|
-
}
|
|
650
|
-
return {
|
|
651
|
-
bind: id,
|
|
652
|
-
view: () => {
|
|
653
|
-
return html ` <div class="d-flex flex-column gap-2">
|
|
654
|
-
${[
|
|
655
|
-
createMultiLanguage(),
|
|
656
|
-
createSelect('商店貨幣', '統一設定商品幣別,前台將依據商品幣別進行換算顯示', 'currency_code'),
|
|
657
|
-
createToggle('啟用多國貨幣', '啟用多國貨幣功能,將自動根據用戶 IP 所在地區進行幣值轉換', 'multi_currency'),
|
|
658
|
-
vm.data.multi_currency
|
|
659
|
-
? createToggle('啟用貨幣切換', '是否開放用戶於前台自行切換幣別進行顯示', 'switch_currency')
|
|
660
|
-
: '',
|
|
661
|
-
createSelect('預設顯示幣別', '當查無相關幣別支援國家,前台將預設使用此幣別進行顯示', 'currency_code_f_def'),
|
|
662
|
-
]
|
|
663
|
-
.filter(item => item.length > 0)
|
|
664
|
-
.join('')}
|
|
665
|
-
</div>`;
|
|
666
|
-
},
|
|
667
|
-
};
|
|
668
|
-
})}
|
|
669
|
-
`);
|
|
670
|
-
},
|
|
671
|
-
};
|
|
672
|
-
const typeMap2 = {
|
|
673
|
-
basic: () => {
|
|
674
|
-
return html `
|
|
675
|
-
${gvc.bindView({
|
|
676
|
-
bind: 'basic',
|
|
677
|
-
view: () => {
|
|
678
|
-
var _a;
|
|
679
|
-
const createInput = (title, key, placeHolder) => {
|
|
680
|
-
var _a;
|
|
681
|
-
return html ` <div class="col-12 col-md-6">
|
|
682
|
-
${BgWidget.editeInput({
|
|
683
|
-
gvc,
|
|
684
|
-
title,
|
|
685
|
-
default: (_a = vm.data[key]) !== null && _a !== void 0 ? _a : '',
|
|
686
|
-
callback: text => (vm.data[key] = text),
|
|
687
|
-
placeHolder,
|
|
688
|
-
divStyle: 'width:100%;',
|
|
689
|
-
})}
|
|
690
|
-
</div>`;
|
|
691
|
-
};
|
|
692
|
-
return BgWidget.mainCard(html `
|
|
693
|
-
<div class="d-flex flex-column" style="gap:18px;">
|
|
694
|
-
<div class="tx_normal fw-bold">關於商店</div>
|
|
695
|
-
<div class="row guide6-3">
|
|
696
|
-
${createInput('商店名稱', 'shop_name', '請輸入商店名稱')}
|
|
697
|
-
<div class="col-12 col-md-6">
|
|
698
|
-
<div class="tx_normal fw-normal">商店類別</div>
|
|
699
|
-
${BgWidget.select({
|
|
700
|
-
gvc,
|
|
701
|
-
default: (_a = vm.data.category) !== null && _a !== void 0 ? _a : '',
|
|
702
|
-
callback: key => {
|
|
703
|
-
vm.data.category = key;
|
|
704
|
-
},
|
|
705
|
-
options: [...new Set(shopCategory)].map(item => ({ key: item, value: item })),
|
|
706
|
-
style: 'width: 100%; margin: 8px 0;',
|
|
707
|
-
})}
|
|
708
|
-
</div>
|
|
709
|
-
${createInput('電子信箱', 'email', '請輸入電子信箱')}
|
|
710
|
-
${createInput('聯絡電話', 'phone', '請輸入聯絡電話')}
|
|
711
|
-
${createInput('店家地址', 'address', '請輸入店家地址')}
|
|
712
|
-
${createInput('統一編號', 'ubn', '請輸入統一編號')}
|
|
713
|
-
</div>
|
|
714
|
-
</div>
|
|
715
|
-
`, '');
|
|
716
|
-
},
|
|
717
|
-
})}
|
|
718
|
-
<div style="margin-top: 24px;"></div>
|
|
719
|
-
${gvc.bindView(() => {
|
|
720
|
-
const editorVM = window.parent.glitter.share.editorViewModel;
|
|
721
|
-
const isShopnex = editorVM.domain.includes('shopnex.tw');
|
|
722
|
-
let domainType = isShopnex ? 'free' : 'custom';
|
|
723
|
-
let domainText = editorVM.domain.replace('.shopnex.tw', '');
|
|
724
|
-
const updateDomain = (text) => {
|
|
725
|
-
domainText = text;
|
|
726
|
-
};
|
|
727
|
-
const applyDomain = () => {
|
|
728
|
-
if (!domainText)
|
|
729
|
-
return dialog.errorMessage({ text: '請輸入網域名稱' });
|
|
730
|
-
if (editorVM.domain === domainText)
|
|
731
|
-
return dialog.errorMessage({ text: '此網域已部署完成' });
|
|
732
|
-
dialog.dataLoading({ visible: true });
|
|
733
|
-
const { appName, saasConfig } = window.parent;
|
|
734
|
-
const apiMethod = domainType === 'custom' ? saasConfig.api.setDomain : saasConfig.api.setSubDomain;
|
|
735
|
-
const payload = domainType === 'custom'
|
|
736
|
-
? { domain: domainText, app_name: appName }
|
|
737
|
-
: { sub_domain: domainText, app_name: appName };
|
|
738
|
-
apiMethod(Object.assign(Object.assign({}, payload), { token: saasConfig.config.token })).then((res) => {
|
|
739
|
-
dialog.dataLoading({ visible: false });
|
|
740
|
-
if (res.result) {
|
|
741
|
-
dialog.successMessage({ text: '網域部署成功' });
|
|
742
|
-
editorVM.domain = domainType === 'custom' ? domainText : `${domainText}.shopnex.tw`;
|
|
743
|
-
}
|
|
744
|
-
else {
|
|
745
|
-
dialog.errorMessage({ text: '網域部署失敗' });
|
|
746
|
-
}
|
|
747
|
-
});
|
|
748
|
-
};
|
|
749
|
-
return {
|
|
750
|
-
bind: 'domain',
|
|
751
|
-
view: () => BgWidget.mainCard(html `
|
|
752
|
-
<div class="d-flex flex-column" style="gap: 8px">
|
|
753
|
-
<div class="tx_normal fw-bold">網域設定</div>
|
|
754
|
-
<div class="d-flex align-items-center" style="gap:8px;">
|
|
755
|
-
${BgWidget.inlineCheckBox({
|
|
756
|
-
gvc,
|
|
757
|
-
title: '',
|
|
758
|
-
def: domainType,
|
|
759
|
-
array: [
|
|
760
|
-
{ title: '子網域', value: 'free' },
|
|
761
|
-
{ title: '獨立網域', value: 'custom' },
|
|
762
|
-
],
|
|
763
|
-
callback: text => {
|
|
764
|
-
domainType = text;
|
|
765
|
-
domainText =
|
|
766
|
-
isShopnex === (text === 'free') ? editorVM.domain.replace('.shopnex.tw', '') : '';
|
|
767
|
-
gvc.notifyDataChange('domain');
|
|
768
|
-
},
|
|
769
|
-
})}
|
|
770
|
-
${this.goDaddyDoc(gvc)}
|
|
771
|
-
</div>
|
|
772
|
-
<div class="d-flex w-100" style="border:1px solid #DDD;border-radius:10px;overflow:hidden;">
|
|
773
|
-
<div style="padding: 9px 10px; background: #EAEAEA; border-radius: 10px 0 0 10px;">
|
|
774
|
-
https://
|
|
775
|
-
</div>
|
|
776
|
-
<input
|
|
777
|
-
class="flex-fill border-0 px-2"
|
|
778
|
-
value="${domainText}"
|
|
779
|
-
onchange="${gvc.event(e => updateDomain(e.value))}"
|
|
780
|
-
/>
|
|
781
|
-
<div
|
|
782
|
-
class="${domainType === 'custom' ? 'd-none' : ''}"
|
|
783
|
-
style="padding: 9px 10px; background: #EAEAEA; border-radius: 0 10px 10px 0;"
|
|
784
|
-
>
|
|
785
|
-
.shopnex.tw
|
|
786
|
-
</div>
|
|
787
|
-
</div>
|
|
788
|
-
<div class="d-flex justify-content-end">${BgWidget.save(gvc.event(applyDomain), '申請')}</div>
|
|
789
|
-
</div>
|
|
790
|
-
`, 'guide6-5'),
|
|
791
|
-
};
|
|
792
|
-
})}
|
|
793
|
-
<div style="margin-top: 24px;"></div>
|
|
794
|
-
${BgWidget.card([
|
|
795
|
-
html ` <div class="d-flex align-items-center">
|
|
796
|
-
<div class="d-flex flex-column">
|
|
797
|
-
<div class="tx_normal fw-bold">301轉址</div>
|
|
798
|
-
<div style="color: #8D8D8D; font-size: 13px; padding-right: 10px;">
|
|
799
|
-
設定301轉址,將舊有連結導向至新連結
|
|
800
|
-
</div>
|
|
801
|
-
</div>
|
|
802
|
-
<div class="flex-fill"></div>
|
|
803
|
-
${BgWidget.customButton({
|
|
804
|
-
button: { color: 'snow', size: 'md' },
|
|
805
|
-
text: { name: '設定' },
|
|
806
|
-
event: gvc.event(() => __awaiter(this, void 0, void 0, function* () {
|
|
807
|
-
var _a;
|
|
808
|
-
let domain_301 = (_a = (yield ApiUser.getPublicConfig('domain_301', 'manager')).response.value.list) !== null && _a !== void 0 ? _a : [];
|
|
809
|
-
function plusEvent() {
|
|
810
|
-
const plus_data = {
|
|
811
|
-
legacy_url: '',
|
|
812
|
-
new_url: '',
|
|
813
|
-
};
|
|
814
|
-
BgWidget.settingDialog({
|
|
815
|
-
gvc,
|
|
816
|
-
title: '新增網址',
|
|
817
|
-
width: 600,
|
|
818
|
-
innerHTML: gvc => {
|
|
819
|
-
return [
|
|
820
|
-
BgWidget.editeInput({
|
|
821
|
-
gvc: gvc,
|
|
822
|
-
title: '舊網址',
|
|
823
|
-
default: plus_data.legacy_url || '',
|
|
824
|
-
placeHolder: '請輸入相對路徑(例如:/blogs/sample-page)',
|
|
825
|
-
callback: text => {
|
|
826
|
-
plus_data.legacy_url = text;
|
|
827
|
-
},
|
|
828
|
-
}),
|
|
829
|
-
BgWidget.editeInput({
|
|
830
|
-
gvc: gvc,
|
|
831
|
-
title: '新網址',
|
|
832
|
-
default: plus_data.new_url || '',
|
|
833
|
-
placeHolder: '請輸入相對路徑(例如:/blogs/sample-page)',
|
|
834
|
-
callback: text => {
|
|
835
|
-
plus_data.new_url = text;
|
|
836
|
-
},
|
|
837
|
-
}),
|
|
838
|
-
].join('');
|
|
839
|
-
},
|
|
840
|
-
footer_html: gvc => {
|
|
841
|
-
return [
|
|
842
|
-
BgWidget.cancel(gvc.event(() => {
|
|
843
|
-
gvc.closeDialog();
|
|
844
|
-
})),
|
|
845
|
-
BgWidget.save(gvc.event(() => __awaiter(this, void 0, void 0, function* () {
|
|
846
|
-
if (domain_301.find((dd) => dd.legacy_url === plus_data.legacy_url || dd.new_url === plus_data.new_url)) {
|
|
847
|
-
dialog.errorMessage({ text: '此網址已設定過' });
|
|
848
|
-
return;
|
|
849
|
-
}
|
|
850
|
-
if (!plus_data.legacy_url) {
|
|
851
|
-
dialog.errorMessage({ text: '請輸入原先網址' });
|
|
852
|
-
return;
|
|
853
|
-
}
|
|
854
|
-
if (!plus_data.new_url) {
|
|
855
|
-
dialog.errorMessage({ text: '請輸入新網址' });
|
|
856
|
-
return;
|
|
857
|
-
}
|
|
858
|
-
if (plus_data.legacy_url === plus_data.new_url) {
|
|
859
|
-
dialog.errorMessage({ text: '網址不可相同' });
|
|
860
|
-
return;
|
|
861
|
-
}
|
|
862
|
-
dialog.dataLoading({ visible: true });
|
|
863
|
-
ApiUser.setPublicConfig({
|
|
864
|
-
key: 'domain_301',
|
|
865
|
-
user_id: 'manager',
|
|
866
|
-
value: {
|
|
867
|
-
list: [
|
|
868
|
-
{
|
|
869
|
-
new_url: plus_data.new_url,
|
|
870
|
-
legacy_url: plus_data.legacy_url,
|
|
871
|
-
},
|
|
872
|
-
...domain_301,
|
|
873
|
-
],
|
|
874
|
-
},
|
|
875
|
-
}).then(res => {
|
|
876
|
-
dialog.dataLoading({ visible: false });
|
|
877
|
-
dialog.successMessage({ text: '設定成功' });
|
|
878
|
-
gvc.closeDialog();
|
|
879
|
-
});
|
|
880
|
-
})), '新增'),
|
|
881
|
-
].join('');
|
|
882
|
-
},
|
|
883
|
-
});
|
|
884
|
-
}
|
|
885
|
-
BgWidget.settingDialog({
|
|
886
|
-
gvc,
|
|
887
|
-
title: '301轉址設定',
|
|
888
|
-
width: 600,
|
|
889
|
-
innerHTML: gvc => {
|
|
890
|
-
if (domain_301.length) {
|
|
891
|
-
return BgWidget.tableV3({
|
|
892
|
-
gvc: gvc,
|
|
893
|
-
getData: vd => {
|
|
894
|
-
vd.pageSize = 1;
|
|
895
|
-
vd.originalData = domain_301;
|
|
896
|
-
vd.tableData = domain_301.map((dd) => {
|
|
897
|
-
var _a, _b;
|
|
898
|
-
return [
|
|
899
|
-
{ key: '舊網址', value: `${(_a = dd.legacy_url) !== null && _a !== void 0 ? _a : ''}` },
|
|
900
|
-
{ key: '新網址', value: `${(_b = dd.new_url) !== null && _b !== void 0 ? _b : ''}` },
|
|
901
|
-
];
|
|
902
|
-
});
|
|
903
|
-
setTimeout(() => {
|
|
904
|
-
vd.callback();
|
|
905
|
-
});
|
|
906
|
-
},
|
|
907
|
-
rowClick: (data, index) => { },
|
|
908
|
-
filter: [
|
|
909
|
-
{
|
|
910
|
-
name: '批量移除',
|
|
911
|
-
event: checkedData => {
|
|
912
|
-
dialog.checkYesOrNot({
|
|
913
|
-
text: '是否確認移除?',
|
|
914
|
-
callback: response => {
|
|
915
|
-
dialog.dataLoading({ visible: true });
|
|
916
|
-
domain_301 = domain_301.filter((dd) => {
|
|
917
|
-
return !checkedData.find((d1) => {
|
|
918
|
-
return d1.legacy_url === dd.legacy_url || d1.new_url === dd.new_url;
|
|
919
|
-
});
|
|
920
|
-
});
|
|
921
|
-
ApiUser.setPublicConfig({
|
|
922
|
-
key: 'domain_301',
|
|
923
|
-
user_id: 'manager',
|
|
924
|
-
value: {
|
|
925
|
-
list: domain_301,
|
|
926
|
-
},
|
|
927
|
-
}).then(res => {
|
|
928
|
-
dialog.dataLoading({ visible: false });
|
|
929
|
-
dialog.successMessage({ text: '設定成功' });
|
|
930
|
-
gvc.recreateView();
|
|
931
|
-
});
|
|
932
|
-
},
|
|
933
|
-
});
|
|
934
|
-
},
|
|
935
|
-
},
|
|
936
|
-
],
|
|
937
|
-
});
|
|
938
|
-
}
|
|
939
|
-
else {
|
|
940
|
-
return BgWidget.warningInsignia('尚未新增轉址連結,點擊右下角新增');
|
|
941
|
-
}
|
|
942
|
-
},
|
|
943
|
-
footer_html: gvc => {
|
|
944
|
-
return [
|
|
945
|
-
BgWidget.cancel(gvc.event(() => {
|
|
946
|
-
gvc.closeDialog();
|
|
947
|
-
})),
|
|
948
|
-
BgWidget.save(gvc.event(() => __awaiter(this, void 0, void 0, function* () {
|
|
949
|
-
plusEvent();
|
|
950
|
-
})), '新增'),
|
|
951
|
-
].join('');
|
|
952
|
-
},
|
|
953
|
-
});
|
|
954
|
-
})),
|
|
955
|
-
})}
|
|
956
|
-
</div>`,
|
|
957
|
-
].join(`<div class="mt-2"></div>`))}
|
|
958
|
-
`;
|
|
959
|
-
},
|
|
960
|
-
function: () => {
|
|
961
|
-
return BgWidget.mainCard(html `
|
|
962
|
-
<div class="d-flex flex-column gap-2">
|
|
963
|
-
${createSection('網站功能', '系統將根據您勾選的項目,開放相對應的功能')}
|
|
964
|
-
${BgWidget.inlineCheckBox({
|
|
512
|
+
<div class="tx_700">商店類型</div>
|
|
513
|
+
<div class="tx_gray_14">系統將根據您勾選的項目,開放相對應的功能</div>
|
|
514
|
+
${BgWidget.inlineCheckBox({
|
|
965
515
|
title: '',
|
|
966
516
|
gvc,
|
|
967
517
|
def: vm.data.web_type,
|
|
@@ -977,10 +527,16 @@ export class ShoppingInformation {
|
|
|
977
527
|
},
|
|
978
528
|
type: 'multiple',
|
|
979
529
|
})}
|
|
530
|
+
`) +
|
|
531
|
+
BgWidget.mbContainer(24)
|
|
532
|
+
+
|
|
533
|
+
BgWidget.mainCard(html `
|
|
534
|
+
<div class="d-flex flex-column " style="gap:18px;">
|
|
535
|
+
<div class="tx_700">商店功能</div>
|
|
980
536
|
${createToggle('啟用 AI 選品', '透過 AI 選品功能,用戶可以使用自然語言描述找到所需商品', 'ai_search')}
|
|
981
537
|
${GlobalUser.getPlan().id > 0
|
|
982
|
-
|
|
983
|
-
|
|
538
|
+
? createToggle('啟用聊聊功能', '啟用聊聊功能,方便客戶直接於官網前台與您聯繫,並詢問商品詳細內容', 'chat_toggle')
|
|
539
|
+
: ''}
|
|
984
540
|
${createToggle('啟用心願單功能', '方便客戶收藏並管理喜愛的商品清單,隨時查看心儀商品,提升購物體驗與轉換率', 'wishlist')}
|
|
985
541
|
${createToggle('啟用顧客評論功能', '顧客可以對您的商品進行評論', 'customer_comment')}
|
|
986
542
|
${createToggle('啟用 Cookie 聲明', '如需使用廣告追蹤行為,必須啟用 Cookie 聲明,才可發送廣告', 'cookie_check')}
|