mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-16 14:26:43 +08:00
个人设置,一次性奖励检查添加
This commit is contained in:
@@ -57,14 +57,14 @@
|
|||||||
<div v-show="interestIsEdit">
|
<div v-show="interestIsEdit">
|
||||||
<div class="interest" v-for="(sys,index) in sysTypeListMap" :key="sys.id">
|
<div class="interest" v-for="(sys,index) in sysTypeListMap" :key="sys.id">
|
||||||
<span class="interest-title">{{sys.name}}</span>
|
<span class="interest-title">{{sys.name}}</span>
|
||||||
<div style="width:100%">
|
<div style="width:100%">
|
||||||
<el-checkbox-group v-model="checkboxGroup" v-if="sys.children.length > 0">
|
<el-checkbox-group v-model="checkboxGroup" v-if="sys.children.length > 0">
|
||||||
<el-checkbox size="medium" border v-for="ch in sys.children" :label="ch.id" :key="ch.id">{{ch.name}}</el-checkbox>
|
<el-checkbox size="medium" border v-for="ch in sys.children" :label="ch.id" :key="ch.id">{{ch.name}}</el-checkbox>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="text-align: center;margin-top:56px">
|
<div style="text-align: center;margin-top:56px">
|
||||||
<el-button v-show="interestIsEdit" @click="interestIsEdit = false">取消</el-button>
|
<el-button v-show="interestIsEdit" @click="interestIsEdit = false">取消</el-button>
|
||||||
<el-button v-show="interestIsEdit" type="primary" @click="saveHobby()">保存</el-button>
|
<el-button v-show="interestIsEdit" type="primary" @click="saveHobby()">保存</el-button>
|
||||||
@@ -195,7 +195,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
||||||
...mapGetters(['userInfo','sysTypeMap']),
|
...mapGetters(['userInfo','sysTypeMap']),
|
||||||
avatar(){
|
avatar(){
|
||||||
if(this.userInfo.avatar){
|
if(this.userInfo.avatar){
|
||||||
@@ -232,6 +232,30 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
|
checkAndSendFinish(){
|
||||||
|
//验证并发送完成事件
|
||||||
|
if(this.userInfo.avatar && this.form.sign && this.form.sign!='' && this.interestList.length>1){
|
||||||
|
let event = {
|
||||||
|
key: "FinishSelf",//后台的事件key 发布文章且审核通过
|
||||||
|
title: "完善个人信息奖励",//事件的标题
|
||||||
|
parameters:"",//用户自定义参数 name:value,name:value
|
||||||
|
content: "需完成头像,个性签名,学习偏好设置",//事件的内容
|
||||||
|
source:'page',
|
||||||
|
objId: this.userInfo.aid,//关联的id
|
||||||
|
objType: "98",//关联的类型
|
||||||
|
objInfo: "个人信息",
|
||||||
|
aid: this.userInfo.aid, //当前登录人的id
|
||||||
|
aname: this.userInfo.name,//当前人的姓名
|
||||||
|
status: 1 //状态,直接写1
|
||||||
|
}
|
||||||
|
this.$store.dispatch("userTrigger", event);
|
||||||
|
}else{
|
||||||
|
// console.log('还未达到奖励');
|
||||||
|
// console.log('this.userInfo.avatar',this.userInfo.avatar);
|
||||||
|
// console.log('this.form.sign',this.form.sign);
|
||||||
|
// console.log('this.interestList',this.interestList);
|
||||||
|
}
|
||||||
|
},
|
||||||
saveDynamic() {
|
saveDynamic() {
|
||||||
userApi.updateDynamic(this.form.dynamic).then(res=>{
|
userApi.updateDynamic(this.form.dynamic).then(res=>{
|
||||||
if(res.status == 200) {
|
if(res.status == 200) {
|
||||||
@@ -245,11 +269,12 @@
|
|||||||
this.$message.success('我的签名修改成功');
|
this.$message.success('我的签名修改成功');
|
||||||
this.form.sign = this.signData.sign;
|
this.form.sign = this.signData.sign;
|
||||||
this.signData.isEdit = false;
|
this.signData.isEdit = false;
|
||||||
|
this.checkAndSendFinish();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getInfo() { //获取用户兴趣关联的id
|
getInfo() { //获取用户兴趣关联的id
|
||||||
this.checkboxGroup = [];
|
this.checkboxGroup = [];
|
||||||
apiUserhobby.info(this.userInfo.aid).then(res=>{
|
apiUserhobby.info(this.userInfo.aid).then(res=>{
|
||||||
if(res.status == 200) {
|
if(res.status == 200) {
|
||||||
res.result.forEach(item=>{
|
res.result.forEach(item=>{
|
||||||
@@ -280,7 +305,8 @@
|
|||||||
if(res.status == 200) {
|
if(res.status == 200) {
|
||||||
this.interestIsEdit = false;
|
this.interestIsEdit = false;
|
||||||
this.getInfo();
|
this.getInfo();
|
||||||
this.$message.success('更改成功!')
|
this.checkAndSendFinish();
|
||||||
|
this.$message.success('更改成功!')
|
||||||
} else {
|
} else {
|
||||||
this.$message.error("更改失败!")
|
this.$message.error("更改失败!")
|
||||||
}
|
}
|
||||||
@@ -326,6 +352,7 @@
|
|||||||
this.$store.dispatch('InitData');
|
this.$store.dispatch('InitData');
|
||||||
this.$message.success("保存图片成功")
|
this.$message.success("保存图片成功")
|
||||||
this.dialogVisibleAvatar=false;
|
this.dialogVisibleAvatar=false;
|
||||||
|
this.checkAndSendFinish();
|
||||||
}else{
|
}else{
|
||||||
this.$message.error("保存图片失败")
|
this.$message.error("保存图片失败")
|
||||||
}
|
}
|
||||||
@@ -372,7 +399,7 @@
|
|||||||
// outline: none !important;
|
// outline: none !important;
|
||||||
// }
|
// }
|
||||||
::v-deep .el-checkbox-button:first-child .el-checkbox-button__inner{
|
::v-deep .el-checkbox-button:first-child .el-checkbox-button__inner{
|
||||||
border-left:none;
|
border-left:none;
|
||||||
}
|
}
|
||||||
.el-checkbox-button, .el-checkbox-button__inner {
|
.el-checkbox-button, .el-checkbox-button__inner {
|
||||||
margin-right: 40px;
|
margin-right: 40px;
|
||||||
@@ -458,7 +485,7 @@
|
|||||||
top:45px;
|
top:45px;
|
||||||
right:45px;
|
right:45px;
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep .el-radio-button__inner{
|
::v-deep .el-radio-button__inner{
|
||||||
background: #F4F4F4 !important;
|
background: #F4F4F4 !important;
|
||||||
border-radius: 4px !important;
|
border-radius: 4px !important;
|
||||||
|
|||||||
Reference in New Issue
Block a user