From bb1972805b8ee90d8b01d52eb7983d7bebc33a31 Mon Sep 17 00:00:00 2001 From: meo <18801474720@163.com> Date: Wed, 20 Mar 2019 17:59:21 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + App.js | 15 ++++++--------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 5d64756..562c430 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,4 @@ buck-out/ # Bundle artifact *.jsbundle +/yarn.lock diff --git a/App.js b/App.js index a9cc9bf..b05c207 100644 --- a/App.js +++ b/App.js @@ -51,7 +51,6 @@ var errorMsg = { } export default class MyPage extends Component { - constructor(props) { super(props); this.state = { @@ -109,7 +108,7 @@ codePushStatusDidChange(syncStatus) { codePushDownloadDidProgress(progress) { this.setState({ progress }); } - + // 列表滚动 updateContent() { if (this.state.adDataList.length <=0) return false; @@ -142,7 +141,7 @@ codePushStatusDidChange(syncStatus) { }) .catch(error => { }) - } + } getAdDataList() { HttpUtils.get(NativeModules.BuildConfig.apiHost + 'api/wxDeviceScreenAd/list?deviceId='+encodeURIComponent(this.state.macAddress)+'&pageNum=1&pageSize=1000') @@ -166,9 +165,8 @@ codePushStatusDidChange(syncStatus) { }) } - + // getBaseInfo() { - HttpUtils.get(NativeModules.BuildConfig.apiHost + 'api/wxDeviceScreenAd/info?deviceId='+encodeURIComponent(this.state.macAddress)) .then(result => { if (result.code != 200) { @@ -229,8 +227,10 @@ startAd() { setInterval( ()=>{ if (this.state.contentDisplayStatus) { + this.setState({ contentDisplayStatus: false}) if (this.updateContent()) { + this.setState({ contentDisplayStatus: true}) } } else { @@ -257,7 +257,6 @@ startAd() { getContentViewItemUplayer(contentItem) { if (contentItem.type == 0) { - if (contentItem.subType == 2) return ( ) if (contentItem.subType == 6) @@ -275,13 +274,11 @@ getContentViewItem(contentItem, annomation) { ) actionText = '扫码领取'; - if (contentItem.target.type == 8) actionText = '扫码砍价'; else if (contentItem.target.type == 9) actionText = '扫码拼团'; - - merchantName = ""; + merchantName = ""; if (contentItem.target.merchantVoList.length > 1) merchantName = '多商户通用'; else