ts-glitter 16.0.1 → 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 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 = 'V_16.0.1';
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 = 'V_16.0.1';
84
+ glitter.share.editerVersion = 'V_16.0.2';
85
85
  glitter.share.start = new Date();
86
86
  const vm: {
87
87
  appConfig: any;
@@ -23,69 +23,75 @@ export class EditorConfig {
23
23
  color: white; font-size: 16px; font-family: Noto Sans; font-weight: 700;
24
24
  }
25
25
  `);
26
- const html = String.raw;
27
- return gvc.bindView(() => {
28
- return {
29
- bind: 'top-notice',
30
- view: () => {
31
- bg_color = '#FEAD20';
32
- const plan = EditorConfig.getPaymentStatus();
33
- let text = '';
34
- 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(() => {
35
- gvc.glitter.setUrlParameter('tab', 'member_plan');
36
- gvc.recreateView();
37
- })}">前往續約</span>`;
38
- let differenceInTime = new Date(plan.dead_line).getTime() - new Date().getTime();
39
- let differenceInDays = (differenceInTime / (1000 * 3600 * 24)).toFixed(0);
40
- if (plan.plan === 'free' && differenceInDays > 1) {
41
- if (gvc.glitter.getUrlParameter('tab') === 'home_page' || ((gvc.glitter.deviceType !== gvc.glitter.deviceTypeEnum.Web) || document.body.clientWidth > 800)) {
42
- text = `<div class="d-flex flex-column flex-sm-row align-items-center justify-content-center" style="gap:10px;">
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;">
43
39
  <span class="notice_text">立即聯繫開店顧問,專人協助打造高質感官網</span>
44
40
  <button class="btn btn-black " type="button" style="height:30px;" onclick="${gvc.event(() => {
45
- gvc.glitter.openNewTab(`https://liff.line.me/1645278921-kWRPP32q/?accountId=263cycek`);
46
- })}">
41
+ gvc.glitter.openNewTab(`https://liff.line.me/1645278921-kWRPP32q/?accountId=263cycek`);
42
+ })}">
47
43
  <span class="tx_700_white">聯繫顧問</span>
48
44
  </button>
49
45
  </div>`;
50
- }
51
- else {
52
- bg_color = '#ff6c02';
53
- text = `
46
+ }
47
+ else {
48
+ bg_color = '#ff6c02';
49
+ text = `
54
50
 
55
51
  <div class="d-flex flex-column flex-sm-row align-items-center justify-content-center" style="gap:10px;">
56
52
  <span class="notice_text">立即下載行動後台APP,享受流暢操作體驗</span>
57
53
  <button class="btn btn-black " type="button" style="height:30px;" onclick="${gvc.event(() => {
58
- function isAppleDevice() {
59
- return /iPhone|iPad|iPod/i.test(navigator.userAgent);
60
- }
61
- function isAndroidDevice() {
62
- return /Android/i.test(navigator.userAgent);
63
- }
64
- if (isAppleDevice()) {
65
- 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`);
66
- }
67
- else if (isAndroidDevice()) {
68
- gvc.glitter.openNewTab(`https://play.google.com/store/apps/details?id=shopnex.cc`);
69
- }
70
- })}">
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
+ })}">
71
67
  <span class="tx_700_white">前往下載</span>
72
68
  </button>
73
69
  </div>
74
70
  `;
75
- }
76
- }
77
- else if (new Date(plan.dead_line).getTime() < new Date().getTime()) {
78
- 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>`;
79
- }
80
- else if (differenceInDays < 30) {
81
- 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>`;
82
- }
83
- else {
84
- return ``;
85
- }
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;
83
+ }
84
+ const html = String.raw;
85
+ if (!getText()) {
86
+ return ``;
87
+ }
88
+ return gvc.bindView(() => {
89
+ return {
90
+ bind: 'top-notice',
91
+ view: () => {
86
92
  return html `
87
93
  <div style="text-align: center;white-space:normal;" class="w-100">
88
- ${text}
94
+ ${getText()}
89
95
  </div>`;
90
96
  },
91
97
  divCreate: () => {
@@ -99,69 +99,76 @@ export class EditorConfig {
99
99
  color: white; font-size: 16px; font-family: Noto Sans; font-weight: 700;
100
100
  }
101
101
  `)
102
- const html = String.raw
103
- return gvc.bindView(() => {
104
- return {
105
- bind: 'top-notice',
106
- view: () => {
107
- bg_color = '#FEAD20'
108
- const plan = EditorConfig.getPaymentStatus();
109
- let text = '';
110
- 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(
111
- () => {
112
- gvc.glitter.setUrlParameter('tab', 'member_plan');
113
- gvc.recreateView();
114
- }
115
- )}">前往續約</span>`;
116
- // 計算兩個日期的毫秒數之差
117
- let differenceInTime = new Date(plan.dead_line).getTime() - new Date().getTime();
118
- // 將毫秒數轉換為天數
119
- let differenceInDays: any = (differenceInTime / (1000 * 3600 * 24)).toFixed(0);
120
- if (plan.plan === 'free' && differenceInDays > 1) {
121
- if (gvc.glitter.getUrlParameter('tab') === 'home_page' || ((gvc.glitter.deviceType !== gvc.glitter.deviceTypeEnum.Web) || document.body.clientWidth > 800)) {
122
- text = `<div class="d-flex flex-column flex-sm-row align-items-center justify-content-center" style="gap:10px;">
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;">
123
119
  <span class="notice_text">立即聯繫開店顧問,專人協助打造高質感官網</span>
124
120
  <button class="btn btn-black " type="button" style="height:30px;" onclick="${gvc.event(()=>{
125
- gvc.glitter.openNewTab(`https://liff.line.me/1645278921-kWRPP32q/?accountId=263cycek`)
126
- })}">
121
+ gvc.glitter.openNewTab(`https://liff.line.me/1645278921-kWRPP32q/?accountId=263cycek`)
122
+ })}">
127
123
  <span class="tx_700_white">聯繫顧問</span>
128
124
  </button>
129
125
  </div>`;
130
- } else {
131
- bg_color = '#ff6c02'
132
- text = `
126
+ } else {
127
+ bg_color = '#ff6c02'
128
+ text = `
133
129
 
134
130
  <div class="d-flex flex-column flex-sm-row align-items-center justify-content-center" style="gap:10px;">
135
131
  <span class="notice_text">立即下載行動後台APP,享受流暢操作體驗</span>
136
132
  <button class="btn btn-black " type="button" style="height:30px;" onclick="${gvc.event(()=>{
137
- function isAppleDevice() {
138
- return /iPhone|iPad|iPod/i.test(navigator.userAgent);
139
- }
140
- function isAndroidDevice() {
141
- return /Android/i.test(navigator.userAgent);
142
- }
133
+ function isAppleDevice() {
134
+ return /iPhone|iPad|iPod/i.test(navigator.userAgent);
135
+ }
136
+ function isAndroidDevice() {
137
+ return /Android/i.test(navigator.userAgent);
138
+ }
143
139
 
144
- if (isAppleDevice()) {
145
- 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`)
146
- } else if (isAndroidDevice()) {
147
- gvc.glitter.openNewTab(`https://play.google.com/store/apps/details?id=shopnex.cc`)
148
- }
149
- })}">
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
+ })}">
150
146
  <span class="tx_700_white">前往下載</span>
151
147
  </button>
152
148
  </div>
153
149
  `;
154
- }
155
- } else if (new Date(plan.dead_line).getTime() < new Date().getTime()) {
156
- 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>`;
157
- } else if (differenceInDays < 30) {
158
- 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>`;
159
- } else {
160
- return ``;
161
- }
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
+
162
169
  return html`
163
170
  <div style="text-align: center;white-space:normal;" class="w-100">
164
- ${text}
171
+ ${getText()}
165
172
  </div>`
166
173
  },
167
174
  divCreate: ()=>{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-glitter",
3
- "version": "16.0.1",
3
+ "version": "16.0.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {