This commit is contained in:
lmj
2022-10-24 17:36:20 +08:00
3 changed files with 16 additions and 5 deletions

View File

@@ -66,9 +66,9 @@
</p> </p>
<p class="portal-summary-text">{{maPage.userFollow.authorInfo.sign}}</p> <p class="portal-summary-text">{{maPage.userFollow.authorInfo.sign}}</p>
</div> </div>
<div> <div v-if="Id == userInfo.aid">
<el-button class="btn" icon="el-icon-plus" v-if="maPage.has">已关注</el-button> <el-button class="btn" icon="el-icon-plus" v-if="maPage.has">已关注</el-button>
<el-button type="primary" class="btn" v-else icon="el-icon-plus">关注他</el-button> <el-button type="primary" class="btn" v-else icon="el-icon-plus" @click="toFollow(maPage)">关注他</el-button>
</div> </div>
</div> </div>
<!--分页没有加--> <!--分页没有加-->
@@ -147,6 +147,16 @@ import apiUser from "@/api/system/user.js";
}) })
}, },
methods:{ methods:{
toFollow(item) {
apiFollow.save(item.userFollow.aid).then(res=>{
if(res.status == 200) {
// this.$message.success("关注成功");
this.getMyPage();
} else {
this.$message.error(res.message);
}
})
},
resetActive(){ resetActive(){
this.active=1; this.active=1;
this.follow={list:[],count:0,pageIndex:1,pageSize:10}, this.follow={list:[],count:0,pageIndex:1,pageSize:10},
@@ -157,7 +167,8 @@ import apiUser from "@/api/system/user.js";
let $this=this; let $this=this;
apiFollow.remove(item.followId).then(res=>{ apiFollow.remove(item.followId).then(res=>{
if(res.status == 200) { if(res.status == 200) {
$this.follow.list.splice(idx,1); this.getPage();
// $this.follow.list.splice(idx,1);
} }
}) })
},//展示全部 },//展示全部

View File

@@ -254,7 +254,7 @@ export default {
} else { } else {
this.loading = false; this.loading = false;
this.$message({ this.$message({
message: res.message, message: "回答发布失败:"+ res.message,
type: 'error' type: 'error'
}); });
} }

View File

@@ -328,7 +328,7 @@
aid: this.userInfo.aid, // #用户id aid: this.userInfo.aid, // #用户id
statType: 20, // #统计类型 10学习时长 11 学习天数 20表经验值 30表u币 40表获取天数 statType: 20, // #统计类型 10学习时长 11 学习天数 20表经验值 30表u币 40表获取天数
field: this.cycle, // #统计周期 todays-当天,weeks-周,months-月,years-年 total-总计 field: this.cycle, // #统计周期 todays-当天,weeks-周,months-月,years-年 total-总计
num: 4, // #显示的条数 num: 5, // #显示的条数
} }
apiStat.getRanking(data).then(res => { apiStat.getRanking(data).then(res => {
if (res.status == 200) { if (res.status == 200) {