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:
@@ -110,18 +110,18 @@
|
||||
onReachBottom() {
|
||||
if(this.tab == 1 && this.followMe.list.length<this.followMe.count) {//关注我的
|
||||
this.followMe.pageIndex ++;
|
||||
this.getMyPage();
|
||||
this.getMyPage(false);
|
||||
} else if(this.tab == 2 && this.follow.list.length<this.follow.count){//我关注的
|
||||
this.follow.pageIndex ++;
|
||||
this.getPage();
|
||||
this.getPage(false);
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.tab = options.type;
|
||||
this.$store.dispatch('GetUserInfo').then(rs => {
|
||||
this.userInfo = rs;
|
||||
this.getMyPage();
|
||||
this.getPage();
|
||||
this.getMyPage(true);
|
||||
this.getPage(true);
|
||||
});
|
||||
|
||||
},
|
||||
@@ -147,7 +147,9 @@
|
||||
this.show = false;
|
||||
if(this.cancelIdx == 1) {
|
||||
$this.followMe.list[this.cancelIndex].has = false;
|
||||
this.getPage(true);
|
||||
} else {
|
||||
this.getMyPage(true)
|
||||
$this.follow.list.splice(this.cancelIndex,1);
|
||||
}
|
||||
uni.showToast({
|
||||
@@ -158,24 +160,24 @@
|
||||
})
|
||||
},
|
||||
toFollow(item,index) {
|
||||
console.log(item,'item')
|
||||
let $this=this;
|
||||
apiFollow.save(item.userFollow.aid).then(res=>{
|
||||
if(res.status == 200) {
|
||||
$this.followMe.list[index].has = true;
|
||||
// 手动把关注成功的数据push进我关注的列表
|
||||
let data = {
|
||||
has:true,
|
||||
userFollow:{
|
||||
aid:res.result.aid,
|
||||
followId:res.result.followId,
|
||||
followTime:res.result.followTime,
|
||||
id:res.result.id,
|
||||
authorInfo:item.userFollow.authorInfo,
|
||||
}
|
||||
this.getPage(true);
|
||||
// let data = {
|
||||
// has:true,
|
||||
// userFollow:{
|
||||
// aid:res.result.aid,
|
||||
// followId:res.result.followId,
|
||||
// followTime:res.result.followTime,
|
||||
// id:res.result.id,
|
||||
// authorInfo:item.userFollow.authorInfo,
|
||||
// }
|
||||
|
||||
}
|
||||
$this.follow.list.push(data);
|
||||
// }
|
||||
// // $this.follow.list.push(data);
|
||||
} else {
|
||||
// this.$message.error(res.message);
|
||||
}
|
||||
@@ -184,7 +186,11 @@
|
||||
ubtab(num){
|
||||
this.tab = num;
|
||||
},
|
||||
getMyPage() {//关注我的,关注他的
|
||||
getMyPage(flag) {//关注我的,关注他的
|
||||
if(flag) {
|
||||
this.followMe.pageIndex =1;
|
||||
this.followMe.list = [];
|
||||
}
|
||||
this.followMe.aid = this.userInfo.aid;
|
||||
let $this=this;
|
||||
uni.showLoading({title:'加载中...'});
|
||||
@@ -202,7 +208,11 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
getPage() { //我关注的,他关注的
|
||||
getPage(falg) { //我关注的,他关注的
|
||||
if(falg) {
|
||||
this.follow.pageIndex = 1;
|
||||
this.follow.list = [];
|
||||
}
|
||||
this.follow.aid = this.userInfo.aid;
|
||||
let $this=this;
|
||||
uni.showLoading({title:'加载中...'});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view>
|
||||
<page-title :showBack="true">我的分享</page-title>
|
||||
<page-title :showBack="true">我分享的</page-title>
|
||||
<view v-for="(item,index) in dataList.list" :key="index">
|
||||
<view v-if="item.type == 1">
|
||||
<view class="course_box">
|
||||
@@ -42,7 +42,7 @@
|
||||
<text style="font-size: 24upx;color: #999;margin-right: 35upx;">分享给{{item.toAname}}</text>
|
||||
</view>
|
||||
<view class="rowbtn-right">
|
||||
<view class="withdraw" v-if="item.isRead" @click.stop="withdraw(item)">
|
||||
<view class="withdraw" v-if="!item.isRead" @click.stop="withdraw(item)">
|
||||
<image src="../../static/images/icon/withdrawnew.png" mode=""></image>撤回
|
||||
</view>
|
||||
<view v-if="item.isRead" class="Viewed">
|
||||
@@ -298,7 +298,7 @@ export default {
|
||||
},
|
||||
toArticleDetail(item) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/resource/articeDetail?id=' + item.objId
|
||||
url: '/pages/resource/articeDetail?id=' + item.id
|
||||
});
|
||||
},
|
||||
toQaDetail(item) {
|
||||
|
||||
Reference in New Issue
Block a user