提交 041e4a40 编写于 作者: M mehaotian

fix(stat): 修复 tabbar 页面不能正常获取标题的bug

上级 adcfdfd2
...@@ -629,39 +629,39 @@ class Util { ...@@ -629,39 +629,39 @@ class Util {
this.imageRequest(optionsData); this.imageRequest(optionsData);
return return
} }
if (getPlatformName() === 'n' && this.statData.p === 'a') { if (getPlatformName() === 'n' && this.statData.p === 'a') {
setTimeout(() => { setTimeout(() => {
this._sendRequest(optionsData); this._sendRequest(optionsData);
}, 200); }, 200);
return return
} }
this._sendRequest(optionsData); this._sendRequest(optionsData);
} }
_sendRequest(optionsData){ _sendRequest(optionsData) {
uni.request({ uni.request({
url: STAT_URL, url: STAT_URL,
method: 'POST', method: 'POST',
// header: { // header: {
// 'content-type': 'application/json' // 默认值 // 'content-type': 'application/json' // 默认值
// }, // },
data: optionsData, data: optionsData,
success: () => { success: () => {
// if (process.env.NODE_ENV === 'development') { // if (process.env.NODE_ENV === 'development') {
// console.log('stat request success'); // console.log('stat request success');
// } // }
}, },
fail: (e) => { fail: (e) => {
// if (process.env.NODE_ENV === 'development') { // if (process.env.NODE_ENV === 'development') {
// console.log('stat request fail', e); // console.log('stat request fail', e);
// } // }
if (++this._retry < 3) { if (++this._retry < 3) {
setTimeout(() => { setTimeout(() => {
this.request(data); this.request(data);
}, 1000); }, 1000);
} }
} }
}); });
} }
/** /**
* h5 请求 * h5 请求
...@@ -775,15 +775,17 @@ class Stat extends Util { ...@@ -775,15 +775,17 @@ class Stat extends Util {
show(self) { show(self) {
this.self = self; this.self = self;
if (!getPageTypes(self)) { if (!getPageTypes(self)) {
this._pageShow(self);
} else {
this._applicationShow(self); this._applicationShow(self);
} }
} }
ready(self) { ready(self) {
this.self = self; // this.self = self;
if (getPageTypes(self)) { // if (getPageTypes(self)) {
this._pageShow(self); // this._pageShow(self);
} // }
} }
hide(self) { hide(self) {
this.self = self; this.self = self;
......
...@@ -364,39 +364,39 @@ class Util { ...@@ -364,39 +364,39 @@ class Util {
this.imageRequest(optionsData) this.imageRequest(optionsData)
return return
} }
if (getPlatformName() === 'n' && this.statData.p === 'a') { if (getPlatformName() === 'n' && this.statData.p === 'a') {
setTimeout(() => { setTimeout(() => {
this._sendRequest(optionsData); this._sendRequest(optionsData);
}, 200) }, 200)
return return
} }
this._sendRequest(optionsData) this._sendRequest(optionsData)
} }
_sendRequest(optionsData){ _sendRequest(optionsData) {
uni.request({ uni.request({
url: STAT_URL, url: STAT_URL,
method: 'POST', method: 'POST',
// header: { // header: {
// 'content-type': 'application/json' // 默认值 // 'content-type': 'application/json' // 默认值
// }, // },
data: optionsData, data: optionsData,
success: () => { success: () => {
// if (process.env.NODE_ENV === 'development') { // if (process.env.NODE_ENV === 'development') {
// console.log('stat request success'); // console.log('stat request success');
// } // }
}, },
fail: (e) => { fail: (e) => {
// if (process.env.NODE_ENV === 'development') { // if (process.env.NODE_ENV === 'development') {
// console.log('stat request fail', e); // console.log('stat request fail', e);
// } // }
if (++this._retry < 3) { if (++this._retry < 3) {
setTimeout(() => { setTimeout(() => {
this.request(data); this.request(data);
}, 1000); }, 1000);
} }
} }
}); });
} }
/** /**
* h5 请求 * h5 请求
...@@ -509,16 +509,18 @@ class Stat extends Util { ...@@ -509,16 +509,18 @@ class Stat extends Util {
show(self) { show(self) {
this.self = self; this.self = self;
if (!getPageTypes(self)) { if (getPageTypes(self)) {
this._pageShow(self);
} else {
this._applicationShow(self); this._applicationShow(self);
} }
} }
ready(self) { ready(self) {
this.self = self; // this.self = self;
if (getPageTypes(self)) { // if (getPageTypes(self)) {
this._pageShow(self); // this._pageShow(self);
} // }
} }
hide(self) { hide(self) {
this.self = self; this.self = self;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册