@taole/dev-helper 0.1.16 → 0.1.18
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/dist/open-diandian.umd.js +12 -3
- package/open-diandian/index.js +12 -3
- package/package.json +2 -1
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
'wxcd28679e4d8c1792': { // 点点狼人
|
|
27
27
|
app_name: '点点狼人',
|
|
28
|
-
link_ios: "", // 空缺,后期补充
|
|
28
|
+
link_ios: "https://partygame.tuwan.com/dlappwolf?type=launch", // 空缺,后期补充
|
|
29
29
|
link_android: "diandainwolf://diandain:8888/splash",
|
|
30
30
|
fallback_link_ios: 'https://apps.apple.com/mo/app/%E7%82%B9%E7%82%B9%E7%8B%BC%E4%BA%BA%E6%9D%80-%E8%AF%AD%E9%9F%B3%E7%A4%BE%E4%BA%A4%E6%8E%A8%E7%90%86%E6%B8%B8%E6%88%8F/id1557616226',
|
|
31
31
|
fallback_link_android: 'https://m.malink.cn/s/AJ3ueu',
|
|
@@ -53,14 +53,16 @@
|
|
|
53
53
|
|
|
54
54
|
function createOpenDiandianElementClass() {
|
|
55
55
|
return class extends HTMLElement {
|
|
56
|
+
// fallback-time: 3000, 跳转fallback链接的延迟时间,单位毫秒 不传或者传0等价于3000ms
|
|
56
57
|
static get observedAttributes() {
|
|
57
|
-
return ['appid', 'extinfo', 'debug', 'scene'];
|
|
58
|
+
return ['appid', 'extinfo', 'debug', 'scene', 'fallback-time'];
|
|
58
59
|
}
|
|
59
60
|
constructor() {
|
|
60
61
|
super();
|
|
61
62
|
this._debug = false;
|
|
62
63
|
this._defaultAppid = 'wx6cd4c28b58e8737f';// 点点开黑
|
|
63
64
|
this._openAppTag = null;
|
|
65
|
+
this._fallbackTime = 3000;
|
|
64
66
|
this._appid = '';
|
|
65
67
|
this._appInfo = null;
|
|
66
68
|
this._alink_fallback = '';
|
|
@@ -226,7 +228,7 @@
|
|
|
226
228
|
var tmplnk = document.createElement("a");
|
|
227
229
|
tmplnk.href = this._alink_fallback;
|
|
228
230
|
tmplnk.click();
|
|
229
|
-
},
|
|
231
|
+
}, this._fallbackTime);
|
|
230
232
|
}
|
|
231
233
|
}
|
|
232
234
|
disconnectedCallback() {
|
|
@@ -347,6 +349,13 @@
|
|
|
347
349
|
this._debug = this.getAttribute('debug') !== null;
|
|
348
350
|
this._appid = this.getAttribute('appid') || this._defaultAppid;
|
|
349
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
|
+
}
|
|
350
359
|
if (!this._appInfo) {
|
|
351
360
|
console.error('open-diandian: appid not supported', this._appid);
|
|
352
361
|
return;
|
package/open-diandian/index.js
CHANGED
|
@@ -20,7 +20,7 @@ const appInfoMap = {
|
|
|
20
20
|
},
|
|
21
21
|
'wxcd28679e4d8c1792': { // 点点狼人
|
|
22
22
|
app_name: '点点狼人',
|
|
23
|
-
link_ios: "", // 空缺,后期补充
|
|
23
|
+
link_ios: "https://partygame.tuwan.com/dlappwolf?type=launch", // 空缺,后期补充
|
|
24
24
|
link_android: "diandainwolf://diandain:8888/splash",
|
|
25
25
|
fallback_link_ios: 'https://apps.apple.com/mo/app/%E7%82%B9%E7%82%B9%E7%8B%BC%E4%BA%BA%E6%9D%80-%E8%AF%AD%E9%9F%B3%E7%A4%BE%E4%BA%A4%E6%8E%A8%E7%90%86%E6%B8%B8%E6%88%8F/id1557616226',
|
|
26
26
|
fallback_link_android: 'https://m.malink.cn/s/AJ3ueu',
|
|
@@ -48,14 +48,16 @@ const OPEN_DIANDIAN_TAG_NAMES = ['open-diandain-app', 'open-diandian-app'];
|
|
|
48
48
|
|
|
49
49
|
function createOpenDiandianElementClass() {
|
|
50
50
|
return class extends HTMLElement {
|
|
51
|
+
// fallback-time: 3000, 跳转fallback链接的延迟时间,单位毫秒 不传或者传0等价于3000ms
|
|
51
52
|
static get observedAttributes() {
|
|
52
|
-
return ['appid', 'extinfo', 'debug', 'scene'];
|
|
53
|
+
return ['appid', 'extinfo', 'debug', 'scene', 'fallback-time'];
|
|
53
54
|
}
|
|
54
55
|
constructor() {
|
|
55
56
|
super();
|
|
56
57
|
this._debug = false;
|
|
57
58
|
this._defaultAppid = 'wx6cd4c28b58e8737f';// 点点开黑
|
|
58
59
|
this._openAppTag = null;
|
|
60
|
+
this._fallbackTime = 3000;
|
|
59
61
|
this._appid = '';
|
|
60
62
|
this._appInfo = null;
|
|
61
63
|
this._alink_fallback = '';
|
|
@@ -221,7 +223,7 @@ function createOpenDiandianElementClass() {
|
|
|
221
223
|
var tmplnk = document.createElement("a");
|
|
222
224
|
tmplnk.href = this._alink_fallback;
|
|
223
225
|
tmplnk.click();
|
|
224
|
-
},
|
|
226
|
+
}, this._fallbackTime);
|
|
225
227
|
}
|
|
226
228
|
}
|
|
227
229
|
disconnectedCallback() {
|
|
@@ -342,6 +344,13 @@ function createOpenDiandianElementClass() {
|
|
|
342
344
|
this._debug = this.getAttribute('debug') !== null;
|
|
343
345
|
this._appid = this.getAttribute('appid') || this._defaultAppid;
|
|
344
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
|
+
}
|
|
345
354
|
if (!this._appInfo) {
|
|
346
355
|
console.error('open-diandian: appid not supported', this._appid);
|
|
347
356
|
return;
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taole/dev-helper",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
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
|
},
|