From 041e4a40868a8cc0db27a3565871001ae41d866e Mon Sep 17 00:00:00 2001 From: mehaotian <490272692@qq.com> Date: Wed, 4 Sep 2019 16:25:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(stat):=20=E4=BF=AE=E5=A4=8D=20tabbar=20?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=B8=8D=E8=83=BD=E6=AD=A3=E5=B8=B8=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=A0=87=E9=A2=98=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/uni-stat/dist/index.js | 74 ++++++++++++++++---------------- packages/uni-stat/src/stat.js | 76 +++++++++++++++++---------------- 2 files changed, 77 insertions(+), 73 deletions(-) diff --git a/packages/uni-stat/dist/index.js b/packages/uni-stat/dist/index.js index 83c5b966e3..42f5c81c33 100644 --- a/packages/uni-stat/dist/index.js +++ b/packages/uni-stat/dist/index.js @@ -629,39 +629,39 @@ class Util { this.imageRequest(optionsData); return } - - if (getPlatformName() === 'n' && this.statData.p === 'a') { - setTimeout(() => { - this._sendRequest(optionsData); - }, 200); - return - } + + if (getPlatformName() === 'n' && this.statData.p === 'a') { + setTimeout(() => { + this._sendRequest(optionsData); + }, 200); + return + } this._sendRequest(optionsData); - } - _sendRequest(optionsData){ - uni.request({ - url: STAT_URL, - method: 'POST', - // header: { - // 'content-type': 'application/json' // 默认值 - // }, - data: optionsData, - success: () => { - // if (process.env.NODE_ENV === 'development') { - // console.log('stat request success'); - // } - }, - fail: (e) => { - // if (process.env.NODE_ENV === 'development') { - // console.log('stat request fail', e); - // } - if (++this._retry < 3) { - setTimeout(() => { - this.request(data); - }, 1000); - } - } - }); + } + _sendRequest(optionsData) { + uni.request({ + url: STAT_URL, + method: 'POST', + // header: { + // 'content-type': 'application/json' // 默认值 + // }, + data: optionsData, + success: () => { + // if (process.env.NODE_ENV === 'development') { + // console.log('stat request success'); + // } + }, + fail: (e) => { + // if (process.env.NODE_ENV === 'development') { + // console.log('stat request fail', e); + // } + if (++this._retry < 3) { + setTimeout(() => { + this.request(data); + }, 1000); + } + } + }); } /** * h5 请求 @@ -775,15 +775,17 @@ class Stat extends Util { show(self) { this.self = self; if (!getPageTypes(self)) { + this._pageShow(self); + } else { this._applicationShow(self); } } ready(self) { - this.self = self; - if (getPageTypes(self)) { - this._pageShow(self); - } + // this.self = self; + // if (getPageTypes(self)) { + // this._pageShow(self); + // } } hide(self) { this.self = self; diff --git a/packages/uni-stat/src/stat.js b/packages/uni-stat/src/stat.js index bb501cb710..58cb8d9a48 100644 --- a/packages/uni-stat/src/stat.js +++ b/packages/uni-stat/src/stat.js @@ -364,39 +364,39 @@ class Util { this.imageRequest(optionsData) return } - - if (getPlatformName() === 'n' && this.statData.p === 'a') { - setTimeout(() => { - this._sendRequest(optionsData); - }, 200) - return - } + + if (getPlatformName() === 'n' && this.statData.p === 'a') { + setTimeout(() => { + this._sendRequest(optionsData); + }, 200) + return + } this._sendRequest(optionsData) - } - _sendRequest(optionsData){ - uni.request({ - url: STAT_URL, - method: 'POST', - // header: { - // 'content-type': 'application/json' // 默认值 - // }, - data: optionsData, - success: () => { - // if (process.env.NODE_ENV === 'development') { - // console.log('stat request success'); - // } - }, - fail: (e) => { - // if (process.env.NODE_ENV === 'development') { - // console.log('stat request fail', e); - // } - if (++this._retry < 3) { - setTimeout(() => { - this.request(data); - }, 1000); - } - } - }); + } + _sendRequest(optionsData) { + uni.request({ + url: STAT_URL, + method: 'POST', + // header: { + // 'content-type': 'application/json' // 默认值 + // }, + data: optionsData, + success: () => { + // if (process.env.NODE_ENV === 'development') { + // console.log('stat request success'); + // } + }, + fail: (e) => { + // if (process.env.NODE_ENV === 'development') { + // console.log('stat request fail', e); + // } + if (++this._retry < 3) { + setTimeout(() => { + this.request(data); + }, 1000); + } + } + }); } /** * h5 请求 @@ -509,16 +509,18 @@ class Stat extends Util { show(self) { this.self = self; - if (!getPageTypes(self)) { + if (getPageTypes(self)) { + this._pageShow(self); + } else { this._applicationShow(self); } } ready(self) { - this.self = self; - if (getPageTypes(self)) { - this._pageShow(self); - } + // this.self = self; + // if (getPageTypes(self)) { + // this._pageShow(self); + // } } hide(self) { this.self = self; -- GitLab