Commit 664f4bc7 authored by jyx's avatar jyx

代码优化

parent 94e51199
......@@ -58,7 +58,7 @@
pm.getPlayletInfo().then(res => {
this.albumId = res.albumId
this.seq = res.seq
this.episodeId = res.episodeId
this.episodeId = res.episodeId
this.loadAdSwitch()
});
......@@ -126,8 +126,8 @@
});
// 推荐位使用简单示例
pm.onChangeEpisode((e) => {
console.log("触发选集切换onChangeEpisode回调:", e);
console.log("触发选集切换onChangeEpisode回调:", e);
this.albumId = e.albumId
this.seq = e.seq
this.episodeId = e.episodeId
......@@ -220,7 +220,7 @@
console.log("playerBeforeMount");
},
mounted() {
this.getShowShortcut()
console.log("playerMounted");
},
......@@ -264,16 +264,16 @@
loadAdSwitch() {
let that = this
common.methods.post({
url: '/vedio/confs',
data: {
albumId: this.albumId
url: '/vedio/confs',
data: {
albumId: this.albumId
},
showLoading: false,
success: ({
data
}) => {
that.showAdForServer = data.douyinAdTipOpen;
if (!that.showAdForServer) {
if (that.showAdForServer) {
// 预加载广告
that.preloadAd()
}
......@@ -284,7 +284,7 @@
let that = this
// 创建实例
this.ad = tt.createRewardedVideoAd({
adUnitId: REWARD_ID,
adUnitId: REWARD_ID
});
// 监听错误
......@@ -415,14 +415,14 @@
message.notify(data.msg)
if (data.code == 200) {
this.pm.setCurrentUnlock()
this.pm.setCurrentUnlock()
// this.commitVideo()
} else if (data.code == 301) {
this.pm.setCurrentUnlock()
// this.commitVideo()
this.pm.setCurrentUnlock()
// this.commitVideo()
} else if (data.code == 302) {
this.pm.setCurrentUnlock()
// this.commitVideo()
this.pm.setCurrentUnlock()
// this.commitVideo()
} else if (data.code == 303) {
this.pm.toggleCustomDialog()
}
......@@ -431,7 +431,7 @@
},
adUnlock() {
let that = this
this.post({
common.methods.post({
url: '/vedio/unlockByAd',
data: {
adSource: 'csj',
......@@ -446,14 +446,14 @@
message.notify(data.msg)
if (data.code == 200) {
that.pm.setCurrentUnlock()
this.commitVideo()
that.pm.setCurrentUnlock()
this.commitVideo()
} else if (data.code == 301) {
that.pm.setCurrentUnlock()
this.commitVideo()
that.pm.setCurrentUnlock()
this.commitVideo()
} else if (data.code == 302) {
that.pm.setCurrentUnlock()
this.commitVideo()
that.pm.setCurrentUnlock()
this.commitVideo()
} else if (data.code == 303) {
that.pm.toggleCustomDialog()
}
......
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