mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-07 01:46:44 +08:00
事件添加
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
<template>
|
||||
<view class="item-author" style="display: flex;">
|
||||
<view>
|
||||
<u-avatar shape="circle" v-if="data.avatar && data.avatar!=''" :size="20" :src="data.avatar"></u-avatar>
|
||||
<view v-else :size="20" :sex="data.sex" random-bg-color >
|
||||
<u-avatar shape="circle" v-if="data.avatar && data.avatar!=''" :size="size" :src="data.avatar"></u-avatar>
|
||||
<view v-else :sex="data.sex" random-bg-color >
|
||||
<view v-if="data.sex == null" class="peo"></view>
|
||||
<view v-else>
|
||||
<view class="peo" v-if="data.sex === 1 "><image src="../../static/images/man.png" alt=""></view>
|
||||
<view class="peo" v-else><image src="../../static/images/woman.png" alt=""></view>
|
||||
<view :style="{width:width,height:height}" class="peo" v-if="data.sex === 1 "><image src="../../static/images/man.png" alt=""></view>
|
||||
<view :style="{width:width,height:height}" class="peo" v-else><image src="../../static/images/woman.png" alt=""></view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <u-avatar v-else :size="25" random-bg-color :text="data.name" shape="square"></u-avatar> -->
|
||||
@@ -36,7 +36,19 @@
|
||||
showCode:{
|
||||
type:Boolean,
|
||||
default:true
|
||||
}
|
||||
},
|
||||
size:{
|
||||
type:Number,
|
||||
default:24
|
||||
},
|
||||
width:{
|
||||
type:String,
|
||||
default:'24px'
|
||||
},
|
||||
height:{
|
||||
type:String,
|
||||
default:'24px'
|
||||
},
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
@@ -65,8 +77,10 @@
|
||||
|
||||
<style lang="scss" scoped >
|
||||
.peo{
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
// width: 25px;
|
||||
// height: 25px;
|
||||
image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
@@ -133,6 +133,7 @@
|
||||
import apiComment from '@/api/modules/comments.js'
|
||||
import apiUser from '@/api/system/user.js'
|
||||
import apiShares from '@/api/modules/shares.js'
|
||||
import apiStat from '@/api/phase2/stat.js'
|
||||
import { mapGetters } from 'vuex';
|
||||
export default {
|
||||
props:{
|
||||
@@ -375,6 +376,20 @@
|
||||
this.list[this.curCommentIndex].replyList.push(res.result);
|
||||
this.$refs.interactToast.show({message:'发布成功',type:'success'});
|
||||
this.inputShow=false;
|
||||
let event = {
|
||||
key: "ReplyComment",//后台的事件key 发布文章且审核通过
|
||||
title: "回复评论",//事件的标题
|
||||
parameters:"",//用户自定义参数 name:value,name:value
|
||||
content: "每回一个评论",//事件的内容
|
||||
objId: this.replyInfo.commentId,//关联的id
|
||||
objType: "81",//关联的类型
|
||||
objInfo: "回复评论",
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 ,//状态,直接写1
|
||||
source:2,
|
||||
}
|
||||
apiStat.sendEvent(event);
|
||||
}else{
|
||||
this.$refs.interactToast.show({message:'发布失败',type:'error'});
|
||||
}
|
||||
@@ -545,7 +560,6 @@
|
||||
this.$refs.interactToast.show({message:'删除回复成功',type:'success'});
|
||||
this.btnsShow=false;
|
||||
}else{
|
||||
console.log(res.error);
|
||||
this.$refs.interactToast.show({message:'删除回复失败',type:'error'});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -84,7 +84,6 @@
|
||||
},
|
||||
watch:{
|
||||
data(newVal,oldVal){
|
||||
console.log(newVal,'newVal')
|
||||
if(newVal && newVal.id!=''){
|
||||
this.checkHas();
|
||||
}
|
||||
@@ -303,7 +302,8 @@
|
||||
objInfo: this.data.title,
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 //状态,直接写1
|
||||
status: 1 ,//状态,直接写1
|
||||
source:2,
|
||||
}
|
||||
apiStat.sendEvent(event);
|
||||
// this.$store.dispatch("userTrigger", event);
|
||||
|
||||
@@ -78,6 +78,7 @@
|
||||
import apiUser from '@/api/system/user.js'
|
||||
import apiCoursePortal from '@/api/modules/coursePortal.js'
|
||||
import apiMessage from '@/api/system/message.js'
|
||||
import apiStat from '@/api/phase2/stat.js'
|
||||
import { mapGetters } from 'vuex';
|
||||
export default {
|
||||
props: {
|
||||
@@ -323,6 +324,20 @@ export default {
|
||||
this.toUserDig.chooseUserName='';
|
||||
this.inputShow=false;
|
||||
this.$emit("comment-success", res.result);
|
||||
let event = {
|
||||
key: "PublishComment",//后台的事件key 发布文章且审核通过
|
||||
title: "发表评论",//事件的标题
|
||||
parameters:"",//用户自定义参数 name:value,name:value
|
||||
content: "每发表一个评论",//事件的内容
|
||||
objId: res.result.id,//关联的id
|
||||
objType: '80',//关联的类型,这里关联的类型应该是评论,不是课程
|
||||
objInfo: "评论",
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 ,//状态,直接写1
|
||||
source:2,
|
||||
}
|
||||
apiStat.sendEvent(event);
|
||||
}else{
|
||||
this.$refs.interactToast.show({message:'发布失败',type:'error'});
|
||||
}
|
||||
@@ -359,12 +374,58 @@ export default {
|
||||
this.isPraise=false;
|
||||
this.$refs.interactToast.show({message:'取消点赞',type:'success'});
|
||||
this.$emit("praise-success", res.result);
|
||||
let event = {
|
||||
key: "CancelPraise",//
|
||||
title: "取消点赞",//事件的标题
|
||||
parameters:"author:"+authorId,//用户自定义参数 name:value,name:value
|
||||
content: "取消点赞"+postData.title,//事件的内容
|
||||
objId: this.data.id,//关联的id
|
||||
objType: this.type,//关联的类型
|
||||
objInfo: this.data.title,
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 ,//状态,直接写1
|
||||
source:2,
|
||||
}
|
||||
apiStat.sendEvent(event);
|
||||
}else{
|
||||
this.$refs.interactToast.show({message:'取消失败',type:'error'});
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
||||
let contentText = '';
|
||||
if(this.type==1){
|
||||
contentText='课程';
|
||||
// conType = this.data.type;
|
||||
}
|
||||
if(this.type==2){
|
||||
contentText='文章'
|
||||
}
|
||||
if(this.type==3){
|
||||
contentText='案例'
|
||||
}
|
||||
if(this.type==4){
|
||||
contentText='提问'
|
||||
}
|
||||
if(this.type==5){
|
||||
contentText='回答'
|
||||
}
|
||||
if(this.type==6){
|
||||
contentText='课程笔记'
|
||||
}
|
||||
if(this.type==60){
|
||||
contentText='课程笔记评论'
|
||||
}
|
||||
// 点赞type
|
||||
if(this.type==10){
|
||||
contentText='课程评论'
|
||||
}
|
||||
if(this.type==20){
|
||||
contentText='文章评论'
|
||||
}
|
||||
if(this.type==30){
|
||||
contentText='案例评论'
|
||||
}
|
||||
apiPraises.save(postData).then(res=>{
|
||||
this.loading=false;
|
||||
if(res.status==200){
|
||||
@@ -375,6 +436,20 @@ export default {
|
||||
this.$refs.interactToast.show({message:'点赞成功',type:'success'});
|
||||
this.messageSave(this.data.id,this.data.title,this.userInfo.name,this.data.sysCreateBy,this.data.sysCreateAid,'点赞了我的');
|
||||
this.$emit("praise-success", res.result);
|
||||
let event = {
|
||||
key: "Praise",//后台的事件key 发布文章且审核通过
|
||||
title: "点赞",//事件的标题
|
||||
parameters:"author:"+this.data.sysCreateAid,//用户自定义参数 name:value,name:value
|
||||
content: "点赞了"+contentText,//事件的内容
|
||||
objId: this.data.id,//关联的id
|
||||
objType: this.type,//关联的类型
|
||||
objInfo: this.data.title,
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 ,//状态,直接写1
|
||||
source:2,
|
||||
}
|
||||
apiStat.sendEvent(event);
|
||||
}else{
|
||||
this.$refs.interactToast.show({message:'点赞失败',type:'error'});
|
||||
}
|
||||
|
||||
@@ -138,6 +138,7 @@
|
||||
allClear() {
|
||||
apiMessage.cleanAll().then(res=>{
|
||||
if(res.status == 200) {
|
||||
this.modalShow = false;
|
||||
this.$emit('loadMessage');
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user