@taole/dev-helper 0.0.27 → 0.0.29
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 +5 -28
- package/open-diandian/index.js +5 -28
- package/package.json +1 -1
|
@@ -85,34 +85,11 @@
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
_handleAlinkClick() {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
let isPageHide = false;
|
|
95
|
-
this._pagehideCallback = this._pagehideCallback || function () {
|
|
96
|
-
// console.log("visibilitychange called", document.hidden, Date.now() - nowTs);
|
|
97
|
-
if (document.hidden) {
|
|
98
|
-
isPageHide = true;
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
window.removeEventListener("visibilitychange", this._pagehideCallback);
|
|
102
|
-
window.addEventListener("visibilitychange", this._pagehideCallback);
|
|
103
|
-
this._alink_click_timer = setTimeout(() => {
|
|
104
|
-
window.removeEventListener("visibilitychange", this._pagehideCallback);
|
|
105
|
-
setTimeout(() => {
|
|
106
|
-
// console.log("3s到了22", isPageHide, Date.now() - nowTs);
|
|
107
|
-
// console.log("document.hasFocus()", document.hasFocus());
|
|
108
|
-
if (isPageHide || document.hasFocus()) return;
|
|
109
|
-
this._alink_click_timer = null;
|
|
110
|
-
// window.location.href = this._alink_fallback; // 直接重定向的话ios上没法去到appstore
|
|
111
|
-
var tmplnk = document.createElement("a");
|
|
112
|
-
tmplnk.href = this._alink_fallback;
|
|
113
|
-
tmplnk.click();
|
|
114
|
-
}, 30);
|
|
115
|
-
}, 3000);
|
|
88
|
+
setTimeout(() => {
|
|
89
|
+
var tmplnk = document.createElement("a");
|
|
90
|
+
tmplnk.href = this._alink_fallback;
|
|
91
|
+
tmplnk.click();
|
|
92
|
+
}, 1000);
|
|
116
93
|
}
|
|
117
94
|
disconnectedCallback() {
|
|
118
95
|
if (this._openAppTag) {
|
package/open-diandian/index.js
CHANGED
|
@@ -79,34 +79,11 @@ function defineTag() {
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
_handleAlinkClick() {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
let isPageHide = false;
|
|
89
|
-
this._pagehideCallback = this._pagehideCallback || function () {
|
|
90
|
-
// console.log("visibilitychange called", document.hidden, Date.now() - nowTs);
|
|
91
|
-
if (document.hidden) {
|
|
92
|
-
isPageHide = true;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
window.removeEventListener("visibilitychange", this._pagehideCallback);
|
|
96
|
-
window.addEventListener("visibilitychange", this._pagehideCallback);
|
|
97
|
-
this._alink_click_timer = setTimeout(() => {
|
|
98
|
-
window.removeEventListener("visibilitychange", this._pagehideCallback);
|
|
99
|
-
setTimeout(() => {
|
|
100
|
-
// console.log("3s到了22", isPageHide, Date.now() - nowTs);
|
|
101
|
-
// console.log("document.hasFocus()", document.hasFocus());
|
|
102
|
-
if (isPageHide || document.hasFocus()) return;
|
|
103
|
-
this._alink_click_timer = null;
|
|
104
|
-
// window.location.href = this._alink_fallback; // 直接重定向的话ios上没法去到appstore
|
|
105
|
-
var tmplnk = document.createElement("a");
|
|
106
|
-
tmplnk.href = this._alink_fallback;
|
|
107
|
-
tmplnk.click();
|
|
108
|
-
}, 30);
|
|
109
|
-
}, 3000);
|
|
82
|
+
setTimeout(() => {
|
|
83
|
+
var tmplnk = document.createElement("a");
|
|
84
|
+
tmplnk.href = this._alink_fallback;
|
|
85
|
+
tmplnk.click();
|
|
86
|
+
}, 1000);
|
|
110
87
|
}
|
|
111
88
|
disconnectedCallback() {
|
|
112
89
|
if (this._openAppTag) {
|