diff --git a/components/tab-bar/postList.vue b/components/tab-bar/postList.vue index 49d99db..8962e0b 100644 --- a/components/tab-bar/postList.vue +++ b/components/tab-bar/postList.vue @@ -263,23 +263,23 @@ } }, computed: { - isSocialArea() { + useSocialText() { return !!this.socialMode }, brandMainText() { - return this.isSocialArea ? '同城二手' : '校园二手' + return this.useSocialText ? '同城二手' : '校园二手' }, brandSloganText() { - return this.isSocialArea ? '物尽其用 · 让同城更便捷' : '物尽其用 · 让校园更美好' + return this.useSocialText ? '物尽其用 · 让同城更便捷' : '物尽其用 · 让校园更美好' }, defaultUserName() { - return this.isSocialArea ? '同城好友' : '校园同学' + return this.useSocialText ? '同城好友' : '校园同学' }, defaultRegionName() { - return this.isSocialArea ? '本区' : '本校' + return this.useSocialText ? '本区' : '本校' }, fishBadgeText() { - return this.isSocialArea ? '同城二手' : '校园二手' + return this.useSocialText ? '同城二手' : '校园二手' }, categories() { return this.baseCategories.concat(this.categoryList.map(item => item.name)) @@ -715,7 +715,7 @@ }) }, async goPublish(type) { - const verified = await this.ensureVerified(this.isSocialArea ? '发布二手信息' : '发布校园二手信息') + const verified = await this.ensureVerified(this.useSocialText ? '发布二手信息' : '发布校园二手信息') if (!verified) return uni.navigateTo({ url: '/package1/tabbar/fishRelease?type=' + (type || 'sell') @@ -728,7 +728,7 @@ }) }, async goFishSessions() { - const verified = await this.ensureVerified(this.isSocialArea ? '查看二手聊天' : '查看校园二手聊天') + const verified = await this.ensureVerified(this.useSocialText ? '查看二手聊天' : '查看校园二手聊天') if (!verified) return uni.navigateTo({ url: '/package2/IdleTrad/sessionList' diff --git a/components/tab-bar/release.vue b/components/tab-bar/release.vue index d42e8df..3ca1b1e 100644 --- a/components/tab-bar/release.vue +++ b/components/tab-bar/release.vue @@ -292,30 +292,30 @@ } }, computed: { - isSocialArea() { + useSocialText() { return !!this.socialMode }, brandTitle() { - return this.isSocialArea ? '同城热榜' : '校园热榜' + return this.useSocialText ? '同频热榜' : '校园热榜' }, brandSubtitle() { - return this.isSocialArea ? '每天都有新鲜事,同城都在聊' : '每天都有新鲜事,全校都在聊' + return this.useSocialText ? '每天都有新鲜事,同频都在聊' : '每天都有新鲜事,全校都在聊' }, searchPlaceholder() { - return this.isSocialArea ? '搜索同城热议、关键词' : '搜索校园热议、关键词' + return this.useSocialText ? '搜索同频热议、关键词' : '搜索校园热议、关键词' }, circleName() { - return this.isSocialArea ? '同城圈' : '校园圈' + return this.useSocialText ? '同频圈' : '校园圈' }, defaultUserName() { - return this.isSocialArea ? '半径好友' : '半径同学' + return this.useSocialText ? '半径好友' : '半径同学' }, displayChannels() { - if (!this.isSocialArea) return this.channels + if (!this.useSocialText) return this.channels return this.channels.map((item) => { const next = Object.assign({}, item) if (item.tone === 'wall') { - next.name = '同城墙' + next.name = '同频墙' next.desc = '新鲜事' } else if (item.tone === 'daily') { next.desc = '吃饭逛街' @@ -781,13 +781,13 @@ uni.navigateTo({ url: '/package1/post/postDetail?id=' + item.id + '&source=campus' }) }, async goPublish() { - const ok = await this.ensureVerified(this.isSocialArea ? '发布同城圈内容' : '发布校园圈内容') + const ok = await this.ensureVerified(this.useSocialText ? '发布同频圈内容' : '发布校园圈内容') if (!ok) return uni.navigateTo({ url: '/package1/campus/campusRelease?type=' + (this.activeCategory === 'wall' || this.activeCategory === 'mine' ? 'wall' : this.activeCategory) }) }, async goChat(item) { if (!this.canUsePartnerChat(item)) return - const ok = await this.ensureVerified(this.isSocialArea ? '联系同城圈搭子' : '联系校园圈搭子') + const ok = await this.ensureVerified(this.useSocialText ? '联系同频圈搭子' : '联系校园圈搭子') if (!ok) return createCampusChatSession(item.id).then(session => { if (!session || !session.sessionId) return diff --git a/components/tab-bar/tab-bar.vue b/components/tab-bar/tab-bar.vue index d941c8b..0f994a8 100644 --- a/components/tab-bar/tab-bar.vue +++ b/components/tab-bar/tab-bar.vue @@ -95,6 +95,10 @@ type: Boolean, default: false }, + socialTextMode: { + type: Boolean, + default: false + }, socialDeliveryEnabled: { type: Boolean, default: true @@ -102,15 +106,16 @@ }, computed: { displayTabs() { - if (!this.socialMode) return this.tabList - return this.tabList - .filter((item) => this.socialDeliveryEnabled || item.pageIndex !== 1) - .map((item) => { - if (item.pageIndex === 2) { - return Object.assign({}, item, { tabName: '同城圈' }) - } - return item - }) + const tabs = this.socialMode + ? this.tabList.filter((item) => this.socialDeliveryEnabled || item.pageIndex !== 1) + : this.tabList + if (!this.socialTextMode) return tabs + return tabs.map((item) => { + if (item.pageIndex === 2) { + return Object.assign({}, item, { tabName: '同城圈' }) + } + return item + }) } }, watch: {