|
@@ -18,7 +18,14 @@ var beautyArchiveDetailMixin = {
|
|
|
fileArchiveList: [], // 文件资料列表
|
|
|
defaultImage: 'https://static.caimei365.com/app/img/icon2/PC-default.png', // 默认图片
|
|
|
videoCover: 'https://static.caimei365.com/app/img/icon2/video-cover.png', //默认视频封面
|
|
|
- archiveProductInfo: {}
|
|
|
+ archiveProductInfo: {},
|
|
|
+ userInfo: {}, // 用户信息
|
|
|
+ videoPermission: { // 视频播放权限
|
|
|
+ allTime: 10, // 分
|
|
|
+ onplay: 3 * 100 * 60 // 分钟
|
|
|
+ },
|
|
|
+ num:0,
|
|
|
+ duration: 0
|
|
|
},
|
|
|
filters: {
|
|
|
// 时间格式化
|
|
@@ -44,8 +51,54 @@ var beautyArchiveDetailMixin = {
|
|
|
},
|
|
|
methods: {
|
|
|
// 图片点击事件
|
|
|
- handleShowImage: function () {
|
|
|
- if (this.checkPermission() !== 0) return;
|
|
|
+ handleShowImage: function (i, imageList) {
|
|
|
+ // this.initPreviewImage()
|
|
|
+ console.log(this.permission)
|
|
|
+ if (this.permission === 2 || this.permission === 4 || this.permission === 1) {
|
|
|
+ if (imageList.length >= 5) {
|
|
|
+ if (i < 2) {
|
|
|
+ console.log(111)
|
|
|
+ this.initPreviewImage()
|
|
|
+ } else {
|
|
|
+ if (this.checkPermission() !== 0) return;
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ if (this.checkPermission() !== 0) return;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (this.checkPermission() !== 0) return;
|
|
|
+ }
|
|
|
+ // CAIMEI.Popup({
|
|
|
+ // content: this.TipStatus.text,
|
|
|
+ // confitmBtnText: this.TipStatus.btn,
|
|
|
+ // cancelBtnText: '取消',
|
|
|
+ // closeIcon:true
|
|
|
+ // }, function () {
|
|
|
+ // // 确认 执行 下一步 链接跳转 支付支付采美豆
|
|
|
+ // this.handleClickToPage(this.TipStatus.redirect);
|
|
|
+ // }, function () {
|
|
|
+ // });
|
|
|
+ // this.initPreviewImage()
|
|
|
+ // } else {
|
|
|
+ // CAIMEI.Popup({
|
|
|
+ // content: this.TipStatus.text,
|
|
|
+ // confitmBtnText: this.TipStatus.btn,
|
|
|
+ // cancelBtnText: '取消',
|
|
|
+ // closeIcon:true
|
|
|
+ // }, function () {
|
|
|
+ // // 确认 执行 下一步 链接跳转 支付支付采美豆
|
|
|
+ // this.handleClickToPage(this.TipStatus.redirect);
|
|
|
+ // }, function () {
|
|
|
+ // });
|
|
|
+ // if (this.checkPermission() !== 0) return;
|
|
|
+ // }
|
|
|
+ // }else {
|
|
|
+ // if (this.checkPermission() !== 0) return;
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // if (this.checkPermission() !== 0) return;
|
|
|
+ // }
|
|
|
+ // if (this.checkPermission() !== 0) return;
|
|
|
},
|
|
|
//初始化预览图片配置
|
|
|
initPreviewImage: function () {
|
|
@@ -56,36 +109,94 @@ var beautyArchiveDetailMixin = {
|
|
|
imageGroup['cm-images-' + index] = new Viewer(imageEl);
|
|
|
});
|
|
|
this.imageGroup = imageGroup;
|
|
|
- console.log('初始化图片预览成功')
|
|
|
},
|
|
|
//显示视频播放窗口
|
|
|
- handleShowPlayer: function (url) {
|
|
|
- var _self = this;
|
|
|
- if (this.checkPermission() !== 0) return;
|
|
|
- //暂停上一个正在播放的播放器
|
|
|
- this.currentVideoUrl = url;
|
|
|
- this.isPlayer = true;
|
|
|
- this.showVideoDialog = true;
|
|
|
- setTimeout(function(){
|
|
|
- // var video = this.$refs.videoRef;
|
|
|
- _self.currentVideo = document.querySelector('#realPlayer');
|
|
|
- _self.currentVideo.addEventListener('pause', function () {
|
|
|
- _self.isPlayer = false;
|
|
|
- console.log('暂停播放');
|
|
|
- });
|
|
|
- _self.currentVideo.addEventListener('ended', function () {
|
|
|
- _self.isPlayer = false;
|
|
|
- console.log('播放结束');
|
|
|
- });
|
|
|
- _self.currentVideo.addEventListener('error', function () {
|
|
|
- _self.isPlayer = false;
|
|
|
- console.log('播放错误');
|
|
|
- });
|
|
|
- _self.currentVideo.addEventListener('play', function () {
|
|
|
- _self.isPlayer = true;
|
|
|
- console.log('开始播放');
|
|
|
- });
|
|
|
- })
|
|
|
+ handleShowPlayer: function (url, dom) {
|
|
|
+ if (this.permission === 2 || this.permission === 4 || this.permission === 1) {
|
|
|
+ let _self = this;
|
|
|
+
|
|
|
+ //暂停上一个正在播放的播放器
|
|
|
+ this.currentVideoUrl = url;
|
|
|
+ this.isPlayer = true;
|
|
|
+ this.showVideoDialog = true;
|
|
|
+ console.log(url)
|
|
|
+ setTimeout(function(){
|
|
|
+ // var video = this.$refs.videoRef;
|
|
|
+ _self.currentVideo = document.querySelector('#realPlayer');
|
|
|
+ // _self.currentVideo.oncanplay = function () {
|
|
|
+ // console.log(parseInt((_self.currentVideo.duration % 3600)/60))
|
|
|
+ // }
|
|
|
+ // console.log(_self.duration)
|
|
|
+ if(_self.permission === 2 || _self.permission === 4 || _self.permission === 1) {
|
|
|
+ _self.currentVideo.oncanplay = function () {
|
|
|
+ console.log(_self.currentVideo.duration)
|
|
|
+ if (parseInt((_self.currentVideo.duration % 3600)/60) < 10) {
|
|
|
+ _self.isPlayer = false;
|
|
|
+ _self.showVideoDialog = false;
|
|
|
+ _self.currentVideo.pause()
|
|
|
+ if (_self.checkPermission() !== 0) return;
|
|
|
+ }
|
|
|
+ if (parseInt((_self.currentVideo.duration % 3600)/60) >= 10) {
|
|
|
+ _self.currentVideo.play()
|
|
|
+ }
|
|
|
+ _self.currentVideo.addEventListener('timeupdate', () =>{
|
|
|
+ // if() {}
|
|
|
+ if (parseInt(_self.currentVideo.currentTime) >= 3) {
|
|
|
+ _self.isPlayer = false;
|
|
|
+ _self.showVideoDialog = false;
|
|
|
+ _self.currentVideo.pause()
|
|
|
+ if (_self.checkPermission() !== 0) return;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ // _self.currentVideo.addEventListener('pause', function () {
|
|
|
+ // _self.isPlayer = false;
|
|
|
+ // console.log('暂停播放');
|
|
|
+ // });
|
|
|
+ // _self.currentVideo.addEventListener('ended', function () {
|
|
|
+ // _self.isPlayer = false;
|
|
|
+ // console.log('播放结束');
|
|
|
+ // });
|
|
|
+ // _self.currentVideo.addEventListener('error', function () {
|
|
|
+ // _self.isPlayer = false;
|
|
|
+ // console.log('播放错误');
|
|
|
+ // });
|
|
|
+ // _self.currentVideo.addEventListener('play', function () {
|
|
|
+ // _self.isPlayer = true;
|
|
|
+ // console.log('开始播放');
|
|
|
+ // })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ let _self = this;
|
|
|
+ if (_self.checkPermission() !== 0) return;
|
|
|
+ //暂停上一个正在播放的播放器
|
|
|
+ this.currentVideoUrl = url;
|
|
|
+ this.isPlayer = true;
|
|
|
+ this.showVideoDialog = true;
|
|
|
+ console.log(url)
|
|
|
+ setTimeout(function(){
|
|
|
+ _self.currentVideo = document.querySelector('#realPlayer');
|
|
|
+ _self.currentVideo.addEventListener('pause', function () {
|
|
|
+ _self.isPlayer = false;
|
|
|
+ console.log('暂停播放');
|
|
|
+ });
|
|
|
+ _self.currentVideo.addEventListener('ended', function () {
|
|
|
+ _self.isPlayer = false;
|
|
|
+ console.log('播放结束');
|
|
|
+ });
|
|
|
+ _self.currentVideo.addEventListener('error', function () {
|
|
|
+ _self.isPlayer = false;
|
|
|
+ console.log('播放错误');
|
|
|
+ });
|
|
|
+ _self.currentVideo.addEventListener('play', function () {
|
|
|
+ _self.isPlayer = true;
|
|
|
+ console.log('开始播放');
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
//隐藏视频播放窗口
|
|
|
handleClosePlayer: function () {
|
|
@@ -239,6 +350,14 @@ var beautyArchiveDetailMixin = {
|
|
|
_self.listLoading = false;
|
|
|
_self.cmSysParams.pageLabel = res.data.relatedLabels;
|
|
|
_self.cmSysParams.pageType = 20;
|
|
|
+ _self.imageArchiveList.forEach((item, index) => {
|
|
|
+ if (item.imageNum !== item.imageList.length) {
|
|
|
+ _self.num = item.imageNum - item.imageList.length
|
|
|
+ for (let i = 0; i < _self.num; i++) {
|
|
|
+ item.imageList.push(_self.defaultImage)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
// 只有当前用户权限为0时初始化图片预览
|
|
|
if (_self.permission === 0) {
|
|
|
setTimeout(function () {
|