Commit 74b0b106 by 穆启卓

onshow bug

parent daeb220b
...@@ -30,12 +30,15 @@ Page({ ...@@ -30,12 +30,15 @@ Page({
wx.showLoading({ wx.showLoading({
title: '获取步数中' title: '获取步数中'
}); });
this.getPageData();
},
onLoad() {
this.setData({ this.setData({
scene: app.globalData.scene, scene: app.globalData.scene,
appName: config.appName, appName: config.appName,
appTitle: config.appTitle appTitle: config.appTitle
}); });
this.getPageData();
this.getAdId(); this.getAdId();
}, },
...@@ -583,7 +586,10 @@ Page({ ...@@ -583,7 +586,10 @@ Page({
}); });
// 看完后会关闭视频,然后触发initVideoAd的videoAd.onClose // 看完后会关闭视频,然后触发initVideoAd的videoAd.onClose
} else { } else {
this.initVideoAd(); // this.initVideoAd();
videoAd = wx.createRewardedVideoAd({
adUnitId: this.data.videoAdId
});
} }
} }
}, },
...@@ -593,7 +599,7 @@ Page({ ...@@ -593,7 +599,7 @@ Page({
if (wx.createRewardedVideoAd) { if (wx.createRewardedVideoAd) {
videoAd = wx.createRewardedVideoAd({ videoAd = wx.createRewardedVideoAd({
adUnitId: this.data.videoAdId adUnitId: this.data.videoAdId
}) });
videoAd.onLoad(); videoAd.onLoad();
videoAd.onError((err) => { videoAd.onError((err) => {
console.log('videoAd.onError', err) console.log('videoAd.onError', err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment