gdpaoup
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="daren-item" @click="toDetailsPage">
|
||||
<image class="head" :src="info.member_avatar"></image>
|
||||
<view class="daren-item">
|
||||
<image class="head" @click="toDetailsPage" :src="info.member_avatar"></image>
|
||||
<text class="name">{{ info.member_nickname }}</text>
|
||||
<text class="zhuangtai">状态: {{ info.live_status == 1 ? '正在直播' : '未开播' }}</text>
|
||||
<view class="guanzhu action" @tap="changeType(info.member_id)" v-if="info.is_attention == 1">已关注</view>
|
||||
@@ -8,17 +8,31 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { mapState } from 'vuex';
|
||||
export default {
|
||||
name:"daren-item",
|
||||
props: {
|
||||
info: Object,
|
||||
},
|
||||
computed: {
|
||||
...mapState(["login","hasLogin"]),
|
||||
},
|
||||
watch: {
|
||||
info(newVal, old) {
|
||||
// console.log(newVal);
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
methods: {
|
||||
toDetailsPage() {
|
||||
// 判断是否登录
|
||||
const toke = uni.getStorageSync('token');
|
||||
if (toke) {
|
||||
console.log(toke);
|
||||
// console.log();
|
||||
if (this.hasLogin) {
|
||||
this.$u.route({
|
||||
url: "/pageB/details/index",
|
||||
params: {
|
||||
id: this.info.member_id
|
||||
}
|
||||
});
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url: '/pageA/login/login'
|
||||
@@ -32,8 +46,8 @@ export default {
|
||||
// })
|
||||
},
|
||||
changeType:function(type){
|
||||
console.log("111")
|
||||
this.$emit("pChangeType",type)
|
||||
// console.log("111")
|
||||
this.$emit("pChangeType",type);
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user