添加事件

This commit is contained in:
zhaofang
2022-11-15 11:57:12 +08:00
parent dcf16210c8
commit d756c74660
5 changed files with 65 additions and 3 deletions

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'});
}