提交 6ef5cf48 编写于 作者: guangjun.yang's avatar guangjun.yang

Merge branch 'dev-coursedetail-0817' of...

Merge branch 'dev-coursedetail-0817' of http://192.168.110.53/com.pica.cloud.education.frontend/pica-professional-exam into dev-coursedetail-0817

* 'dev-coursedetail-0817' of http://192.168.110.53/com.pica.cloud.education.frontend/pica-professional-exam:
  修改头像加载错误
  修改课件样式
  修改文件路径
  测试pdf

# Conflicts:
#	src/utils/env-config.js
<template> <template>
<div class="course-comment"> <div class="course-comment">
<div class="item" v-for="(item, index) in comments" :key="index"> <div class="item" v-for="(item, index) in comments" :key="index">
<img class="img" :src="item.imageUrl || 'https://file.yunqueyi.com/File/doctor_default.png'" alt="头像" /> <img class="img" :src="item.imageUrl || 'https://file.yunqueyi.com/File/doctor_default.png'" alt="头像" @error="onAvatarError" />
<div class="info-box"> <div class="info-box">
<div class="info-user"> <div class="info-user">
<div class="name">{{ item.doctorName }}</div> <div class="name">{{ item.doctorName }}</div>
...@@ -78,7 +78,7 @@ export default { ...@@ -78,7 +78,7 @@ export default {
item.cList = item.aList; item.cList = item.aList;
} }
this.comments.splice(index, 1, item); this.comments.splice(index, 1, item);
} },
} }
}; };
</script> </script>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="course-teacher-wrapper"> <div class="course-teacher-wrapper">
<div class="basic-title">讲师介绍</div> <div class="basic-title">讲师介绍</div>
<div class="leader-info" v-for="(item,index) in doctorList" :key="index"> <div class="leader-info" v-for="(item,index) in doctorList" :key="index">
<img :src="item.app_image_url" alt="头像" /> <img :src="item.app_image_url" alt="头像" @error="onAvatarError" />
<div class="leader-text"> <div class="leader-text">
<div class="leader-con"> <div class="leader-con">
<span>{{item.name}}</span> <span>{{item.name}}</span>
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
*/ */
import pdfJS from 'pdfjs-dist/es5/build/pdf'; import pdfJS from 'pdfjs-dist/es5/build/pdf';
pdfJS.GlobalWorkerOptions.workerSrc = 'https://cdn.bootcdn.net/ajax/libs/pdf.js/2.4.456/pdf.worker.min.js'; pdfJS.GlobalWorkerOptions.workerSrc = 'https://cdn.bootcdn.net/ajax/libs/pdf.js/2.4.456/pdf.worker.min.js';
import coverImg from '@/images/course/lock-big.png';
export default { export default {
props: { props: {
...@@ -58,10 +59,13 @@ export default { ...@@ -58,10 +59,13 @@ export default {
createCanvas(pdfPage) { createCanvas(pdfPage) {
let viewport = pdfPage.getViewport({ scale: 1.0 }); let viewport = pdfPage.getViewport({ scale: 1.0 });
let box = document.createElement("div"); let box = document.createElement("div");
box.className = 'canvas-box'; box.style.position = 'relative';
box.style.marginBottom = '30px';
let canvas = document.createElement("canvas"); let canvas = document.createElement("canvas");
canvas.width = viewport.width; canvas.width = viewport.width;
canvas.height = viewport.height; canvas.height = viewport.height;
canvas.style.display = 'block';
canvas.style.width = '100%';
let ctx = canvas.getContext("2d"); let ctx = canvas.getContext("2d");
let renderTask = pdfPage.render({ let renderTask = pdfPage.render({
canvasContext: ctx, canvasContext: ctx,
...@@ -70,9 +74,16 @@ export default { ...@@ -70,9 +74,16 @@ export default {
box.appendChild(canvas); box.appendChild(canvas);
if (!this.visible) { if (!this.visible) {
let cover = document.createElement("div"); let cover = document.createElement("div");
cover.className = 'canvas-cover'; cover.style.position = 'absolute';
cover.style.left = '0';
cover.style.top = '0';
cover.style.width = '100%';
cover.style.height = '100%';
cover.style.background = `url(${coverImg}) no-repeat center center`;
cover.style.backgroundSize = '50px auto';
cover.style.backgroundColor = 'rgba(255, 255, 255, .8)';
cover.onclick = () => { cover.onclick = () => {
if (!this.$store.getter.logged) { if (!this.$store.getters.logged) {
this.$store.dispatch('goLogin'); this.$store.dispatch('goLogin');
return; return;
} }
...@@ -90,23 +101,5 @@ export default { ...@@ -90,23 +101,5 @@ export default {
.course-ware{ .course-ware{
padding-top: 20px; padding-top: 20px;
overflow: hidden; overflow: hidden;
/deep/ .canvas-box{
position: relative;
margin-bottom: 30px;
}
/deep/ .canvas-cover{
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: url('~@/images/course/lock-big.png') no-repeat center center;
background-size: 50px auto;
background-color: rgba(255, 255, 255, .2);
}
/deep/ canvas{
display: block;
width: 100%;
}
} }
</style> </style>
...@@ -27,6 +27,12 @@ export const envConfig = { ...@@ -27,6 +27,12 @@ export const envConfig = {
// fileUrl: 'https://dev-www.yunqueyi.com', // fileUrl: 'https://dev-www.yunqueyi.com',
// appId: 'wxf4e66242d31c81c2', // 用于微信授权登录 // appId: 'wxf4e66242d31c81c2', // 用于微信授权登录
// apiUrl: 'https://uat-api.yunqueyi.com/',
// webPageUrl: 'https://uat-phome.yunqueyi.com/',
// hactiveUrl: 'https://uat-hactive.yunqueyi.com',
// phomeDemain: 'https://dev-phome.yunqueyi.com',
// appId: 'wxf4e66242d31c81c2', // 用于微信授权登录
// baseUrl: 'https://sc.yunqueyi.com/', // baseUrl: 'https://sc.yunqueyi.com/',
// apiUrl: 'https://api.yunqueyi.com/', // apiUrl: 'https://api.yunqueyi.com/',
// webPageUrl: 'https://phome.yunqueyi.com/' // webPageUrl: 'https://phome.yunqueyi.com/'
......
...@@ -25,8 +25,8 @@ export function getHactiveUrl(url) { ...@@ -25,8 +25,8 @@ export function getHactiveUrl(url) {
// 获取pdf文件地址 // 获取pdf文件地址
export function getPdfFileUrl(path) { export function getPdfFileUrl(path) {
let base = getConfigByEnvType('fileUrl'); let base = getConfigByEnvType('webPageUrl');
return `${base}/proxyPdf${path}`; return `${base}proxyPdf${path}`;
} }
// 获取微信APPID // 获取微信APPID
......
...@@ -211,6 +211,8 @@ module.exports = { ...@@ -211,6 +211,8 @@ module.exports = {
} }
return null return null
}, },
onAvatarError(e) {
e.target.src = 'https://file.yunqueyi.com/File/doctor_default.png';
},
} }
} }
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册