diff --git a/pages/index/index.vue b/pages/index/index.vue index d4044e7..7613be0 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -455,20 +455,20 @@ - + @@ -482,7 +482,7 @@ - 检测到您当前在「{{ suggestedArea.title }}」区域,是否选中该区域?或可下方选择其他区域。 + 检测到您当前在「{{ suggestedArea.title }}」区域,是否选中该区域?也可点击更多区域手动选择。 选中该区域 @@ -510,6 +510,10 @@ 没找到这个区域 换个关键词试试,比如学校简称或区域名 + + 查看更多区域 + › + @@ -574,7 +578,7 @@ import myCenter from "@/components/tab-bar/myCenter.vue"; import homeGroupPending from "@/components/tab-bar/homeGroupPending.vue"; import { getIeRealNameAuditSetting } from '@/common/ieApi.js' - import { resolveHomeShareTarget, normalizeShareTargetPath, resolveMiniCodeSceneTarget, isShareTargetHandled, completeShareEnter, reopenShareEnter, consumeShareRedirectSuppression } from '@/utils/sharePath.js' + import { resolveHomeShareTarget, normalizeShareTargetPath, resolveMiniCodeSceneTarget, isShareTargetHandled, completeShareEnter, reopenShareEnter, consumeShareRedirectSuppression, rememberInviteParams, buildInviteHomeSharePath } from '@/utils/sharePath.js' const HOME_AD_IMAGE_CACHE_KEY = 'home_ad_image_cache_v1' const HOME_POPUP_AD_SHOWN_KEY_PREFIX = 'home_popup_ad_shown_v1' @@ -755,6 +759,7 @@ dataList: [], areaList: [], areaKeyword: '', + areaShowAll: false, areaPopupCanClose: false, areaPopupVisible: false, suggestedArea: null, @@ -871,12 +876,22 @@ }, filteredAreaList() { const keyword = this.areaKeyword.trim().toLowerCase() - if (!keyword) return this.areaList - return this.areaList.filter((item) => { + const list = this.areaList || [] + if (!keyword && this.suggestedArea && this.suggestedArea.id && !this.areaShowAll) { + const hit = list.find((item) => item && item.id == this.suggestedArea.id) + return hit ? [hit] : [this.suggestedArea] + } + if (!keyword) return list + return list.filter((item) => { const title = item.title ? String(item.title).toLowerCase() : '' return title.indexOf(keyword) > -1 }) }, + showMoreAreaButton() { + if (this.areaKeyword.trim()) return false + if (!this.suggestedArea || !this.suggestedArea.id || this.areaShowAll) return false + return (this.areaList || []).some((item) => item && item.id != this.suggestedArea.id) + }, homeCenterAds() { return (this.mallAds || []) .filter(item => item && item.position != 'home_top' && item.position != 'home_popup') @@ -982,6 +997,7 @@ if (option && option.deliveryRuleEdited == 1) { this.pendingDeliveryRuleConfirm = true } + rememberInviteParams(option) const shareTargetPath = resolveMiniCodeSceneTarget(option && option.scene) || resolveHomeShareTarget(option) if (shareTargetPath) { reopenShareEnter(shareTargetPath) @@ -1052,6 +1068,9 @@ const detail = e && e.detail ? e.detail : e this.areaPopupVisible = !!(detail && detail.show) }, + showAllAreas() { + this.areaShowAll = true + }, enableShareMenu() { if (!uni.showShareMenu) return uni.showShareMenu({ @@ -1061,7 +1080,7 @@ }, buildHomeShareInfo() { const tabIndex = Number(this.currentIndex) || 0 - const path = tabIndex > 0 ? '/pages/index/index?tabIndex=' + tabIndex : '/pages/index/index' + const path = tabIndex > 0 ? buildInviteHomeSharePath({ tabIndex }) : buildInviteHomeSharePath() const tabTitleMap = { 1: '兼职配送,顺路赚点零花钱', 2: '新鲜事和搭子都在这里', @@ -1079,6 +1098,11 @@ toggleCampusWiki() { this.campusWikiCollapsed = !this.campusWikiCollapsed }, + goInviteReward() { + uni.navigateTo({ + url: '/package2/invite/reward' + }) + }, refreshTabCounts() { if (this.$refs.tabBar && this.$refs.tabBar.getWorkerCounts) { return this.$refs.tabBar.getWorkerCounts() @@ -2085,6 +2109,7 @@ this.areaName = uni.getStorageSync('schoolName') || item.title || '沧州师范学院' this.syncAreaKind(item) this.areaKeyword = '' + this.areaShowAll = false this.suggestedArea = null this.searchForm.regionId = item.id this.resetDeliveryQuery() @@ -2249,10 +2274,12 @@ }, checkArea(suggestedArea) { this.suggestedArea = suggestedArea && suggestedArea.id ? suggestedArea : null + this.areaShowAll = false this.tui.request("/app/shopArea/getByParentId/0", "get", {}, false, false).then((res) => { if (res.code == 200) { this.areaList = res.result || [] this.areaKeyword = '' + this.areaShowAll = false this.areaPopupCanClose = !!uni.getStorageSync('area') // 若推荐项不在列表中,仍保留提示,列表以接口为准 if (this.suggestedArea && this.suggestedArea.id) { @@ -2578,6 +2605,20 @@ overflow: hidden; } + .campus-wiki-card::after { + content: ''; + position: absolute; + left: 50%; + top: 30rpx; + width: 92rpx; + height: 92rpx; + border-radius: 28rpx; + border: 2rpx solid rgba(66, 215, 185, 0.42); + transform: translateX(-50%); + animation: campusWikiPulse 2.4s ease-out infinite; + pointer-events: none; + } + .campus-wiki-card:active { transform: scale(0.98); } @@ -2616,6 +2657,37 @@ box-shadow: 0 10rpx 24rpx rgba(20, 146, 119, 0.16); position: relative; z-index: 1; + transform-origin: 50% 70%; + animation: campusWikiFloat 2.4s ease-in-out infinite; + } + + @keyframes campusWikiFloat { + 0%, 100% { + transform: translate3d(0, 0, 0) rotate(0deg) scale(1); + box-shadow: 0 10rpx 24rpx rgba(20, 146, 119, 0.16); + } + 32% { + transform: translate3d(0, -8rpx, 0) rotate(-4deg) scale(1.06); + box-shadow: 0 18rpx 34rpx rgba(20, 146, 119, 0.24); + } + 58% { + transform: translate3d(0, 2rpx, 0) rotate(3deg) scale(1.02); + } + } + + @keyframes campusWikiPulse { + 0% { + opacity: 0.58; + transform: translateX(-50%) scale(0.86); + } + 70% { + opacity: 0; + transform: translateX(-50%) scale(1.34); + } + 100% { + opacity: 0; + transform: translateX(-50%) scale(1.34); + } } .campus-wiki-copy { @@ -4831,6 +4903,33 @@ line-height: 50rpx; } + .campus-area-more { + display: flex; + align-items: center; + justify-content: center; + gap: 10rpx; + height: 82rpx; + margin: 8rpx 0 18rpx; + border-radius: 999rpx; + background: linear-gradient(90deg, rgba(18, 59, 49, 0.94), rgba(42, 191, 139, 0.94)); + color: #ffffff; + font-size: 26rpx; + font-weight: 900; + text-align: center; + box-shadow: 0 16rpx 34rpx rgba(42, 191, 139, 0.22); + } + + .campus-area-more:active { + transform: scale(0.985); + opacity: 0.9; + } + + .campus-area-more-arrow { + font-size: 38rpx; + line-height: 1; + transform: translateY(-1rpx); + } + .campus-area-empty { padding: 70rpx 0 56rpx; text-align: center;