This commit is contained in:
daihh
2022-11-15 11:58:18 +08:00
9 changed files with 326 additions and 28 deletions

View File

@@ -110,7 +110,7 @@
item.checked = false;
this.message.list.push(item);
});
this.loadAuthorInfo(res.result.list,ids)
this.loadAuthorInfo(res.result.list,ids,0)
}
} else {
this.$refs.toast.show({ message: '获取数据失败', type: 'error' })
@@ -140,7 +140,7 @@
item.authorInfo={avatar:'',name:'',code:'',sex:null};
this.data.push(item)
})
this.loadAuthorInfo(res.result.list,ids);
this.loadAuthorInfo(res.result.list,ids,1);
}
}else{
this.$refs.interactToast.show({message:'加载@我的评论失败',type:'error'});
@@ -148,7 +148,7 @@
uni.hideLoading();
})
},
loadAuthorInfo(list, ids) {
loadAuthorInfo(list, ids,num) {
//加载作者信息,头像,机构信息
if (ids.length == 0) {
return;
@@ -159,10 +159,10 @@
if (res.status == 200) {
list.forEach((item, index) => {
res.result.some(author => {
if ($this.tab == 0 && author.aid == item.sendAid) {
if (num == 0 && author.aid == item.sendAid) {
item.authorInfo = author;
return true;
} else if($this.tab == 1 && author.aid == item.sysCreateAid){
} else if(num == 1 && author.aid == item.sysCreateAid){
item.authorInfo = author;
} else {
return false;

View File

@@ -85,6 +85,8 @@
import apiArtice from '@/api/modules/article.js'
import config from '@/config/index.js'
import uploadUtil from '@/utils/upload.js'
import apiStat from '@/api/phase2/stat.js'
import { mapGetters } from 'vuex';
export default {
data() {
return {
@@ -104,6 +106,9 @@
fileList: []
}
},
computed:{
...mapGetters(['userInfo']),
},
mounted() {
uni.onKeyboardHeightChange(res => {
this.editorCtx.scrollIntoView({
@@ -156,6 +161,20 @@
}else if(res.result.status==3){
$this.$refs.messager.show({message:'审核未通过已转人工审核',type:'error'});
}else if(res.result.status==9){
let event = {
key: "PublishArticle",//后台的事件key 发布文章且审核通过
title: "发表文章",//事件的标题
parameters:"",//用户自定义参数 name:value,name:value
content: "发表了文章",//事件的内容
objId: res.result.id,//关联的id
objType: "2",//关联的类型
objInfo: $this.article.title,
aid: $this.userInfo.aid, //当前登录人的id
aname: $this.userInfo.name,//当前人的姓名
status: 1 ,//状态直接写1
source:2,
}
apiStat.sendEvent(event);
uni.redirectTo({
url:'/pages/resource/articeDetail?id='+res.result.id
})

View File

@@ -66,9 +66,10 @@
</template>
<script>
import { mapGetters } from 'vuex';
import apiQa from '@/api/modules/qa.js'
import uploadUtil from '@/utils/upload.js'
import apiStat from '@/api/phase2/stat.js'
export default {
data() {
return {
@@ -85,6 +86,9 @@
fileList: [],
}
},
computed:{
...mapGetters(['userInfo']),
},
methods: {
insertLabel(){
let $this=this;
@@ -157,6 +161,20 @@
apiQa.save($this.qa).then((rs)=>{
setTimeout(function(){uni.hideLoading()},1000);
if(rs.status==200){
let event = {
key: "PulishQuestion",//后台的事件key 发布文章且审核通过
title: '发布问题',//事件的标题
parameters:"",//用户自定义参数 name:value,name:value
content: "提出了问题",//事件的内容
objId: rs.result.id,//关联的id
objType: "4",//关联的类型
objInfo: $this.qa.title,
aid: $this.userInfo.aid, //当前登录人的id
aname: $this.userInfo.name,//当前人的姓名
status: 1 ,//状态直接写1
source:2,
}
apiStat.sendEvent(event);
$this.$refs.messager.show({message:'提交成功',type:'success'});
uni.redirectTo({
url:'/pages/resource/qaDetail?id='+rs.result.id

View File

@@ -35,6 +35,8 @@
<script>
import apiQa from '@/api/modules/qa.js'
import uploadUtil from '@/utils/upload.js'
import { mapGetters } from 'vuex';
import apiStat from '@/api/phase2/stat.js'
export default {
data() {
return {
@@ -48,6 +50,9 @@
fileList: [],
}
},
computed:{
...mapGetters(['userInfo']),
},
methods: {
toBack(){
uni.navigateBack();
@@ -62,6 +67,7 @@
uni.showLoading({title:'提交中...'})
apiQa.update(this.qa).then(rs=>{
if(rs.status==200){
this.$refs.messager.show({message:'提交成功',type:'success'});
uni.redirectTo({
url:'/pages/resource/qaDetail?id='+rs.result.id

View File

@@ -48,6 +48,8 @@
<script>
import apiFeedback from '@/api/modules/feedback.js'
import apiUser from '@/api/system/user.js'
import apiStat from '@/api/phase2/stat.js'
import { mapGetters } from 'vuex';
export default {
data() {
return {
@@ -62,7 +64,9 @@
index: 0
}
},
computed:{
...mapGetters(['userInfo']),
},
methods: {
isClick(type) {
this.info.type = type;
@@ -89,6 +93,20 @@
// uni.redirectTo({
// url:'/pages/resource/qaDetail?id='+rs.result.id
// })
let event = {
key: "Feedback",//后台的事件key
title: "意见反馈",//事件的标题
parameters:"",//用户自定义参数 name:value,name:value
content: '意见反馈',//事件的内容
objId: rs.result.id,//关联的id
objType:'99',//关联的类型
objInfo: "意见反馈",
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'});
}