wangfukang 1 week ago
parent
commit
e7d3a0f376
  1. 1096
      components/tab-bar/homeGroupPending.vue
  2. 16
      components/tab-bar/myCenter.vue
  3. 40
      components/tab-bar/postList.vue
  4. 63
      components/tab-bar/release.vue
  5. 88
      components/tab-bar/tab-bar.vue

1096
components/tab-bar/homeGroupPending.vue

File diff suppressed because it is too large

16
components/tab-bar/myCenter.vue

@ -16,7 +16,7 @@
</view>
<view class="school-row" hover-class="tap-soft" hover-stay-time="80"
@tap.stop="navigatorTo('qiehuan')">{{schoolName1}} </view>
<view class="identity-pill" @tap.stop="navigatorTo('qiehuan')">切换</view>
<view class="identity-pill" @tap.stop="navigatorTo('qiehuan')">切换区</view>
</view>
</view>
<!-- <view class="ticket-card" hover-class="tap-soft" hover-stay-time="80" @tap="navigatorTo('blindBox')">
@ -42,7 +42,7 @@
<view class="legal-btn fade-up" hover-class="tap-soft" hover-stay-time="80"
style="animation-delay: 280ms;" @tap="openOfficialAccountPopup">
<text class="legal-dot"></text>
<text>关注公众号可实时接收ie/校园/二手消息</text>
<text>关注公众号可实时接收ie//二手消息</text>
<text class="legal-arrow"></text>
</view>
@ -155,7 +155,7 @@
<view class="official-account-card" @tap.stop>
<view class="official-account-close" @tap="closeOfficialAccountPopup">×</view>
<view class="official-account-title">关注公众号</view>
<view class="official-account-desc">关注后可实时接收 i/e校园校园二手消息提醒</view>
<view class="official-account-desc">关注后可实时接收 i/e二手消息提醒</view>
<image
show-menu-by-longpress
class="official-account-qr"
@ -221,13 +221,13 @@
<view class="area-popup-glow area-popup-glow-a"></view>
<view class="area-popup-glow area-popup-glow-b"></view>
<view class="campus-area-header">
<view class="campus-area-kicker">选择你的校园半径</view>
<view class="campus-area-title">你现在在哪个</view>
<view class="campus-area-kicker">选择你的区域半径</view>
<view class="campus-area-title">你现在在哪个区</view>
<view class="campus-area-subtitle">选定后会优先展示附近同学正在拼的内容</view>
</view>
<view class="campus-area-search">
<text class="area-search-icon"></text>
<input v-model="areaKeyword" confirm-type="search" placeholder="搜索学校 / 校区 / 区域"
<input v-model="areaKeyword" confirm-type="search" placeholder="搜索区域、学校"
placeholder-class="area-search-placeholder" />
</view>
<scroll-view scroll-y class="campus-area-list">
@ -240,7 +240,7 @@
<view class="area-item-action">进入</view>
</view>
<view class="campus-area-empty" v-if="filteredAreaList.length === 0">
<view class="area-empty-title">没找到这个</view>
<view class="area-empty-title">没找到这个区</view>
<view class="area-empty-desc">换个关键词试试比如学校简称或区域名</view>
</view>
</scroll-view>
@ -387,7 +387,7 @@
action: 'planet'
}, {
type: 'school',
title: '学院奖金',
title: '排位奖金',
subPre: '',
subEm: '有现金奖励哦',
subPost: '',

40
components/tab-bar/postList.vue

@ -3,11 +3,11 @@
<view class="fixed-header" :style="{ paddingTop: statusBarTop + 'px' }">
<view class="brand-row">
<view class="brand">
<text class="brand-main">校园二手</text>
<text class="brand-main">{{brandMainText}}</text>
<text class="brand-sub">鱼塘</text>
<view class="brand-fish"></view>
</view>
<view class="brand-slogan">物尽其用 · 让校园更美好</view>
<view class="brand-slogan">{{brandSloganText}}</view>
</view>
<view class="search-bar">
<uni-icons type="search" size="19" color="#8d9693"></uni-icons>
@ -204,6 +204,12 @@
}
export default {
props: {
socialMode: {
type: Boolean,
default: false
}
},
data() {
return {
menuButtonInfo: {},
@ -257,6 +263,24 @@
}
},
computed: {
isSocialArea() {
return !!this.socialMode
},
brandMainText() {
return this.isSocialArea ? '同城二手' : '校园二手'
},
brandSloganText() {
return this.isSocialArea ? '物尽其用 · 让同城更便捷' : '物尽其用 · 让校园更美好'
},
defaultUserName() {
return this.isSocialArea ? '同城好友' : '校园同学'
},
defaultRegionName() {
return this.isSocialArea ? '本区' : '本校'
},
fishBadgeText() {
return this.isSocialArea ? '同城二手' : '校园二手'
},
categories() {
return this.baseCategories.concat(this.categoryList.map(item => item.name))
},
@ -580,7 +604,7 @@
},
normalizeRecords(records, isWant) {
const area = this.getArea()
const fallbackRegionName = area.title || area.name || uni.getStorageSync('schoolName') || '本校'
const fallbackRegionName = area.title || area.name || uni.getStorageSync('schoolName') || this.defaultRegionName
return (Array.isArray(records) ? records : []).map(item => {
const images = this.parseJsonList(item.images)
const tags = this.parseJsonList(item.tags)
@ -593,9 +617,9 @@
originalPrice: item.originPrice,
xiangyao: item.likeCount || 0,
browseCount: item.browseCount || 0,
distance: item.distance || '本校',
distance: item.distance || this.defaultRegionName,
icon: item.userAvatar || 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/f7227759d693497a8beab87ff437a875.png',
shopName: item.userName || '校园同学',
shopName: item.userName || this.defaultUserName,
regionName: item.regionName || item.schoolName || item.areaName || fallbackRegionName,
tags: tags.length ? tags : (item.negotiable == 1 ? ['可小刀'] : []),
category: item.categoryName || '',
@ -691,7 +715,7 @@
})
},
async goPublish(type) {
const verified = await this.ensureVerified('发布校园二手信息')
const verified = await this.ensureVerified(this.isSocialArea ? '发布二手信息' : '发布校园二手信息')
if (!verified) return
uni.navigateTo({
url: '/package1/tabbar/fishRelease?type=' + (type || 'sell')
@ -704,7 +728,7 @@
})
},
async goFishSessions() {
const verified = await this.ensureVerified('查看校园二手聊天')
const verified = await this.ensureVerified(this.isSocialArea ? '查看二手聊天' : '查看校园二手聊天')
if (!verified) return
uni.navigateTo({
url: '/package2/IdleTrad/sessionList'
@ -723,7 +747,7 @@
profile: profile || {},
actionText,
authDialog: {
badge: '校园二手',
badge: this.fishBadgeText,
title: '实名认证',
content: actionText + '前需完成实名认证。半径里不会存储您的实名信息。',
steps: []

63
components/tab-bar/release.vue

@ -1,15 +1,15 @@
<template>
<template>
<view class="campus-page">
<view class="header" :style="{ paddingTop: statusBarHeight + 'px' }">
<view class="brand-line">
<text class="brand">校园热榜</text>
<text class="brand">{{brandTitle}}</text>
<text class="eating">热议中</text>
</view>
<view class="subtitle">每天都有新鲜事全校都在聊</view>
<view class="subtitle">{{brandSubtitle}}</view>
<view class="search-line">
<view class="search-box">
<uni-icons type="search" size="19" color="#8a9692"></uni-icons>
<input class="search-input" v-model.trim="keyword" placeholder="搜索校园热议、关键词" placeholder-class="placeholder" confirm-type="search" @confirm="search" />
<input class="search-input" v-model.trim="keyword" :placeholder="searchPlaceholder" placeholder-class="placeholder" confirm-type="search" @confirm="search" />
<view class="search-button" @tap="search">搜索</view>
</view>
<view class="release-fab" @tap="goPublish">
@ -36,7 +36,7 @@
<view
class="category-card"
:class="{ active: activeCategory === item.tone }"
v-for="item in channels"
v-for="item in displayChannels"
:key="item.tone"
@tap="selectCategory(item.tone)"
>
@ -107,7 +107,7 @@
<image class="avatar" :src="displayAvatar(item)" mode="aspectFill"></image>
<view class="author-main">
<view class="author">{{displayName(item)}}</view>
<view class="time">{{item.createTime || ''}} · <text class="time-category">{{item.categoryName || '本'}}</text></view>
<view class="time">{{item.createTime || ''}} · <text class="time-category">{{item.categoryName || '本区域'}}</text></view>
</view>
<view class="partner-action" v-if="canUsePartnerChat(item)" @tap.stop="goChat(item)">搭一下</view>
</view>
@ -249,6 +249,12 @@
const releaseIconDownloading = {}
export default {
props: {
socialMode: {
type: Boolean,
default: false
}
},
data() {
return {
statusBarHeight: 24,
@ -285,6 +291,37 @@
}
},
computed: {
isSocialArea() {
return !!this.socialMode
},
brandTitle() {
return this.isSocialArea ? '同城热榜' : '校园热榜'
},
brandSubtitle() {
return this.isSocialArea ? '每天都有新鲜事,同城都在聊' : '每天都有新鲜事,全校都在聊'
},
searchPlaceholder() {
return this.isSocialArea ? '搜索同城热议、关键词' : '搜索校园热议、关键词'
},
circleName() {
return this.isSocialArea ? '同城圈' : '校园圈'
},
defaultUserName() {
return this.isSocialArea ? '半径好友' : '半径同学'
},
displayChannels() {
if (!this.isSocialArea) return this.channels
return this.channels.map((item) => {
const next = Object.assign({}, item)
if (item.tone === 'wall') {
next.name = '同城墙'
next.desc = '新鲜事'
} else if (item.tone === 'daily') {
next.desc = '吃饭逛街'
}
return next
})
},
headerHeight() {
return this.statusBarHeight + (uni.upx2px ? uni.upx2px(204) : 102)
},
@ -305,8 +342,8 @@
},
sectionTitle() {
if (this.activeCategory === 'mine') return '我的圈子'
const item = this.channels.find(row => row.tone === this.activeCategory)
return item ? item.name : '校园圈'
const item = this.displayChannels.find(row => row.tone === this.activeCategory)
return item ? item.name : this.circleName
},
sectionSubTitle() {
if (this.postSortType === 'hot') return '按点赞和评论综合热度排序'
@ -696,7 +733,7 @@
try { return JSON.parse(item.tags) || [] } catch (e) { return [] }
},
displayName(item) {
return item && item.userName ? item.userName : '半径同学'
return item && item.userName ? item.userName : this.defaultUserName
},
isAnonymousItem(item) {
if (!item) return false
@ -709,6 +746,8 @@
|| item.isAnonymous === '1'
|| item.isAnonymous === 'true'
|| item.userName === '半径同学'
|| item.userName === '半径好友'
|| item.userName === this.defaultUserName
},
displayAvatar(item) {
if (this.isAnonymousItem(item)) return this.defaultAvatar
@ -734,13 +773,13 @@
uni.navigateTo({ url: '/package1/post/postDetail?id=' + item.id + '&source=campus' })
},
async goPublish() {
const ok = await this.ensureVerified('发布校园圈内容')
const ok = await this.ensureVerified(this.isSocialArea ? '发布同城圈内容' : '发布校园圈内容')
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('联系校园圈搭子')
const ok = await this.ensureVerified(this.isSocialArea ? '联系同城圈搭子' : '联系校园圈搭子')
if (!ok) return
createCampusChatSession(item.id).then(session => {
if (!session || !session.sessionId) return
@ -797,7 +836,7 @@
return ensureIeVerifiedBeforeAction({
profile: profile || {},
actionText,
authDialog: { badge: '校园圈', title: '实名认证', desc: actionText + '前需完成实名认证' },
authDialog: { badge: this.circleName, title: '实名认证', desc: actionText + '前需完成实名认证' },
reload: getIeProfile,
requireProfileSetup: false
})

88
components/tab-bar/tab-bar.vue

@ -1,25 +1,25 @@
<template>
<view class="tabbar-box">
<view class="bar-box" @click="clickBar(index)" v-for="(item,index) in tabList" :key="index" hover-class="none">
<view class="red-dot" v-if="index == 0 && indexZhipaiCount > 0">
<view class="bar-box" @click="clickBar(index)" v-for="(item,index) in displayTabs" :key="item.pageIndex" hover-class="none">
<view class="red-dot" v-if="item.pageIndex == 0 && indexZhipaiCount > 0">
{{formatBadgeCount(indexZhipaiCount)}}
</view>
<view class="red-dot" v-if="index == 1 && indexWorkerCount > 0">
<view class="red-dot" v-if="item.pageIndex == 1 && indexWorkerCount > 0">
{{formatBadgeCount(indexWorkerCount)}}
</view>
<view class="red-dot" v-if="index == 2 && indexCampusCount > 0">
<view class="red-dot" v-if="item.pageIndex == 2 && indexCampusCount > 0">
{{formatBadgeCount(indexCampusCount)}}
</view>
<view class="red-dot" v-if="index == 3 && indexFishCount > 0">
<view class="red-dot" v-if="item.pageIndex == 3 && indexFishCount > 0">
{{formatBadgeCount(indexFishCount)}}
</view>
<view class="red-dot" v-if="index == 4 && indexMyCount > 0">
<view class="red-dot" v-if="item.pageIndex == 4 && indexMyCount > 0">
{{formatBadgeCount(indexMyCount)}}
</view>
<view class="img-box" v-if="index != 2" :class="item.shaking?'shaking':''">
<view class="img-box" v-if="item.pageIndex != 2" :class="item.shaking?'shaking':''">
<img :src="item.isCheck?item.tabIconSelect:item.tabIcon" alt="" />
</view>
<view class="img-box uni-tab-icon" v-if="index == 2" :class="item.shaking?'shaking':''">
<view class="img-box uni-tab-icon" v-if="item.pageIndex == 2" :class="item.shaking?'shaking':''">
<uni-icons type="pyq" size="25" :color="item.isCheck?'#48D1CC':'#30363d'"></uni-icons>
</view>
<view class="text-box" :style="{color:item.isCheck?'#48D1CC':'#000'}">
@ -35,30 +35,36 @@
return {
tabList: [{
tabName: '首页',
pageIndex: 0,
tabIcon: '/static/images/tabbar/shouye1.png',
tabIconSelect: '/static/images/tabbar/shouye.png',
isCheck: true,
shaking:false
}, {
tabName: '配送',
pageIndex: 1,
hideInSocial: true,
tabIcon: '/static/images/tabbar/peisong1.png',
tabIconSelect: '/static/images/tabbar/peisong.png',
isCheck: false,
shaking:false
}, {
tabName: '校园圈',
pageIndex: 2,
tabIcon: '/static/images/tabbar/xiaoyuan.png',
tabIconSelect: '',
isCheck: false,
shaking:false
}, {
tabName: '鱼塘',
pageIndex: 3,
tabIcon: '/static/images/tabbar/xianyu1.png',
tabIconSelect: '/static/images/tabbar/xianyu.png',
isCheck: false,
shaking:false
}, {
tabName: '我的',
pageIndex: 4,
tabIcon: '/static/images/tabbar/wode1.png',
tabIconSelect: '/static/images/tabbar/wode.png',
isCheck: false,
@ -81,22 +87,36 @@
type: Number,
default: true
},
//tab
//tab
currentIndex: {
type: Number,
default: 0
},
socialMode: {
type: Boolean,
default: false
}
},
computed: {
displayTabs() {
if (!this.socialMode) return this.tabList
return this.tabList
.filter((item) => !item.hideInSocial)
.map((item) => {
if (item.pageIndex === 2) {
return Object.assign({}, item, { tabName: '同城圈' })
}
return item
})
}
},
watch: {
//currentIndex
currentIndex(newVal) {
for (let i = 0; i < this.tabList.length; i++) {
if (newVal == i) {
this.tabList[i].isCheck = true
} else {
this.tabList[i].isCheck = false
}
}
this.syncTabCheck(newVal)
},
socialMode() {
this.syncTabCheck(this.currentIndex)
}
},
mounted() {
@ -104,6 +124,7 @@
uni.$on('fishUnreadChange', this.setFishUnreadCounts)
uni.$on('campusUnreadChange', this.setCampusUnreadCounts)
this.setDeliveryStatusCounts(uni.getStorageSync('deliveryStatusCounts') || {})
this.syncTabCheck(this.currentIndex)
},
beforeDestroy() {
uni.$off('deliveryStatusCountsChange', this.setDeliveryStatusCounts)
@ -111,6 +132,11 @@
uni.$off('campusUnreadChange', this.setCampusUnreadCounts)
},
methods: {
syncTabCheck(pageIndex) {
for (let i = 0; i < this.tabList.length; i++) {
this.tabList[i].isCheck = this.tabList[i].pageIndex == pageIndex
}
},
hasLogin() {
const token = uni.getStorageSync('hiver_token')
return !!(token && typeof token === 'string' && token.trim() && token !== 'null' && token !== 'undefined')
@ -149,25 +175,19 @@
}
this.getWorkerCounts()
},
//tab
//tab
clickBar(index) {
for (let i = 0; i < this.tabList.length; i++) {
if (index == i) {
this.$emit('tab-index', i);
this.getWorkerCounts()
this.tabList[i].isCheck = true
if (this.tabList[i].shaking) return
this.tabList[i].shaking = true
setTimeout(() => {
this.tabList[i].shaking = false
}, 500)
} else {
this.tabList[i].isCheck = false
this.$forceUpdate()
}
}
const item = this.displayTabs[index]
if (!item) return
const pageIndex = item.pageIndex
this.$emit('tab-index', pageIndex);
this.getWorkerCounts()
this.syncTabCheck(pageIndex)
if (item.shaking) return
item.shaking = true
setTimeout(() => {
item.shaking = false
}, 500)
},
getWorkerCounts(){
const now = Date.now()

Loading…
Cancel
Save