ts-glitter 21.8.3 → 21.8.4
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-dialog.js +342 -100
- package/lowcode/backend-manager/bg-dialog.ts +432 -145
- package/lowcode/backend-manager/bg-widget.js +4 -4
- package/lowcode/backend-manager/bg-widget.ts +5 -5
- package/lowcode/cms-plugin/shopping-discount-setting.js +148 -92
- package/lowcode/cms-plugin/shopping-discount-setting.ts +162 -111
- package/lowcode/cms-plugin/shopping-product-stock.js +58 -45
- package/lowcode/cms-plugin/shopping-product-stock.ts +66 -49
- package/lowcode/css/editor.css +8 -9
- package/lowcode/editor/basic-component.js +0 -10
- package/lowcode/editor/basic-component.ts +1 -11
- package/lowcode/glitter-base/route/article.js +50 -51
- package/lowcode/glitter-base/route/article.ts +102 -103
- package/lowcode/glitter-base/route/recommend.js +1 -0
- package/lowcode/glitter-base/route/recommend.ts +141 -123
- package/lowcode/glitterBundle/plugins/html-render.js +2 -0
- package/lowcode/glitterBundle/plugins/html-render.ts +1 -0
- package/lowcode/jspage/function-page/tool-setting.js +0 -1
- package/lowcode/jspage/function-page/tool-setting.ts +0 -1
- package/lowcode/jspage/main.js +6 -1
- package/lowcode/jspage/main.ts +6 -1
- package/lowcode/modules/image-library-clone.ts +2 -0
- package/lowcode/modules/image-library.js +118 -155
- package/lowcode/modules/image-library.ts +134 -197
- package/lowcode/official_view_component/official/component.js +1 -1
- package/lowcode/official_view_component/official/component.ts +1 -1
- package/lowcode/public-components/banner/first-banner.js +85 -50
- package/lowcode/public-components/banner/first-banner.ts +96 -59
- package/lowcode/public-components/layout-plugin/social-links-01.js +23 -44
- package/lowcode/public-components/layout-plugin/social-links-01.ts +23 -48
- package/package.json +1 -1
- package/src/api-public/controllers/article.js +11 -0
- package/src/api-public/controllers/article.js.map +1 -1
- package/src/api-public/controllers/article.ts +13 -0
- package/src/api-public/controllers/recommend.js +1 -0
- package/src/api-public/controllers/recommend.js.map +1 -1
- package/src/api-public/controllers/recommend.ts +99 -89
- package/src/api-public/services/checkout-event.js +4 -3
- package/src/api-public/services/checkout-event.js.map +1 -1
- package/src/api-public/services/checkout-event.ts +11 -7
- package/src/api-public/services/post.js +7 -17
- package/src/api-public/services/post.js.map +1 -1
- package/src/api-public/services/recommend.d.ts +1 -0
- package/src/api-public/services/recommend.js +12 -2
- package/src/api-public/services/recommend.js.map +1 -1
- package/src/api-public/services/recommend.ts +375 -354
- package/src/api-public/services/shopping.d.ts +1 -0
- package/src/api-public/services/shopping.js +4 -2
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +7 -2
|
@@ -7,6 +7,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
+
import { ApiPageConfig } from "../../api/pageConfig.js";
|
|
11
|
+
import { GlobalWidget } from "../../glitterBundle/html-component/global-widget.js";
|
|
10
12
|
const html = String.raw;
|
|
11
13
|
const css = String.raw;
|
|
12
14
|
export class FirstBanner {
|
|
@@ -37,18 +39,50 @@ export class FirstBanner {
|
|
|
37
39
|
background: #393939!important;
|
|
38
40
|
}
|
|
39
41
|
`);
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
const widget = obj.ed_widget || ((yield ApiPageConfig.getPage({
|
|
43
|
+
appName: gvc.glitter.window.appName,
|
|
44
|
+
type: 'template',
|
|
45
|
+
tag: 'advertise',
|
|
46
|
+
})).response.result[0]).config[0];
|
|
47
|
+
(gvc.glitter.window.glitterInitialHelper).getPageData({
|
|
48
|
+
tag: widget.data.tag,
|
|
49
|
+
appName: widget.data.refer_app
|
|
50
|
+
}, (d2) => {
|
|
51
|
+
const data = d2.response.result[0];
|
|
52
|
+
function getFormData(ref) {
|
|
53
|
+
var _a, _b;
|
|
54
|
+
ref = window.parent.glitter.share.updated_form_data[`${widget.refer_app}_${widget.tag}`] || ref;
|
|
55
|
+
let formData = JSON.parse(JSON.stringify(ref || {}));
|
|
56
|
+
if ((widget.data.refer_app)) {
|
|
57
|
+
GlobalWidget.initialShowCaseData({
|
|
58
|
+
widget: widget,
|
|
59
|
+
gvc: gvc
|
|
60
|
+
});
|
|
61
|
+
if (gvc.glitter.document.body.clientWidth < 800 && widget.mobile.refer === 'custom') {
|
|
62
|
+
((_a = widget[`mobile_editable`]) !== null && _a !== void 0 ? _a : []).map((dd) => {
|
|
63
|
+
formData[dd] = JSON.parse(JSON.stringify((widget.mobile.data.refer_form_data || data.page_config.formData)[dd] || {}));
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
else if (gvc.glitter.document.body.clientWidth >= 800 && widget.desktop.refer === 'custom') {
|
|
67
|
+
((_b = widget[`desktop_editable`]) !== null && _b !== void 0 ? _b : []).map((dd) => {
|
|
68
|
+
formData[dd] = JSON.parse(JSON.stringify((widget.desktop.data.refer_form_data || data.page_config.formData)[dd] || {}));
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return formData;
|
|
73
|
+
}
|
|
74
|
+
const formData = getFormData((widget.data.refer_app) ? (widget.data.refer_form_data || data.page_config.formData) : data.page_config.formData);
|
|
75
|
+
if (formData.list && formData.list.length) {
|
|
76
|
+
obj.gvc.glitter.innerDialog((gvc) => {
|
|
77
|
+
return gvc.bindView(() => {
|
|
78
|
+
return {
|
|
79
|
+
bind: id,
|
|
80
|
+
view: () => {
|
|
81
|
+
return html `
|
|
48
82
|
<div class="swiper mySwiper_${id}" style="width:520px;max-width:100vw;height:auto !important;">
|
|
49
83
|
<div class="swiper-wrapper">
|
|
50
84
|
${formData.list.map((dd) => {
|
|
51
|
-
|
|
85
|
+
return html `
|
|
52
86
|
<div class="swiper-slide pb-4 d-flex align-items-center justify-content-center position-relative"
|
|
53
87
|
style="background: none;
|
|
54
88
|
overflow: hidden;;
|
|
@@ -56,60 +90,61 @@ overflow: hidden;;
|
|
|
56
90
|
<img src="${dd.img || 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg'}" style="width:520px;max-width:calc(100vw - 40px);max-height: 100vh;cursor: pointer;
|
|
57
91
|
border-radius: 25px;
|
|
58
92
|
" onclick="${gvc.event(() => {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
93
|
+
gvc.glitter.href = dd.link;
|
|
94
|
+
gvc.closeDialog();
|
|
95
|
+
})}" >
|
|
62
96
|
<div class="position-absolute d-flex align-items-center justify-content-center"
|
|
63
97
|
style="top:0px;right: 0px;width:50px;height: 50px;
|
|
64
98
|
background: rgba(0,0,0,0.5);border-top-right-radius: 25px;border-bottom-left-radius: 10px;cursor: pointer;" onclick="${(() => {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
99
|
+
if (gvc.glitter.htmlGenerate.isEditMode()) {
|
|
100
|
+
return gvc.editorEvent(() => {
|
|
101
|
+
gvc.closeDialog();
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
return gvc.event(() => {
|
|
106
|
+
gvc.closeDialog();
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
})()}">
|
|
76
110
|
<i class="fa-regular fa-circle-xmark text-white fs-5"
|
|
77
111
|
></i>
|
|
78
112
|
</div>
|
|
79
113
|
</div>
|
|
80
114
|
`;
|
|
81
|
-
|
|
115
|
+
}).join('')}
|
|
82
116
|
</div>
|
|
83
117
|
<div class="swiper-pagination swiper-pagination-${id}"></div>
|
|
84
118
|
</div>`;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
119
|
+
},
|
|
120
|
+
divCreate: {
|
|
121
|
+
class: `vw-100 vh-100 position-fixed ${id} d-flex align-items-center justify-content-center`,
|
|
122
|
+
style: css `z-index: 999999;
|
|
89
123
|
background: rgba(0, 0, 0, 0.5);`
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
},
|
|
100
|
-
on: {
|
|
101
|
-
slideChange: function () {
|
|
124
|
+
},
|
|
125
|
+
onCreate: () => {
|
|
126
|
+
const interval = setInterval(() => {
|
|
127
|
+
if (gvc.glitter.window.Swiper) {
|
|
128
|
+
const swiper = new gvc.glitter.window.Swiper(`.mySwiper_${id}`, {
|
|
129
|
+
loop: true,
|
|
130
|
+
pagination: {
|
|
131
|
+
el: `.swiper-pagination-${id}`,
|
|
132
|
+
clickable: true,
|
|
102
133
|
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
134
|
+
on: {
|
|
135
|
+
slideChange: function () {
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
clearTimeout(interval);
|
|
140
|
+
}
|
|
141
|
+
}, 100);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
});
|
|
145
|
+
}, 'first-banner', {});
|
|
146
|
+
}
|
|
147
|
+
});
|
|
113
148
|
return ``;
|
|
114
149
|
});
|
|
115
150
|
}
|
|
@@ -8,10 +8,9 @@ const css = String.raw
|
|
|
8
8
|
|
|
9
9
|
export class FirstBanner {
|
|
10
10
|
|
|
11
|
-
public static async main(obj:{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
subData: any
|
|
11
|
+
public static async main(obj: {
|
|
12
|
+
gvc: GVC,
|
|
13
|
+
ed_widget?:any
|
|
15
14
|
}) {
|
|
16
15
|
|
|
17
16
|
const gvc = obj.gvc
|
|
@@ -39,21 +38,57 @@ export class FirstBanner {
|
|
|
39
38
|
background: #393939!important;
|
|
40
39
|
}
|
|
41
40
|
`)
|
|
42
|
-
|
|
41
|
+
const widget=obj.ed_widget || ((
|
|
42
|
+
await ApiPageConfig.getPage({
|
|
43
|
+
appName: (gvc.glitter.window as any).appName,
|
|
44
|
+
type: 'template',
|
|
45
|
+
tag:'advertise',
|
|
46
|
+
})
|
|
47
|
+
).response.result[0]).config[0];
|
|
48
|
+
((gvc.glitter.window as any).glitterInitialHelper).getPageData( {
|
|
49
|
+
tag: widget.data.tag,
|
|
50
|
+
appName: widget.data.refer_app
|
|
51
|
+
}, (d2: any) => {
|
|
52
|
+
const data = d2.response.result[0]
|
|
53
|
+
function getFormData(ref: any) {
|
|
54
|
+
//判斷是否有上次的更新資料
|
|
55
|
+
ref= (window.parent as any).glitter.share.updated_form_data[`${widget.refer_app}_${widget.tag}`] || ref;
|
|
56
|
+
let formData = JSON.parse(JSON.stringify(ref || {}))
|
|
57
|
+
if ((widget.data.refer_app)) {
|
|
58
|
+
GlobalWidget.initialShowCaseData({
|
|
59
|
+
widget: widget,
|
|
60
|
+
gvc: gvc
|
|
61
|
+
});
|
|
62
|
+
if (gvc.glitter.document.body.clientWidth < 800 && (widget as any).mobile.refer === 'custom') {
|
|
63
|
+
((widget as any)[`mobile_editable`] ?? []).map((dd: any) => {
|
|
64
|
+
formData[dd] = JSON.parse(JSON.stringify(((widget as any).mobile.data.refer_form_data || data.page_config.formData)[dd] || {}))
|
|
65
|
+
});
|
|
66
|
+
// data.page_config.formData = (widget.data.refer_form_data || data.page_config.formData)
|
|
67
|
+
} else if (gvc.glitter.document.body.clientWidth >= 800 && (widget as any).desktop.refer === 'custom') {
|
|
68
|
+
((widget as any)[`desktop_editable`] ?? []).map((dd: any) => {
|
|
69
|
+
formData[dd] = JSON.parse(JSON.stringify(((widget as any).desktop.data.refer_form_data || data.page_config.formData)[dd] || {}))
|
|
70
|
+
});
|
|
43
71
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return gvc.bindView(() => {
|
|
72
|
+
// data.page_config.formData = ((widget as any).desktop.data.refer_form_data || data.page_config.formData);
|
|
73
|
+
}
|
|
47
74
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
75
|
+
}
|
|
76
|
+
return formData;
|
|
77
|
+
}
|
|
78
|
+
const formData=getFormData((widget.data.refer_app) ? (widget.data.refer_form_data || data.page_config.formData) : data.page_config.formData);
|
|
79
|
+
if(formData.list && formData.list.length){
|
|
80
|
+
obj.gvc.glitter.innerDialog((gvc) => {
|
|
81
|
+
return gvc.bindView(() => {
|
|
82
|
+
|
|
83
|
+
return {
|
|
84
|
+
bind: id,
|
|
85
|
+
view: () => {
|
|
86
|
+
return html`
|
|
52
87
|
<div class="swiper mySwiper_${id}" style="width:520px;max-width:100vw;height:auto !important;">
|
|
53
88
|
<div class="swiper-wrapper">
|
|
54
89
|
${
|
|
55
|
-
|
|
56
|
-
|
|
90
|
+
formData.list.map((dd:any) => {
|
|
91
|
+
return html`
|
|
57
92
|
<div class="swiper-slide pb-4 d-flex align-items-center justify-content-center position-relative"
|
|
58
93
|
style="background: none;
|
|
59
94
|
overflow: hidden;;
|
|
@@ -61,66 +96,68 @@ overflow: hidden;;
|
|
|
61
96
|
<img src="${dd.img || 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg'}" style="width:520px;max-width:calc(100vw - 40px);max-height: 100vh;cursor: pointer;
|
|
62
97
|
border-radius: 25px;
|
|
63
98
|
" onclick="${gvc.event(() => {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
99
|
+
gvc.glitter.href=dd.link;
|
|
100
|
+
gvc.closeDialog()
|
|
101
|
+
})}" >
|
|
67
102
|
<div class="position-absolute d-flex align-items-center justify-content-center"
|
|
68
103
|
style="top:0px;right: 0px;width:50px;height: 50px;
|
|
69
104
|
background: rgba(0,0,0,0.5);border-top-right-radius: 25px;border-bottom-left-radius: 10px;cursor: pointer;" onclick="${
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
105
|
+
(()=>{
|
|
106
|
+
if(gvc.glitter.htmlGenerate.isEditMode()){
|
|
107
|
+
return gvc.editorEvent(()=>{
|
|
108
|
+
gvc.closeDialog()
|
|
109
|
+
})
|
|
110
|
+
}else{
|
|
111
|
+
return gvc.event(()=>{
|
|
112
|
+
gvc.closeDialog()
|
|
113
|
+
})
|
|
114
|
+
}
|
|
115
|
+
})()}">
|
|
81
116
|
<i class="fa-regular fa-circle-xmark text-white fs-5"
|
|
82
117
|
></i>
|
|
83
118
|
</div>
|
|
84
119
|
</div>
|
|
85
120
|
`
|
|
86
|
-
|
|
87
|
-
|
|
121
|
+
}).join('')
|
|
122
|
+
}
|
|
88
123
|
</div>
|
|
89
124
|
<div class="swiper-pagination swiper-pagination-${id}"></div>
|
|
90
125
|
</div>`
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
126
|
+
},
|
|
127
|
+
divCreate: {
|
|
128
|
+
class: `vw-100 vh-100 position-fixed ${id} d-flex align-items-center justify-content-center`,
|
|
129
|
+
style: css`z-index: 999999;
|
|
95
130
|
background: rgba(0, 0, 0, 0.5);`
|
|
96
|
-
|
|
97
|
-
|
|
131
|
+
},
|
|
132
|
+
onCreate: () => {
|
|
98
133
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
134
|
+
const interval = setInterval(() => {
|
|
135
|
+
if ((gvc.glitter.window as any).Swiper) {
|
|
136
|
+
const swiper = new (gvc.glitter.window as any).Swiper(`.mySwiper_${id}`, {
|
|
137
|
+
// Optional parameters
|
|
138
|
+
loop: true,
|
|
139
|
+
// If we need pagination
|
|
140
|
+
pagination: {
|
|
141
|
+
el: `.swiper-pagination-${id}`,
|
|
142
|
+
clickable: true,
|
|
143
|
+
},
|
|
144
|
+
on: {
|
|
145
|
+
slideChange: function () {
|
|
146
|
+
// @ts-ignore
|
|
147
|
+
},
|
|
148
|
+
},
|
|
114
149
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
150
|
+
});
|
|
151
|
+
clearTimeout(interval)
|
|
152
|
+
}
|
|
153
|
+
}, 100)
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
})
|
|
157
|
+
}, 'first-banner', {})
|
|
120
158
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
159
|
+
})
|
|
160
|
+
|
|
124
161
|
|
|
125
162
|
|
|
126
163
|
return ``
|
|
@@ -23,32 +23,16 @@ export class SocialLinks01 {
|
|
|
23
23
|
};
|
|
24
24
|
const gotoTopImg = 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/arrow-up-to-line-light.svg';
|
|
25
25
|
gvc.addStyle(css `
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
z-index: 1000;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
@media (min-width: 769px) {
|
|
40
|
-
.floating-action-panel {
|
|
41
|
-
position: fixed;
|
|
42
|
-
bottom: 30px;
|
|
43
|
-
right: 30px;
|
|
44
|
-
display: flex;
|
|
45
|
-
flex-direction: column; /* 垂直排列 */
|
|
46
|
-
align-items: center;
|
|
47
|
-
gap: 10px; /* 按鈕間距 */
|
|
48
|
-
z-index: 1000;
|
|
49
|
-
}
|
|
26
|
+
.floating-action-panel {
|
|
27
|
+
position: fixed;
|
|
28
|
+
bottom: 30px;
|
|
29
|
+
right: 30px;
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column; /* 垂直排列 */
|
|
32
|
+
align-items: center;
|
|
33
|
+
gap: 10px; /* 按鈕間距 */
|
|
34
|
+
z-index: 1000;
|
|
50
35
|
}
|
|
51
|
-
|
|
52
36
|
|
|
53
37
|
.social-links {
|
|
54
38
|
display: flex;
|
|
@@ -75,20 +59,22 @@ export class SocialLinks01 {
|
|
|
75
59
|
border: none;
|
|
76
60
|
padding: 2px;
|
|
77
61
|
cursor: pointer;
|
|
78
|
-
width: 40px;
|
|
79
|
-
height: 40px;
|
|
80
62
|
border-radius: 50%;
|
|
81
63
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
|
82
64
|
}
|
|
83
65
|
|
|
84
|
-
|
|
66
|
+
.component-img {
|
|
67
|
+
width: 40px;
|
|
68
|
+
height: 40px;
|
|
69
|
+
object-fit: contain;
|
|
70
|
+
}
|
|
85
71
|
|
|
86
|
-
.component-circle:hover {
|
|
72
|
+
.component-circle:hover .component-img {
|
|
87
73
|
opacity: 0.8;
|
|
88
74
|
}
|
|
89
75
|
|
|
90
76
|
.up-to-top.hidden {
|
|
91
|
-
display: none
|
|
77
|
+
display: none;
|
|
92
78
|
}
|
|
93
79
|
`);
|
|
94
80
|
return gvc.bindView({
|
|
@@ -100,37 +86,30 @@ export class SocialLinks01 {
|
|
|
100
86
|
${socialList
|
|
101
87
|
.map(socialLink => {
|
|
102
88
|
var _a;
|
|
103
|
-
if (socialLink.icon === 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg') {
|
|
104
|
-
socialLink.icon = undefined;
|
|
105
|
-
}
|
|
106
89
|
const imgSrc = supportSocial.includes(socialLink.social_type)
|
|
107
90
|
? socialIMG[socialLink.social_type]
|
|
108
91
|
: socialIMG.other;
|
|
109
92
|
return html `
|
|
110
|
-
<
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
background-image: url('${(_a = socialLink.icon) !== null && _a !== void 0 ? _a : imgSrc}');background-size: cover;background-position: center;"
|
|
114
|
-
>
|
|
115
|
-
</div>
|
|
93
|
+
<a href="${socialLink.link}" class="component-circle">
|
|
94
|
+
<img src="${(_a = socialLink.icon) !== null && _a !== void 0 ? _a : imgSrc}" alt="Go to top" class="component-img" />
|
|
95
|
+
</a>
|
|
116
96
|
`;
|
|
117
97
|
})
|
|
118
98
|
.join('')}
|
|
119
99
|
</div>
|
|
120
100
|
<button
|
|
121
|
-
class="component-circle up-to-top hidden
|
|
122
|
-
style="overflow: hidden; background-color: white;display: flex; "
|
|
101
|
+
class="component-circle up-to-top hidden"
|
|
123
102
|
onclick="${gvc.event(() => {
|
|
124
103
|
scrollToTop();
|
|
125
104
|
})}"
|
|
126
105
|
>
|
|
127
|
-
<
|
|
106
|
+
<img src="${gotoTopImg}" alt="Go to top" class="component-img" />
|
|
128
107
|
</button>
|
|
129
108
|
</div>
|
|
130
109
|
`;
|
|
131
110
|
}, divCreate: {},
|
|
132
111
|
onInitial: () => {
|
|
133
|
-
window.
|
|
112
|
+
window.onscroll = function () {
|
|
134
113
|
const scrollPosition = window.scrollY;
|
|
135
114
|
const threshold = window.innerHeight / 2;
|
|
136
115
|
const panel = document.querySelector('.up-to-top');
|
|
@@ -140,7 +119,7 @@ background-image: url('${(_a = socialLink.icon) !== null && _a !== void 0 ? _a :
|
|
|
140
119
|
else {
|
|
141
120
|
panel.classList.add('hidden');
|
|
142
121
|
}
|
|
143
|
-
}
|
|
122
|
+
};
|
|
144
123
|
}
|
|
145
124
|
});
|
|
146
125
|
}
|
|
@@ -33,32 +33,16 @@ export class SocialLinks01 {
|
|
|
33
33
|
};
|
|
34
34
|
const gotoTopImg = 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/arrow-up-to-line-light.svg';
|
|
35
35
|
gvc.addStyle(css`
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
z-index: 1000;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
@media (min-width: 769px) {
|
|
50
|
-
.floating-action-panel {
|
|
51
|
-
position: fixed;
|
|
52
|
-
bottom: 30px;
|
|
53
|
-
right: 30px;
|
|
54
|
-
display: flex;
|
|
55
|
-
flex-direction: column; /* 垂直排列 */
|
|
56
|
-
align-items: center;
|
|
57
|
-
gap: 10px; /* 按鈕間距 */
|
|
58
|
-
z-index: 1000;
|
|
59
|
-
}
|
|
36
|
+
.floating-action-panel {
|
|
37
|
+
position: fixed;
|
|
38
|
+
bottom: 30px;
|
|
39
|
+
right: 30px;
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column; /* 垂直排列 */
|
|
42
|
+
align-items: center;
|
|
43
|
+
gap: 10px; /* 按鈕間距 */
|
|
44
|
+
z-index: 1000;
|
|
60
45
|
}
|
|
61
|
-
|
|
62
46
|
|
|
63
47
|
.social-links {
|
|
64
48
|
display: flex;
|
|
@@ -85,23 +69,24 @@ export class SocialLinks01 {
|
|
|
85
69
|
border: none;
|
|
86
70
|
padding: 2px;
|
|
87
71
|
cursor: pointer;
|
|
88
|
-
width: 40px;
|
|
89
|
-
height: 40px;
|
|
90
72
|
border-radius: 50%;
|
|
91
73
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
|
92
74
|
}
|
|
93
75
|
|
|
94
|
-
|
|
76
|
+
.component-img {
|
|
77
|
+
width: 40px;
|
|
78
|
+
height: 40px;
|
|
79
|
+
object-fit: contain;
|
|
80
|
+
}
|
|
95
81
|
|
|
96
|
-
.component-circle:hover {
|
|
82
|
+
.component-circle:hover .component-img {
|
|
97
83
|
opacity: 0.8;
|
|
98
84
|
}
|
|
99
85
|
|
|
100
86
|
.up-to-top.hidden {
|
|
101
|
-
display: none
|
|
87
|
+
display: none;
|
|
102
88
|
}
|
|
103
89
|
`);
|
|
104
|
-
|
|
105
90
|
return gvc.bindView({
|
|
106
91
|
bind:vm.id,
|
|
107
92
|
view:()=>{
|
|
@@ -110,39 +95,30 @@ export class SocialLinks01 {
|
|
|
110
95
|
<div class="social-links">
|
|
111
96
|
${socialList
|
|
112
97
|
.map(socialLink => {
|
|
113
|
-
if(socialLink.icon==='https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg'){
|
|
114
|
-
(socialLink.icon as any) = undefined;
|
|
115
|
-
}
|
|
116
98
|
const imgSrc = supportSocial.includes(socialLink.social_type)
|
|
117
99
|
? socialIMG[socialLink.social_type]
|
|
118
100
|
: socialIMG.other;
|
|
119
101
|
return html`
|
|
120
|
-
<
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
})
|
|
124
|
-
}" class="component-circle" style="overflow: hidden;
|
|
125
|
-
background-image: url('${socialLink.icon??imgSrc}');background-size: cover;background-position: center;"
|
|
126
|
-
>
|
|
127
|
-
</div>
|
|
102
|
+
<a href="${socialLink.link}" class="component-circle">
|
|
103
|
+
<img src="${socialLink.icon??imgSrc}" alt="Go to top" class="component-img" />
|
|
104
|
+
</a>
|
|
128
105
|
`;
|
|
129
106
|
})
|
|
130
107
|
.join('')}
|
|
131
108
|
</div>
|
|
132
109
|
<button
|
|
133
|
-
class="component-circle up-to-top hidden
|
|
134
|
-
style="overflow: hidden; background-color: white;display: flex; "
|
|
110
|
+
class="component-circle up-to-top hidden"
|
|
135
111
|
onclick="${gvc.event(() => {
|
|
136
112
|
scrollToTop();
|
|
137
113
|
})}"
|
|
138
114
|
>
|
|
139
|
-
<
|
|
115
|
+
<img src="${gotoTopImg}" alt="Go to top" class="component-img" />
|
|
140
116
|
</button>
|
|
141
117
|
</div>
|
|
142
118
|
`;
|
|
143
119
|
},divCreate:{}
|
|
144
120
|
,onInitial:()=>{
|
|
145
|
-
window.
|
|
121
|
+
(window as any).onscroll = function() {
|
|
146
122
|
const scrollPosition = window.scrollY;
|
|
147
123
|
|
|
148
124
|
const threshold = window.innerHeight / 2;
|
|
@@ -154,8 +130,7 @@ background-image: url('${socialLink.icon??imgSrc}');background-size: cover;backg
|
|
|
154
130
|
} else {
|
|
155
131
|
panel!.classList.add('hidden');
|
|
156
132
|
}
|
|
157
|
-
}
|
|
158
|
-
|
|
133
|
+
};
|
|
159
134
|
}
|
|
160
135
|
})
|
|
161
136
|
|
package/package.json
CHANGED
|
@@ -70,6 +70,17 @@ router.get('/manager', async (req, resp) => {
|
|
|
70
70
|
if (req.query.search) {
|
|
71
71
|
query.push(`(content->>'$.name' like '%${req.query.search}%') || (content->>'$.title' like '%${req.query.search}%')`);
|
|
72
72
|
}
|
|
73
|
+
const idStr = req.query.id_list
|
|
74
|
+
? req.query.id_list
|
|
75
|
+
.toString()
|
|
76
|
+
.split(',')
|
|
77
|
+
.filter(Boolean)
|
|
78
|
+
.map(id => database_js_1.default.escape(id))
|
|
79
|
+
.join(',')
|
|
80
|
+
: '';
|
|
81
|
+
if (req.query.id_list && idStr) {
|
|
82
|
+
query.push(`(id in (${idStr}))`);
|
|
83
|
+
}
|
|
73
84
|
const collection_list_value = await new user_js_1.User(req.get('g-app')).getConfigV2({
|
|
74
85
|
key: 'blog_collection',
|
|
75
86
|
user_id: 'manager',
|