mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-06 17:36:45 +08:00
提交修改
This commit is contained in:
@@ -18,7 +18,12 @@
|
||||
<view v-if="users.length>0" style="overflow-x: auto;height: 160upx;white-space: nowrap;overflow-y: hidden;">
|
||||
<view style="line-height: 60upx;display: inline-block;margin: 10upx;" v-for="(su,suidx) in users" :key="suidx" @click="confirmShare(su)">
|
||||
<view style="text-align: center;"><!--用户头像-->
|
||||
<image src="/static/images/man.png" shape="circle" style="width: 80upx;height: 80upx;"></image>
|
||||
<view v-if="su.avatar"><image :src="su.avatar" shape="circle" style="width: 80upx;height: 80upx;"></image></view>
|
||||
<view v-else>
|
||||
<image v-if="su.sex === 1 " shape="circle" src="../../static/images/man.png" style="width: 80upx;height: 80upx;" alt=""></image>
|
||||
<image v-else shape="circle" src="../../static/images/woman.png" style="width: 80upx;height: 80upx;" alt=""></image>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view style="text-align: center;font-size: 22upx;">{{su.name}}({{su.code}})</view>
|
||||
</view>
|
||||
@@ -80,6 +85,8 @@
|
||||
refId,
|
||||
refType:this.type,
|
||||
sendName,
|
||||
pageType:this.type,
|
||||
pageParams:this.data.id,
|
||||
acceptName,
|
||||
acceptId,
|
||||
title:'系统消息',
|
||||
@@ -111,8 +118,9 @@
|
||||
apiUser.getByLoginName(name).then(rs=>{
|
||||
if(rs.status==200){
|
||||
//因为根据工号查询,只会是一个人,所有会有null情况,而json会返回空字符串
|
||||
if(rs.result!=''){
|
||||
if(rs.result){
|
||||
$this.users=[rs.result];
|
||||
$this.loadAuthorInfo($this.users,rs.result.aid);
|
||||
}else{
|
||||
$this.$refs.messager.show({message:"无此用户",type:'warning'});
|
||||
}
|
||||
@@ -128,6 +136,19 @@
|
||||
//uni.showToast({title: rs.message,icon: 'none'});
|
||||
this.$refs.messager.show({message:rs.message,type:'error'});
|
||||
}else{
|
||||
let ids=[];
|
||||
rs.result.forEach(item=>{
|
||||
// if(item.avatar){
|
||||
// item.avatar=this.$config.fileUrl + item.avatar;
|
||||
// }else{
|
||||
// item.sex=1;
|
||||
// ids.push(item.aid);
|
||||
// }
|
||||
item.avatar='';
|
||||
item.sex=1;
|
||||
ids.push(item.aid);
|
||||
});
|
||||
this.loadAuthorInfo(rs.result,ids);
|
||||
this.users=rs.result;
|
||||
}
|
||||
}else{
|
||||
@@ -170,7 +191,7 @@
|
||||
apiShares.save(postData).then(rs=>{
|
||||
if(rs.status==200){
|
||||
if(rs.result){
|
||||
this.shareInfo.show=false;
|
||||
this.show=false;
|
||||
this.$refs.messager.show({message:'分享成功',type:'success'});
|
||||
let event = {
|
||||
key: "Share",//分享
|
||||
@@ -194,7 +215,7 @@
|
||||
this.messageSave(this.data.id,this.data.title,this.userInfo.name,u.name,u.aid,'分享给我的');
|
||||
}
|
||||
}
|
||||
this.show=false;
|
||||
|
||||
}else{
|
||||
this.$refs.messager.show({message:'已分享过,不能再分享',type:'warning'});
|
||||
}
|
||||
@@ -206,6 +227,36 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
loadAuthorInfo(list, ids) {
|
||||
//加载作者信息,头像,机构信息
|
||||
if (ids.length == 0) {
|
||||
return;
|
||||
}
|
||||
apiUser.getByIds(ids).then(res => {
|
||||
if (res.status == 200) {
|
||||
list.forEach((item, index) => {
|
||||
res.result.some(author => {
|
||||
if (author.aid == item.teacherId) {
|
||||
item.name= author.name;
|
||||
item.orgInfo=cutOrgNamePath(author.orgInfo);
|
||||
item.avatar= author.avatar;
|
||||
item.code= author.code;
|
||||
item.sex=author.sex;
|
||||
if(author.avatar != '') {
|
||||
item.avatar=this.$config.fileUrl + author.avatar;
|
||||
}
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
console.log('获取用户信息失败:'+res.error);
|
||||
//this.$message.error(res.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user