|
|
@@ -1,16 +1,16 @@
|
|
|
<template>
|
|
|
- <div class="course-detail-page">
|
|
|
+ <div class="communication-detail-page">
|
|
|
<!--课程信息-->
|
|
|
- <div class="course-detail-container">
|
|
|
+ <div class="communication-detail-container">
|
|
|
<!--课程基本信息-->
|
|
|
<el-card>
|
|
|
<div class="header">
|
|
|
- <img :src="communicationInfo.img" alt="err" class="course-img">
|
|
|
- <div class="course-info">
|
|
|
+ <img :src="titleImg" alt="err" class="communication-img">
|
|
|
+ <div class="communication-info">
|
|
|
<el-row style="font-size: xx-large; font-weight: bold">
|
|
|
{{ communicationInfo.title }}
|
|
|
</el-row>
|
|
|
- <div class="course-info-main">
|
|
|
+ <div class="communication-info-main">
|
|
|
<el-row>发布作者: {{ communicationInfo.publisherName }}</el-row>
|
|
|
<el-row>所属组织: {{ communicationInfo.organization }}</el-row>
|
|
|
<el-row>持续时间:</el-row>
|
|
|
@@ -32,31 +32,38 @@
|
|
|
<el-row>
|
|
|
联系方式:
|
|
|
</el-row>
|
|
|
- <el-row v-if="communicationInfo.phone != null">
|
|
|
+ <el-row v-if="communicationInfo.phone !== ''">
|
|
|
电话:{{communicationInfo.phone}}
|
|
|
</el-row>
|
|
|
- <el-row v-if="communicationInfo.qq != null">
|
|
|
+ <el-row v-if="communicationInfo.qq !== ''">
|
|
|
qq:{{communicationInfo.qq}}
|
|
|
</el-row>
|
|
|
- <el-row v-if="communicationInfo.wechat != null">
|
|
|
+ <el-row v-if="communicationInfo.wechat !== ''">
|
|
|
微信:{{communicationInfo.wechat}}
|
|
|
</el-row>
|
|
|
- <el-row v-if="communicationInfo.email != null">
|
|
|
+ <el-row v-if="communicationInfo.email !== ''">
|
|
|
邮箱:{{communicationInfo.email}}
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</div>
|
|
|
<el-divider/>
|
|
|
<div class="introduce">
|
|
|
- <div class="title">详细描述</div>
|
|
|
+ <div class="title">详细描述:</div>
|
|
|
<div class="introduce-content">{{ communicationInfo.description }}</div>
|
|
|
</div>
|
|
|
+ <div class="pictureList">
|
|
|
+ <div class="title">图片:</div>
|
|
|
+ <div v-for="image in imgList" :key="image.id">
|
|
|
+ <img :src="image.fileUrl" alt="err" class="picture">
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
<div class="attachment">
|
|
|
<div class="title">附件:</div>
|
|
|
<div class="attachment-list"
|
|
|
v-for="attachment in attachments"
|
|
|
:key="attachment.id"
|
|
|
- @click="downloadAttachment"
|
|
|
+ @click="downloadAttachment(attachment.fileUrl, attachment.fileName)"
|
|
|
>
|
|
|
{{attachment.fileName}}{{attachment.fileExtention}}({{attachment.fileSize}})
|
|
|
</div>
|
|
|
@@ -68,14 +75,15 @@
|
|
|
|
|
|
<script>
|
|
|
import {ElMessage} from "element-plus";
|
|
|
+import communication from "@/api/communication";
|
|
|
|
|
|
export default {
|
|
|
name: "CommunicationDetail",
|
|
|
data(){
|
|
|
return{
|
|
|
- communicationInfo: {
|
|
|
- img: "",
|
|
|
- },
|
|
|
+ communicationInfo: {},
|
|
|
+ titleImg: "",
|
|
|
+ imgList: [],
|
|
|
attachments: [],
|
|
|
starersList: [],
|
|
|
starersListString: "",
|
|
|
@@ -90,13 +98,14 @@ export default {
|
|
|
fetchData(){
|
|
|
this.$apis.getCommunicationDetail(this.$route.params.communicationId).then(res=>{
|
|
|
this.communicationInfo = res.data.data;
|
|
|
- if (this.communicationInfo.photos.length != 0){
|
|
|
- this.communicationInfo.img = this.communicationInfo.photos[0].fileUrl;
|
|
|
+ if (this.communicationInfo.photos.length !== 0){
|
|
|
+ this.titleImg = this.communicationInfo.photos[0].fileUrl;
|
|
|
+ this.imgList = this.communicationInfo.photos;
|
|
|
}
|
|
|
- else this.communicationInfo.img = this.$variables.noImgUrl;
|
|
|
+ else this.titleImg = this.$variables.noImgUrl;
|
|
|
this.attachments = this.communicationInfo.attachments;
|
|
|
this.publishTime = this.communicationInfo.publishTime.substring(0,10) + " " + this.communicationInfo.publishTime.substring(11,19);
|
|
|
- if (this.deadline != ""){
|
|
|
+ if (this.deadline !== ""){
|
|
|
this.deadline = this.communicationInfo.deadline.substring(0,10) + " " + this.communicationInfo.deadline.substring(11,19);
|
|
|
}
|
|
|
else this.deadline = "无截止日期";
|
|
|
@@ -123,8 +132,26 @@ export default {
|
|
|
this.$apis.cancelStarCommunication(this.$store.state.user.id, this.communicationInfo.id);
|
|
|
ElMessage.success("取消收藏成功");
|
|
|
},
|
|
|
- downloadAttachment(){
|
|
|
+ downloadAttachment(url, fileName){
|
|
|
console.log("下载!");
|
|
|
+ const data = url;
|
|
|
+ let file = new Blob(["\ufeff" + data]);
|
|
|
+ if (window.navigator.msSaveOrOpenBlob)
|
|
|
+ // IE10+
|
|
|
+ window.navigator.msSaveOrOpenBlob(file, fileName);
|
|
|
+ else {
|
|
|
+ // Others
|
|
|
+ let a = document.createElement("a"),
|
|
|
+ url = URL.createObjectURL(file);
|
|
|
+ a.href = url;
|
|
|
+ a.download = fileName;
|
|
|
+ document.body.appendChild(a);
|
|
|
+ a.click();
|
|
|
+ setTimeout(function() {
|
|
|
+ document.body.removeChild(a);
|
|
|
+ window.URL.revokeObjectURL(url);
|
|
|
+ }, 0);
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
};
|
|
|
@@ -150,12 +177,12 @@ export default {
|
|
|
color: #337ecc;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
-.course-detail-page {
|
|
|
+.communication-detail-page {
|
|
|
margin: 40px 0 80px 0;
|
|
|
min-height: calc(100vh - 100px);
|
|
|
}
|
|
|
|
|
|
-.course-detail-container {
|
|
|
+.communication-detail-container {
|
|
|
box-sizing: border-box;
|
|
|
padding: 0 100px;
|
|
|
margin-top: 32px;
|
|
|
@@ -167,27 +194,37 @@ export default {
|
|
|
margin: 40px 10vw 80px 10vw;
|
|
|
}
|
|
|
|
|
|
-.course-img {
|
|
|
- width: 400px;
|
|
|
+.communication-img {
|
|
|
+ width: 320px;
|
|
|
height: 230px;
|
|
|
- margin-left: -80px
|
|
|
+ margin-left: -120px;
|
|
|
}
|
|
|
|
|
|
-.course-img > img {
|
|
|
+.communication-img > img {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
object-fit: cover;
|
|
|
object-position: center center;
|
|
|
}
|
|
|
|
|
|
-.course-info {
|
|
|
+.pictureList{
|
|
|
+ margin-top: 20px;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+
|
|
|
+.picture{
|
|
|
+ max-width: 600px;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+
|
|
|
+.communication-info {
|
|
|
font-size: 16px;
|
|
|
color: #333333;
|
|
|
margin-left: 32px;
|
|
|
margin-right: -80px;
|
|
|
}
|
|
|
|
|
|
-.course-info-main {
|
|
|
+.communication-info-main {
|
|
|
background-color: #f6f6f6;
|
|
|
color: #777777;
|
|
|
margin-top: 10px;
|
|
|
@@ -196,20 +233,20 @@ export default {
|
|
|
width: 350px;
|
|
|
}
|
|
|
|
|
|
-.course-info > div {
|
|
|
+.communication-info > div {
|
|
|
margin-bottom: 16px;
|
|
|
}
|
|
|
|
|
|
-.course-info > div:last-child {
|
|
|
+.communication-info > div:last-child {
|
|
|
margin-bottom: 0;
|
|
|
}
|
|
|
|
|
|
-.course-info .mooc-link .el-link {
|
|
|
+.communication-info .mooc-link .el-link {
|
|
|
font-size: 16px;
|
|
|
color: #409eff;
|
|
|
}
|
|
|
|
|
|
-.course-info .mooc-link .el-link:hover {
|
|
|
+.communication-info .mooc-link .el-link:hover {
|
|
|
color: #79bbff;
|
|
|
}
|
|
|
|
|
|
@@ -228,6 +265,7 @@ export default {
|
|
|
color: #333333;
|
|
|
font-weight: 500;
|
|
|
font-size: 20px;
|
|
|
+ text-align: left;
|
|
|
}
|
|
|
|
|
|
.new-notice-content .new-notice-item {
|