|
@@ -50,8 +50,9 @@
|
|
|
class="cm-video"
|
|
|
ref="myVideo"
|
|
|
:id="'myVideo' + index"
|
|
|
- :src="item.fileUrl"
|
|
|
+ :src="myDecrypt([item.fileUrl])[0]"
|
|
|
:style="videoStyle['myVideo' + index]"
|
|
|
+ referrer-policy='origin'
|
|
|
controls
|
|
|
show-fullscreen-btn
|
|
|
show-mute-btn
|
|
@@ -119,6 +120,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { mapState } from 'vuex'
|
|
|
+import CryptoJS from '@/utils/crypto-js/crypto.js'
|
|
|
export default {
|
|
|
props: {
|
|
|
product: {
|
|
@@ -179,7 +181,7 @@ export default {
|
|
|
false, // 正常访问
|
|
|
{ text: '请登录后查看!', btn: '去登录', redirect: '/pages/login/login' },
|
|
|
{ text: '请升级成为会员机构后方可查看!', btn: '去升级', redirect: '/pages/login/apply' },
|
|
|
- { text: '请升级成为医美会员机构后方可查看!', btn: '去升级', redirect: '/pages/login/apply' },
|
|
|
+ { text: '医美资质机构可查看完整内容!', btn: '升级医美资质', redirect: '/pages/login/apply' },
|
|
|
{ text: '需抵扣100采美豆方可查看!', btn: '去查看', redirect: 10 },
|
|
|
{ text: '无权限查看!', btn: '确认' }
|
|
|
]
|
|
@@ -269,7 +271,7 @@ export default {
|
|
|
rh = (rw * h) / w
|
|
|
}
|
|
|
// 使用set向videoStyle添加样式信息
|
|
|
- this.$set(this.videoStyle, e.currentTarget.id, `width:${rw}rpx;height:${rh}rpx;`)
|
|
|
+ this.$set(this.videoStyle, e.currentTarget.id, `width:${rw}rpx;height:${400}rpx;`)
|
|
|
},
|
|
|
// 视频播放
|
|
|
handlePlayer(id, info) {
|
|
@@ -291,19 +293,7 @@ export default {
|
|
|
},
|
|
|
// 监听video时长
|
|
|
onPlayVideo(e) {
|
|
|
- console.log(e)
|
|
|
- const allTime = parseInt((e.detail.duration % 3600) / 60) // 获取分钟
|
|
|
- const inPlay = parseInt((e.detail.duration % 3600) / 60)
|
|
|
- if (this.permission === 2 || this.permission === 4 || this.permission === 1) {
|
|
|
- if (allTime >= 10 && 3 < inPlay) {
|
|
|
- this.handleStop(e.target.id)
|
|
|
- this.checkPermission()
|
|
|
- }
|
|
|
- if (allTime < 10) {
|
|
|
- this.handleStop(e.target.id)
|
|
|
- this.checkPermission()
|
|
|
- }
|
|
|
- }
|
|
|
+ this.checkPermission()
|
|
|
},
|
|
|
// 开始播放
|
|
|
handelPlay(id) {
|
|
@@ -343,37 +333,17 @@ export default {
|
|
|
if (info) {
|
|
|
this.GetStatisticsAddPv(1, info.archiveContentId)
|
|
|
}
|
|
|
- if (this.permission === 2 || this.permission === 4 || this.permission === 1) {
|
|
|
- if (previewImageList.length >= 5) {
|
|
|
- if (index < 2) {
|
|
|
- uni.previewImage({
|
|
|
- current: index,
|
|
|
- indicator: 'number',
|
|
|
- urls: previewImageList,
|
|
|
- loop: true,
|
|
|
- success() {
|
|
|
- that.$emit('previewImage', true)
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- if (this.checkPermission()) return
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (this.checkPermission()) return
|
|
|
+ if (this.checkPermission()) return
|
|
|
+ const that = this
|
|
|
+ uni.previewImage({
|
|
|
+ current: index,
|
|
|
+ indicator: 'number',
|
|
|
+ urls: previewImageList,
|
|
|
+ loop: true,
|
|
|
+ success() {
|
|
|
+ that.$emit('previewImage', true)
|
|
|
}
|
|
|
- } else {
|
|
|
- if (this.checkPermission()) return
|
|
|
- const that = this
|
|
|
- uni.previewImage({
|
|
|
- current: index,
|
|
|
- indicator: 'number',
|
|
|
- urls: previewImageList,
|
|
|
- loop: true,
|
|
|
- success() {
|
|
|
- that.$emit('previewImage', true)
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
+ })
|
|
|
},
|
|
|
//用户权限校验拦截
|
|
|
checkPermission() {
|
|
@@ -385,6 +355,27 @@ export default {
|
|
|
this.showModal = true
|
|
|
return -1
|
|
|
},
|
|
|
+ myDecrypt(
|
|
|
+ word,
|
|
|
+ iv = CryptoJS.enc.Utf8.parse('caimei--20240103'),
|
|
|
+ key = CryptoJS.enc.Utf8.parse('caimei--20240103')
|
|
|
+ ) {
|
|
|
+ if (word) {
|
|
|
+ return word.map(e => {
|
|
|
+ if (e) {
|
|
|
+ const encryptedHexStr = CryptoJS.enc.Base64.parse(e)
|
|
|
+ const srcs = CryptoJS.enc.Base64.stringify(encryptedHexStr)
|
|
|
+ const decrypt = CryptoJS.AES.decrypt(srcs, key, {
|
|
|
+ iv,
|
|
|
+ mode: CryptoJS.mode.CBC,
|
|
|
+ padding: CryptoJS.pad.NoPadding
|
|
|
+ })
|
|
|
+ const decryptedStr = decrypt.toString(CryptoJS.enc.Utf8)
|
|
|
+ return decryptedStr.toString()
|
|
|
+ } else return ''
|
|
|
+ })
|
|
|
+ } else return []
|
|
|
+ },
|
|
|
// modal 按钮点击
|
|
|
handleModalClick(e) {
|
|
|
// 点击确认按钮
|
|
@@ -445,35 +436,15 @@ export default {
|
|
|
},
|
|
|
// 文件预览
|
|
|
previewFile(file) {
|
|
|
- // if (this.checkPermission()) return
|
|
|
- // // 获取文件后缀
|
|
|
- // const index = file.fileName.lastIndexOf('.')
|
|
|
- // const suffix = file.fileName.substring(index)
|
|
|
- if (uni.getStorageSync('fileInfo')) {
|
|
|
- uni.removeStorageSync('fileInfo')
|
|
|
- }
|
|
|
- if (file) {
|
|
|
- this.GetStatisticsAddPv(1, file.archiveContentId)
|
|
|
- }
|
|
|
- uni.setStorageSync('fileInfo', file.content || '文章预览')
|
|
|
- this.openDocument(file)
|
|
|
- // if (suffix === '.doc' || suffix === '.ppt' || suffix === '.pptx' || suffix === '.docx') {
|
|
|
- // //先将链接缓存
|
|
|
- // uni.setStorageSync('openLink', file.htmlUrl)
|
|
|
- // this.openDocument(file.fileUrl)
|
|
|
- // // this.$api.navigateTo('/pages/h5/article/path?key=openLink&type=1')
|
|
|
- // } else if (suffix === '.pdf') {
|
|
|
- // //先将链接缓存
|
|
|
- // uni.setStorageSync('openLink', file.fileUrl)
|
|
|
- // this.$api.navigateTo('/pages/h5/article/path?key=openLink&type=2')
|
|
|
- // } else {
|
|
|
- // // 不支持的文件
|
|
|
- // return uni.showModal({
|
|
|
- // content: `${suffix}类型文件暂不支持预览`,
|
|
|
- // cancelColor: '#666',
|
|
|
- // confirmColor: '#FF5B00'
|
|
|
- // })
|
|
|
- // }
|
|
|
+ if (this.checkPermission()) return
|
|
|
+ const link = this.myDecrypt([file.fileUrl])[0].split('?')[0] || ''
|
|
|
+ const domainUrl = process.env.NODE_ENV === 'development' ? 'https://material-b.caimei365.com' : 'https://material.caimei365.com'
|
|
|
+ const url = `${domainUrl}/preview?t=3&url=${link}&isSp=1`
|
|
|
+ uni.setStorageSync('databaseurl', url)
|
|
|
+ console.log(link, url)
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pages/h5/article/path?databaseurl=1`
|
|
|
+ })
|
|
|
},
|
|
|
// 打开文档
|
|
|
openDocument(file) {
|
|
@@ -679,13 +650,12 @@ export default {
|
|
|
color: #b2b2b2;
|
|
|
}
|
|
|
.cm-img-list {
|
|
|
- display: flex;
|
|
|
- justify-content: flex-start;
|
|
|
- flex-wrap: wrap;
|
|
|
+ display: grid;
|
|
|
+ grid-template-columns: repeat(3, 1fr);
|
|
|
&.cm-list {
|
|
|
image {
|
|
|
- width: 162rpx;
|
|
|
- height: 162rpx;
|
|
|
+ width: 210rpx;
|
|
|
+ height: 210rpx;
|
|
|
margin: 18rpx 18rpx 0 0;
|
|
|
box-sizing: border-box;
|
|
|
border-radius: 6rpx;
|