| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <template>
- <view class="explore ">
- <!-- 搜索 -->
- <view>
- <router-link
- :to="{path: '/bundle_b/pages/community_search/community_search'}">
- <u-search disabled
- bgColor="#fff" :hideRight="true"
- borderColor="#F73E33" placeholder="请输入搜索内容" height="64" focus
- ></u-search>
- </router-link>
- </view>
- <view class="content">
- <tabs :current="current" @change="changeTabs" height="100" >
- <tab v-for="(item, index) in tabList" :key="index" :name="item.name">
- <lists :cateId="item.id" :i="index" :index="current"></lists>
-
- </tab>
- </tabs>
- </view>
- </view>
- </template>
- <script>
- import {
- getCommunityCate,
- getCommunityArticleLists
- } from '@/api/community.js';
- import Lists from "./lists.vue"
- export default {
- components: {
- Lists
- },
- data() {
- return {
- tabList: [{
- name: '全部',
- id: ''
- }],
- current: 0
- }
- },
- created() {
- this.initRecommendTopic()
- },
- methods: {
- initMescroll(event) {
- this.isInit = true; // 标记为true
- this.mescroll = event;
- },
- handleCancel() {
- this.keyword = '';
- },
- // 切换标签导航
- changeTabs(event) {
- this.current = event;
- },
- // 初始化获取话题
- initRecommendTopic() {
- getCommunityCate().then(res => {
- if( res.code === 1 ) {
- this.tabList = [{
- name: '全部',
- id: ''
- }, ...res.data]
- } else {
- this.$toast({ title: res.msg })
- }
- })
- },
-
- }
- }
- </script>
- <style lang="scss" scoped>
- .explore {
- border-radius: 20rpx;
- overflow: hidden;
- // pb
- .content {
- height: calc(100vh - 92px - var(--window-bottom));
- overflow: hidden;
- }
- }
- </style>
|