|
|
@@ -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 (<Image source={require('./image/groupbuy.png')} resizeMode='center' style={styles.contentItemUpLayer} /> ) |
|
|
|
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 |
|
|
|