ts-glitter 15.9.9 → 16.0.2
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/editor-config.js +81 -22
- package/lowcode/editor-config.ts +93 -33
- package/lowcode/jspage/function-page/setting_editor.js +1 -0
- package/lowcode/jspage/function-page/setting_editor.ts +2 -0
- package/lowcode/jspage/main.js +0 -6
- package/lowcode/jspage/main.ts +5 -5
- package/package.json +1 -1
package/lowcode/Entry.js
CHANGED
|
@@ -79,7 +79,7 @@ export class Entry {
|
|
|
79
79
|
}
|
|
80
80
|
window.renderClock = (_a = window.renderClock) !== null && _a !== void 0 ? _a : clockF();
|
|
81
81
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
82
|
-
glitter.share.editerVersion = '
|
|
82
|
+
glitter.share.editerVersion = 'V_16.0.2';
|
|
83
83
|
glitter.share.start = new Date();
|
|
84
84
|
const vm = {
|
|
85
85
|
appConfig: [],
|
package/lowcode/Entry.ts
CHANGED
|
@@ -81,7 +81,7 @@ export class Entry {
|
|
|
81
81
|
|
|
82
82
|
(window as any).renderClock = (window as any).renderClock ?? clockF();
|
|
83
83
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
84
|
-
glitter.share.editerVersion = '
|
|
84
|
+
glitter.share.editerVersion = 'V_16.0.2';
|
|
85
85
|
glitter.share.start = new Date();
|
|
86
86
|
const vm: {
|
|
87
87
|
appConfig: any;
|
package/lowcode/editor-config.js
CHANGED
|
@@ -17,32 +17,91 @@ export class EditorConfig {
|
|
|
17
17
|
if (EditorConfig.backend_page() !== 'backend-manger') {
|
|
18
18
|
return ``;
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
gvc.recreateView();
|
|
25
|
-
})}">前往續約</span>`;
|
|
26
|
-
let differenceInTime = new Date(plan.dead_line).getTime() - new Date().getTime();
|
|
27
|
-
let differenceInDays = (differenceInTime / (1000 * 3600 * 24)).toFixed(0);
|
|
28
|
-
if (plan.plan === 'free' && differenceInDays > 1) {
|
|
29
|
-
text = `<span style="color: white; font-size: 16px; font-family: Noto Sans; font-weight: 700;" class="me-3">方案提醒:當前為免費試用方案,立即升級方案,享受全方位支援服務。</span>${paymentBtn}`;
|
|
20
|
+
let bg_color = '#FEAD20';
|
|
21
|
+
gvc.glitter.addStyle(`
|
|
22
|
+
.notice_text {
|
|
23
|
+
color: white; font-size: 16px; font-family: Noto Sans; font-weight: 700;
|
|
30
24
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
text =
|
|
25
|
+
`);
|
|
26
|
+
function getText() {
|
|
27
|
+
bg_color = '#FEAD20';
|
|
28
|
+
const plan = EditorConfig.getPaymentStatus();
|
|
29
|
+
let text = '';
|
|
30
|
+
let paymentBtn = `<span style="color: white; font-size: 16px; font-family: Noto Sans; font-weight: 700; text-decoration: underline; word-wrap: break-word;cursor: pointer;" class="" onclick="${gvc.event(() => {
|
|
31
|
+
gvc.glitter.setUrlParameter('tab', 'member_plan');
|
|
32
|
+
gvc.recreateView();
|
|
33
|
+
})}">前往續約</span>`;
|
|
34
|
+
let differenceInTime = new Date(plan.dead_line).getTime() - new Date().getTime();
|
|
35
|
+
let differenceInDays = (differenceInTime / (1000 * 3600 * 24)).toFixed(0);
|
|
36
|
+
if (plan.plan === 'free' && differenceInDays > 1) {
|
|
37
|
+
if (gvc.glitter.getUrlParameter('tab') === 'home_page' || ((gvc.glitter.deviceType !== gvc.glitter.deviceTypeEnum.Web) || document.body.clientWidth > 800)) {
|
|
38
|
+
text = `<div class="d-flex flex-column flex-sm-row align-items-center justify-content-center" style="gap:10px;">
|
|
39
|
+
<span class="notice_text">立即聯繫開店顧問,專人協助打造高質感官網</span>
|
|
40
|
+
<button class="btn btn-black " type="button" style="height:30px;" onclick="${gvc.event(() => {
|
|
41
|
+
gvc.glitter.openNewTab(`https://liff.line.me/1645278921-kWRPP32q/?accountId=263cycek`);
|
|
42
|
+
})}">
|
|
43
|
+
<span class="tx_700_white">聯繫顧問</span>
|
|
44
|
+
</button>
|
|
45
|
+
</div>`;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
bg_color = '#ff6c02';
|
|
49
|
+
text = `
|
|
50
|
+
|
|
51
|
+
<div class="d-flex flex-column flex-sm-row align-items-center justify-content-center" style="gap:10px;">
|
|
52
|
+
<span class="notice_text">立即下載行動後台APP,享受流暢操作體驗</span>
|
|
53
|
+
<button class="btn btn-black " type="button" style="height:30px;" onclick="${gvc.event(() => {
|
|
54
|
+
function isAppleDevice() {
|
|
55
|
+
return /iPhone|iPad|iPod/i.test(navigator.userAgent);
|
|
56
|
+
}
|
|
57
|
+
function isAndroidDevice() {
|
|
58
|
+
return /Android/i.test(navigator.userAgent);
|
|
59
|
+
}
|
|
60
|
+
if (isAppleDevice()) {
|
|
61
|
+
gvc.glitter.openNewTab(`https://apps.apple.com/us/app/shopnex-%E5%85%A8%E9%80%9A%E8%B7%AF%E6%95%B4%E5%90%88%E9%96%8B%E5%BA%97%E5%B9%B3%E5%8F%B0/id6736935325`);
|
|
62
|
+
}
|
|
63
|
+
else if (isAndroidDevice()) {
|
|
64
|
+
gvc.glitter.openNewTab(`https://play.google.com/store/apps/details?id=shopnex.cc`);
|
|
65
|
+
}
|
|
66
|
+
})}">
|
|
67
|
+
<span class="tx_700_white">前往下載</span>
|
|
68
|
+
</button>
|
|
69
|
+
</div>
|
|
70
|
+
`;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
else if (new Date(plan.dead_line).getTime() < new Date().getTime()) {
|
|
74
|
+
text = ` <i class="fa-sharp fa-solid fa-bullhorn" style="color: white;"></i><span style="color: white; font-size: 16px; font-family: Noto Sans; font-weight: 700; ">方案到期提醒:您的方案已過期,為維護您的權益,請儘速${paymentBtn}。</span>`;
|
|
75
|
+
}
|
|
76
|
+
else if (differenceInDays < 30) {
|
|
77
|
+
text = ` <i class="fa-sharp fa-solid fa-bullhorn" style="color: white;"></i><span style="color: white; font-size: 16px; font-family: Noto Sans; font-weight: 700; ">方案到期提醒:您的方案將於${differenceInDays}天後到期,為維護您的權益,請儘速${paymentBtn}。</span>`;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
return ``;
|
|
81
|
+
}
|
|
82
|
+
return text;
|
|
36
83
|
}
|
|
37
|
-
|
|
84
|
+
const html = String.raw;
|
|
85
|
+
if (!getText()) {
|
|
38
86
|
return ``;
|
|
39
87
|
}
|
|
40
|
-
return
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
88
|
+
return gvc.bindView(() => {
|
|
89
|
+
return {
|
|
90
|
+
bind: 'top-notice',
|
|
91
|
+
view: () => {
|
|
92
|
+
return html `
|
|
93
|
+
<div style="text-align: center;white-space:normal;" class="w-100">
|
|
94
|
+
${getText()}
|
|
95
|
+
</div>`;
|
|
96
|
+
},
|
|
97
|
+
divCreate: () => {
|
|
98
|
+
return {
|
|
99
|
+
class: `position-fixed vw-100 p-2`,
|
|
100
|
+
style: `z-index:999;margin-top:${56 + (parseInt(gvc.glitter.share.top_inset, 10) ? (parseInt(gvc.glitter.share.top_inset, 10) + 10) : 0)}px;width: 100%; min-height: 42px; background: ${bg_color}; box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.08);`
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
});
|
|
46
105
|
}
|
|
47
106
|
static getPaddingTop(gvc) {
|
|
48
107
|
return EditorConfig.paymentInfo(gvc)
|
package/lowcode/editor-config.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {GVC} from './glitterBundle/GVController.js';
|
|
2
|
+
import {BgWidget} from "./backend-manager/bg-widget.js";
|
|
2
3
|
|
|
3
4
|
export class EditorConfig {
|
|
4
5
|
public static get editor_layout(): {
|
|
@@ -92,43 +93,102 @@ export class EditorConfig {
|
|
|
92
93
|
if (EditorConfig.backend_page() !== 'backend-manger') {
|
|
93
94
|
return ``;
|
|
94
95
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
gvc.glitter.setUrlParameter('tab', 'member_plan');
|
|
100
|
-
gvc.recreateView();
|
|
101
|
-
}
|
|
102
|
-
)}">前往續約</span>`;
|
|
103
|
-
// 計算兩個日期的毫秒數之差
|
|
104
|
-
let differenceInTime = new Date(plan.dead_line).getTime() - new Date().getTime();
|
|
105
|
-
// 將毫秒數轉換為天數
|
|
106
|
-
let differenceInDays: any = (differenceInTime / (1000 * 3600 * 24)).toFixed(0);
|
|
107
|
-
if (plan.plan === 'free' && differenceInDays > 1) {
|
|
108
|
-
text = `<span style="color: white; font-size: 16px; font-family: Noto Sans; font-weight: 700;" class="me-3">方案提醒:當前為免費試用方案,立即升級方案,享受全方位支援服務。</span>${paymentBtn}`;
|
|
109
|
-
} else if (new Date(plan.dead_line).getTime() < new Date().getTime()) {
|
|
110
|
-
text = `<span style="color: white; font-size: 16px; font-family: Noto Sans; font-weight: 700; ">方案到期提醒:您的方案已過期,為維護您的權益,請儘速${paymentBtn}。</span>`;
|
|
111
|
-
} else if (differenceInDays < 30) {
|
|
112
|
-
text = `<span style="color: white; font-size: 16px; font-family: Noto Sans; font-weight: 700; ">方案到期提醒:您的方案將於${differenceInDays}天後到期,為維護您的權益,請儘速${paymentBtn}。</span>`;
|
|
113
|
-
} else {
|
|
114
|
-
return ``;
|
|
96
|
+
let bg_color = '#FEAD20'
|
|
97
|
+
gvc.glitter.addStyle(`
|
|
98
|
+
.notice_text {
|
|
99
|
+
color: white; font-size: 16px; font-family: Noto Sans; font-weight: 700;
|
|
115
100
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
101
|
+
`)
|
|
102
|
+
function getText(){
|
|
103
|
+
bg_color = '#FEAD20'
|
|
104
|
+
const plan = EditorConfig.getPaymentStatus();
|
|
105
|
+
let text = '';
|
|
106
|
+
let paymentBtn = `<span style="color: white; font-size: 16px; font-family: Noto Sans; font-weight: 700; text-decoration: underline; word-wrap: break-word;cursor: pointer;" class="" onclick="${gvc.event(
|
|
107
|
+
() => {
|
|
108
|
+
gvc.glitter.setUrlParameter('tab', 'member_plan');
|
|
109
|
+
gvc.recreateView();
|
|
110
|
+
}
|
|
111
|
+
)}">前往續約</span>`;
|
|
112
|
+
// 計算兩個日期的毫秒數之差
|
|
113
|
+
let differenceInTime = new Date(plan.dead_line).getTime() - new Date().getTime();
|
|
114
|
+
// 將毫秒數轉換為天數
|
|
115
|
+
let differenceInDays: any = (differenceInTime / (1000 * 3600 * 24)).toFixed(0);
|
|
116
|
+
if (plan.plan === 'free' && differenceInDays > 1) {
|
|
117
|
+
if (gvc.glitter.getUrlParameter('tab') === 'home_page' || ((gvc.glitter.deviceType !== gvc.glitter.deviceTypeEnum.Web) || document.body.clientWidth > 800)) {
|
|
118
|
+
text = `<div class="d-flex flex-column flex-sm-row align-items-center justify-content-center" style="gap:10px;">
|
|
119
|
+
<span class="notice_text">立即聯繫開店顧問,專人協助打造高質感官網</span>
|
|
120
|
+
<button class="btn btn-black " type="button" style="height:30px;" onclick="${gvc.event(()=>{
|
|
121
|
+
gvc.glitter.openNewTab(`https://liff.line.me/1645278921-kWRPP32q/?accountId=263cycek`)
|
|
122
|
+
})}">
|
|
123
|
+
<span class="tx_700_white">聯繫顧問</span>
|
|
124
|
+
</button>
|
|
121
125
|
</div>`;
|
|
126
|
+
} else {
|
|
127
|
+
bg_color = '#ff6c02'
|
|
128
|
+
text = `
|
|
129
|
+
|
|
130
|
+
<div class="d-flex flex-column flex-sm-row align-items-center justify-content-center" style="gap:10px;">
|
|
131
|
+
<span class="notice_text">立即下載行動後台APP,享受流暢操作體驗</span>
|
|
132
|
+
<button class="btn btn-black " type="button" style="height:30px;" onclick="${gvc.event(()=>{
|
|
133
|
+
function isAppleDevice() {
|
|
134
|
+
return /iPhone|iPad|iPod/i.test(navigator.userAgent);
|
|
135
|
+
}
|
|
136
|
+
function isAndroidDevice() {
|
|
137
|
+
return /Android/i.test(navigator.userAgent);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (isAppleDevice()) {
|
|
141
|
+
gvc.glitter.openNewTab(`https://apps.apple.com/us/app/shopnex-%E5%85%A8%E9%80%9A%E8%B7%AF%E6%95%B4%E5%90%88%E9%96%8B%E5%BA%97%E5%B9%B3%E5%8F%B0/id6736935325`)
|
|
142
|
+
} else if (isAndroidDevice()) {
|
|
143
|
+
gvc.glitter.openNewTab(`https://play.google.com/store/apps/details?id=shopnex.cc`)
|
|
144
|
+
}
|
|
145
|
+
})}">
|
|
146
|
+
<span class="tx_700_white">前往下載</span>
|
|
147
|
+
</button>
|
|
148
|
+
</div>
|
|
149
|
+
`;
|
|
150
|
+
}
|
|
151
|
+
} else if (new Date(plan.dead_line).getTime() < new Date().getTime()) {
|
|
152
|
+
text = ` <i class="fa-sharp fa-solid fa-bullhorn" style="color: white;"></i><span style="color: white; font-size: 16px; font-family: Noto Sans; font-weight: 700; ">方案到期提醒:您的方案已過期,為維護您的權益,請儘速${paymentBtn}。</span>`;
|
|
153
|
+
} else if (differenceInDays < 30) {
|
|
154
|
+
text = ` <i class="fa-sharp fa-solid fa-bullhorn" style="color: white;"></i><span style="color: white; font-size: 16px; font-family: Noto Sans; font-weight: 700; ">方案到期提醒:您的方案將於${differenceInDays}天後到期,為維護您的權益,請儘速${paymentBtn}。</span>`;
|
|
155
|
+
} else {
|
|
156
|
+
return ``;
|
|
157
|
+
}
|
|
158
|
+
return text
|
|
159
|
+
}
|
|
160
|
+
const html = String.raw;
|
|
161
|
+
if(!getText()){
|
|
162
|
+
return ``
|
|
163
|
+
}
|
|
164
|
+
return gvc.bindView(() => {
|
|
165
|
+
return {
|
|
166
|
+
bind: 'top-notice',
|
|
167
|
+
view: () => {
|
|
168
|
+
|
|
169
|
+
return html`
|
|
170
|
+
<div style="text-align: center;white-space:normal;" class="w-100">
|
|
171
|
+
${getText()}
|
|
172
|
+
</div>`
|
|
173
|
+
},
|
|
174
|
+
divCreate: ()=>{
|
|
175
|
+
return {
|
|
176
|
+
class: `position-fixed vw-100 p-2`,
|
|
177
|
+
style: `z-index:999;margin-top:${56 + (parseInt(gvc.glitter.share.top_inset, 10) ? (parseInt(gvc.glitter.share.top_inset, 10) + 10) : 0)}px;width: 100%; min-height: 42px; background: ${bg_color}; box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.08);`
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
})
|
|
122
182
|
}
|
|
123
183
|
|
|
124
184
|
public static getPaddingTop(gvc: GVC) {
|
|
125
185
|
return EditorConfig.paymentInfo(gvc)
|
|
126
186
|
? gvc.glitter.ut.frSize(
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
187
|
+
{
|
|
188
|
+
sm: 40,
|
|
189
|
+
},
|
|
190
|
+
67
|
|
191
|
+
)
|
|
132
192
|
: 0;
|
|
133
193
|
}
|
|
134
194
|
|
|
@@ -141,8 +201,8 @@ export class EditorConfig {
|
|
|
141
201
|
};
|
|
142
202
|
}
|
|
143
203
|
|
|
144
|
-
public static backend_page():'backend-manger'|'page-editor'|'user-editor'{
|
|
145
|
-
if((window as any).glitter.getUrlParameter('page')==='cms'){
|
|
204
|
+
public static backend_page(): 'backend-manger' | 'page-editor' | 'user-editor' {
|
|
205
|
+
if ((window as any).glitter.getUrlParameter('page') === 'cms') {
|
|
146
206
|
return 'backend-manger'
|
|
147
207
|
}
|
|
148
208
|
return (window as any).glitter.getUrlParameter('function')
|
|
@@ -146,6 +146,7 @@ export class Setting_editor {
|
|
|
146
146
|
url.searchParams.set('appName', items[parseInt(index)].appName);
|
|
147
147
|
url.searchParams.set('cms', 'true');
|
|
148
148
|
url.searchParams.set('page', page);
|
|
149
|
+
gvc.notifyDataChange('top-notice');
|
|
149
150
|
$('#editerCenter').html(html `
|
|
150
151
|
<iframe src="${url.href}"
|
|
151
152
|
style="border: none;height: calc(100%);"></iframe>`);
|
|
@@ -753,6 +753,7 @@ export class Setting_editor {
|
|
|
753
753
|
bind: id,
|
|
754
754
|
view: () => {
|
|
755
755
|
Storage.select_bg_btn = 'custom';
|
|
756
|
+
|
|
756
757
|
return html`
|
|
757
758
|
<div
|
|
758
759
|
class="d-flex p-3 bg-white border-bottom align-items-end d-lg-none"
|
|
@@ -806,6 +807,7 @@ export class Setting_editor {
|
|
|
806
807
|
url.searchParams.set('appName', items[parseInt(index)].appName);
|
|
807
808
|
url.searchParams.set('cms', 'true');
|
|
808
809
|
url.searchParams.set('page', page);
|
|
810
|
+
gvc.notifyDataChange('top-notice')
|
|
809
811
|
// ((window as any).glitterInitialHelper).getPageData({
|
|
810
812
|
// tag: page,
|
|
811
813
|
// appName: items[parseInt(index)].appName
|
package/lowcode/jspage/main.js
CHANGED
|
@@ -39,7 +39,6 @@ import { BaseApi } from "../glitterBundle/api/base.js";
|
|
|
39
39
|
import { GlobalUser } from "../glitter-base/global/global-user.js";
|
|
40
40
|
import { Article } from "../glitter-base/route/article.js";
|
|
41
41
|
import { AiChat } from "../glitter-base/route/ai-chat.js";
|
|
42
|
-
import { BgMobileGuide } from "../backend-manager/bg-mobile-guide.js";
|
|
43
42
|
import { SaasViewModel } from "../view-model/saas-view-model.js";
|
|
44
43
|
const html = String.raw;
|
|
45
44
|
const editorContainerID = `HtmlEditorContainer`;
|
|
@@ -728,11 +727,6 @@ ${Storage.page_setting_item === `${da.index}` ? `background:${EditorConfig.edito
|
|
|
728
727
|
});
|
|
729
728
|
}
|
|
730
729
|
else {
|
|
731
|
-
if (!localStorage.getItem('see_bg_mobile_guide')) {
|
|
732
|
-
let bgMobileGuide = new BgMobileGuide(gvc, 1);
|
|
733
|
-
bgMobileGuide.drawGuide();
|
|
734
|
-
localStorage.setItem('see_bg_mobile_guide', 'true');
|
|
735
|
-
}
|
|
736
730
|
}
|
|
737
731
|
}
|
|
738
732
|
(ApiUser.getSaasUserData(GlobalUser.saas_token, 'me')).then((res) => {
|
package/lowcode/jspage/main.ts
CHANGED
|
@@ -779,11 +779,11 @@ ${Storage.page_setting_item === `${da.index}` ? `background:${EditorConfig.edito
|
|
|
779
779
|
}
|
|
780
780
|
})
|
|
781
781
|
}else {
|
|
782
|
-
if(!localStorage.getItem('see_bg_mobile_guide')){
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
}
|
|
782
|
+
// if(!localStorage.getItem('see_bg_mobile_guide')){
|
|
783
|
+
// let bgMobileGuide = new BgMobileGuide(gvc,1);
|
|
784
|
+
// bgMobileGuide.drawGuide();
|
|
785
|
+
// localStorage.setItem('see_bg_mobile_guide','true')
|
|
786
|
+
// }
|
|
787
787
|
}
|
|
788
788
|
}
|
|
789
789
|
//如未填寫聯絡資訊則固定跳彈窗出來
|