Skip to content

Commit

Permalink
fix: 小说控制定制化组件发送广告请求的策略 #1264
Browse files Browse the repository at this point in the history
  • Loading branch information
Espoir-L committed Oct 19, 2018
1 parent f161d6e commit 2db66d2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/mip-custom/mip-custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,24 @@ define(function () {
dom.addPlaceholder.apply(this);
// 判断是否是MIP2的环境,配合小说shell,由小说shell去控制custom的请求是否发送
if (window.MIP.version && +window.MIP.version === 2) {
me.noCommonFetch = true
me.noCommonFetch = true;
// 监听小说shell播放的广告请求的事件
MIP.watch('novelData', novelData => {
MIP.watch('novelData', function (novelData) {
if (
JSON.stringify(novelData) !== "{}"
&& novelData.customId === window.MIP.viewer.page.pageId
&& me.element.querySelector('.mip-custom-placeholder')
&& me.noCommonFetch
) {
me.noCommonFetch = false
me.noCommonFetch = false;
me.customId = novelData.customId;
me.novelData = novelData.novelData;
me.initElement(dom)
me.initElement(dom);
}
})
});
}
else {
this.initElement(dom)
this.initElement(dom);
}
};

Expand Down

0 comments on commit 2db66d2

Please sign in to comment.