添加事件

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

@@ -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