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:
@@ -52,15 +52,17 @@
|
||||
<view v-for="(an, anidx) in answerList" :key="anidx" class="comment">
|
||||
<view class="comment-top">
|
||||
<view style="display: flex;">
|
||||
<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>
|
||||
<!-- <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>
|
||||
<view v-if="detailData.isResolve">
|
||||
<text v-if="an.isBest" style="color:#FFB30F;">最佳答案</text>
|
||||
</view>
|
||||
<view class="set-good-an" v-if="userInfo.aid==detailData.sysCreateAid && !detailData.isResolve && an.id && an.clevel==1" @click="setBest()">设置为最佳答案</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
@@ -96,7 +98,7 @@
|
||||
</view> -->
|
||||
</view>
|
||||
<!--一级评论,二级数据-->
|
||||
<!-- <view v-if="an.answers && an.answers.length!=0" class="comment-replys" style="margin-left: 60upx;">
|
||||
<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;">
|
||||
@@ -162,7 +164,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -230,6 +232,7 @@ 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() {
|
||||
@@ -394,6 +397,20 @@ export default {
|
||||
}
|
||||
})
|
||||
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:2,
|
||||
}
|
||||
apiStat.sendEvent(event);
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
@@ -526,6 +543,20 @@ export default {
|
||||
this.answerList=[]
|
||||
//console.log("我经过这里面美哟")
|
||||
this.getAnswerList(this.questionId)
|
||||
let event = {
|
||||
key: "AnswerBest",//设置为最佳答案
|
||||
title: "回答被选为最佳答案",//
|
||||
parameters:"author:"+this.curItem.sysCreateAid,//内容的作者
|
||||
content: '回答被选为最佳答案',//事件的内容
|
||||
objId: this.curItem.id,//关联的id
|
||||
objType: '5',//关联的类型
|
||||
objInfo: '设置最佳答案',
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 ,//状态,直接写1
|
||||
source:2,
|
||||
}
|
||||
apiStat.sendEvent(event);
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
@@ -573,6 +604,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:2,
|
||||
}
|
||||
apiStat.sendEvent(event);
|
||||
} else {
|
||||
uni.showToast({icon: 'none',title:"发布失败"})
|
||||
}
|
||||
@@ -589,10 +634,13 @@ export default {
|
||||
list.forEach(item=>{
|
||||
res.result.some(author=>{
|
||||
if(author.aid==item.sysCreateAid){
|
||||
// if(author.avatar!=''){
|
||||
// item.avatar=$this.fileUrl+author.avatar;
|
||||
// }
|
||||
item.avatar=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;
|
||||
@@ -634,6 +682,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:2,
|
||||
}
|
||||
apiStat.sendEvent(event);
|
||||
}else{
|
||||
$this.$refs.messager.show({message:'删除失败:'+rs.message,type:'error'});
|
||||
}
|
||||
@@ -736,6 +798,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:2,
|
||||
}
|
||||
apiStat.sendEvent(event);
|
||||
}else{
|
||||
uni.showToast({icon: 'none',title:"回复失败"});
|
||||
this.replyShow = false;
|
||||
@@ -951,6 +1027,11 @@ export default {
|
||||
}
|
||||
.comment-time{
|
||||
color: #696969;font-size: 0.9em;
|
||||
.set-good-an{
|
||||
color: #387DF7;
|
||||
background: #F6F6F6;
|
||||
padding: 0 10upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.comment-body{
|
||||
|
||||
Reference in New Issue
Block a user