123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307 |
- <template>
- <div class="normal-card">
- <div class="title-box">
- <div class="title">{{detailData.title}}</div>
- <div>
- <div class="descript">{{detailData.summary}}</div>
- <div class="info">
- <span class="tag">{{detailData.classname}}</span>
- <span>{{detailData.createdate}}</span>
- </div>
- </div>
- </div>
- <div class="text-content" v-if="detailData.content != '<p><br></p>'">
- <div id="fwb"></div>
- </div>
- <div class="file-content" v-if="detailData.attinfos && detailData.attinfos.length > 0">
- <div class="file-download">
- <p class="title">附件下载</p>
- <div class="file-list">
- <file-item
- :isDownLoad="true"
- :itemStyle="itemStyle"
- :sat_noticeid="detailData.sat_noticeid"
- :fileData="detailData.attinfos"
- @updateDownLoadRecord="updateDownLoadRecord">
- </file-item>
- </div>
- </div>
- </div>
- <div class="comments">
- <div class="score-box">
- <p>评分反馈</p>
- <div class="handle">
- <p>总体</p>
- <el-rate v-model="send.content.score" :disabled="!commentData.leavemessage == false" :colors="scoreColor"></el-rate>
- <p>满意</p>
- </div>
- <p>{{detailData.readpersoncount}}人评分</p>
- </div>
- <div class="text-box">
- <p>留言反馈</p>
- <div class="comment-panl">
- <el-input type="textarea" :rows="4" placeholder="请填写留言" resize="none" :disabled="!commentData.leavemessage == false" v-model="send.content.leavemessage">
- </el-input>
- <el-button type="success" size="small" :disabled="!commentData.leavemessage == false" @click.native="sendComment()">发表</el-button>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import FileItem from '@/components/file-block/index2'
- export default {
- name: "NoticeDetail",
- data () {
- return {
- //拉取数据配置
- param: {
- "classname": "saletool.notice.notice",
- "method": "queryNoticeMain",
- "content": {
- "sat_noticeid":4
- }
- },
- //发表配置
- send: {
- "classname": "saletool.notice.notice",
- "method": "updateReadRecord",
- "content": {
- "sat_noticeid": this.$route.query.id,
- "score": 0,
- "leavemessage": ""
- }
- },
- //itemfile样式
- itemStyle: {
- itemWidth: 360,
- margin:20,
- img: {
- width: 29,
- height: 29
- },
- title: 14,
- descript: 10
- },
- score: 0,
- scoreColor: ["#99A9BF", "#F7BA2A", "#FADB14"],
- textarea: "",
- //详情数据
- detailData: '',
- //评论数据
- commentData:''
- };
- },
- components: {
- FileItem
- },
- filters: {
- },
- computed: {},
- watch: {},
- created () {
- this.getNoticeDetail()
- this.getCommentDetail()
- },
- mounted () {
- },
- methods: {
- //解析富文本
- compileFWB () {
- document.getElementById('fwb').innerHTML = this.detailData.content
- },
- //获取详情数据
- async getNoticeDetail () {
- this.param.content.sat_noticeid = this.$route.query.id
- let res = await this.$api.requested(this.param)
- this.detailData = res.data
- this.detailData.attinfos = this.fileType.fileList(this.detailData.attinfos)
- this.detailData.content != '<p><br></p>' ? this.compileFWB() : ''
- },
- //发表
- async sendComment () {
- if (!this.send.content.leavemessage == true || this.send.content.score == 0) {
- this.$notify({
- title:'提示',
- message:'请填写评论或评分',
- type:'warning'
- })
- return
- } else {
- let res = await this.$api.requested(this.send)
- this.tool.showMessage(res,() => {
- this.getCommentDetail()
- })
- }
-
- },
- //获取评论
- async getCommentDetail() {
- let res = await this.$api.requested({
- "accesstoken": "148928f55b25f5c4636d5ae7cd339f93",
- "classname": "saletool.notice.notice",
- "method": "queryReadRecord",
- "content": {
- "sat_noticeid":this.$route.query.id
- }
- })
- this.commentData = res.data[0]
- this.send.content.score = res.data[0].score
- this.send.content.leavemessage = res.data[0].leavemessage
- },
- //更新下载记录
- async updateDownLoadRecord(data) {
- let res = await this.$api.requested({
- "classname": "saletool.notice.notice",
- "method": "updateDownloadRecord",
- "content": {
- "sat_noticeid":this.$route.query.id
- }
- })
- }
- }
- };
- </script>
- <style scoped>
- *{
- box-sizing: border-box;
- }
- .fwb-img {
- width: 50% !important;
- }
- .title {
- font-size: 14px;
- font-family: PingFang SC-Bold, PingFang SC;
- font-weight: bold;
- color: #333333;
- }
- .normal-card {
- padding: 30px;
- margin-top: 10px;
- font-family: PingFang SC-Regular;
- margin: 0 auto;
- }
- .normal-card .title-box {
- padding-bottom: 20px;
- border-bottom: 1px solid #eeeeee;
- display: flex;
- flex-direction: column;
- }
- .normal-card .title-box .title {
- line-height: 24px;
- padding-bottom: 10px;
- font-size: 25px;
- border-bottom: 1px solid #eeeeee;
- }
- .normal-card .title-box .descript {
- font-size: 14px;
- font-family: PingFang SC-Bold, PingFang SC;
- color: #333333;
- line-height: 24px;
- padding-top: 10px;
- }
- .normal-card .title-box .info {
- line-height: 16px;
- margin-top: 10px;
- font-size: 12px;
- display: flex;
- align-items: center;
- }
- .normal-card .title-box .info .tag {
- border: 1px solid #fa8c16;
- color: #fa8c16;
- margin-right: 10px;
- text-align: center;
- font-size: 10px;
- display: inline-block;
- padding: 2px 5px;
- }
- .normal-card .text-content {
- padding: 20px 0;
- border-bottom: 1px solid #eeeeee;
- font-size: 12px;
- }
- .normal-card .text-content #fwb {
- }
- #fwb img {
- width: 200px !important;
- }
- .normal-card .file-content {
- border-bottom: 1px solid #eeeeee;
- font-size: 12px;
- }
- .normal-card .file-content .title {
- margin: 10px 0;
- }
- .normal-card .file-content video {
- margin-top: 10px;
- }
- .normal-card .file-content .title {
- margin-bottom: 10px;
- }
- .normal-card .file-content .file-download .file-list {
- display: flex;
- flex-wrap: wrap;
- padding-bottom: 8px;
- }
- .normal-card .comments {
- margin-top: 20px;
- }
- .normal-card .comments .score-box {
- }
- .normal-card .comments .score-box p:first-child {
- font-size: 14px;
- font-family: PingFang SC-Bold, PingFang SC;
- font-weight: bold;
- color: #333333;
- }
- .normal-card .comments .score-box .handle {
- margin-top: 22px;
- display: flex;
- }
- .normal-card .comments .score-box .handle p:first-child {
- font-size: 14px;
- font-weight: 400;
- color: #333333;
- margin-right: 20px;
- }
- .normal-card .comments .score-box p:last-child {
- font-size: 12px;
- font-weight: 400;
- color: #999999;
- margin-top: 12px;
- }
- .normal-card .comments .score-box .handle p:last-child {
- font-size: 14px;
- font-weight: normal;
- color: #262626;
- margin-left: 20px;
- margin-top: 0;
- }
- .normal-card .comments .text-box {
- margin-top: 40px;
- }
- .normal-card .comments .text-box p {
- font-size: 14px;
- font-family: PingFang SC-Bold, PingFang SC;
- font-weight: bold;
- color: #333333;
- }
- .normal-card .comments .text-box .comment-panl {
- margin-top: 10px;
- }
- .normal-card .comments .text-box .comment-panl .el-input {
- min-height: 64px;
- }
- .normal-card .comments .text-box .comment-panl .el-button {
- background: #52c41a;
- margin-top: 10px;
- }
- .file-see img,video {
- max-width: 100%;
- }
- </style>
|