You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
104 lines
3.1 KiB
104 lines
3.1 KiB
<template>
|
|
<view class="community">
|
|
<template v-if="appConfig.is_open_community">
|
|
<like-header @change="handleNav" :current="currentNav" />
|
|
<view class="container">
|
|
<follow :active="currentNav" v-show="currentNav===0" @share="handleShare"></follow>
|
|
<!-- 找服务 -->
|
|
<explore :active="currentNav" v-show="currentNav===1"></explore>
|
|
<!-- 找需求 -->
|
|
<xuqiu :active="currentNav" v-show="currentNav===2"></xuqiu>
|
|
<!-- 检测机构 -->
|
|
<organ :active="currentNav" v-show="currentNav===3"></organ>
|
|
<!-- 专家服务 -->
|
|
<team :active="currentNav" v-show="currentNav===4"></team>
|
|
</view>
|
|
</template>
|
|
<template v-else>
|
|
<view class="community-empty flex-col col-center row-center">
|
|
<image class="img-null" src="/static/images/follow_null.png"></image>
|
|
<view class="muted mt20">当前页面暂无内容~</view>
|
|
</view>
|
|
</template>
|
|
<tabbar></tabbar>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import LikeHeader from "../../components/components/like-header.vue"
|
|
import Explore from "../../components/components/explore.vue"
|
|
import Xuqiu from "../../components/components/xuqiu.vue"
|
|
import Organ from "../../components/components/organ.vue"
|
|
import Follow from "../../components/components/follow.vue"
|
|
import Team from "../../components/components/team.vue"
|
|
export default {
|
|
components: {
|
|
LikeHeader,
|
|
Explore,
|
|
Follow,
|
|
Xuqiu,
|
|
Organ,
|
|
Team
|
|
},
|
|
data() {
|
|
return {
|
|
currentNav: 1,
|
|
communityShareItem: {}
|
|
}
|
|
},
|
|
onUnload() {
|
|
uni.$off("changeItem")
|
|
uni.$off("hasNew")
|
|
},
|
|
onShareAppMessage() {
|
|
const promise = new Promise(resolve => {
|
|
setTimeout(() => {
|
|
resolve({
|
|
title: `${this.communityShareItem.user.nickname},TA的内容超级棒`,
|
|
path: '/bundle_b/pages/community_user/community_user?id=' + this
|
|
.communityShareItem.id,
|
|
imageUrl: this.communityShareItem.image
|
|
})
|
|
}, 10)
|
|
})
|
|
return {
|
|
title: '自定义转发标题',
|
|
path: '/page/user/user',
|
|
promise
|
|
}
|
|
},
|
|
methods: {
|
|
handleNav(event) {
|
|
this.currentNav = Number(event)
|
|
console.log(this.currentNav,333)
|
|
},
|
|
// 关注页的分享信息
|
|
handleShare(event) {
|
|
this.communityShareItem = event
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
page {
|
|
padding: 0;
|
|
}
|
|
|
|
.community {
|
|
display: flex;
|
|
height: calc(100vh - var(--window-bottom));
|
|
overflow: hidden;
|
|
flex-direction: column;
|
|
|
|
&-empty {
|
|
height: calc(100vh - var(--window-bottom));
|
|
}
|
|
|
|
.container {
|
|
flex: 1;
|
|
min-height: 0;
|
|
overflow: scroll;
|
|
}
|
|
}
|
|
</style>
|
|
|