tian jia guan zhu

This commit is contained in:
zmr900709 2020-07-18 19:52:47 +08:00
parent e34c74c303
commit 30b99968db
3 changed files with 42 additions and 11 deletions

View File

@ -286,6 +286,12 @@ export default {
snsfriendList({ }) {
return vm.$u.post('message/snsfriendList', { });
},
// 关注达人
attentionMember({ member_id }) {
return vm.$u.post('member/attentionMember', {
member_id : member_id
});
},
// 公告消息列表
informationInfo({ }) {
return vm.$u.post('message/informationInfo', { });

View File

@ -3,7 +3,8 @@
<image class="head" :src="info.member_avatar"></image>
<text class="name">{{ info.member_nickname }}</text>
<text class="zhuangtai">状态: {{ info.live_status == 1 ? '正在直播' : '未开播' }}</text>
<view class="guanzhu">关注</view>
<view class="guanzhu" @tap="changeType(info.member_id)" v-if="info.is_attention == 1">关注</view>
<view class="guanzhu" @tap="changeType(info.member_id)" v-else>未关注</view>
</view>
</template>
<script>
@ -14,13 +15,26 @@ export default {
},
methods: {
toDetailsPage() {
this.$u.route({
url: '',
params: {
name: 'lisa'
}
//
const toke = uni.getStorageSync('token');
if (toke) {
console.log(toke);
}else{
uni.navigateTo({
url: '/pageA/login/login'
})
}
// this.$u.route({
// url: '',
// params: {
// name: 'lisa'
// }
// })
},
changeType:function(type){
this.$emit("pChangeType",type)
},
},
}
</script>

View File

@ -63,7 +63,7 @@
<view class="tuijianlist">
<!-- <darenItem style="margin-right:23rpx"></darenItem>
<darenItem style="margin-right:23rpx"></darenItem> -->
<darenItem v-for="item in recommendList.slice(0,3)" :key="item.id" :info="item"></darenItem>
<darenItem v-for="item in recommendList.slice(0,3)" :key="item.id" :info="item" v-on:pChangeType="changeType" ></darenItem>
</view>
</view>
<view class="list">
@ -225,6 +225,16 @@
}
})
},
changeType(member_id){
console.log(member_id);
this.$emit("pChangeType")
this.$u.api.attentionMember({
member_id: member_id
}).then((res)=>{
console.log(res)
this.getRecommendList();
})
},
getZhiBoSwiper() {
this.$u.api.getZhiBoSwiper().then(res => {
if (res.errCode == 0) {
@ -260,9 +270,10 @@
})
},
toSearchPage() {
uni.navigateTo({
url: '/pageB/follow/index'
})
// uni.navigateTo({
// url: '/pageB/follow/index'
// })
},
},
}