@taole/dev-helper 0.1.15 → 0.1.17
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/custom-data/t-div.html-data.json +173 -173
- package/dist/open-diandian.umd.js +15 -2
- package/open-diandian/index.js +15 -2
- package/package.json +2 -1
|
@@ -1,173 +1,173 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 1.1,
|
|
3
|
-
"tags": [
|
|
4
|
-
{
|
|
5
|
-
"name": "t-div",
|
|
6
|
-
"description": "基于设计稿尺寸的布局容器 Web Component。数值属性会按 viewportWidth(默认 750)换算为 vw;设置 usePx 后按 px 输出。支持背景图、九宫格 border-image、flex 布局与文本省略。需先引入 tdiv.umd.js。",
|
|
7
|
-
"attributes": [
|
|
8
|
-
{
|
|
9
|
-
"name": "class",
|
|
10
|
-
"description": "class属性"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"name": "_class",
|
|
14
|
-
"description": "(兼容)同 class,与 class 合并生效;推荐直接使用 class属性"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"name": "usePx",
|
|
18
|
-
"description": "为 true 时 width/height/top 等数值属性直接输出 px,否则按 viewportWidth 换算为 viewportUnit(默认 vw)。可覆盖全局 setting.usePx。"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"name": "_style",
|
|
22
|
-
"description": "追加到计算后内联 style 末尾的原始 CSS 字符串。"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"name": "src",
|
|
26
|
-
"description": "背景图或九宫格图源。非 http(s) 路径会补全为 dynamics-share CDN;以 -- 开头时作为 CSS 变量(如 --bg1 → var(--bg1))。支持 WebP 自动处理。"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"name": "srcMode",
|
|
30
|
-
"description": "非九宫格时 background-size 模式。",
|
|
31
|
-
"valueSet": "tdiv-srcMode"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"name": "dot9",
|
|
35
|
-
"description": "九宫格 border-image slice,4 个空格分隔数值(上 右 下 左)"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"name": "dot9Border",
|
|
39
|
-
"description": "九宫格 border-width,4 个空格分隔数值;未设置时回退为 dot9 的值。"
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
"name": "width",
|
|
43
|
-
"description": "宽度,数字或数字字符串"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"name": "height",
|
|
47
|
-
"description": "高度,数字或数字字符串"
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"name": "absolute",
|
|
51
|
-
"description": "为 true 时使用 position: absolute,top/left/right/bottom 作为定位偏移。"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"name": "fixed",
|
|
55
|
-
"description": "为 true 时使用 position: fixed(优先于 absolute),top/left/right/bottom 作为定位偏移。"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"name": "top",
|
|
59
|
-
"description": "absolute/fixed 时为 top;否则为 margin-top。"
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"name": "left",
|
|
63
|
-
"description": "absolute/fixed 时为 left;否则为 margin-left。"
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"name": "right",
|
|
67
|
-
"description": "absolute/fixed 时为 right;否则为 margin-right。"
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
"name": "bottom",
|
|
71
|
-
"description": "absolute/fixed 时为 bottom;否则为 margin-bottom。"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"name": "zIndex",
|
|
75
|
-
"description": "z-index 层叠顺序。"
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
"name": "pointer",
|
|
79
|
-
"description": "为 true 时 cursor: pointer。未设置且存在 onClick 时也会显示手型光标。"
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
"name": "flex",
|
|
83
|
-
"description": "为 true 时 display: flex。"
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"name": "column",
|
|
87
|
-
"description": "flex 为 true 时设置 flex-direction: column。"
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
"name": "center",
|
|
91
|
-
"description": "flex 为 true 时水平垂直居中;否则 text-align: center。"
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
"name": "text",
|
|
95
|
-
"description": "字号,数值经 calc 换算为 font-size。"
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
"name": "bold",
|
|
99
|
-
"description": "为 true 时 font-weight: bold。"
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
"name": "color",
|
|
103
|
-
"description": "文字颜色。以 -- 开头时使用 var(--xxx)。"
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
"name": "bgColor",
|
|
107
|
-
"description": "背景色。以 -- 开头时使用 var(--xxx)。"
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
"name": "radius",
|
|
111
|
-
"description": "圆角 border-radius,数值经 calc 换算。"
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
"name": "border",
|
|
115
|
-
"description": "边框宽度,数值经 calc 换算;与 borderColor 组合为 solid 边框。"
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
"name": "borderColor",
|
|
119
|
-
"description": "边框颜色,默认 #000;以 -- 开头时使用 var(--xxx)。仅设 borderColor 时只改 border-color。"
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
"name": "textEllipsis",
|
|
123
|
-
"description": "文本省略:非纯数字时为单行省略;纯数字时为多行省略(-webkit-line-clamp 行数)。"
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
"name": "textDot",
|
|
127
|
-
"description": "textEllipsis 的别名,行为相同。"
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
"name": "onClick",
|
|
131
|
-
"description": "点击回调:填写挂载在 window 上的函数名字符串;全局 useButtonEffect 为 true 时会附加 click-effect 样式。不推荐使用onClick属性,推荐使用click事件"
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
"name": "debug",
|
|
135
|
-
"description": "为 true 时在控制台输出计算后的 layoutStyle。"
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
"name": "viewportWidth",
|
|
139
|
-
"description": "覆盖本次样式计算的设计稿基准宽度(默认 750)。"
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
"name": "viewportUnit",
|
|
143
|
-
"description": "覆盖数值换算单位(默认 vw)。"
|
|
144
|
-
}
|
|
145
|
-
],
|
|
146
|
-
"references": [
|
|
147
|
-
{
|
|
148
|
-
"name": "Tdiv 源码",
|
|
149
|
-
"url": "https://codeup.aliyun.com/5ec8bb7bd1d1abe63b55cd33/PC_Web/web-libs/blob/master/dev-helper/Tdiv/index.js"
|
|
150
|
-
}
|
|
151
|
-
]
|
|
152
|
-
}
|
|
153
|
-
],
|
|
154
|
-
"valueSets": [
|
|
155
|
-
{
|
|
156
|
-
"name": "tdiv-srcMode",
|
|
157
|
-
"values": [
|
|
158
|
-
{
|
|
159
|
-
"name": "auto",
|
|
160
|
-
"description": "默认,background-size: 100% auto(仅顶部对齐拉伸宽度)。"
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
"name": "fill",
|
|
164
|
-
"description": "background-size: 100% 100%,铺满容器。"
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
"name": "cover",
|
|
168
|
-
"description": "background-size: cover,等比覆盖。"
|
|
169
|
-
}
|
|
170
|
-
]
|
|
171
|
-
}
|
|
172
|
-
]
|
|
173
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"version": 1.1,
|
|
3
|
+
"tags": [
|
|
4
|
+
{
|
|
5
|
+
"name": "t-div",
|
|
6
|
+
"description": "基于设计稿尺寸的布局容器 Web Component。数值属性会按 viewportWidth(默认 750)换算为 vw;设置 usePx 后按 px 输出。支持背景图、九宫格 border-image、flex 布局与文本省略。需先引入 tdiv.umd.js。",
|
|
7
|
+
"attributes": [
|
|
8
|
+
{
|
|
9
|
+
"name": "class",
|
|
10
|
+
"description": "class属性"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"name": "_class",
|
|
14
|
+
"description": "(兼容)同 class,与 class 合并生效;推荐直接使用 class属性"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "usePx",
|
|
18
|
+
"description": "为 true 时 width/height/top 等数值属性直接输出 px,否则按 viewportWidth 换算为 viewportUnit(默认 vw)。可覆盖全局 setting.usePx。"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "_style",
|
|
22
|
+
"description": "追加到计算后内联 style 末尾的原始 CSS 字符串。"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "src",
|
|
26
|
+
"description": "背景图或九宫格图源。非 http(s) 路径会补全为 dynamics-share CDN;以 -- 开头时作为 CSS 变量(如 --bg1 → var(--bg1))。支持 WebP 自动处理。"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "srcMode",
|
|
30
|
+
"description": "非九宫格时 background-size 模式。",
|
|
31
|
+
"valueSet": "tdiv-srcMode"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "dot9",
|
|
35
|
+
"description": "九宫格 border-image slice,4 个空格分隔数值(上 右 下 左)"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "dot9Border",
|
|
39
|
+
"description": "九宫格 border-width,4 个空格分隔数值;未设置时回退为 dot9 的值。"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"name": "width",
|
|
43
|
+
"description": "宽度,数字或数字字符串"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "height",
|
|
47
|
+
"description": "高度,数字或数字字符串"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "absolute",
|
|
51
|
+
"description": "为 true 时使用 position: absolute,top/left/right/bottom 作为定位偏移。"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "fixed",
|
|
55
|
+
"description": "为 true 时使用 position: fixed(优先于 absolute),top/left/right/bottom 作为定位偏移。"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "top",
|
|
59
|
+
"description": "absolute/fixed 时为 top;否则为 margin-top。"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "left",
|
|
63
|
+
"description": "absolute/fixed 时为 left;否则为 margin-left。"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "right",
|
|
67
|
+
"description": "absolute/fixed 时为 right;否则为 margin-right。"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"name": "bottom",
|
|
71
|
+
"description": "absolute/fixed 时为 bottom;否则为 margin-bottom。"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "zIndex",
|
|
75
|
+
"description": "z-index 层叠顺序。"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "pointer",
|
|
79
|
+
"description": "为 true 时 cursor: pointer。未设置且存在 onClick 时也会显示手型光标。"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"name": "flex",
|
|
83
|
+
"description": "为 true 时 display: flex。"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "column",
|
|
87
|
+
"description": "flex 为 true 时设置 flex-direction: column。"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "center",
|
|
91
|
+
"description": "flex 为 true 时水平垂直居中;否则 text-align: center。"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"name": "text",
|
|
95
|
+
"description": "字号,数值经 calc 换算为 font-size。"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "bold",
|
|
99
|
+
"description": "为 true 时 font-weight: bold。"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "color",
|
|
103
|
+
"description": "文字颜色。以 -- 开头时使用 var(--xxx)。"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"name": "bgColor",
|
|
107
|
+
"description": "背景色。以 -- 开头时使用 var(--xxx)。"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"name": "radius",
|
|
111
|
+
"description": "圆角 border-radius,数值经 calc 换算。"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"name": "border",
|
|
115
|
+
"description": "边框宽度,数值经 calc 换算;与 borderColor 组合为 solid 边框。"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"name": "borderColor",
|
|
119
|
+
"description": "边框颜色,默认 #000;以 -- 开头时使用 var(--xxx)。仅设 borderColor 时只改 border-color。"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"name": "textEllipsis",
|
|
123
|
+
"description": "文本省略:非纯数字时为单行省略;纯数字时为多行省略(-webkit-line-clamp 行数)。"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"name": "textDot",
|
|
127
|
+
"description": "textEllipsis 的别名,行为相同。"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"name": "onClick",
|
|
131
|
+
"description": "点击回调:填写挂载在 window 上的函数名字符串;全局 useButtonEffect 为 true 时会附加 click-effect 样式。不推荐使用onClick属性,推荐使用click事件"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"name": "debug",
|
|
135
|
+
"description": "为 true 时在控制台输出计算后的 layoutStyle。"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"name": "viewportWidth",
|
|
139
|
+
"description": "覆盖本次样式计算的设计稿基准宽度(默认 750)。"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"name": "viewportUnit",
|
|
143
|
+
"description": "覆盖数值换算单位(默认 vw)。"
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
"references": [
|
|
147
|
+
{
|
|
148
|
+
"name": "Tdiv 源码",
|
|
149
|
+
"url": "https://codeup.aliyun.com/5ec8bb7bd1d1abe63b55cd33/PC_Web/web-libs/blob/master/dev-helper/Tdiv/index.js"
|
|
150
|
+
}
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
],
|
|
154
|
+
"valueSets": [
|
|
155
|
+
{
|
|
156
|
+
"name": "tdiv-srcMode",
|
|
157
|
+
"values": [
|
|
158
|
+
{
|
|
159
|
+
"name": "auto",
|
|
160
|
+
"description": "默认,background-size: 100% auto(仅顶部对齐拉伸宽度)。"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"name": "fill",
|
|
164
|
+
"description": "background-size: 100% 100%,铺满容器。"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"name": "cover",
|
|
168
|
+
"description": "background-size: cover,等比覆盖。"
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
app_name: '点点开黑',
|
|
11
11
|
link_ios: "com.tuwan.diandian://openPage",
|
|
12
12
|
link_android: "intent://diandain:8888/splash#Intent;scheme=taole;package=com.tuwan.yw;S.browser_fallback_url=https://sj.qq.com/myapp/detail.htm?apkName=com.tuwan.yw;end",
|
|
13
|
+
link_harmony: "taole://diandain:8888/splash",
|
|
13
14
|
fallback_link_ios: "https://apps.apple.com/cn/app/%E7%82%B9%E7%82%B9-%E8%AF%AD%E9%9F%B3%E5%BC%80%E9%BB%91/id1449564746",
|
|
14
15
|
fallback_link_android: 'https://m.malink.cn/s/3iQziy',
|
|
15
16
|
fallback_fin_5s: 'https://sj.qq.com/appdetail/com.tuwan.yw', // 5秒后跳转的链接(仅安卓)
|
|
@@ -52,14 +53,16 @@
|
|
|
52
53
|
|
|
53
54
|
function createOpenDiandianElementClass() {
|
|
54
55
|
return class extends HTMLElement {
|
|
56
|
+
// fallback-time: 3000, 跳转fallback链接的延迟时间,单位毫秒 不传或者传0等价于3000ms
|
|
55
57
|
static get observedAttributes() {
|
|
56
|
-
return ['appid', 'extinfo', 'debug', 'scene'];
|
|
58
|
+
return ['appid', 'extinfo', 'debug', 'scene', 'fallback-time'];
|
|
57
59
|
}
|
|
58
60
|
constructor() {
|
|
59
61
|
super();
|
|
60
62
|
this._debug = false;
|
|
61
63
|
this._defaultAppid = 'wx6cd4c28b58e8737f';// 点点开黑
|
|
62
64
|
this._openAppTag = null;
|
|
65
|
+
this._fallbackTime = 3000;
|
|
63
66
|
this._appid = '';
|
|
64
67
|
this._appInfo = null;
|
|
65
68
|
this._alink_fallback = '';
|
|
@@ -225,7 +228,7 @@
|
|
|
225
228
|
var tmplnk = document.createElement("a");
|
|
226
229
|
tmplnk.href = this._alink_fallback;
|
|
227
230
|
tmplnk.click();
|
|
228
|
-
},
|
|
231
|
+
}, this._fallbackTime);
|
|
229
232
|
}
|
|
230
233
|
}
|
|
231
234
|
disconnectedCallback() {
|
|
@@ -346,6 +349,13 @@
|
|
|
346
349
|
this._debug = this.getAttribute('debug') !== null;
|
|
347
350
|
this._appid = this.getAttribute('appid') || this._defaultAppid;
|
|
348
351
|
this._appInfo = appInfoMap[this._appid];
|
|
352
|
+
var fallbackTime = this.getAttribute('fallback-time');
|
|
353
|
+
if (fallbackTime == null || fallbackTime === '' || isNaN(Number(fallbackTime))) {
|
|
354
|
+
this._fallbackTime = 3000;
|
|
355
|
+
} else {
|
|
356
|
+
var ms = parseInt(fallbackTime, 10);
|
|
357
|
+
this._fallbackTime = (ms <= 0) ? 3000 : ms;
|
|
358
|
+
}
|
|
349
359
|
if (!this._appInfo) {
|
|
350
360
|
console.error('open-diandian: appid not supported', this._appid);
|
|
351
361
|
return;
|
|
@@ -358,6 +368,9 @@
|
|
|
358
368
|
} else {
|
|
359
369
|
this._alink_fallback = this._appInfo.fallback_link_android;
|
|
360
370
|
this._alink_link = this._appInfo.link_android || this._alink_fallback;
|
|
371
|
+
if(this._isHarmony && this._appInfo.link_harmony){
|
|
372
|
+
this._alink_link = this._appInfo.link_harmony;
|
|
373
|
+
}
|
|
361
374
|
this._alink_fin_5s = this._appInfo.fallback_fin_5s || '';
|
|
362
375
|
}
|
|
363
376
|
if (this._openAppTag) {
|
package/open-diandian/index.js
CHANGED
|
@@ -5,6 +5,7 @@ const appInfoMap = {
|
|
|
5
5
|
app_name: '点点开黑',
|
|
6
6
|
link_ios: "com.tuwan.diandian://openPage",
|
|
7
7
|
link_android: "intent://diandain:8888/splash#Intent;scheme=taole;package=com.tuwan.yw;S.browser_fallback_url=https://sj.qq.com/myapp/detail.htm?apkName=com.tuwan.yw;end",
|
|
8
|
+
link_harmony: "taole://diandain:8888/splash",
|
|
8
9
|
fallback_link_ios: "https://apps.apple.com/cn/app/%E7%82%B9%E7%82%B9-%E8%AF%AD%E9%9F%B3%E5%BC%80%E9%BB%91/id1449564746",
|
|
9
10
|
fallback_link_android: 'https://m.malink.cn/s/3iQziy',
|
|
10
11
|
fallback_fin_5s: 'https://sj.qq.com/appdetail/com.tuwan.yw', // 5秒后跳转的链接(仅安卓)
|
|
@@ -47,14 +48,16 @@ const OPEN_DIANDIAN_TAG_NAMES = ['open-diandain-app', 'open-diandian-app'];
|
|
|
47
48
|
|
|
48
49
|
function createOpenDiandianElementClass() {
|
|
49
50
|
return class extends HTMLElement {
|
|
51
|
+
// fallback-time: 3000, 跳转fallback链接的延迟时间,单位毫秒 不传或者传0等价于3000ms
|
|
50
52
|
static get observedAttributes() {
|
|
51
|
-
return ['appid', 'extinfo', 'debug', 'scene'];
|
|
53
|
+
return ['appid', 'extinfo', 'debug', 'scene', 'fallback-time'];
|
|
52
54
|
}
|
|
53
55
|
constructor() {
|
|
54
56
|
super();
|
|
55
57
|
this._debug = false;
|
|
56
58
|
this._defaultAppid = 'wx6cd4c28b58e8737f';// 点点开黑
|
|
57
59
|
this._openAppTag = null;
|
|
60
|
+
this._fallbackTime = 3000;
|
|
58
61
|
this._appid = '';
|
|
59
62
|
this._appInfo = null;
|
|
60
63
|
this._alink_fallback = '';
|
|
@@ -220,7 +223,7 @@ function createOpenDiandianElementClass() {
|
|
|
220
223
|
var tmplnk = document.createElement("a");
|
|
221
224
|
tmplnk.href = this._alink_fallback;
|
|
222
225
|
tmplnk.click();
|
|
223
|
-
},
|
|
226
|
+
}, this._fallbackTime);
|
|
224
227
|
}
|
|
225
228
|
}
|
|
226
229
|
disconnectedCallback() {
|
|
@@ -341,6 +344,13 @@ function createOpenDiandianElementClass() {
|
|
|
341
344
|
this._debug = this.getAttribute('debug') !== null;
|
|
342
345
|
this._appid = this.getAttribute('appid') || this._defaultAppid;
|
|
343
346
|
this._appInfo = appInfoMap[this._appid];
|
|
347
|
+
var fallbackTime = this.getAttribute('fallback-time');
|
|
348
|
+
if (fallbackTime == null || fallbackTime === '' || isNaN(Number(fallbackTime))) {
|
|
349
|
+
this._fallbackTime = 3000;
|
|
350
|
+
} else {
|
|
351
|
+
var ms = parseInt(fallbackTime, 10);
|
|
352
|
+
this._fallbackTime = (ms <= 0) ? 3000 : ms;
|
|
353
|
+
}
|
|
344
354
|
if (!this._appInfo) {
|
|
345
355
|
console.error('open-diandian: appid not supported', this._appid);
|
|
346
356
|
return;
|
|
@@ -353,6 +363,9 @@ function createOpenDiandianElementClass() {
|
|
|
353
363
|
} else {
|
|
354
364
|
this._alink_fallback = this._appInfo.fallback_link_android;
|
|
355
365
|
this._alink_link = this._appInfo.link_android || this._alink_fallback;
|
|
366
|
+
if(this._isHarmony && this._appInfo.link_harmony){
|
|
367
|
+
this._alink_link = this._appInfo.link_harmony;
|
|
368
|
+
}
|
|
356
369
|
this._alink_fin_5s = this._appInfo.fallback_fin_5s || '';
|
|
357
370
|
}
|
|
358
371
|
if (this._openAppTag) {
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taole/dev-helper",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.17",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"dev-helper": "./bin/dev-helper.js"
|
|
7
7
|
},
|
|
8
8
|
"scripts": {
|
|
9
9
|
"build": "npx -y rimraf dist && rollup -c",
|
|
10
|
+
"gen:cdn": "npx -y @taole/deploy-helper@latest prod -c deploy-cdn.config.json",
|
|
10
11
|
"postinstall": "node ./bin/dev-helper.js postinstall",
|
|
11
12
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
12
13
|
},
|