From 569a5004e76831ec4f95a416925033944e696bbf Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Tue, 11 Aug 2026 15:07:11 +0800 Subject: [PATCH] 1 --- pages/index/index.vue | 135 +++++++++++++++++++++++++++++++++++------- 1 file changed, 115 insertions(+), 20 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index d18653c..aa63f17 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -137,9 +137,9 @@ - 省钱榜 Top1 - 爆款指数 ↑ - 拼团王在线 + + {{areaName || '选择校区'}} + @@ -465,7 +465,7 @@ - + @@ -707,6 +707,7 @@ dataList: [], areaList: [], areaKeyword: '', + areaPopupCanClose: false, orderLists: [], waimaiCount: 0, kuaidiCount: 0, @@ -735,6 +736,10 @@ }, checked: 'waimai', navBarHeight: 0, + menuButtonInfo: { + top: 44, + height: 32 + }, menuListOffsetTop: 0, stickyTrigger: 583, lastScrollTop: 0, @@ -868,6 +873,7 @@ }, onLoad(option) { this.startDeliveryTimeTimer() + this.enableShareMenu() if (option && option.tabIndex !== undefined) { const tabIndex = Number(option.tabIndex) if (!isNaN(tabIndex) && tabIndex > 0) { @@ -884,6 +890,7 @@ } }, onShow() { + this.enableShareMenu() this.startDeliveryTimeTimer() this.runHomeInit() if (this.openShareTargetIfNeeded()) return @@ -931,7 +938,31 @@ this.closeProductPopup() this.stopDeliveryTimeTimer() }, + onShareAppMessage() { + return this.buildHomeShareInfo() + }, methods: { + enableShareMenu() { + if (!uni.showShareMenu) return + uni.showShareMenu({ + withShareTicket: true, + menus: ['shareAppMessage'] + }) + }, + buildHomeShareInfo() { + const tabIndex = Number(this.currentIndex) || 0 + const path = tabIndex > 0 ? '/pages/index/index?tabIndex=' + tabIndex : '/pages/index/index' + const tabTitleMap = { + 1: '校园兼职配送,顺路赚点零花钱', + 2: '校园新鲜事和搭子都在这里', + 3: '同校二手好物,来鱼塘逛逛', + 4: '半径里个人中心' + } + return { + title: tabTitleMap[tabIndex] || '半径里,校园生活更省心', + path + } + }, setTabBarVisible(visible) { this.isTabBarVisible = visible }, @@ -1122,6 +1153,18 @@ // 计算导航栏高度用于sticky offset:statusBarHeight + 40px内容区 const info = uni.getSystemInfoSync(); this.navBarHeight = info.statusBarHeight; + if (uni.getMenuButtonBoundingClientRect) { + const menuButtonInfo = uni.getMenuButtonBoundingClientRect() + this.menuButtonInfo = { + top: menuButtonInfo.top || this.navBarHeight + 8, + height: menuButtonInfo.height || 32 + } + } else { + this.menuButtonInfo = { + top: this.navBarHeight + 8, + height: 32 + } + } this.swipeOrderBaseWidth = info.windowWidth * 0.86; this.swipeOrderThumbWidth = uni.upx2px ? uni.upx2px(82) : 41; const iosVersionMatch = info.platform === 'ios' && info.system ? String(info.system).match(/\d+/) : null; @@ -1777,7 +1820,7 @@ //选择区域 onClickArea(item) { uni.setStorageSync('area', JSON.stringify(item)) - this.areaName = item.title + this.areaName = uni.getStorageSync('schoolName') || item.title || '沧州师范学院' this.areaKeyword = '' this.searchForm.regionId = item.id this.resetDeliveryQuery() @@ -1787,7 +1830,7 @@ if(uni.getStorageSync('hiver_token')){ that.tui.request("/worker/admin/add", "POST", { userId: uni.getStorageSync('id'), - isChangeArea: 0, + isChangeArea: 1, region: item.id }, false, true).then((res) => { if (res.code == 200) { @@ -1803,6 +1846,10 @@ } this.$refs.areaPopup.close() + this.tui.toast('切换成功') + if (this.$refs.myCenterPage && this.$refs.myCenterPage.init) { + this.$refs.myCenterPage.init() + } this.pendingShareTargetPath = uni.getStorageSync('pendingShareTargetPath') || this.pendingShareTargetPath setTimeout(() => { this.openShareTargetIfNeeded() @@ -1813,6 +1860,7 @@ if (res.code == 200) { this.areaList = res.result this.areaKeyword = '' + this.areaPopupCanClose = !!uni.getStorageSync('area') this.$refs.areaPopup.open(); } else { this.tui.toast(res.message) @@ -2112,6 +2160,45 @@ radial-gradient(circle at 8% 12%, rgba(166, 255, 234, 0.18) 0, rgba(166, 255, 234, 0) 170rpx); } + .campus-switch { + position: absolute; + left: 14rpx; + z-index: 6; + height: 56rpx; + margin-bottom: 4rpx; + padding: 0 22rpx; + box-sizing: border-box; + display: inline-flex; + align-items: center; + border-radius: 999rpx; + background: rgba(255, 255, 255, 0.76); + border: 1px solid rgba(255, 255, 255, 0.88); + box-shadow: 0 8rpx 22rpx rgba(18, 52, 46, 0.09); + backdrop-filter: saturate(160%) blur(14rpx); + } + + .campus-switch-icon { + margin-right: 10rpx; + color: #05745f; + font-size: 27rpx; + font-weight: 900; + line-height: 1; + text-align: center; + } + + .campus-switch-name { + position: relative; + z-index: 1; + max-width: 320rpx; + color: #004638; + font-size: 30rpx; + font-weight: 900; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + text-shadow: 0 0 10rpx rgba(31, 214, 151, 0.26); + } + .hero-live-strip { display: flex; align-items: center; @@ -3153,27 +3240,35 @@ position: absolute; left: 20rpx; right: 240rpx; - top: 26rpx; - height: 36rpx; + top: 16rpx; + height: 56rpx; display: flex; align-items: center; overflow: hidden; z-index: 4; - pointer-events: none; + pointer-events: auto; } - .brand-memory-strip text { - flex-shrink: 0; - height: 32rpx; - margin-right: 10rpx; - padding: 0 12rpx; + .campus-switch--strip { + position: relative; + left: auto; + height: 56rpx; + width: auto; + max-width: 100%; + min-width: 0; + flex: 0 1 auto; + } + + .campus-switch--strip::after { + content: ''; + position: absolute; + left: 18rpx; + right: 18rpx; + bottom: 10rpx; + height: 10rpx; border-radius: 999rpx; - background: rgba(255, 255, 255, 0.8); - color: #0f695b; - font-size: 18rpx; - font-weight: 900; - line-height: 32rpx; - box-shadow: 0 6rpx 14rpx rgba(0, 35, 28, 0.06); + background: linear-gradient(90deg, rgba(44, 232, 158, 0), rgba(44, 232, 158, 0.46), rgba(44, 232, 158, 0)); + box-shadow: 0 0 16rpx rgba(44, 232, 158, 0.36); } .group-flat-row {