Commit b98e673c authored by xiabin's avatar xiabin

添加视频观看完后提示

parent e3193e1d
...@@ -37,17 +37,18 @@ ...@@ -37,17 +37,18 @@
}, },
methods: { methods: {
pay(){ pay(){
this.$dispatch('pay-click'); this.$dispatch('pay-click');
} }
}, },
ready(){ ready(){
if (this.videoInfo.isShop) { if (this.videoInfo.isShop) {
this.showTips = false; this.showTips = false;
} else { } else {
this.showTips = true; this.showTips = true;
} }
//不显示视频则不绑定 //不显示视频则不绑定 不为没有购买且为不免费
if (this.videoInfo.freeTime > 0) { if (this.videoInfo.freeTime > 0 || this.videoInfo.isShop == true) {
var self = this; var self = this;
var rate = 9 / 16; var rate = 9 / 16;
var w = $('.video-main').width(); var w = $('.video-main').width();
...@@ -70,13 +71,26 @@ ...@@ -70,13 +71,26 @@
var hVideo = wVideo * rate; var hVideo = wVideo * rate;
$('#my-video-play').css('height', hVideo); $('#my-video-play').css('height', hVideo);
}; };
}); })
myPlayer.bigPlayButton.on('click', function () { //没购买显示
self.showTips = false; if (this.videoInfo.isShop == false) {
}); myPlayer.bigPlayButton.on('click', function () {
self.showTips = false;
});
myPlayer.on('ended', function () {
layer.confirm('试看已结束,购买后查看完整版课程?', {
btn: ['立即购买'] //按钮
}, function () {
self.pay();
});
});
}
} }
} }
} }
</script> </script>
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