|
|
|
@ -3,7 +3,7 @@ |
|
|
|
<view class="swiper-container"> |
|
|
|
<view class="swiper-page" v-show="currentIndex == 0"> |
|
|
|
<view style="position: relative;height: 545rpx;"> |
|
|
|
<view class="daimai-sticky-cover" :style="{'height': (navBarHeight + 220) + 'px'}" |
|
|
|
<view class="daimai-sticky-cover" :style="{'height': stickyCoverHeight + 'px'}" |
|
|
|
v-if="lastScrollTop>stickyTrigger"></view> |
|
|
|
<view class="campus-hero campus-hero--ad"> |
|
|
|
<swiper class="swiper hero-bg-swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" |
|
|
|
@ -25,7 +25,7 @@ |
|
|
|
<swiper class="swiper" vertical circular :autoplay="orderLists.length <= 0" v-if="orderLists.length <= 0" |
|
|
|
:interval="onlineWorkerInterval" :duration="onlineWorkerDuration" |
|
|
|
style="height: 150rpx;margin-top: -100rpx;"> |
|
|
|
<swiper-item v-for="(item,index) in gaoxiaoList" :key="index"> |
|
|
|
<swiper-item v-for="(item,index) in displayGaoxiaoList" :key="index"> |
|
|
|
<view class="order-msg-box life-status-row"> |
|
|
|
<view class="life-ip order-msg-left"> |
|
|
|
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/f7227759d693497a8beab87ff437a875.png" alt="" /> |
|
|
|
@ -37,7 +37,7 @@ |
|
|
|
<view class="life-progress"> |
|
|
|
<view class="life-progress-bar" style="width: 56%;"></view> |
|
|
|
</view> |
|
|
|
<view class="life-status-desc">{{item.content}} · 附近宿舍在拼</view> |
|
|
|
<view class="life-status-desc">{{item.content}} · {{gaoxiaoSuffix}}</view> |
|
|
|
</view> |
|
|
|
<view class="life-action order-msg-right" @tap.stop="goDetail('2')"> |
|
|
|
去拼 |
|
|
|
@ -62,7 +62,7 @@ |
|
|
|
<text v-if="item.status == 3 && item.deliveryType == 1">外卖配送 · 骑手已接单</text> |
|
|
|
<text v-if="item.status == 3 && item.deliveryType == 2">到店消费 · 等你核销</text> |
|
|
|
<text v-if="item.status == 4 && item.deliveryType == 1">外卖配送 · 已取货</text> |
|
|
|
<text v-if="item.status == 5">校园任务完成啦</text> |
|
|
|
<text v-if="item.status == 5">订单任务完成啦</text> |
|
|
|
<text v-if="item.status == 7">退款状态 · 等商家确认</text> |
|
|
|
<text v-if="item.status == 6">订单已取消</text> |
|
|
|
<text v-if="item.status == 8">订单已退款</text> |
|
|
|
@ -97,7 +97,7 @@ |
|
|
|
<!-- <img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/1a02b40d853a4cfdb062fff44ec49e6a.png" |
|
|
|
alt="" style="position: absolute;top: -10rpx;right: 0;width: 78rpx;height: 32rpx;"> --> |
|
|
|
<view class="menu-name">饭团星球</view> |
|
|
|
<view class="menu-desc">食堂搭子</view> |
|
|
|
<view class="menu-desc">{{isSocialArea ? '美食搭子' : '食堂搭子'}}</view> |
|
|
|
</view> |
|
|
|
<view class="menu-list world-store" @tap="goDetail('3')"> |
|
|
|
<view class="world-light"></view> |
|
|
|
@ -138,10 +138,11 @@ |
|
|
|
<view class="like-content-box"> |
|
|
|
<view class="brand-memory-strip"> |
|
|
|
<view class="campus-switch campus-switch--strip" @tap.stop="checkArea"> |
|
|
|
<text class="campus-switch-name">{{areaName || '选择校区'}}</text> |
|
|
|
<text class="campus-switch-name">{{areaName || '选择区域'}}</text> |
|
|
|
<uni-icons class="campus-switch-icon" type="location-filled" size="14" color="#05745f"></uni-icons> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="seckill-entry seckill-entry--in-card" @tap="goPendingGroup"> |
|
|
|
<view v-if="!isSocialArea" class="seckill-entry seckill-entry--in-card" @tap="goPendingGroup"> |
|
|
|
<view class="heat-dot heat-dot-a"></view> |
|
|
|
<view class="heat-dot heat-dot-b"></view> |
|
|
|
<view class="seckill-entry-light"></view> |
|
|
|
@ -184,7 +185,7 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="daimai-box" style="padding-bottom:180rpx;"> |
|
|
|
<view class="daimai-box" v-if="!isSocialArea" style="padding-bottom:180rpx;"> |
|
|
|
<view class="earn-guide"> |
|
|
|
<view class="earn-guide-light"></view> |
|
|
|
<view class="earn-guide-icon">🛵</view> |
|
|
|
@ -426,6 +427,14 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="daimai-box social-pending-box" id="socialPendingBox" v-else style="padding-bottom:180rpx;"> |
|
|
|
<home-group-pending |
|
|
|
ref="homeGroupPending" |
|
|
|
:embedded="true" |
|
|
|
:sticky-top="navBarHeight + 46" |
|
|
|
:sticky-active="lastScrollTop > stickyTrigger" |
|
|
|
/> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
@ -433,10 +442,10 @@ |
|
|
|
<de-livery ref="deLiveryPage" @tabbar-visible-change="setTabBarVisible"></de-livery> |
|
|
|
</view> |
|
|
|
<view class="swiper-page" v-show="currentIndex == 2"> |
|
|
|
<release-page ref="releasePage"></release-page> |
|
|
|
<release-page ref="releasePage" :social-mode="isSocialArea"></release-page> |
|
|
|
</view> |
|
|
|
<view class="swiper-page" v-show="currentIndex == 3"> |
|
|
|
<post-list ref="postListPage"></post-list> |
|
|
|
<post-list ref="postListPage" :social-mode="isSocialArea"></post-list> |
|
|
|
</view> |
|
|
|
<view class="swiper-page" v-show="currentIndex == 4"> |
|
|
|
<my-center ref="myCenterPage"></my-center> |
|
|
|
@ -462,9 +471,15 @@ |
|
|
|
<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-subtitle">选定后,会优先展示附近同学正在拼的内容。</view> |
|
|
|
<view class="campus-area-kicker">选择你的区域半径</view> |
|
|
|
<view class="campus-area-title">你现在在哪个区域?</view> |
|
|
|
<view class="campus-area-subtitle">选定后,会优先展示附近正在拼的内容。</view> |
|
|
|
</view> |
|
|
|
<view v-if="suggestedArea && suggestedArea.id" class="campus-area-suggest"> |
|
|
|
<view class="campus-area-suggest-text"> |
|
|
|
检测到您当前在「{{ suggestedArea.title }}」区域,是否选中该区域?或可下方选择其他区域。 |
|
|
|
</view> |
|
|
|
<view class="campus-area-suggest-btn" @tap.stop="onClickArea(suggestedArea)">选中该区域</view> |
|
|
|
</view> |
|
|
|
<view class="campus-area-search"> |
|
|
|
<text class="area-search-icon">⌕</text> |
|
|
|
@ -472,16 +487,22 @@ |
|
|
|
placeholder-class="area-search-placeholder" /> |
|
|
|
</view> |
|
|
|
<scroll-view scroll-y class="campus-area-list"> |
|
|
|
<view class="campus-area-item" v-for="(item,index) in filteredAreaList" :key="index" |
|
|
|
@tap="onClickArea(item)"> |
|
|
|
<view |
|
|
|
class="campus-area-item" |
|
|
|
:class="{ 'campus-area-item--suggest': suggestedArea && suggestedArea.id == item.id }" |
|
|
|
v-for="(item,index) in filteredAreaList" |
|
|
|
:key="index" |
|
|
|
@tap="onClickArea(item)" |
|
|
|
> |
|
|
|
<view class="area-item-main"> |
|
|
|
<view class="area-item-dot"></view> |
|
|
|
<text>{{item.title}}</text> |
|
|
|
<text v-if="suggestedArea && suggestedArea.id == item.id" class="area-item-tag">推荐</text> |
|
|
|
</view> |
|
|
|
<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> |
|
|
|
@ -537,7 +558,7 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uni-popup> |
|
|
|
<tab-bar v-if="isTabBarVisible" ref="tabBar" :width="width" @tab-index="changeIndex" :currentIndex="currentIndex"></tab-bar> |
|
|
|
<tab-bar v-if="isTabBarVisible" ref="tabBar" :width="width" @tab-index="changeIndex" :currentIndex="currentIndex" :socialMode="isSocialArea"></tab-bar> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
@ -546,6 +567,7 @@ |
|
|
|
import releasePage from "@/components/tab-bar/release.vue"; |
|
|
|
import postList from "@/components/tab-bar/postList.vue"; |
|
|
|
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 } from '@/utils/sharePath.js' |
|
|
|
|
|
|
|
@ -669,6 +691,7 @@ |
|
|
|
url: '/package1/farm/farm' |
|
|
|
}], |
|
|
|
areaName: '', |
|
|
|
areaKind: 1, |
|
|
|
gaoxiaoList:[{ |
|
|
|
title:'拼团搭子哪里找', |
|
|
|
content:'隔壁宿舍全是宝!' |
|
|
|
@ -679,6 +702,16 @@ |
|
|
|
title:'有件事你知道吗?', |
|
|
|
content:'拼团和期末不挂科一样重要!' |
|
|
|
}], |
|
|
|
socialGaoxiaoList:[{ |
|
|
|
title:'拼团搭子去哪捞', |
|
|
|
content:'同城好友全是宝!' |
|
|
|
},{ |
|
|
|
title:'这门"省钱课"', |
|
|
|
content:'拼团就是好友的满分答案!' |
|
|
|
},{ |
|
|
|
title:'有件事你知道吗?', |
|
|
|
content:'拼团和柴米油盐一样重要!' |
|
|
|
}], |
|
|
|
indicatorDots: false, |
|
|
|
autoplay: true, |
|
|
|
mallAds: [], |
|
|
|
@ -714,6 +747,7 @@ |
|
|
|
areaList: [], |
|
|
|
areaKeyword: '', |
|
|
|
areaPopupCanClose: false, |
|
|
|
suggestedArea: null, |
|
|
|
orderLists: [], |
|
|
|
waimaiCount: 0, |
|
|
|
kuaidiCount: 0, |
|
|
|
@ -789,9 +823,27 @@ |
|
|
|
deLivery, |
|
|
|
releasePage, |
|
|
|
postList, |
|
|
|
myCenter |
|
|
|
myCenter, |
|
|
|
homeGroupPending |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
isSocialArea() { |
|
|
|
return Number(this.areaKind) === 2 |
|
|
|
}, |
|
|
|
displayGaoxiaoList() { |
|
|
|
return this.isSocialArea ? this.socialGaoxiaoList : this.gaoxiaoList |
|
|
|
}, |
|
|
|
gaoxiaoSuffix() { |
|
|
|
return this.isSocialArea ? '同城好友在拼' : '附近宿舍在拼' |
|
|
|
}, |
|
|
|
stickyCoverHeight() { |
|
|
|
const nav = Number(this.navBarHeight) || 0 |
|
|
|
// 社会区域覆盖「标题+标签+搜索」高度即可,避免大块空白 |
|
|
|
if (this.isSocialArea) { |
|
|
|
return nav + 220 |
|
|
|
} |
|
|
|
return nav + 220 |
|
|
|
}, |
|
|
|
filteredAreaList() { |
|
|
|
const keyword = this.areaKeyword.trim().toLowerCase() |
|
|
|
if (!keyword) return this.areaList |
|
|
|
@ -882,6 +934,12 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
onReachBottom() { |
|
|
|
if (this.currentIndex === 0 && this.isSocialArea) { |
|
|
|
if (this.$refs.homeGroupPending && this.$refs.homeGroupPending.loadMore) { |
|
|
|
this.$refs.homeGroupPending.loadMore() |
|
|
|
} |
|
|
|
return |
|
|
|
} |
|
|
|
// 接管原 delivery-list scroll-view 的 scrolltolower 分页 |
|
|
|
if (this.searchForm.pageNum >= this.totalPages) return; |
|
|
|
this.searchForm.pageNum++; |
|
|
|
@ -969,13 +1027,13 @@ |
|
|
|
const tabIndex = Number(this.currentIndex) || 0 |
|
|
|
const path = tabIndex > 0 ? '/pages/index/index?tabIndex=' + tabIndex : '/pages/index/index' |
|
|
|
const tabTitleMap = { |
|
|
|
1: '校园兼职配送,顺路赚点零花钱', |
|
|
|
2: '校园新鲜事和搭子都在这里', |
|
|
|
3: '同校二手好物,来鱼塘逛逛', |
|
|
|
1: '兼职配送,顺路赚点零花钱', |
|
|
|
2: '新鲜事和搭子都在这里', |
|
|
|
3: '二手好物,来鱼塘逛逛', |
|
|
|
4: '半径里个人中心' |
|
|
|
} |
|
|
|
return { |
|
|
|
title: tabTitleMap[tabIndex] || '半径里,校园生活更省心', |
|
|
|
title: tabTitleMap[tabIndex] || '半径里,生活更省心', |
|
|
|
path |
|
|
|
} |
|
|
|
}, |
|
|
|
@ -1100,6 +1158,15 @@ |
|
|
|
}, |
|
|
|
refreshDaimaiStickyPosition() { |
|
|
|
const query = uni.createSelectorQuery().in(this); |
|
|
|
if (this.isSocialArea) { |
|
|
|
query.select('#socialPendingBox').boundingClientRect(rect => { |
|
|
|
if (rect) { |
|
|
|
this.menuListOffsetTop = rect.top + (this._scrollTopRaw || 0); |
|
|
|
this.stickyTrigger = Math.max(200, this.menuListOffsetTop - this.navBarHeight - 46); |
|
|
|
} |
|
|
|
}).exec(); |
|
|
|
return; |
|
|
|
} |
|
|
|
query.select('#menuList').boundingClientRect(rect => { |
|
|
|
if (rect) { |
|
|
|
this.menuListOffsetTop = rect.top + (this._scrollTopRaw || 0); |
|
|
|
@ -1150,13 +1217,17 @@ |
|
|
|
this.getUserOrders(); |
|
|
|
} |
|
|
|
if (!uni.getStorageSync('area')) { |
|
|
|
this.checkArea() |
|
|
|
this.tryAutoBindAreaByLocation() |
|
|
|
} else { |
|
|
|
if (uni.getStorageSync('area')) { |
|
|
|
this.searchForm.regionId = JSON.parse(uni.getStorageSync('area')).id; |
|
|
|
} |
|
|
|
let area = JSON.parse(uni.getStorageSync('area')) |
|
|
|
this.areaName = area.title |
|
|
|
this.syncAreaKind(area) |
|
|
|
if (this.isSocialArea && this.currentIndex === 1) { |
|
|
|
this.currentIndex = 0 |
|
|
|
} |
|
|
|
if (uni.getStorageSync('waimaiData')) { |
|
|
|
this.waimailistData = [] |
|
|
|
let waimailist = uni.getStorageSync('waimaiData') |
|
|
|
@ -1187,6 +1258,9 @@ |
|
|
|
this.searchForm.kuaidiData = []; |
|
|
|
this.getDelivery(); |
|
|
|
this.getShopArea(); |
|
|
|
if (this.isSocialArea) { |
|
|
|
this.refreshHomeGroupPending() |
|
|
|
} |
|
|
|
} |
|
|
|
// 计算导航栏高度用于sticky offset:statusBarHeight + 40px内容区 |
|
|
|
const info = uni.getSystemInfoSync(); |
|
|
|
@ -1453,14 +1527,26 @@ |
|
|
|
|
|
|
|
if (item.workerId != null && item.workerId != undefined && item.workerId != '') { |
|
|
|
that.zhipaiCount -= 1 |
|
|
|
if(that.zhipaiCount < 0){ |
|
|
|
that.zhipaiCount = 0 |
|
|
|
} |
|
|
|
that.decreaseIndexZhipaiBadge() |
|
|
|
} else { |
|
|
|
if (item.deliveryType == 1) { |
|
|
|
that.waimaiCount -= 1 |
|
|
|
if(that.waimaiCount < 0){ |
|
|
|
that.waimaiCount = 0 |
|
|
|
} |
|
|
|
} else if (item.deliveryType == 2) { |
|
|
|
that.kuaidiCount -= 1 |
|
|
|
if(that.kuaidiCount < 0){ |
|
|
|
that.kuaidiCount = 0 |
|
|
|
} |
|
|
|
} else if (item.deliveryType == 3) { |
|
|
|
that.paotuiCount -= 1 |
|
|
|
if(that.paotuiCount < 0){ |
|
|
|
that.paotuiCount = 0 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -1494,14 +1580,26 @@ |
|
|
|
that.tui.toast(res.message, 2000); |
|
|
|
if (item.workerId != null && item.workerId != undefined && item.workerId != '') { |
|
|
|
that.zhipaiCount -= 1 |
|
|
|
if(that.zhipaiCount < 0){ |
|
|
|
that.zhipaiCount = 0 |
|
|
|
} |
|
|
|
that.decreaseIndexZhipaiBadge() |
|
|
|
} else { |
|
|
|
if (item.deliveryType == 1) { |
|
|
|
that.waimaiCount -= 1 |
|
|
|
if(that.waimaiCount < 0){ |
|
|
|
that.waimaiCount = 0 |
|
|
|
} |
|
|
|
} else if (item.deliveryType == 2) { |
|
|
|
that.kuaidiCount -= 1 |
|
|
|
if(that.kuaidiCount < 0){ |
|
|
|
that.kuaidiCount = 0 |
|
|
|
} |
|
|
|
} else if (item.deliveryType == 3) { |
|
|
|
that.paotuiCount -= 1 |
|
|
|
if(that.paotuiCount < 0){ |
|
|
|
that.paotuiCount = 0 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
that.$forceUpdate(); |
|
|
|
@ -1913,13 +2011,25 @@ |
|
|
|
}, |
|
|
|
//选择区域 |
|
|
|
onClickArea(item) { |
|
|
|
this.bindArea(item, { fromManual: true }) |
|
|
|
}, |
|
|
|
bindArea(item, options = {}) { |
|
|
|
const fromManual = options.fromManual === true |
|
|
|
uni.setStorageSync('area', JSON.stringify(item)) |
|
|
|
this.areaName = uni.getStorageSync('schoolName') || item.title || '沧州师范学院' |
|
|
|
this.syncAreaKind(item) |
|
|
|
this.areaKeyword = '' |
|
|
|
this.suggestedArea = null |
|
|
|
this.searchForm.regionId = item.id |
|
|
|
this.resetDeliveryQuery() |
|
|
|
if (this.isSocialArea && this.currentIndex === 1) { |
|
|
|
this.currentIndex = 0 |
|
|
|
} |
|
|
|
this.getDelivery(); |
|
|
|
this.getShopArea(); |
|
|
|
if (this.isSocialArea) { |
|
|
|
this.$nextTick(() => this.refreshHomeGroupPending()) |
|
|
|
} |
|
|
|
let that = this |
|
|
|
if(uni.getStorageSync('hiver_token')){ |
|
|
|
that.tui.request("/worker/admin/add", "POST", { |
|
|
|
@ -1939,8 +2049,10 @@ |
|
|
|
}).catch((res) => {}) |
|
|
|
} |
|
|
|
|
|
|
|
this.$refs.areaPopup.close() |
|
|
|
this.tui.toast('切换成功') |
|
|
|
if (this.$refs.areaPopup) { |
|
|
|
this.$refs.areaPopup.close() |
|
|
|
} |
|
|
|
this.tui.toast(fromManual ? '切换成功' : ('已定位到:' + (item.title || '当前区域'))) |
|
|
|
if (this.$refs.myCenterPage && this.$refs.myCenterPage.init) { |
|
|
|
this.$refs.myCenterPage.init() |
|
|
|
} |
|
|
|
@ -1949,12 +2061,97 @@ |
|
|
|
this.openShareTargetIfNeeded() |
|
|
|
}, 300) |
|
|
|
}, |
|
|
|
checkArea() { |
|
|
|
syncAreaKind(areaObj) { |
|
|
|
let area = areaObj |
|
|
|
if (!area) { |
|
|
|
try { |
|
|
|
const cached = uni.getStorageSync('area') |
|
|
|
area = cached ? (typeof cached === 'string' ? JSON.parse(cached) : cached) : null |
|
|
|
} catch (e) { |
|
|
|
area = null |
|
|
|
} |
|
|
|
} |
|
|
|
const kind = area ? Number(area.areaKind) : 1 |
|
|
|
this.areaKind = kind === 2 ? 2 : 1 |
|
|
|
}, |
|
|
|
refreshHomeGroupPending() { |
|
|
|
if (!this.isSocialArea) return |
|
|
|
this.$nextTick(() => { |
|
|
|
if (this.$refs.homeGroupPending && this.$refs.homeGroupPending.init) { |
|
|
|
this.$refs.homeGroupPending.init() |
|
|
|
} |
|
|
|
setTimeout(() => { |
|
|
|
this.refreshDaimaiStickyPosition() |
|
|
|
}, 300) |
|
|
|
}) |
|
|
|
}, |
|
|
|
tryAutoBindAreaByLocation() { |
|
|
|
if (this._autoBindingArea) { |
|
|
|
return |
|
|
|
} |
|
|
|
// 同一次冷启动只申请一次定位,避免授权弹窗重复出现 |
|
|
|
if (this._areaLocationAskedOnce) { |
|
|
|
this.checkArea() |
|
|
|
return |
|
|
|
} |
|
|
|
this._areaLocationAskedOnce = true |
|
|
|
this._autoBindingArea = true |
|
|
|
uni.showLoading({ |
|
|
|
title: '定位区域中...', |
|
|
|
mask: true |
|
|
|
}) |
|
|
|
const done = (next) => { |
|
|
|
try { |
|
|
|
uni.hideLoading() |
|
|
|
} catch (e) {} |
|
|
|
this._autoBindingArea = false |
|
|
|
if (typeof next === 'function') { |
|
|
|
next() |
|
|
|
} |
|
|
|
} |
|
|
|
const matchThenOpenPopup = (lat, lng) => { |
|
|
|
if (lat == null || lng == null) { |
|
|
|
done(() => this.checkArea()) |
|
|
|
return |
|
|
|
} |
|
|
|
this.tui.request('/app/shopArea/matchByLocation', 'GET', { |
|
|
|
lat, |
|
|
|
lng |
|
|
|
}, false, false, true).then((matchRes) => { |
|
|
|
if (matchRes && matchRes.code == 200 && matchRes.result && matchRes.result.id) { |
|
|
|
done(() => this.checkArea(matchRes.result)) |
|
|
|
} else { |
|
|
|
done(() => this.checkArea()) |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
done(() => this.checkArea()) |
|
|
|
}) |
|
|
|
} |
|
|
|
uni.getLocation({ |
|
|
|
type: 'gcj02', |
|
|
|
success: (res) => { |
|
|
|
matchThenOpenPopup(res.latitude, res.longitude) |
|
|
|
}, |
|
|
|
fail: () => { |
|
|
|
// 只请求一次定位,失败直接手选,不再二次 authorize/getLocation |
|
|
|
done(() => this.checkArea()) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
checkArea(suggestedArea) { |
|
|
|
this.suggestedArea = suggestedArea && suggestedArea.id ? suggestedArea : null |
|
|
|
this.tui.request("/app/shopArea/getByParentId/0", "get", {}, false, false).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.areaList = res.result |
|
|
|
this.areaList = res.result || [] |
|
|
|
this.areaKeyword = '' |
|
|
|
this.areaPopupCanClose = !!uni.getStorageSync('area') |
|
|
|
// 若推荐项不在列表中,仍保留提示,列表以接口为准 |
|
|
|
if (this.suggestedArea && this.suggestedArea.id) { |
|
|
|
const hit = this.areaList.find((item) => item && item.id == this.suggestedArea.id) |
|
|
|
if (hit) { |
|
|
|
this.suggestedArea = hit |
|
|
|
} |
|
|
|
} |
|
|
|
this.$refs.areaPopup.open(); |
|
|
|
} else { |
|
|
|
this.tui.toast(res.message) |
|
|
|
@ -2119,6 +2316,9 @@ |
|
|
|
let that = this; |
|
|
|
this.isTabBarVisible = true |
|
|
|
this.lastIndex = this.currentIndex |
|
|
|
if (this.isSocialArea && index === 1) { |
|
|
|
index = 0 |
|
|
|
} |
|
|
|
if (index != 0) { |
|
|
|
this.closeProductPopup() |
|
|
|
} |
|
|
|
@ -2492,12 +2692,10 @@ |
|
|
|
} |
|
|
|
|
|
|
|
.campus-switch-icon { |
|
|
|
margin-right: 10rpx; |
|
|
|
color: #05745f; |
|
|
|
font-size: 27rpx; |
|
|
|
font-weight: 900; |
|
|
|
line-height: 1; |
|
|
|
text-align: center; |
|
|
|
margin-left: 6rpx; |
|
|
|
flex-shrink: 0; |
|
|
|
position: relative; |
|
|
|
z-index: 1; |
|
|
|
} |
|
|
|
|
|
|
|
.campus-switch-name { |
|
|
|
@ -4305,6 +4503,55 @@ |
|
|
|
line-height: 1.5; |
|
|
|
} |
|
|
|
|
|
|
|
.campus-area-suggest { |
|
|
|
position: relative; |
|
|
|
z-index: 1; |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: space-between; |
|
|
|
gap: 16rpx; |
|
|
|
margin-top: 24rpx; |
|
|
|
padding: 20rpx 22rpx; |
|
|
|
border-radius: 24rpx; |
|
|
|
background: rgba(72, 209, 204, 0.14); |
|
|
|
border: 1rpx solid rgba(72, 209, 204, 0.35); |
|
|
|
} |
|
|
|
|
|
|
|
.campus-area-suggest-text { |
|
|
|
flex: 1; |
|
|
|
min-width: 0; |
|
|
|
color: #073d33; |
|
|
|
font-size: 24rpx; |
|
|
|
line-height: 1.45; |
|
|
|
font-weight: 600; |
|
|
|
} |
|
|
|
|
|
|
|
.campus-area-suggest-btn { |
|
|
|
flex-shrink: 0; |
|
|
|
padding: 12rpx 20rpx; |
|
|
|
border-radius: 999rpx; |
|
|
|
background: #48D1CC; |
|
|
|
color: #fff; |
|
|
|
font-size: 24rpx; |
|
|
|
font-weight: 700; |
|
|
|
} |
|
|
|
|
|
|
|
.campus-area-item--suggest { |
|
|
|
border-color: rgba(72, 209, 204, 0.55); |
|
|
|
background: rgba(72, 209, 204, 0.12); |
|
|
|
} |
|
|
|
|
|
|
|
.area-item-tag { |
|
|
|
flex-shrink: 0; |
|
|
|
margin-left: 12rpx; |
|
|
|
padding: 2rpx 10rpx; |
|
|
|
border-radius: 999rpx; |
|
|
|
background: rgba(72, 209, 204, 0.2); |
|
|
|
color: #0b7a72; |
|
|
|
font-size: 20rpx; |
|
|
|
font-weight: 700; |
|
|
|
} |
|
|
|
|
|
|
|
.campus-area-search { |
|
|
|
position: relative; |
|
|
|
z-index: 1; |
|
|
|
|