mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-08 18:36:47 +08:00
添加事件
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user