mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-09 10:56:47 +08:00
提交合并后的所有文件
This commit is contained in:
@@ -1,23 +1,24 @@
|
||||
<template>
|
||||
<!--文章详细页面-->
|
||||
<view><watermark></watermark><u-toast ref="articleToast"></u-toast>
|
||||
<page-title :showBack="true">文章详细信息</page-title>
|
||||
<view class="adetail content">
|
||||
<page-title :showBack="true">文章详情</page-title>
|
||||
<view class="adetail content" style="border-radius: 0;">
|
||||
<!--文章内容-->
|
||||
<view class="adetail-title">{{ detail.title }}</view>
|
||||
<view class="adetail-info">
|
||||
<view style="display: flex;">
|
||||
<!-- <author-info :name="detail.sysCreateBy" :avatar="detail.avatar"></author-info> -->
|
||||
<author v-if="detail" :showInfo="true" :data="detail" ></author>
|
||||
<author v-if="detail" :showInfo="true" :data="detail" ></author>
|
||||
</view>
|
||||
<view style="padding: 10upx 10upx 10upx 40upx; font-size: 24rpx;"> {{ detail.sysCreateTime }}</view>
|
||||
<view style="padding: 10upx 10upx 10upx 40upx; font-size: 24upx;"> {{ detail.sysCreateTime }}</view>
|
||||
</view>
|
||||
<view class="adetail-body">
|
||||
<!-- class="ql-container" -->
|
||||
<view class="ql-container">
|
||||
<view class="ql-container" >
|
||||
<!-- class="ql-editor" -->
|
||||
<u-parse class="ql-editor" :content="detail.content" :tagStyle="style"></u-parse>
|
||||
</view>
|
||||
<!-- <view v-if="articleMore && detail.content.length>200" @click="showMore" style="text-align: center;color: #387DF7;"><text>查看更多∨</text> </view> -->
|
||||
<!-- <view v-if="userInfo.aid==detail.sysCreateAid" style="display: flex;justify-content: flex-end;color: #b1b1b1;padding-top: 10px;">
|
||||
<u-icon @click="toEdit" name="edit-pen-fill" label="编辑"></u-icon>
|
||||
<u-icon @click="del" style="margin-left: 20px;" name="trash" label="删除"></u-icon>
|
||||
@@ -32,7 +33,7 @@
|
||||
<script>
|
||||
import apiArticle from '@/api/modules/article.js'
|
||||
import apiUser from '@/api/system/user.js'
|
||||
|
||||
import apiStat from '@/api/phase2/stat.js'
|
||||
import { mapGetters } from 'vuex';
|
||||
export default {
|
||||
data() {
|
||||
@@ -43,10 +44,11 @@
|
||||
page:1,//当前页数
|
||||
pagesize:10, //总页数
|
||||
fileUrl:this.$config.fileUrl,
|
||||
articleMore:true,
|
||||
style: {
|
||||
// 字符串的形式
|
||||
p: 'word-break:break-all;font-size: 30rpx;letter-spacing:1rpx; line-height: 1.6;margin-bottom:25px',
|
||||
span: 'word-break:break-all;font-size: 30rpx;letter-spacing:1rpx; line-height: 1.6'
|
||||
p: 'word-break:break-all;font-size: 28upx;letter-spacing:1rpx; line-height: 1.6;margin-bottom:25px',
|
||||
span: 'word-break:break-all;font-size: 28upx;letter-spacing:1rpx; line-height: 1.6'
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -56,6 +58,32 @@
|
||||
this.id = options.id;
|
||||
this.getDetail();
|
||||
},
|
||||
mounted() {
|
||||
let event = {
|
||||
key: "ViewArticle",//后台的事件key 发布文章且审核通过
|
||||
title: "查看文章",//事件的标题
|
||||
parameters:"",//用户自定义参数 name:value,name:value
|
||||
content: "查看了文章",//事件的内容
|
||||
source:'page',
|
||||
objId: this.id,//关联的id
|
||||
objType: "2",//关联的类型
|
||||
objInfo: this.detail.title,
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 ,//状态,直接写1
|
||||
source:"h5",
|
||||
}
|
||||
apiStat.sendEvent(event);
|
||||
// this.$store.dispatch("userTrigger", event);
|
||||
this.setTime = setTimeout(()=>{
|
||||
event.key = 'ReadArticle';
|
||||
event.title = "阅读文章";
|
||||
event.parameters='second:60';//增加60秒的学习时长
|
||||
event.content = "阅读了文章"
|
||||
apiStat.sendEvent(event);
|
||||
// $this.$store.dispatch("userTrigger", event);
|
||||
},61000);//1分钟后记录
|
||||
},
|
||||
onReachBottom(){
|
||||
this.getDetail()
|
||||
},
|
||||
@@ -102,6 +130,9 @@
|
||||
setTimeout(function(){ uni.hideLoading() },100);
|
||||
})
|
||||
},
|
||||
showMore(){
|
||||
this.articleMore=false;
|
||||
},
|
||||
commentSuccess(rs){
|
||||
//console.log(rs,'success');
|
||||
this.$refs.comComments.loadData(false);
|
||||
@@ -149,12 +180,22 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
/deep/ .comments{
|
||||
margin-top: 0;
|
||||
.comments-top{
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
::v-deep .uavatar{
|
||||
width: 72upx !important;
|
||||
height: 72upx !important;
|
||||
}
|
||||
.adetail{
|
||||
padding: 15upx 30upx;
|
||||
.adetail-title{
|
||||
font-weight: 610;
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
font-size: 36upx;
|
||||
letter-spacing: 0.5px;
|
||||
padding: 10upx;
|
||||
word-break:break-all;
|
||||
@@ -209,6 +250,20 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.more-info{overflow: hidden; position: relative;}
|
||||
.more-info::after{
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 30px;
|
||||
background: -webkit-gradient(linear, 0 0, 0 100%, from(rgba(255, 255, 255, 0)), to(rgba(255, 255, 255, 1)));
|
||||
background: -moz-linear-gradient(top, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
|
||||
background: -o-linear-gradient(top, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
|
||||
background: linear-gradient(top, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0ff, endColorstr=#fff, GradientType=0);
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
}
|
||||
.ql-container {
|
||||
display: block;
|
||||
position: relative;
|
||||
@@ -223,9 +278,10 @@
|
||||
.ql-container[hidden] {
|
||||
display: none;
|
||||
}
|
||||
.ql-container .ql-editor {
|
||||
::v-deep .ql-container .ql-editor {
|
||||
position: relative;
|
||||
font-size: inherit;
|
||||
font-size: 28upx !important;
|
||||
color: #666666;
|
||||
line-height: inherit;
|
||||
font-family: inherit;
|
||||
min-height: inherit;
|
||||
@@ -238,6 +294,7 @@
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.ql-container .ql-editor::-webkit-scrollbar {
|
||||
width: 0 !important;
|
||||
}
|
||||
@@ -350,7 +407,7 @@
|
||||
}
|
||||
.ql-editor p{
|
||||
margin-bottom: 20px;
|
||||
font-size: 32rpx;
|
||||
font-size: 28upx;
|
||||
line-height: 1.2em;
|
||||
}
|
||||
.ql-editor ol > li,
|
||||
|
||||
@@ -9,17 +9,29 @@
|
||||
<page-title :showBack="true">问答详情</page-title>
|
||||
<u-toast ref="messager"></u-toast>
|
||||
<view class="adetail content">
|
||||
<!--文章内容-->
|
||||
<view class="adetail-title" v-if="detailData.id" style="word-break: break-all;">
|
||||
<text class="qa-basic qa-solve" v-if="detailData.isResolve">[已解决]</text>
|
||||
<text class="qa-basic qa-unSolve" v-else>[待解决]</text>
|
||||
<!-- <text class="qa-basic qa-solve" v-if="detailData.isResolve">[已解决]</text> -->
|
||||
<!-- <text class="qa-basic qa-unSolve" v-else>[待解决]</text> -->
|
||||
{{ detailData.title }}
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="interval"></view> -->
|
||||
<view class="adetail content">
|
||||
<!--文章内容-->
|
||||
<view class="adetail-info">
|
||||
<view style="display: flex;line-height: 40upx;">
|
||||
<author-info :name="detailData.sysCreateBy" :avatar="detailData.avatar" :sex="detailData.sex" :info="detailData.ucode" :showInfo="true"></author-info>
|
||||
</view>
|
||||
<view style="padding: 20upx 0upx 10upx 40upx; font-size: 24rpx; ">{{ detailData.sysCreateTime }}</view>
|
||||
<!-- <view class="concern" style="color: #979797;" v-if="hasFollow" @click="followShow = true">
|
||||
已关注
|
||||
</view>
|
||||
<view class="concern" v-else @click="addFollow()">
|
||||
+关注
|
||||
</view> -->
|
||||
<!-- <view class="concern" style="color: #999;">
|
||||
已关注
|
||||
</view> -->
|
||||
<view style="margin-left: auto;margin-right: ; font-size: 24rpx; ">{{ detailData.sysCreateTime }}</view>
|
||||
</view>
|
||||
<view class="adetail-body">
|
||||
<u-parse :content="detailData.content"></u-parse>
|
||||
@@ -29,7 +41,7 @@
|
||||
<view>
|
||||
<view class="comments">
|
||||
<view class="comments-top">
|
||||
<view v-if="detailData.id">回答<text style="color: #818181;margin-left: 5px;">{{ answers }}</text></view>
|
||||
<view v-if="detailData.id">回答<text style="color: #333333;margin-left: 5px;">({{ answers }})</text></view>
|
||||
<!-- <view class="share-btn" @click="openShare">
|
||||
<view class="share-btn-icon"><img src="../../static/images/icon/share.png" alt="" /></view>
|
||||
<view class="share-btn-name">分享</view>
|
||||
@@ -40,14 +52,18 @@
|
||||
<view v-for="(an, anidx) in answerList" :key="anidx" class="comment">
|
||||
<view class="comment-top">
|
||||
<view style="display: flex;">
|
||||
<author v-if="an" :showInfo="true" :data="an"></author>
|
||||
<author :showInfo="true" :size="30" width="30px" height="30px" :data="an"></author>
|
||||
<!-- {{an}} -->
|
||||
<!-- <author-img :avatar="an.avatar" :sex="an.sex" width="30px" height="30px" :size="30"></author-img>
|
||||
<text style="color: #333333;font-weight: 500;font-size: 28upx;margin-left: 22upx;">{{an.sysCreateBy}}</text> -->
|
||||
</view>
|
||||
<view class="comment-time">
|
||||
<view style="display: flex;">
|
||||
<view>
|
||||
<view v-if="detailData.isResolve">
|
||||
<text v-if="an.isBest" style="color:#FFB30F;">最佳答案</text>
|
||||
</view>
|
||||
<view style="margin-left: 10px"><time-show :time="an.sysCreateTime"></time-show></view>
|
||||
<view class="set-good-an" v-if="userInfo.aid==detailData.sysCreateAid && !detailData.isResolve && an.id && an.clevel==1" @click="setBest(an)">设置为最佳答案</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -56,18 +72,33 @@
|
||||
<text v-html="displayAll(an)"></text>
|
||||
<text style="color: #00aaff;word-break: normal; " v-if="an.content.length>minTextLen" @click="changeIsAll(an)">{{an.isAll?' 收起':' 全文'}}</text>
|
||||
</view>
|
||||
<view class="comment-btns">
|
||||
<view style="display: flex;">
|
||||
<view class="comment-btns" style="margin-bottom: 20upx;">
|
||||
<view><time-show :time="an.sysCreateTime"></time-show></view>
|
||||
<view class="" style="display: flex;">
|
||||
<view style="font-size: 12px;color: #999999;line-height: 50upx;" @click="openReply(an,{})">
|
||||
<image style="width: 32upx;height: 32upx;vertical-align: middle;margin-right: 10upx;" src="../../static/images/icon/bar-comment.png" size="24"></image>回复
|
||||
</view>
|
||||
<view v-if="!an.isPraise" style="font-size: 12px;color: #999999;line-height: 50upx;margin-left: 40upx;" @click="addPraise(anidx)">
|
||||
<image style="width: 32upx;height: 32upx;vertical-align: middle;margin-right: 10upx;" src="../../static/images/icon/bar-praise.png" size="24"></image>
|
||||
<text> {{an.praises}}</text>
|
||||
</view>
|
||||
<view v-if="an.isPraise" style="font-size: 12px;color: #999999;line-height: 50upx;margin-left: 40upx;" @click="removePraise(anidx)">
|
||||
<image style="width: 32upx;height: 32upx;vertical-align: middle;margin-right: 10upx;" src="../../static/images/icon/bar-praise-active.png" size="24"></image>
|
||||
<text style="color: #387DF7;"> {{an.praises}}</text>
|
||||
</view>
|
||||
<!-- <interact-bar :data="comm" :comments="false" :favorites="false"></interact-bar> -->
|
||||
</view>
|
||||
<!-- <view style="display: flex;">
|
||||
<u-icon style="margin-right: 15px;" @click="openReply(an,{})" name="chat" color="#979797" size="18" label="回复"></u-icon>
|
||||
<u-icon v-if="an.isPraise" style="margin-right: 10px;" @click="removePraise(anidx)" name="thumb-up-fill" color="#979797" size="18" :label="an.praises"></u-icon>
|
||||
<u-icon v-if="!an.isPraise" style="margin-right: 10px;" @click="addPraise(anidx)" name="thumb-up" color="#979797" size="18" :label="an.praises"></u-icon>
|
||||
</view>
|
||||
<view>
|
||||
</view> -->
|
||||
<!-- <view>
|
||||
<u-icon v-if="userInfo.aid==an.sysCreateAid" @click="openBtns(an,anidx)" name="more-dot-fill" size="20"></u-icon>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<!--一级评论,二级数据-->
|
||||
<view v-if="an.answers && an.answers.length!=0" class="comment-replys">
|
||||
<view v-if="an.answers && an.answers.length!=0" class="comment-replys" style="margin-left: 60upx;">
|
||||
<view v-for="(ele, replyIndex) in an.answers" :key="replyIndex" class="comment">
|
||||
<view class="comment-top">
|
||||
<view style="display: flex;">
|
||||
@@ -75,9 +106,7 @@
|
||||
<text style="padding-left: 16upx;padding-top: 6upx;color: #979797;">回复</text>
|
||||
<text style="padding-left: 16upx;padding-top: 6upx;font-size: 26upx;">{{ele.replayName}}</text>
|
||||
</view>
|
||||
<view class="comment-time">
|
||||
<time-show :time="ele.sysCreateTime"></time-show>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="comment-body">
|
||||
<view class="comment-content" style="word-break: break-all;white-space: pre-wrap;">
|
||||
@@ -85,14 +114,23 @@
|
||||
<text style="color: #00aaff; white-space: nowrap;" v-if="ele.content.length>minTextLen" @click="changeIsAll(ele)">{{ele.isAll?' 收起':' 全文'}}</text>
|
||||
</view>
|
||||
<view class="comment-btns">
|
||||
<view>
|
||||
<u-icon @click="openReply(ele,an)" name="chat" color="#979797" size="18" label="回复"></u-icon>
|
||||
<view class="comment-time">
|
||||
<time-show :time="ele.sysCreateTime"></time-show>
|
||||
</view>
|
||||
<view>
|
||||
<u-icon v-if="userInfo.aid==ele.sysCreateAid" @click="openBtns(ele,replyIndex)" name="more-dot-fill" size="20"></u-icon>
|
||||
<view class="" style="display: flex;">
|
||||
<view style="font-size: 12px;color: #999999;line-height: 50upx;" @click="openReply(ele,an)">
|
||||
<image style="width: 32upx;height: 32upx;vertical-align: middle;margin-right: 10upx;" src="../../static/images/icon/bar-comment.png" size="24"></image>回复
|
||||
</view>
|
||||
<!-- <view v-if="!ele.isPraise" style="font-size: 12px;color: #999999;line-height: 50upx;margin-left: 40upx;" @click="addPraise(anidx)">
|
||||
<image style="width: 32upx;height: 32upx;vertical-align: middle;margin-right: 10upx;" src="../../static/images/icon/bar-praise.png" size="24"></image>
|
||||
<text> {{ele.praises}}</text>
|
||||
</view>
|
||||
<view v-if="ele.isPraise" style="font-size: 12px;color: #999999;line-height: 50upx;margin-left: 40upx;" @click="removePraise(anidx)">
|
||||
<image style="width: 32upx;height: 32upx;vertical-align: middle;margin-right: 10upx;" src="../../static/images/icon/bar-praise-active.png" size="24"></image>
|
||||
<text style="color: #387DF7;"> {{ele.praises}}</text>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<!--评论的二级显示-->
|
||||
<view v-if="ele.answers && ele.answers.length!=0" class="comment-replys">
|
||||
<view v-for="(row, rowIdx) in ele.answers" :key="rowIdx" class="comment">
|
||||
<view class="comment-top">
|
||||
@@ -101,9 +139,7 @@
|
||||
<text style="padding-left: 16upx;padding-top: 6upx;color: #979797;">回复</text>
|
||||
<text style="padding-left: 16upx;padding-top: 6upx;font-size: 26upx;">{{row.replayName}}</text>
|
||||
</view>
|
||||
<view class="comment-time">
|
||||
<time-show :time="row.sysCreateTime"></time-show>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="comment-body">
|
||||
<view class="comment-content" style="word-break: break-all;white-space: pre-wrap;">
|
||||
@@ -111,12 +147,17 @@
|
||||
<text style="color: #00aaff; white-space: nowrap;" v-if="row.content.length>minTextLen" @click="changeIsAll(row)">{{row.isAll?' 收起':' 全文'}}</text>
|
||||
</view>
|
||||
<view class="comment-btns">
|
||||
<view>
|
||||
<u-icon @click="openReply(row,ele)" name="chat" color="#979797" size="18" label="回复"></u-icon>
|
||||
<view class="comment-time">
|
||||
<time-show :time="row.sysCreateTime"></time-show>
|
||||
</view>
|
||||
<view>
|
||||
<u-icon v-if="userInfo.aid==row.sysCreateAid" @click="openBtns(row,rowIdx)" name="more-dot-fill" size="20"></u-icon>
|
||||
<!-- <view v-if="!row.isPraise" style="font-size: 12px;color: #999999;line-height: 50upx;margin-left: 40upx;" @click="addPraise(anidx)">
|
||||
<image style="width: 32upx;height: 32upx;vertical-align: middle;margin-right: 10upx;" src="../../static/images/icon/bar-praise.png" size="24"></image>
|
||||
<text> {{row.praises}}</text>
|
||||
</view>
|
||||
<view v-if="row.isPraise" style="font-size: 12px;color: #999999;line-height: 50upx;margin-left: 40upx;" @click="removePraise(anidx)">
|
||||
<image style="width: 32upx;height: 32upx;vertical-align: middle;margin-right: 10upx;" src="../../static/images/icon/bar-praise-active.png" size="24"></image>
|
||||
<text style="color: #387DF7;"> {{row.praises}}</text>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -128,34 +169,32 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view><uni-load-more :status="loadStatus"></uni-load-more></view>
|
||||
<!-- <view><uni-load-more :status="loadStatus"></uni-load-more></view> -->
|
||||
</view>
|
||||
<!-- 下方的点赞 -->
|
||||
<interact-fixed :data="detailData" ref="fiexdbar" :comments="false" :answers="true" :type="4">
|
||||
<view class="field" @click="openAnswerInput()">
|
||||
<u-icon name="edit-pen-fill" size="18" class="field-icon"></u-icon>
|
||||
<text class="wenz">我来回答..</text>
|
||||
<text class="wenz">写回答</text>
|
||||
</view>
|
||||
</interact-fixed>
|
||||
<!--弹出回答的窗口-->
|
||||
<u-popup :show="replyShow" @close="closeReply">
|
||||
<u-popup :show="replyShow" @close="closeReply" :round="16">
|
||||
<view>
|
||||
<view style="display: flex;justify-content: space-around;">
|
||||
<view style="padding: 20rpx;flex: 1; white-space: pre-wrap; word-break: break-all;">
|
||||
<u--textarea :height="120" v-model="answercontent" :placeholder="placeholder" count maxlength="200"></u--textarea>
|
||||
<view>
|
||||
<view style="padding: 40rpx;white-space: pre-wrap; word-break: break-all;">
|
||||
<u--textarea style="border: none;background: #F4F4F4;" :height="50" v-model="answercontent" :placeholder="placeholder" count maxlength="200"></u--textarea>
|
||||
</view>
|
||||
<view style="padding: 20px 10px">
|
||||
<view style="line-height: 82upx;text-align: center;margin-bottom: 20upx" @click="askQuestioner">
|
||||
<text v-if="replyLevel=='one'">@</text>
|
||||
</view>
|
||||
<u-button style="height: 60px;" @click="submitReply" type="primary" size="small" :text="replyLevel=='one'? '提交回答':'提交回复'"></u-button>
|
||||
<view style="padding: 0 10px 40upx 0;display: flex;justify-content: flex-end;">
|
||||
<!-- <text v-if="replyLevel=='one'" @click="askQuestioner">@</text> -->
|
||||
<u-button style="padding: 10upx 30upx;height: 52upx;background: #87B3FF;border-color: #87B3FF;margin: 0 40upx 0 40upx;width: 200upx;" @click="submitReply" type="primary" size="small" :text="replyLevel=='one'? '提交回答':'提交回复'"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-popup :show="answerEdit.show" @close="closeAnswerEdit" @open="openAnswerEdit">
|
||||
<u-popup :show="answerEdit.show" @close="closeAnswerEdit" @open="openAnswerEdit" :round="16">
|
||||
<view>
|
||||
<view style="display: flex;justify-content: space-around;">
|
||||
<view>
|
||||
<view style="padding: 20rpx;flex: 1;">
|
||||
<u--textarea :height="120" v-model="curItem.content" placeholder="请输入5-1000个字" count maxlength="1000"></u--textarea>
|
||||
</view>
|
||||
@@ -172,6 +211,17 @@
|
||||
<view @click="closeBtns()" class="big-button">取消</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-popup :show="followShow">
|
||||
<view class="cancel-pop">
|
||||
<view class="btn" @click="cancelFollow()">
|
||||
<image style="width:32upx;height:32upx;vertical-align: middle;margin-right: 20upx;" src="../../static/images/icon/follow-stop.png" mode=""></image>
|
||||
停止关注 {{detailData.sysCreateBy}}
|
||||
</view>
|
||||
<view class="btn btn2" @click="followShow = false">
|
||||
取消
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-toast ref="interactToast"></u-toast>
|
||||
</view>
|
||||
</template>
|
||||
@@ -181,10 +231,13 @@ import apiQa from '@/api/modules/qa.js';
|
||||
import apiUser from '@/api/system/user.js'
|
||||
import apiPraises from '@/api/modules/praises.js'
|
||||
import apiMessage from '@/api/system/message.js'
|
||||
import apiFollow from "@/api/phase2/userfollow.js"
|
||||
import apiStat from '@/api/phase2/stat.js'
|
||||
import { mapGetters } from 'vuex';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
followShow:false,
|
||||
detailData: {}, //问题详情数据
|
||||
answers:0,
|
||||
images:[],
|
||||
@@ -212,19 +265,21 @@ export default {
|
||||
loading: false,//控制点赞按钮是否可以点击
|
||||
firstIndex:0,
|
||||
type:4,
|
||||
hasFollow:false,
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
this.questionId=option.id
|
||||
this.getData(this.questionId);
|
||||
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['userInfo']),
|
||||
placeholder(){
|
||||
let txt='请写下您的答案(200字以内),可以@提问者哦~';
|
||||
let txt='写下你的回答吧···';
|
||||
if(this.curItem && this.curItem.id){
|
||||
//if(this.curItem.clevel>1){
|
||||
txt='请写下您的回复(200字以内)';
|
||||
txt=`回复 ${this.curItem.sysCreateBy}`;
|
||||
//}
|
||||
}
|
||||
return txt;
|
||||
@@ -253,6 +308,49 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
addFollow(){ //添加关注
|
||||
if(this.detailData.sysCreateAid){
|
||||
if(this.userInfo.aid==this.detailData.sysCreateAid){
|
||||
uni.showToast({icon: 'info',title:"不能对自己操作"})
|
||||
return;
|
||||
}
|
||||
let $this=this;
|
||||
apiFollow.save(this.detailData.sysCreateAid).then(res=>{
|
||||
if(res.status == 200) {
|
||||
$this.hasFollow=true;
|
||||
uni.showToast({icon: 'success',title:"关注成功"})
|
||||
} else {
|
||||
uni.showToast({icon: 'info',title:"关注失败"+res.message})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
cancelFollow(){
|
||||
if(this.detailData.sysCreateAid){
|
||||
if(this.userInfo.aid==this.detailData.sysCreateAid){
|
||||
uni.showToast({icon: 'info',title:"不能对自己操作"})
|
||||
return;
|
||||
}
|
||||
|
||||
let $this=this;
|
||||
apiFollow.remove(this.detailData.sysCreateAid).then(res=>{
|
||||
if(res.status == 200) {
|
||||
$this.hasFollow=false;
|
||||
$this.followShow = false;
|
||||
uni.showToast({icon: 'success',title:"已取消关注"})
|
||||
}else {
|
||||
uni.showToast({icon: 'info',title:"取消关注失败"+res.message})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
autoCheck(id){
|
||||
apiFollow.checkFllow(id).then(res => {
|
||||
if (res.status == 200) {
|
||||
this.hasFollow = res.result ? true : false;
|
||||
}
|
||||
})
|
||||
},
|
||||
closeAnswerEdit(){
|
||||
this.answerEdit.show=false;
|
||||
},
|
||||
@@ -264,6 +362,7 @@ export default {
|
||||
uni.showLoading({title:'加载中...'})
|
||||
let $this=this;
|
||||
apiQa.detail(id).then(res => {
|
||||
setTimeout(function(){ uni.hideLoading() },100);
|
||||
if (res.status == 200) {
|
||||
//处理图片
|
||||
let imgArray=[];
|
||||
@@ -277,16 +376,19 @@ export default {
|
||||
this.answers=res.result.answers;
|
||||
this.answerList=[]
|
||||
this.getAnswerList(id);
|
||||
this.autoCheck(res.result.sysCreateAid);
|
||||
apiUser.getByIds([res.result.sysCreateAid]).then(rs=>{
|
||||
|
||||
setTimeout(function(){ uni.hideLoading() },100);
|
||||
if(rs.status==200){
|
||||
if(rs.result!='' && rs.result.length>0){
|
||||
let author=rs.result[0];
|
||||
if(author.avatar != '') {
|
||||
res.result.avatar=$this.fileUrl+author.avatar;
|
||||
} else {
|
||||
res.result.avatar='';
|
||||
}
|
||||
// if(author.avatar != '') {
|
||||
// res.result.avatar=$this.fileUrl+author.avatar;
|
||||
// } else {
|
||||
// res.result.avatar='';
|
||||
// }
|
||||
res.result.avatar=author.avatar;
|
||||
res.result.sex = author.sex;
|
||||
res.result.orgInfo=author.orgInfo;
|
||||
res.result.ucode=author.code;
|
||||
@@ -296,10 +398,29 @@ export default {
|
||||
$this.detailData = res.result;
|
||||
}
|
||||
})
|
||||
setTimeout(function(){ uni.hideLoading() },100);
|
||||
let event = {
|
||||
key: "ReadQuestion",//后台的事件key 发布文章且审核通过
|
||||
title: "阅读问题",//事件的标题
|
||||
parameters:"author:"+res.result.sysCreateAid,//用户自定义参数 name:value,name:value
|
||||
content: '阅读了问题',//事件的内容
|
||||
objId: id,//关联的id
|
||||
objType: "4",//关联的类型
|
||||
objInfo: $this.detailData.title,
|
||||
aid: $this.userInfo.aid, //当前登录人的id
|
||||
aname: $this.userInfo.name,//当前人的姓名
|
||||
status: 1 ,//状态,直接写1
|
||||
source:"h5",
|
||||
}
|
||||
apiStat.sendEvent(event);
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
title:res.message
|
||||
})
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
setTimeout(function(){ uni.hideLoading() },100);
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title:"获取数据失败"
|
||||
@@ -316,7 +437,9 @@ export default {
|
||||
apiQa.page(params).then(res => {
|
||||
if (res.status == 200) {
|
||||
let allList=[];
|
||||
this.answerList = [];
|
||||
if(this.pageIndex == 1) {
|
||||
this.answerList = [];
|
||||
}
|
||||
this.answers= res.result.count;
|
||||
let uids=[];
|
||||
let level3ParentIds=[];
|
||||
@@ -389,7 +512,6 @@ export default {
|
||||
return item.content;
|
||||
},
|
||||
changeIsAll(item) {
|
||||
//console.log(item,'isall');
|
||||
item.isAll=!item.isAll;
|
||||
},
|
||||
messageSave(refId,title,sendName,acceptName,acceptId,typeText){
|
||||
@@ -407,6 +529,11 @@ export default {
|
||||
sendType:1,
|
||||
conType,
|
||||
content,
|
||||
source:1,
|
||||
pageType:4,
|
||||
pageParams:this.questionId,
|
||||
// pageUrl:location.href,
|
||||
sendAid:this.userInfo.aid,
|
||||
}
|
||||
apiMessage.save(message).then(res=>{
|
||||
if(res.status==200){
|
||||
@@ -414,16 +541,29 @@ export default {
|
||||
})
|
||||
},
|
||||
//设置最佳答案接口
|
||||
setBest() {
|
||||
setBest(an) {
|
||||
//userInfo.aid == an.sysCreateAid因为身份信息为空,所以为了接接口没有加这个判断,但是实际上要加的
|
||||
apiQa.isBest(this.curItem.id).then(res => {
|
||||
apiQa.isBest(an.id).then(res => {
|
||||
if (res.status == 200) {
|
||||
this.$set(this.detailData, 'isResolve', true);
|
||||
uni.showToast({title:"设置成功" ,duration: 2000})
|
||||
this.btnsShow=false
|
||||
this.answerList=[]
|
||||
//console.log("我经过这里面美哟")
|
||||
this.getAnswerList(this.questionId)
|
||||
let event = {
|
||||
key: "AnswerBest",//设置为最佳答案
|
||||
title: "回答被选为最佳答案",//
|
||||
parameters:"author:"+an.sysCreateAid,//内容的作者
|
||||
content: '回答被选为最佳答案',//事件的内容
|
||||
objId: an.id,//关联的id
|
||||
objType: '5',//关联的类型
|
||||
objInfo: '设置最佳答案',
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 ,//状态,直接写1
|
||||
source:"h5",
|
||||
}
|
||||
apiStat.sendEvent(event);
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
@@ -471,6 +611,20 @@ export default {
|
||||
this.getAnswerList(this.questionId);
|
||||
this.answercontent = '';
|
||||
this.replyShow = false;
|
||||
let event = {
|
||||
key: "AnswerQuestion",//后台的事件key
|
||||
title: "回答问题",//事件的标题
|
||||
parameters:"",//用户自定义参数 name:value,name:value
|
||||
content: '回答了问题',//事件的内容
|
||||
objId: res.result.id,//关联的id
|
||||
objType: "5",//关联的类型
|
||||
objInfo: this.detailData.title,
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 ,//状态,直接写1
|
||||
source:"h5",
|
||||
}
|
||||
apiStat.sendEvent(event);
|
||||
} else {
|
||||
uni.showToast({icon: 'none',title:"发布失败"})
|
||||
}
|
||||
@@ -487,9 +641,13 @@ export default {
|
||||
list.forEach(item=>{
|
||||
res.result.some(author=>{
|
||||
if(author.aid==item.sysCreateAid){
|
||||
if(author.avatar!=''){
|
||||
item.avatar=$this.fileUrl+author.avatar;
|
||||
// if(item.parentId == "" ) {
|
||||
// item.avatar= author.avatar;
|
||||
// } else
|
||||
if(author.avatar != ''){
|
||||
item.avatar=this.$config.fileUrl + author.avatar;
|
||||
}
|
||||
// item.avatar=author.avatar;
|
||||
item.sex=author.sex;
|
||||
item.ucode=author.code;
|
||||
item.orgInfo=author.orgInfo;
|
||||
@@ -531,6 +689,20 @@ export default {
|
||||
this.answerList=[]
|
||||
$this.$refs.messager.show({message:'删除成功',type:'success'});
|
||||
$this.getAnswerList($this.questionId);//questionId要移出去
|
||||
let event = {
|
||||
key: "DeleteAnswer",//自己删除自己的回答
|
||||
title: "删除自己的回答",//事件的标题
|
||||
parameters:"",//用户自定义参数 name:value,name:value
|
||||
content: '删除了自己问题',//事件的内容
|
||||
objId: $this.curItem.id,//关联的id
|
||||
objType: "5",//关联的类型
|
||||
objInfo: $this.detailData.title,
|
||||
aid: $this.userInfo.aid, //当前登录人的id
|
||||
aname: $this.userInfo.name,//当前人的姓名
|
||||
status: 1 ,//状态,直接写1
|
||||
source:"h5",
|
||||
}
|
||||
apiStat.sendEvent(event);
|
||||
}else{
|
||||
$this.$refs.messager.show({message:'删除失败:'+rs.message,type:'error'});
|
||||
}
|
||||
@@ -620,9 +792,6 @@ export default {
|
||||
this.curParentId='';
|
||||
this.answercontent='';
|
||||
this.loadUserInfos([res.result],[res.result.sysCreateAid]);
|
||||
//console.log(this.curItem,'this.curItem');
|
||||
//console.log(this.curParent,'this.curParent');
|
||||
//if(this.curItem.id)
|
||||
if(this.curItem.clevel<3){
|
||||
if(!this.curItem.answers){
|
||||
this.curItem.answers=[];
|
||||
@@ -633,6 +802,20 @@ export default {
|
||||
}
|
||||
uni.showToast({icon: 'none',title:"回复成功"});
|
||||
this.replyShow = false;
|
||||
let event = {
|
||||
key: "ReplyAnswer",//
|
||||
title: '回复回答',//
|
||||
parameters:"",//作者
|
||||
content: '回复回答',//
|
||||
objId: this.curItem.id,//关联的id
|
||||
objType: "5",//关联的类型
|
||||
objInfo:'',
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1,
|
||||
source:"h5",
|
||||
}
|
||||
apiStat.sendEvent(event);
|
||||
}else{
|
||||
uni.showToast({icon: 'none',title:"回复失败"});
|
||||
this.replyShow = false;
|
||||
@@ -664,7 +847,6 @@ export default {
|
||||
this.answerList[index].isPraise=true;
|
||||
this.answerList[index].praises++;
|
||||
this.$refs.interactToast.show({message:'点赞成功',type:'success'});
|
||||
//console.log(this.answerList[index],'content)')
|
||||
this.messageSave(this.answerList[index].id,this.answerList[index].content,this.userInfo.name,this.answerList[index].sysCreateBy,this.answerList[index].sysCreateAid,'点赞了我的');
|
||||
|
||||
}else{
|
||||
@@ -696,6 +878,47 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.cancel-pop{
|
||||
// height: 142px;
|
||||
background: #F8F8F8;
|
||||
border-radius: 32upx 32upx 0 0;
|
||||
padding: 44upx 36upx 40upx 36upx;
|
||||
.btn{
|
||||
height: 88upx;
|
||||
font-size: 32upx;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
line-height: 88upx;
|
||||
box-shadow: 0 4upx 14upx 2upx rgba(104,102,102,0.08);
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
-webkit-box-orient: vertical;
|
||||
display: -webkit-box;-webkit-line-clamp: 1;
|
||||
word-break:break-all;
|
||||
}
|
||||
.btn2{
|
||||
margin-top: 22upx;
|
||||
border-radius: 44upx;
|
||||
|
||||
}
|
||||
}
|
||||
.interval{
|
||||
height: 20upx;
|
||||
width: 100%;
|
||||
background-color: #F9F9F9;
|
||||
}
|
||||
.concern{
|
||||
width: 140upx;
|
||||
height: 68upx;
|
||||
background: #F6F6F6;
|
||||
border-radius: 12upx;
|
||||
text-align: center;
|
||||
line-height: 68upx;
|
||||
font-size: 28upx;
|
||||
color: #387DF7;
|
||||
margin-left: auto;
|
||||
}
|
||||
.one-wrap {
|
||||
// width: 80%;
|
||||
flex:1;
|
||||
@@ -716,12 +939,11 @@ export default {
|
||||
.adetail {
|
||||
padding: 15upx 30upx;
|
||||
.adetail-title {
|
||||
// font-weight: 700;
|
||||
font-weight: bold;
|
||||
//font-weight: 610;
|
||||
font-size: 32rpx;
|
||||
background-color: #fff;
|
||||
// padding-bottom: 40upx;
|
||||
font-weight: 500;
|
||||
font-size: 36upx;
|
||||
letter-spacing: 0.5px;
|
||||
|
||||
.qa-basic{
|
||||
font-size: 32rpx;
|
||||
|
||||
@@ -734,10 +956,12 @@ export default {
|
||||
color: #7e7e7e;
|
||||
}
|
||||
.adetail-body {
|
||||
//padding-top: 15px;
|
||||
padding-top: 20upx;
|
||||
line-height: 55upx;
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
font-size: 28upx;
|
||||
color: #999;
|
||||
background-color: #ffffff;
|
||||
> div {
|
||||
text-indent: 24px;
|
||||
@@ -746,10 +970,10 @@ export default {
|
||||
}
|
||||
.field {
|
||||
width: 200px;
|
||||
height: 40px;
|
||||
height: 36px;
|
||||
line-height: 30px;
|
||||
background: rgb(247,247,249);
|
||||
border-radius: 10upx;
|
||||
border-radius: 17px;
|
||||
display: flex;
|
||||
.field-icon{
|
||||
margin-top: 2px;
|
||||
@@ -770,8 +994,9 @@ export default {
|
||||
.comments-top {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding-bottom: 30upx;
|
||||
border-bottom: 1px solid #f4f4f4;
|
||||
padding-top: 20upx;
|
||||
// padding-bottom: 30upx;
|
||||
// border-bottom: 1px solid #f4f4f4;
|
||||
font-weight: 500;
|
||||
font-size: 30upx;
|
||||
}
|
||||
@@ -806,16 +1031,21 @@ export default {
|
||||
}
|
||||
.comment-time{
|
||||
color: #696969;font-size: 0.9em;
|
||||
.set-good-an{
|
||||
color: #387DF7;
|
||||
background: #F6F6F6;
|
||||
padding: 0 10upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.comment-body{
|
||||
padding: 6upx 0upx 0upx 60upx;
|
||||
padding: 14upx 0upx 0upx 0;
|
||||
color: #373737;
|
||||
.comment-content{
|
||||
word-break:break-all;
|
||||
padding: 0upx 10upx 10upx 0upx;
|
||||
font-size: 28upx;
|
||||
color: #333333;
|
||||
color: #666666;
|
||||
}
|
||||
.comment-btns{
|
||||
display: flex;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user