@taole/dev-helper 0.0.18 → 0.0.20
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.
|
@@ -34,6 +34,8 @@
|
|
|
34
34
|
if (!this._openAppTag) {
|
|
35
35
|
// 放进去一个wx-open-launch-app, 宽高占满父容器
|
|
36
36
|
this._openAppTag = document.createElement('wx-open-launch-app');
|
|
37
|
+
this._openAppTag.style.background = "transparent";
|
|
38
|
+
this._openAppTag.style.opacity = 0;
|
|
37
39
|
this._updateTagAttr();
|
|
38
40
|
|
|
39
41
|
var contentEle = document.createElement('div');
|
|
@@ -92,7 +94,8 @@
|
|
|
92
94
|
window.removeEventListener("visibilitychange", this._pagehideCallback);
|
|
93
95
|
setTimeout(() => {
|
|
94
96
|
// console.log("3s到了22", isPageHide, Date.now() - nowTs);
|
|
95
|
-
|
|
97
|
+
// console.log("document.hasFocus()", document.hasFocus());
|
|
98
|
+
if (isPageHide || document.hasFocus()) return;
|
|
96
99
|
this._alink_click_timer = null;
|
|
97
100
|
// window.location.href = this._alink_fallback; // 直接重定向的话ios上没法去到appstore
|
|
98
101
|
var tmplnk = document.createElement("a");
|
|
@@ -114,7 +117,7 @@
|
|
|
114
117
|
_genTemplate() {
|
|
115
118
|
if (!this._template) {
|
|
116
119
|
this._template = document.createElement('template');
|
|
117
|
-
this._template.innerHTML = '<style>:host {display: block;width: 100%;height: 100%;overflow: hidden;}</style>';
|
|
120
|
+
this._template.innerHTML = '<style>:host {display: block;width: 100%;height: 100%;overflow: hidden;opacity: 0;background:transparent;}</style>';
|
|
118
121
|
}
|
|
119
122
|
}
|
|
120
123
|
_updateTagAttr() {
|
|
@@ -124,7 +127,7 @@
|
|
|
124
127
|
} else if (this._alink) {
|
|
125
128
|
// TODO: 如果设置了点点以外的appid,这里其实是有问题的,待后续更新优化
|
|
126
129
|
if (this._isIOS) {
|
|
127
|
-
this._alink.href = "com.tuwan.diandian://openPage
|
|
130
|
+
this._alink.href = "com.tuwan.diandian://openPage";
|
|
128
131
|
this._alink_fallback = "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";
|
|
129
132
|
} else {
|
|
130
133
|
var packageName = "com.tuwan.yw";
|
package/open-diandian/index.js
CHANGED
|
@@ -28,6 +28,8 @@ function defineTag() {
|
|
|
28
28
|
if (!this._openAppTag) {
|
|
29
29
|
// 放进去一个wx-open-launch-app, 宽高占满父容器
|
|
30
30
|
this._openAppTag = document.createElement('wx-open-launch-app');
|
|
31
|
+
this._openAppTag.style.background = "transparent";
|
|
32
|
+
this._openAppTag.style.opacity = 0;
|
|
31
33
|
this._updateTagAttr();
|
|
32
34
|
|
|
33
35
|
var contentEle = document.createElement('div');
|
|
@@ -86,7 +88,8 @@ function defineTag() {
|
|
|
86
88
|
window.removeEventListener("visibilitychange", this._pagehideCallback);
|
|
87
89
|
setTimeout(() => {
|
|
88
90
|
// console.log("3s到了22", isPageHide, Date.now() - nowTs);
|
|
89
|
-
|
|
91
|
+
// console.log("document.hasFocus()", document.hasFocus());
|
|
92
|
+
if (isPageHide || document.hasFocus()) return;
|
|
90
93
|
this._alink_click_timer = null;
|
|
91
94
|
// window.location.href = this._alink_fallback; // 直接重定向的话ios上没法去到appstore
|
|
92
95
|
var tmplnk = document.createElement("a");
|
|
@@ -108,7 +111,7 @@ function defineTag() {
|
|
|
108
111
|
_genTemplate() {
|
|
109
112
|
if (!this._template) {
|
|
110
113
|
this._template = document.createElement('template');
|
|
111
|
-
this._template.innerHTML = '<style>:host {display: block;width: 100%;height: 100%;overflow: hidden;}</style>';
|
|
114
|
+
this._template.innerHTML = '<style>:host {display: block;width: 100%;height: 100%;overflow: hidden;opacity: 0;background:transparent;}</style>';
|
|
112
115
|
}
|
|
113
116
|
}
|
|
114
117
|
_updateTagAttr() {
|
|
@@ -118,7 +121,7 @@ function defineTag() {
|
|
|
118
121
|
} else if (this._alink) {
|
|
119
122
|
// TODO: 如果设置了点点以外的appid,这里其实是有问题的,待后续更新优化
|
|
120
123
|
if (this._isIOS) {
|
|
121
|
-
this._alink.href = "com.tuwan.diandian://openPage
|
|
124
|
+
this._alink.href = "com.tuwan.diandian://openPage";
|
|
122
125
|
this._alink_fallback = "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";
|
|
123
126
|
} else {
|
|
124
127
|
var packageName = "com.tuwan.yw";
|