ts-glitter 21.7.2 → 21.7.3
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 +2 -2
- package/lowcode/Entry.ts +2 -2
- package/lowcode/api/pageConfig.js +15 -1
- package/lowcode/api/pageConfig.ts +15 -13
- package/lowcode/cms-plugin/line-auto-reply.js +1 -0
- package/lowcode/cms-plugin/line-auto-reply.ts +1 -0
- package/lowcode/cms-plugin/menus-setting.js +4 -4
- package/lowcode/cms-plugin/menus-setting.ts +4 -4
- package/lowcode/cms-plugin/shopping-market-shopee.js +2 -20
- package/lowcode/cms-plugin/shopping-market-shopee.ts +3 -19
- package/lowcode/cms-plugin/shopping-order-manager.ts +1 -0
- package/lowcode/editor-components/global-widget/bridge.js +95 -3
- package/lowcode/editor-components/global-widget/bridge.ts +124 -115
- package/lowcode/glitter-base/route/shopee.js +0 -2
- package/lowcode/glitter-base/route/shopee.ts +0 -2
- package/lowcode/glitterBundle/html-component/global-widget.js +37 -11
- package/lowcode/glitterBundle/html-component/global-widget.ts +75 -14
- package/lowcode/jspage/main.js +152 -68
- package/lowcode/jspage/main.ts +155 -80
- package/lowcode/modules/image-library.js +70 -86
- package/lowcode/modules/image-library.ts +98 -119
- package/lowcode/official_view_component/official/component.js +17 -15
- package/lowcode/official_view_component/official/component.ts +20 -15
- package/lowcode/official_view_component/official/form.js +186 -159
- package/lowcode/official_view_component/official/form.ts +1150 -1068
- package/lowcode/public-components/blogs/blogs-01.js +20 -4
- package/lowcode/public-components/blogs/blogs-01.ts +25 -4
- package/lowcode/public-components/footer/footer-01.js +1 -1
- package/lowcode/public-components/footer/footer-01.ts +2 -1
- package/lowcode/public-components/footer/footer-02.js +1 -1
- package/lowcode/public-components/footer/footer-02.ts +1 -1
- package/lowcode/public-components/footer/footer-03.js +1 -1
- package/lowcode/public-components/footer/footer-03.ts +1 -1
- package/package.json +1 -1
- package/src/api-public/controllers/shopee.js +10 -0
- package/src/api-public/controllers/shopee.js.map +1 -1
- package/src/api-public/controllers/shopee.ts +12 -12
- package/src/api-public/services/auto-send-email.js +16 -0
- package/src/api-public/services/auto-send-email.js.map +1 -1
- package/src/api-public/services/auto-send-email.ts +16 -0
- package/src/api-public/services/checkout-event.js +13 -17
- package/src/api-public/services/checkout-event.js.map +1 -1
- package/src/api-public/services/checkout-event.ts +9 -1
- package/src/api-public/services/data-analyze.d.ts +1 -1
- package/src/api-public/services/line-message.js +1 -0
- package/src/api-public/services/line-message.js.map +1 -1
- package/src/api-public/services/line-message.ts +2 -0
- package/src/api-public/services/shopee.d.ts +4 -3
- package/src/api-public/services/shopee.js +28 -24
- package/src/api-public/services/shopee.js.map +1 -1
- package/src/api-public/services/shopee.ts +30 -24
- package/src/api-public/services/shopping.js +2 -7
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +5 -14
- package/src/index.js +3 -3
- package/src/modules/database.d.ts +1 -1
- package/src/public-config-initial/auto-fcm.js +4 -0
- package/src/public-config-initial/auto-fcm.js.map +1 -1
- package/src/public-config-initial/auto-fcm.ts +7 -1
- package/src/seo-config.js +0 -1
- package/src/seo-config.js.map +1 -1
- package/src/seo-config.ts +0 -1
- package/src/services/template.js +10 -0
- package/src/services/template.js.map +1 -1
- package/src/services/template.ts +9 -0
|
@@ -3,6 +3,7 @@ import { ToolSetting } from '../../jspage/function-page/tool-setting.js';
|
|
|
3
3
|
import { BgWidget } from '../../backend-manager/bg-widget.js';
|
|
4
4
|
import { ApiUser } from '../../glitter-base/route/user.js';
|
|
5
5
|
import { OptionsItem } from '../../glitterBundle/html-component/global-widget.js';
|
|
6
|
+
import { ApiPageConfig } from '../../api/pageConfig.js';
|
|
6
7
|
const html=String.raw;
|
|
7
8
|
export class Bridge {
|
|
8
9
|
|
|
@@ -48,7 +49,6 @@ export class Bridge {
|
|
|
48
49
|
</select>`;
|
|
49
50
|
}
|
|
50
51
|
public static main(obj: any) {
|
|
51
|
-
console.log(`refer_form_data=>`,obj.widget)
|
|
52
52
|
const gvc: GVC = obj.gvc;
|
|
53
53
|
const glitter = gvc.glitter;
|
|
54
54
|
const is_sub_page = ['pages/','hidden/','shop/'].find((dd)=>{
|
|
@@ -57,124 +57,133 @@ export class Bridge {
|
|
|
57
57
|
const c_view=[
|
|
58
58
|
`<div style="height:5px;"></div>`,
|
|
59
59
|
]
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
60
|
+
|
|
61
|
+
c_view.push(`<div class="mx-n2">${
|
|
62
|
+
ToolSetting.item({
|
|
63
|
+
gvc: gvc,
|
|
64
|
+
dd: (() => {
|
|
65
|
+
switch (glitter.share.editorViewModel.selectItem.data.tag){
|
|
66
|
+
case 'c_header':
|
|
67
|
+
return {
|
|
68
|
+
title: '標頭選單',
|
|
69
|
+
tag: '標頭元件',
|
|
70
|
+
hint: (is_sub_page) ? `
|
|
69
71
|
此頁面標頭將預設為以下樣式
|
|
70
72
|
`:`全館 (首頁,隱形賣場,一頁式網頁) 的標頭將預設為以下樣式`,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
toggle:true
|
|
74
|
+
};
|
|
75
|
+
case 'footer':
|
|
76
|
+
return {
|
|
77
|
+
title: '頁腳選單',
|
|
78
|
+
tag: '頁腳元件',
|
|
79
|
+
hint: `全館 (首頁,隱形賣場,一頁式網頁) 的頁腳將預設為以下樣式`,
|
|
80
|
+
toggle:true
|
|
81
|
+
};
|
|
82
|
+
case 'SY00-normal-products':
|
|
83
|
+
case 'SY02_page_product':
|
|
84
|
+
case 'SY00-normal-scroll-products':
|
|
85
|
+
return {
|
|
86
|
+
title: '商品卡片',
|
|
87
|
+
tag: '商品卡片',
|
|
88
|
+
hint: `全館 (首頁,隱形賣場,一頁式網頁) 的商品卡片將預設為以下樣式`,
|
|
89
|
+
toggle:true,
|
|
90
|
+
editable:true
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
})(),
|
|
94
|
+
})
|
|
95
|
+
}</div>`);
|
|
96
|
+
if(['c_header','footer'].includes(glitter.share.editorViewModel.selectItem.data.tag)){
|
|
97
|
+
c_view.push(
|
|
98
|
+
[
|
|
99
|
+
`<div class="fs-6 mb-2" style="color: black;">選單列表內容</div>`,
|
|
100
|
+
gvc.bindView(()=>{
|
|
101
|
+
const bi=gvc.glitter.getUUID()
|
|
74
102
|
return {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
103
|
+
bind:bi,
|
|
104
|
+
view:async ()=>{
|
|
105
|
+
try {
|
|
106
|
+
const vm:any={
|
|
107
|
+
tab:(glitter.share.editorViewModel.selectItem.data.tag==='c_header') ? 'menu':'footer',
|
|
108
|
+
dataList:[]
|
|
109
|
+
}
|
|
110
|
+
const tag=vm.tab==='menu' ? 'menu-setting':'footer-setting';
|
|
111
|
+
let menu_all= (await ApiUser.getPublicConfig('menu-setting-list','manager')).response.value;
|
|
112
|
+
menu_all.list = menu_all.list ?? [];
|
|
113
|
+
vm.dataList = [
|
|
114
|
+
{ tag: tag, title: `系統預設
|
|
115
|
+
` },
|
|
116
|
+
...menu_all.list.filter((d1:any)=>{
|
|
117
|
+
return d1.tab===tag
|
|
118
|
+
})
|
|
119
|
+
];
|
|
120
|
+
return [
|
|
121
|
+
this.select({
|
|
122
|
+
gvc: gvc,
|
|
123
|
+
callback: (text: any) => {
|
|
124
|
+
obj.subData.form_data['menu_refer']=text;
|
|
125
|
+
obj.subData.refresh();
|
|
126
|
+
},
|
|
127
|
+
default: obj.subData.form_data['menu_refer'] ?? tag,
|
|
128
|
+
options: vm.dataList.map((dd:any)=>{
|
|
129
|
+
return {
|
|
130
|
+
key:dd.tag,
|
|
131
|
+
value:dd.title
|
|
132
|
+
}
|
|
133
|
+
})
|
|
134
|
+
}),
|
|
135
|
+
this.grayButton(
|
|
136
|
+
'設定',
|
|
137
|
+
gvc.event(() => {
|
|
138
|
+
gvc.glitter.getModule(`${gvc.glitter.root_path}cms-plugin/menus-setting.js`, menu => {
|
|
139
|
+
gvc.glitter.innerDialog((gvc)=>{
|
|
140
|
+
return html`
|
|
141
|
+
<div class="vw-100 vh-100 bg-white">
|
|
142
|
+
<div class="d-flex align-items-center" style="height: 60px;width: 100vw;border-bottom: solid 1px #DDD;font-size: 16px;font-style: normal;font-weight: 700;color: #393939;">
|
|
143
|
+
<div class="d-flex" style="padding:19px 32px;gap:8px;cursor: pointer;border-right: solid 1px #DDD;" onclick="${gvc.event(()=>{
|
|
144
|
+
gvc.closeDialog()
|
|
145
|
+
})}">
|
|
146
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
147
|
+
<path d="M13.7859 4.96406L8.02969 10.7203C7.69219 11.0578 7.5 11.5219 7.5 12C7.5 12.4781 7.69219 12.9422 8.02969 13.2797L13.7859 19.0359C14.0859 19.3359 14.4891 19.5 14.9109 19.5C15.7875 19.5 16.5 18.7875 16.5 17.9109V15H22.5C23.3297 15 24 14.3297 24 13.5V10.5C24 9.67031 23.3297 9 22.5 9H16.5V6.08906C16.5 5.2125 15.7875 4.5 14.9109 4.5C14.4891 4.5 14.0859 4.66875 13.7859 4.96406ZM7.5 19.5H4.5C3.67031 19.5 3 18.8297 3 18V6C3 5.17031 3.67031 4.5 4.5 4.5H7.5C8.32969 4.5 9 3.82969 9 3C9 2.17031 8.32969 1.5 7.5 1.5H4.5C2.01562 1.5 0 3.51562 0 6V18C0 20.4844 2.01562 22.5 4.5 22.5H7.5C8.32969 22.5 9 21.8297 9 21C9 20.1703 8.32969 19.5 7.5 19.5Z" fill="#393939"></path>
|
|
148
|
+
</svg>
|
|
149
|
+
返回
|
|
150
|
+
</div>
|
|
151
|
+
<div class="flex-fill" style="padding: 19px 32px;">編輯選單內容</div>
|
|
152
|
+
</div>
|
|
153
|
+
<div class="w-100">${
|
|
154
|
+
menu.main(gvc, obj.widget,vm.tab)
|
|
155
|
+
}</div>
|
|
156
|
+
</div>
|
|
157
|
+
`
|
|
158
|
+
}, 'menus-setting',{
|
|
159
|
+
dismiss:()=>{
|
|
160
|
+
gvc.notifyDataChange(bi)
|
|
161
|
+
obj.subData.refresh();
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
setTimeout(()=>{
|
|
165
|
+
(document.querySelector('.glitter-dialog') as any).style.zIndex=9999
|
|
166
|
+
},1000)
|
|
167
|
+
});
|
|
168
|
+
}),
|
|
169
|
+
{
|
|
170
|
+
}
|
|
171
|
+
)
|
|
172
|
+
].join('')
|
|
173
|
+
}catch (e) {
|
|
174
|
+
console.log(e)
|
|
175
|
+
return ``
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
divCreate:{
|
|
179
|
+
class:`d-flex align-items-center mb-2`,style:`gap:5px;`
|
|
180
|
+
}
|
|
89
181
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
// `<div class="fs-6 mb-2" style="color: black;">選單參照內容</div>`,
|
|
96
|
-
// gvc.bindView(()=>{
|
|
97
|
-
// const bi=gvc.glitter.getUUID()
|
|
98
|
-
// return {
|
|
99
|
-
// bind:bi,
|
|
100
|
-
// view:async ()=>{
|
|
101
|
-
// try {
|
|
102
|
-
// const vm:any={
|
|
103
|
-
// tab:'menu',
|
|
104
|
-
// dataList:[]
|
|
105
|
-
// }
|
|
106
|
-
// const tag=vm.tab==='menu' ? 'menu-setting':'footer-setting';
|
|
107
|
-
// let menu_all= (await ApiUser.getPublicConfig('menu-setting-list','manager')).response.value;
|
|
108
|
-
// menu_all.list = menu_all.list ?? [];
|
|
109
|
-
// vm.dataList = [
|
|
110
|
-
// { tag: tag, title: `系統預設
|
|
111
|
-
// ` },
|
|
112
|
-
// ...menu_all.list.filter((d1:any)=>{
|
|
113
|
-
// return d1.tab===tag
|
|
114
|
-
// })
|
|
115
|
-
// ];
|
|
116
|
-
// return [
|
|
117
|
-
// this.select({
|
|
118
|
-
// gvc: gvc,
|
|
119
|
-
// callback: (text: any) => {
|
|
120
|
-
// glitter.share.refer_form['menu_refer']=text
|
|
121
|
-
// glitter.share.refresh_global();
|
|
122
|
-
// },
|
|
123
|
-
// default: glitter.share.refer_form['menu_refer'] ?? tag,
|
|
124
|
-
// options: vm.dataList.map((dd:any)=>{
|
|
125
|
-
// return {
|
|
126
|
-
// key:dd.tag,
|
|
127
|
-
// value:dd.title
|
|
128
|
-
// }
|
|
129
|
-
// })
|
|
130
|
-
// }),
|
|
131
|
-
// this.grayButton(
|
|
132
|
-
// '設定',
|
|
133
|
-
// gvc.event(() => {
|
|
134
|
-
// gvc.glitter.getModule(`${gvc.glitter.root_path}cms-plugin/menus-setting.js`, menu => {
|
|
135
|
-
// gvc.glitter.innerDialog((gvc)=>{
|
|
136
|
-
// return html`
|
|
137
|
-
// <div class="vw-100 vh-100 bg-white">
|
|
138
|
-
// <div class="d-flex align-items-center" style="height: 60px;width: 100vw;border-bottom: solid 1px #DDD;font-size: 16px;font-style: normal;font-weight: 700;color: #393939;">
|
|
139
|
-
// <div class="d-flex" style="padding:19px 32px;gap:8px;cursor: pointer;border-right: solid 1px #DDD;" onclick="${gvc.event(()=>{
|
|
140
|
-
// gvc.closeDialog()
|
|
141
|
-
// })}">
|
|
142
|
-
// <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
143
|
-
// <path d="M13.7859 4.96406L8.02969 10.7203C7.69219 11.0578 7.5 11.5219 7.5 12C7.5 12.4781 7.69219 12.9422 8.02969 13.2797L13.7859 19.0359C14.0859 19.3359 14.4891 19.5 14.9109 19.5C15.7875 19.5 16.5 18.7875 16.5 17.9109V15H22.5C23.3297 15 24 14.3297 24 13.5V10.5C24 9.67031 23.3297 9 22.5 9H16.5V6.08906C16.5 5.2125 15.7875 4.5 14.9109 4.5C14.4891 4.5 14.0859 4.66875 13.7859 4.96406ZM7.5 19.5H4.5C3.67031 19.5 3 18.8297 3 18V6C3 5.17031 3.67031 4.5 4.5 4.5H7.5C8.32969 4.5 9 3.82969 9 3C9 2.17031 8.32969 1.5 7.5 1.5H4.5C2.01562 1.5 0 3.51562 0 6V18C0 20.4844 2.01562 22.5 4.5 22.5H7.5C8.32969 22.5 9 21.8297 9 21C9 20.1703 8.32969 19.5 7.5 19.5Z" fill="#393939"></path>
|
|
144
|
-
// </svg>
|
|
145
|
-
// 返回
|
|
146
|
-
// </div>
|
|
147
|
-
// <div class="flex-fill" style="padding: 19px 32px;">編輯選單內容</div>
|
|
148
|
-
// </div>
|
|
149
|
-
// <div class="w-100">${
|
|
150
|
-
// menu.main(gvc, obj.widget)
|
|
151
|
-
// }</div>
|
|
152
|
-
// </div>
|
|
153
|
-
// `
|
|
154
|
-
// }, 'menus-setting',{
|
|
155
|
-
// dismiss:()=>{
|
|
156
|
-
// glitter.share.refresh_global();
|
|
157
|
-
// }
|
|
158
|
-
// });
|
|
159
|
-
// });
|
|
160
|
-
// }),
|
|
161
|
-
// {
|
|
162
|
-
// }
|
|
163
|
-
// )
|
|
164
|
-
// ].join('')
|
|
165
|
-
// }catch (e) {
|
|
166
|
-
// console.log(e)
|
|
167
|
-
// return ``
|
|
168
|
-
// }
|
|
169
|
-
// },
|
|
170
|
-
// divCreate:{
|
|
171
|
-
// class:`d-flex align-items-center`,style:`gap:5px;`
|
|
172
|
-
// }
|
|
173
|
-
// }
|
|
174
|
-
// })
|
|
175
|
-
// ].join('')
|
|
176
|
-
// );
|
|
177
|
-
// civ.push(`<div class="mx-n2 border-top mb-2 mt-3"></div>`);
|
|
182
|
+
})
|
|
183
|
+
].join('')
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
|
|
178
187
|
c_view.push( `<div style="height:1px;" class="border-top mx-n3"></div>`)
|
|
179
188
|
return c_view.join(`<div style="height:10px;"></div>`);
|
|
180
189
|
}
|
|
@@ -13,7 +13,6 @@ export class ApiShopee {
|
|
|
13
13
|
redirect: redirect,
|
|
14
14
|
}),
|
|
15
15
|
}).then(r => {
|
|
16
|
-
console.log('r.response.result -- ', r.response.result);
|
|
17
16
|
localStorage.setItem('shopee', window.parent.location.href);
|
|
18
17
|
window.parent.location.href = r.response.result;
|
|
19
18
|
});
|
|
@@ -31,7 +30,6 @@ export class ApiShopee {
|
|
|
31
30
|
redirect: redirect,
|
|
32
31
|
}),
|
|
33
32
|
}).then(r => {
|
|
34
|
-
console.log('r.response.result -- ', r.response.result);
|
|
35
33
|
localStorage.setItem('shopee', window.parent.location.href);
|
|
36
34
|
window.parent.location.href = r.response.result;
|
|
37
35
|
});
|
|
@@ -14,7 +14,6 @@ export class ApiShopee {
|
|
|
14
14
|
redirect: redirect,
|
|
15
15
|
}),
|
|
16
16
|
}).then(r => {
|
|
17
|
-
console.log('r.response.result -- ', r.response.result);
|
|
18
17
|
localStorage.setItem('shopee', window.parent.location.href);
|
|
19
18
|
window.parent.location.href = r.response.result;
|
|
20
19
|
});
|
|
@@ -33,7 +32,6 @@ export class ApiShopee {
|
|
|
33
32
|
redirect: redirect,
|
|
34
33
|
}),
|
|
35
34
|
}).then(r => {
|
|
36
|
-
console.log('r.response.result -- ', r.response.result);
|
|
37
35
|
localStorage.setItem('shopee', window.parent.location.href);
|
|
38
36
|
window.parent.location.href = r.response.result;
|
|
39
37
|
});
|
|
@@ -8,7 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { Storage } from '../helper/storage.js';
|
|
11
|
-
import { ApiPageConfig } from '../../api/pageConfig.js';
|
|
12
11
|
var ViewType;
|
|
13
12
|
(function (ViewType) {
|
|
14
13
|
ViewType["mobile"] = "mobile";
|
|
@@ -228,17 +227,15 @@ export class GlobalWidget {
|
|
|
228
227
|
const is_sub_page = ['pages/', 'hidden/', 'shop/'].find(dd => {
|
|
229
228
|
return (obj.gvc.glitter.getUrlParameter('page') || '').startsWith(dd);
|
|
230
229
|
});
|
|
231
|
-
const is_shop = ['hidden/', 'shop/'].find(dd => {
|
|
232
|
-
return (obj.gvc.glitter.getUrlParameter('page') || '').startsWith(dd);
|
|
233
|
-
});
|
|
234
230
|
if (!glitter.share.c_header_list) {
|
|
235
|
-
glitter.share.c_header_list = (
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
231
|
+
glitter.share.c_header_list = glitter.share._global_component.filter((d1) => {
|
|
232
|
+
return d1.template_config.tag.find((dd) => { return dd === '標頭元件'; });
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
if (!glitter.share.c_footer_list) {
|
|
236
|
+
glitter.share.c_footer_list = glitter.share._global_component.filter((d1) => {
|
|
237
|
+
return d1.template_config.tag.find((dd) => { return dd === '頁腳元件'; });
|
|
238
|
+
});
|
|
242
239
|
}
|
|
243
240
|
if (is_sub_page &&
|
|
244
241
|
glitter.share.c_header_list.find((d1) => {
|
|
@@ -269,6 +266,35 @@ export class GlobalWidget {
|
|
|
269
266
|
return;
|
|
270
267
|
}
|
|
271
268
|
}
|
|
269
|
+
if (is_sub_page &&
|
|
270
|
+
glitter.share.c_footer_list.find((d1) => {
|
|
271
|
+
return d1.tag === obj.widget.data.tag && d1.appName === obj.widget.data.refer_app;
|
|
272
|
+
})) {
|
|
273
|
+
glitter.share.footer_refer = glitter.share.footer_refer || 'def';
|
|
274
|
+
civ.push(`<div class="mt-2 fs-6 mb-2" style="color: black;margin-bottom: 5px;" >標頭樣式參照</div>`);
|
|
275
|
+
civ.push(GlobalWidget.select({
|
|
276
|
+
gvc: gvc,
|
|
277
|
+
callback: (text) => {
|
|
278
|
+
glitter.share.footer_refer = text;
|
|
279
|
+
glitter.share.selectEditorItem();
|
|
280
|
+
},
|
|
281
|
+
default: glitter.share.footer_refer,
|
|
282
|
+
options: [
|
|
283
|
+
{
|
|
284
|
+
key: 'custom',
|
|
285
|
+
value: '自定義頁腳樣式',
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
key: 'def',
|
|
289
|
+
value: '全站預設樣式',
|
|
290
|
+
},
|
|
291
|
+
],
|
|
292
|
+
}));
|
|
293
|
+
if (glitter.share.footer_refer === 'def') {
|
|
294
|
+
window.parent.document.querySelector('.' + outer_id).outerHTML = civ.join('');
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
272
298
|
civ.push((() => {
|
|
273
299
|
GlobalWidget.glitter_view_type = ViewType.desktop;
|
|
274
300
|
if (Storage.view_type === 'mobile') {
|
|
@@ -258,19 +258,16 @@ export class GlobalWidget {
|
|
|
258
258
|
const is_sub_page = ['pages/', 'hidden/', 'shop/'].find(dd => {
|
|
259
259
|
return (obj.gvc.glitter.getUrlParameter('page') || '').startsWith(dd);
|
|
260
260
|
});
|
|
261
|
-
|
|
262
|
-
return (obj.gvc.glitter.getUrlParameter('page') || '').startsWith(dd);
|
|
263
|
-
});
|
|
261
|
+
|
|
264
262
|
if (!glitter.share.c_header_list) {
|
|
265
|
-
glitter.share.c_header_list = (
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
).response.result.data;
|
|
263
|
+
glitter.share.c_header_list = glitter.share._global_component.filter((d1: any) => {
|
|
264
|
+
return d1.template_config.tag.find((dd:any)=>{return dd==='標頭元件'})
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
if (!glitter.share.c_footer_list) {
|
|
268
|
+
glitter.share.c_footer_list = glitter.share._global_component.filter((d1: any) => {
|
|
269
|
+
return d1.template_config.tag.find((dd:any)=>{return dd==='頁腳元件'})
|
|
270
|
+
});
|
|
274
271
|
}
|
|
275
272
|
if (
|
|
276
273
|
is_sub_page &&
|
|
@@ -300,13 +297,77 @@ export class GlobalWidget {
|
|
|
300
297
|
],
|
|
301
298
|
})
|
|
302
299
|
);
|
|
303
|
-
|
|
304
300
|
if (glitter.share.header_refer === 'def') {
|
|
305
301
|
(window.parent as any).document.querySelector('.' + outer_id).outerHTML = civ.join('');
|
|
306
302
|
return;
|
|
307
303
|
}
|
|
308
|
-
|
|
309
304
|
}
|
|
305
|
+
if (
|
|
306
|
+
is_sub_page &&
|
|
307
|
+
glitter.share.c_footer_list.find((d1: any) => {
|
|
308
|
+
return d1.tag === obj.widget.data.tag && d1.appName === obj.widget.data.refer_app;
|
|
309
|
+
})
|
|
310
|
+
) {
|
|
311
|
+
glitter.share.footer_refer = glitter.share.footer_refer || 'def';
|
|
312
|
+
civ.push(`<div class="mt-2 fs-6 mb-2" style="color: black;margin-bottom: 5px;" >標頭樣式參照</div>`);
|
|
313
|
+
civ.push(
|
|
314
|
+
GlobalWidget.select({
|
|
315
|
+
gvc: gvc,
|
|
316
|
+
callback: (text: any) => {
|
|
317
|
+
glitter.share.footer_refer = text;
|
|
318
|
+
glitter.share.selectEditorItem();
|
|
319
|
+
},
|
|
320
|
+
default: glitter.share.footer_refer,
|
|
321
|
+
options: [
|
|
322
|
+
{
|
|
323
|
+
key: 'custom',
|
|
324
|
+
value: '自定義頁腳樣式',
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
key: 'def',
|
|
328
|
+
value: '全站預設樣式',
|
|
329
|
+
},
|
|
330
|
+
],
|
|
331
|
+
})
|
|
332
|
+
);
|
|
333
|
+
if (glitter.share.footer_refer === 'def') {
|
|
334
|
+
(window.parent as any).document.querySelector('.' + outer_id).outerHTML = civ.join('');
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
// if (
|
|
339
|
+
// is_sub_page &&
|
|
340
|
+
// glitter.share.c_header_list.find((d1: any) => {
|
|
341
|
+
// return d1.tag === obj.widget.data.tag && d1.appName === obj.widget.data.refer_app;
|
|
342
|
+
// })
|
|
343
|
+
// ) {
|
|
344
|
+
// glitter.share.header_refer = glitter.share.header_refer || 'def';
|
|
345
|
+
// civ.push(`<div class="mt-2 fs-6 mb-2" style="color: black;margin-bottom: 5px;" >標頭樣式參照</div>`);
|
|
346
|
+
// civ.push(
|
|
347
|
+
// GlobalWidget.select({
|
|
348
|
+
// gvc: gvc,
|
|
349
|
+
// callback: (text: any) => {
|
|
350
|
+
// glitter.share.header_refer = text;
|
|
351
|
+
// glitter.share.selectEditorItem();
|
|
352
|
+
// },
|
|
353
|
+
// default: glitter.share.header_refer,
|
|
354
|
+
// options: [
|
|
355
|
+
// {
|
|
356
|
+
// key: 'custom',
|
|
357
|
+
// value: '自定義標頭樣式',
|
|
358
|
+
// },
|
|
359
|
+
// {
|
|
360
|
+
// key: 'def',
|
|
361
|
+
// value: '全站預設樣式',
|
|
362
|
+
// },
|
|
363
|
+
// ],
|
|
364
|
+
// })
|
|
365
|
+
// );
|
|
366
|
+
// if (glitter.share.header_refer === 'def') {
|
|
367
|
+
// (window.parent as any).document.querySelector('.' + outer_id).outerHTML = civ.join('');
|
|
368
|
+
// return;
|
|
369
|
+
// }
|
|
370
|
+
// }
|
|
310
371
|
civ.push(
|
|
311
372
|
(() => {
|
|
312
373
|
GlobalWidget.glitter_view_type = ViewType.desktop;
|