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