1. 账号体系与数据库解耦: - 师傅表 fa_master 解除对 fa_user.id 的外键依赖,升级为独立认证账号主表; - 新增师傅端独立支撑表:fa_master_security、fa_master_token、fa_master_wechat、fa_master_agreement_read; - 新增工单超时未接单自动关闭与原路退款配置(order_unaccepted_close_days)。 2. 服务端(Server): - 新增师傅端独立 API 控制器与认证库(MasterAuth, MasterBase, MasterMessage, MasterSecurity, MasterToken); - WxLogin 支持双小程序端(user/master)独立换取 session_key、openid 与 access_token; - 新增控制台调度命令 php think order:autoclose,支持订单超时自动关闭与售后退款闭环; - 修复 PHP 8.5 兼容性问题(Request.php 的 (bool) 强制转换); - 系统业务配置全面收敛至数据库 fa_config 及 site.php。 3. 小程序端: - yjyf-app(用户端):彻底剥离师傅端路由、组件及静态资源,增加隐私授权弹窗与评价模块; - yjyf-master-app(师傅端):全新独立微信小程序工程(wx140d90ceda786107),实现工作台、接单大厅、资质认证、工单协同与钱包提现完整闭环。
2169 行
54 KiB
Vue
2169 行
54 KiB
Vue
<template>
|
||
<view class="location-page">
|
||
<!-- 1. 全站统一导航栏 -->
|
||
<YjyfNavBar theme="white" :border="true" title="选择接单位置" />
|
||
|
||
<!-- 2. 顶部吸顶城市切换与关键词搜索栏 -->
|
||
<view class="search-header">
|
||
<view class="city-pill clickable-hover" @tap="openCityDrawer">
|
||
<text class="city-pill-txt">{{ displayCityShort }}</text>
|
||
<image class="city-caret" src="/static/icons/master/loc-city-caret.svg" mode="aspectFit" />
|
||
</view>
|
||
|
||
<view class="search-input-box">
|
||
<image class="search-ico" src="/static/icons/master/hall-loc-search.svg" mode="aspectFit" />
|
||
<input
|
||
class="search-input"
|
||
v-model="searchKeyword"
|
||
type="text"
|
||
placeholder="搜索小区、写字楼、街道或商圈"
|
||
placeholder-class="search-ph"
|
||
confirm-type="search"
|
||
@input="onSearchInput"
|
||
@confirm="executeSearch"
|
||
/>
|
||
<view class="clear-btn clickable-hover" v-if="searchKeyword" @tap="clearSearch">
|
||
<image class="clear-ico" src="/static/icons/master/loc-clear.svg" mode="aspectFit" />
|
||
</view>
|
||
</view>
|
||
|
||
<view
|
||
class="search-action clickable-hover"
|
||
v-if="inSearchMode"
|
||
@tap="clearSearch"
|
||
>
|
||
<text class="search-action-txt">取消</text>
|
||
</view>
|
||
<view
|
||
class="search-action primary clickable-hover"
|
||
v-else
|
||
@tap="executeSearch"
|
||
>
|
||
<text class="search-action-txt primary">搜索</text>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 3. 关键词搜索专属结果模式 -->
|
||
<view class="search-mode-panel" v-if="inSearchMode">
|
||
<view class="search-scope-bar">
|
||
<text class="scope-txt">检索范围:{{ activeCity || '全国' }}</text>
|
||
<text class="scope-switch clickable-hover" @tap="openCityDrawer">切换城市</text>
|
||
</view>
|
||
|
||
<scroll-view class="search-scroll" scroll-y="true">
|
||
<view class="state-box" v-if="searching">
|
||
<text class="state-title">正在检索真实地点...</text>
|
||
</view>
|
||
|
||
<view class="state-box" v-else-if="searchError">
|
||
<text class="state-title">{{ searchError }}</text>
|
||
<view class="state-retry clickable-hover" @tap="executeSearch">
|
||
<text class="state-retry-txt">重新搜索</text>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="state-box" v-else-if="!searchResults.length">
|
||
<image class="state-ico" src="/static/icons/master/hall-location-pin.svg" mode="aspectFit" />
|
||
<text class="state-title">未找到匹配地点</text>
|
||
<text class="state-sub">尝试输入更具体的区县、商圈或切换左侧城市</text>
|
||
</view>
|
||
|
||
<view class="search-list" v-else>
|
||
<view
|
||
class="poi-row clickable-hover"
|
||
v-for="(item, idx) in searchResults"
|
||
:key="'sr-' + idx"
|
||
@tap="pickSearchResult(item)"
|
||
>
|
||
<image class="poi-ico" src="/static/icons/master/loc-poi-dot.svg" mode="aspectFit" />
|
||
<view class="poi-main">
|
||
<view class="poi-top">
|
||
<text class="poi-name">{{ item.name }}</text>
|
||
<text class="poi-dist" v-if="item.distance_text">{{ item.distance_text }}</text>
|
||
</view>
|
||
<text class="poi-addr">{{ item.address || [item.city, item.district].filter(Boolean).join(' ') }}</text>
|
||
</view>
|
||
<text class="poi-pick-tag">定位至此</text>
|
||
</view>
|
||
</view>
|
||
</scroll-view>
|
||
</view>
|
||
|
||
<!-- 4. 主体选点模式:交互地图 + 服务半径面板 + 周边地标/常用历史 -->
|
||
<template v-else>
|
||
<!-- 4A. 交互式地图预览与拖动选点区 -->
|
||
<view class="map-stage" :class="{ collapsed: mapCollapsed }">
|
||
<!-- 地图尚未获取坐标时的引导层 -->
|
||
<view class="map-placeholder" v-if="!hasSelectedCoord">
|
||
<image class="map-ph-ico" src="/static/icons/master/hall-location-pin.svg" mode="aspectFit" />
|
||
<text class="map-ph-title">暂无中心定位点</text>
|
||
<text class="map-ph-sub">点击下方定位按钮、选择城市或搜索地点以预览接单服务圈</text>
|
||
<view class="map-ph-actions">
|
||
<view class="map-ph-btn primary clickable-hover" @tap="handleLocateDevice">
|
||
<text class="map-ph-btn-txt primary">{{ locating ? '定位中...' : '获取当前定位' }}</text>
|
||
</view>
|
||
<view class="map-ph-btn clickable-hover" @tap="openCityDrawer">
|
||
<text class="map-ph-btn-txt">选择接单城市</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 有坐标时渲染真实交互地图 -->
|
||
<template v-else>
|
||
<!-- #ifdef H5 -->
|
||
<view class="h5-map-wrap">
|
||
<view id="yjyf-tianditu-map" class="h5-map-canvas"></view>
|
||
<view class="map-loading-mask" v-if="h5MapState === 'loading'">
|
||
<text class="map-loading-txt">正在加载天地图矢量视图...</text>
|
||
</view>
|
||
<view class="map-fallback-card" v-else-if="h5MapState === 'error'">
|
||
<text class="mf-title">天地图底图暂未加载</text>
|
||
<text class="mf-coord">当前坐标:{{ Number(selectedLat).toFixed(4) }}, {{ Number(selectedLng).toFixed(4) }}</text>
|
||
<view class="mf-btn clickable-hover" @tap="initH5Map(true)">
|
||
<text class="mf-btn-txt">重新加载底图</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<!-- #endif -->
|
||
|
||
<!-- #ifdef MP-WEIXIN -->
|
||
<map
|
||
id="yjyf-mp-map"
|
||
class="mp-map-canvas"
|
||
:latitude="Number(selectedLat)"
|
||
:longitude="Number(selectedLng)"
|
||
:scale="mpMapScale"
|
||
:circles="mpCircles"
|
||
:show-location="true"
|
||
@regionchange="onMpRegionChange"
|
||
/>
|
||
<!-- #endif -->
|
||
|
||
<!-- 地图中心悬停定位准星 -->
|
||
<view class="center-pin-wrap" :class="{ moving: mapDragging }" v-if="!mapCollapsed">
|
||
<image class="center-pin-ico" src="/static/icons/master/loc-map-pin-center.svg" mode="aspectFit" />
|
||
</view>
|
||
|
||
<!-- 左上角服务圈实时工单概览胶囊 -->
|
||
<view class="map-stats-pill">
|
||
<text class="map-stats-txt">{{ serveRadius }}km服务圈 · 约 {{ orderStats.in_radius_count }} 单可接</text>
|
||
</view>
|
||
|
||
<!-- 右上角地图折叠切换按钮 -->
|
||
<view class="map-collapse-pill clickable-hover" @tap="toggleMapCollapsed">
|
||
<image
|
||
class="collapse-ico"
|
||
:class="{ down: mapCollapsed }"
|
||
src="/static/icons/master/loc-map-collapse.svg"
|
||
mode="aspectFit"
|
||
/>
|
||
<text class="collapse-txt">{{ mapCollapsed ? '展开地图' : '收起地图' }}</text>
|
||
</view>
|
||
|
||
<!-- 右下角一键回到当前实时定位 -->
|
||
<view
|
||
class="recenter-btn clickable-hover"
|
||
v-if="!mapCollapsed"
|
||
@tap="handleLocateDevice"
|
||
>
|
||
<image class="recenter-ico" src="/static/icons/master/hall-loc-target.svg" mode="aspectFit" />
|
||
</view>
|
||
</template>
|
||
</view>
|
||
|
||
<!-- 4B. 当前选中锚点详情 & 服务半径精细调控卡 -->
|
||
<view class="anchor-card">
|
||
<view class="anchor-top">
|
||
<view class="anchor-info">
|
||
<view class="anchor-title-row">
|
||
<text class="anchor-name">{{ selectedName || '请定位或选择接单地点' }}</text>
|
||
<text class="anchor-source" v-if="sourceBadgeText">{{ sourceBadgeText }}</text>
|
||
</view>
|
||
<text class="anchor-addr">{{ selectedAddress || '设定后,抢单大厅将优先推荐周边待接工单' }}</text>
|
||
</view>
|
||
<view class="anchor-relocate clickable-hover" @tap="handleLocateDevice">
|
||
<image class="relocate-ico" src="/static/icons/master/hall-loc-target.svg" mode="aspectFit" />
|
||
<text class="relocate-txt">{{ locating ? '定位中' : '重新定位' }}</text>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="radius-box">
|
||
<view class="radius-head">
|
||
<view class="radius-label-wrap">
|
||
<image class="radius-ico" src="/static/icons/master/loc-radius-radar.svg" mode="aspectFit" />
|
||
<text class="radius-label">优先接单半径</text>
|
||
</view>
|
||
<text class="radius-summary">
|
||
{{ serveRadius }}km内 {{ orderStats.in_radius_count }} 单 · 同城共 {{ orderStats.city_order_count }} 单
|
||
</text>
|
||
</view>
|
||
|
||
<view class="radius-chips">
|
||
<view
|
||
class="radius-chip clickable-hover"
|
||
v-for="r in radiusOptions"
|
||
:key="r"
|
||
:class="{ active: serveRadius === r }"
|
||
@tap="changeServeRadius(r)"
|
||
>
|
||
<text class="radius-chip-txt">{{ r }}km</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 4C. 下半部 Tab 列表区:周边推荐 POI / 常用与历史位置 -->
|
||
<view class="poi-section">
|
||
<scroll-view class="poi-tabs-scroll" scroll-x="true" :show-scrollbar="false">
|
||
<view class="poi-tabs">
|
||
<view
|
||
class="poi-tab clickable-hover"
|
||
v-for="tab in poiTabs"
|
||
:key="tab.key"
|
||
:class="{ active: activeTab === tab.key }"
|
||
@tap="switchPoiTab(tab.key)"
|
||
>
|
||
<text class="poi-tab-txt">{{ tab.name }}</text>
|
||
</view>
|
||
</view>
|
||
</scroll-view>
|
||
|
||
<scroll-view class="poi-list-scroll" scroll-y="true">
|
||
<!-- Tab: 常用与历史位置 -->
|
||
<view class="history-pane" v-if="activeTab === 'saved'">
|
||
<!-- 1. 实名常驻城市 -->
|
||
<view class="saved-block" v-if="masterCity">
|
||
<text class="saved-block-title">认证常驻城市</text>
|
||
<view class="saved-city-row clickable-hover" @tap="jumpToCity(masterCity)">
|
||
<image class="saved-ico" src="/static/icons/master/loc-home-city.svg" mode="aspectFit" />
|
||
<view class="saved-info">
|
||
<text class="saved-name">{{ masterCity }}</text>
|
||
<text class="saved-sub">切回认证注册常驻服务城市</text>
|
||
</view>
|
||
<text class="saved-action">定位至此</text>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 2. 最近使用过的真实接单位置 -->
|
||
<view class="saved-block">
|
||
<view class="saved-block-head">
|
||
<text class="saved-block-title">最近使用位置</text>
|
||
<text
|
||
class="saved-clear clickable-hover"
|
||
v-if="recentLocations.length"
|
||
@tap="handleClearRecent"
|
||
>清空</text>
|
||
</view>
|
||
|
||
<view class="saved-empty" v-if="!recentLocations.length">
|
||
<text class="saved-empty-txt">确认过的接单位置会自动记录于此,方便跨区接单快速切换</text>
|
||
</view>
|
||
|
||
<view
|
||
class="poi-row clickable-hover"
|
||
v-for="rec in recentLocations"
|
||
:key="rec.key"
|
||
:class="{ active: isSamePoint(rec.lat, rec.lng) }"
|
||
@tap="selectRecentPlace(rec)"
|
||
>
|
||
<image class="poi-ico" src="/static/icons/master/loc-history-clock.svg" mode="aspectFit" />
|
||
<view class="poi-main">
|
||
<text class="poi-name">{{ rec.name }}</text>
|
||
<text class="poi-addr">{{ rec.address || [rec.city, rec.district].filter(Boolean).join(' ') }}</text>
|
||
</view>
|
||
<view class="rec-del-btn clickable-hover" @tap.stop="handleRemoveRecent(rec.key)">
|
||
<image class="rec-del-ico" src="/static/icons/master/loc-delete.svg" mode="aspectFit" />
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 3. 个人地址簿真实坐标(如果有) -->
|
||
<view class="saved-block" v-if="addressBookList.length">
|
||
<text class="saved-block-title">我的常用地址簿</text>
|
||
<view
|
||
class="poi-row clickable-hover"
|
||
v-for="addr in addressBookList"
|
||
:key="'ab-' + addr.id"
|
||
:class="{ active: addr.lat && addr.lng && isSamePoint(addr.lat, addr.lng) }"
|
||
@tap="selectAddressBookItem(addr)"
|
||
>
|
||
<image class="poi-ico" src="/static/icons/master/hall-location-pin.svg" mode="aspectFit" />
|
||
<view class="poi-main">
|
||
<text class="poi-name">{{ addr.address }}</text>
|
||
<text class="poi-addr">{{ [addr.province, addr.city, addr.district].filter(Boolean).join(' ') }}</text>
|
||
</view>
|
||
<text class="poi-pick-tag">选用</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- Tab: 天地图周边真实地标 POI 列表 -->
|
||
<template v-else>
|
||
<view class="state-box compact" v-if="loadingNearby">
|
||
<text class="state-title">正在匹配周边真实地标...</text>
|
||
</view>
|
||
|
||
<view class="state-box compact" v-else-if="nearbyError">
|
||
<text class="state-title">{{ nearbyError }}</text>
|
||
<view class="state-retry clickable-hover" @tap="loadLocationContext(false)">
|
||
<text class="state-retry-txt">重新加载</text>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="state-box compact" v-else-if="!hasSelectedCoord">
|
||
<text class="state-title">尚未设定定位中心</text>
|
||
<text class="state-sub">开启定位、切换城市或搜索小区后,将自动列出周边真实地点</text>
|
||
</view>
|
||
|
||
<view class="state-box compact" v-else-if="!nearbyList.length">
|
||
<text class="state-title">当前分类暂无周边地点</text>
|
||
<text class="state-sub">可切换“全部周边”或拖动地图中心查看附近街区</text>
|
||
</view>
|
||
|
||
<view class="poi-list" v-else>
|
||
<view
|
||
class="poi-row clickable-hover"
|
||
v-for="(poi, idx) in nearbyList"
|
||
:key="'poi-' + idx + '-' + poi.name"
|
||
:class="{ active: isPoiSelected(poi, idx) }"
|
||
@tap="selectNearbyPoi(poi, idx)"
|
||
>
|
||
<image
|
||
class="poi-ico"
|
||
:src="isPoiSelected(poi, idx) ? '/static/icons/master/loc-poi-checked.svg' : '/static/icons/master/loc-poi-dot.svg'"
|
||
mode="aspectFit"
|
||
/>
|
||
<view class="poi-main">
|
||
<view class="poi-top">
|
||
<text class="poi-center-badge" v-if="poi.is_center">中心</text>
|
||
<text class="poi-name">{{ poi.name }}</text>
|
||
</view>
|
||
<text class="poi-addr">{{ poi.address || '周边真实地点' }}</text>
|
||
</view>
|
||
<text class="poi-dist" :class="{ active: isPoiSelected(poi, idx) }">{{ poi.distance_text }}</text>
|
||
</view>
|
||
</view>
|
||
</template>
|
||
</scroll-view>
|
||
</view>
|
||
</template>
|
||
|
||
<!-- 5. 底部固定安全确认操作栏(唯一 Primary Action) -->
|
||
<view class="bottom-bar safe-area-bottom">
|
||
<view class="bottom-summary">
|
||
<text class="bottom-loc-name">{{ selectedName ? `已选:${selectedName}` : '请先定位或搜索选择地点' }}</text>
|
||
<text class="bottom-loc-meta" v-if="hasSelectedCoord">
|
||
{{ serveRadius }}km 接单圈 · 附近 {{ orderStats.in_radius_count }} 笔待接工单
|
||
</text>
|
||
</view>
|
||
<view
|
||
class="confirm-btn clickable-hover"
|
||
:class="{ disabled: !hasSelectedCoord || saving }"
|
||
@tap="confirmAndSave"
|
||
>
|
||
<text class="confirm-btn-txt">{{ saving ? '保存中...' : '确认设为接单位置' }}</text>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 6. 切换接单城市面板(展示真实工单活跃城市 + 全国省市区选择联动) -->
|
||
<view class="city-drawer-mask" v-if="showCityDrawer" @tap="showCityDrawer = false">
|
||
<view class="city-drawer-sheet safe-area-bottom" @tap.stop>
|
||
<view class="city-drawer-hd">
|
||
<text class="city-drawer-title">切换接单城市</text>
|
||
<view class="city-drawer-close clickable-hover" @tap="showCityDrawer = false">
|
||
<image class="city-drawer-close-ico" src="/static/icons/master/hall-loc-close.svg" mode="aspectFit" />
|
||
</view>
|
||
</view>
|
||
|
||
<view class="city-section" v-if="activeCity || masterCity">
|
||
<text class="city-section-label">当前定位 / 常驻</text>
|
||
<view class="city-chips">
|
||
<view
|
||
class="city-chip active clickable-hover"
|
||
v-if="activeCity"
|
||
@tap="jumpToCity(activeCity)"
|
||
>
|
||
<text class="city-chip-txt">{{ activeCity }}</text>
|
||
</view>
|
||
<view
|
||
class="city-chip clickable-hover"
|
||
v-if="masterCity && masterCity !== activeCity"
|
||
@tap="jumpToCity(masterCity)"
|
||
>
|
||
<text class="city-chip-txt">{{ masterCity }}(常驻)</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="city-section" v-if="activeCities.length">
|
||
<text class="city-section-label">当前有待接工单城市</text>
|
||
<view class="city-chips">
|
||
<view
|
||
class="city-chip clickable-hover"
|
||
v-for="ac in activeCities"
|
||
:key="ac.city"
|
||
:class="{ active: activeCity === ac.city }"
|
||
@tap="jumpToCity(ac.city)"
|
||
>
|
||
<text class="city-chip-txt">{{ ac.city }}</text>
|
||
<text class="city-chip-badge">{{ ac.order_count }}单</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="city-all-btn clickable-hover" @tap="openFullRegionPicker">
|
||
<text class="city-all-txt">选择全国其他省 / 市 / 区县</text>
|
||
<image class="city-all-arrow" src="/static/icons/master/hall-arrow-right-orange.svg" mode="aspectFit" />
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 复用全站真实全国行政区划三级选择器 -->
|
||
<RegionPickerDrawer
|
||
v-model:visible="showRegionDrawer"
|
||
:city="activeCity"
|
||
@confirm="onRegionConfirm"
|
||
/>
|
||
<YjyfPrivacyPopup />
|
||
</view>
|
||
</template>
|
||
|
||
<script setup>
|
||
import { ref, computed, nextTick, onBeforeUnmount } from 'vue';
|
||
import { onLoad } from '@dcloudio/uni-app';
|
||
import api from '@/utils/api.js';
|
||
import { isLogin, toLogin } from '@/utils/request.js';
|
||
import RegionPickerDrawer from '@/components/RegionPickerDrawer.vue';
|
||
import YjyfPrivacyPopup from '@/components/YjyfPrivacyPopup.vue';
|
||
import {
|
||
checkLocationPermissionStatus,
|
||
getCurrentCoordinates,
|
||
openMiniProgramLocationSettingSync,
|
||
getSavedManualLocation,
|
||
saveManualLocation,
|
||
getRecentLocations,
|
||
saveRecentLocation,
|
||
removeRecentLocation,
|
||
clearRecentLocations,
|
||
loadTiandituScript
|
||
} from '@/utils/location.js';
|
||
|
||
const radiusOptions = [5, 10, 15, 20, 30, 50];
|
||
const poiTabs = [
|
||
{ key: 'all', name: '全部周边' },
|
||
{ key: 'residential', name: '住宅小区' },
|
||
{ key: 'office', name: '写字楼宇' },
|
||
{ key: 'plaza', name: '商圈广场' },
|
||
{ key: 'saved', name: '常用与历史' }
|
||
];
|
||
|
||
const selectedLat = ref('');
|
||
const selectedLng = ref('');
|
||
const selectedName = ref('');
|
||
const selectedAddress = ref('');
|
||
const activeCity = ref('');
|
||
const selectedDistrict = ref('');
|
||
const masterCity = ref('');
|
||
const serveRadius = ref(15);
|
||
const locationSource = ref(''); // realtime | drag | search | saved | city
|
||
const locationStatus = ref('prompt');
|
||
|
||
const activeTab = ref('all');
|
||
const nearbyList = ref([]);
|
||
const selectedPoiIdx = ref(0);
|
||
const loadingNearby = ref(false);
|
||
const nearbyError = ref('');
|
||
|
||
const orderStats = ref({
|
||
serve_radius: 15,
|
||
in_radius_count: 0,
|
||
city_order_count: 0,
|
||
total_order_count: 0
|
||
});
|
||
const activeCities = ref([]);
|
||
const recentLocations = ref(getRecentLocations());
|
||
const addressBookList = ref([]);
|
||
|
||
const searchKeyword = ref('');
|
||
const searchResults = ref([]);
|
||
const searching = ref(false);
|
||
const searchError = ref('');
|
||
|
||
const locating = ref(false);
|
||
const saving = ref(false);
|
||
const mapCollapsed = ref(false);
|
||
const mapDragging = ref(false);
|
||
const showCityDrawer = ref(false);
|
||
const showRegionDrawer = ref(false);
|
||
|
||
// #ifdef H5
|
||
const h5MapState = ref('idle'); // idle | loading | ready | error
|
||
let h5Map = null;
|
||
let h5Circle = null;
|
||
// #endif
|
||
|
||
let searchTimer = null;
|
||
let dragTimer = null;
|
||
let contextSeq = 0;
|
||
let programmaticLockUntil = 0;
|
||
|
||
const hasSelectedCoord = computed(() => {
|
||
const lat = Number(selectedLat.value);
|
||
const lng = Number(selectedLng.value);
|
||
return Number.isFinite(lat) && Number.isFinite(lng) && (Math.abs(lat) > 0.0001 || Math.abs(lng) > 0.0001);
|
||
});
|
||
|
||
const inSearchMode = computed(() => searchKeyword.value.trim().length > 0);
|
||
|
||
const displayCityShort = computed(() => {
|
||
const c = (activeCity.value || masterCity.value || '选城市').trim();
|
||
return c.length > 5 ? c.slice(0, 5) : c;
|
||
});
|
||
|
||
const sourceBadgeText = computed(() => {
|
||
const map = {
|
||
realtime: '实时定位',
|
||
drag: '地图选点',
|
||
search: '搜索选定',
|
||
saved: '常用位置',
|
||
city: '城市中心'
|
||
};
|
||
return map[locationSource.value] || '';
|
||
});
|
||
|
||
const mpMapScale = computed(() => {
|
||
const r = serveRadius.value;
|
||
if (r <= 5) return 13;
|
||
if (r <= 15) return 12;
|
||
if (r <= 30) return 11;
|
||
return 10;
|
||
});
|
||
|
||
const mpCircles = computed(() => {
|
||
if (!hasSelectedCoord.value) return [];
|
||
return [
|
||
{
|
||
latitude: Number(selectedLat.value),
|
||
longitude: Number(selectedLng.value),
|
||
color: '#F0710D99',
|
||
fillColor: '#F0710D1F',
|
||
radius: serveRadius.value * 1000,
|
||
strokeWidth: 2
|
||
}
|
||
];
|
||
});
|
||
|
||
function getZoomForRadius(r) {
|
||
if (r <= 5) return 13;
|
||
if (r <= 10) return 12;
|
||
if (r <= 20) return 11;
|
||
if (r <= 35) return 10;
|
||
return 9;
|
||
}
|
||
|
||
function isSamePoint(lat, lng) {
|
||
if (!hasSelectedCoord.value) return false;
|
||
const aLat = Number(selectedLat.value);
|
||
const aLng = Number(selectedLng.value);
|
||
const bLat = Number(lat);
|
||
const bLng = Number(lng);
|
||
return Math.abs(aLat - bLat) < 0.0002 && Math.abs(aLng - bLng) < 0.0002;
|
||
}
|
||
|
||
function isPoiSelected(poi, idx) {
|
||
if (selectedPoiIdx.value === idx) return true;
|
||
return isSamePoint(poi.lat, poi.lng) && selectedName.value === poi.name;
|
||
}
|
||
|
||
// #ifdef H5
|
||
async function initH5Map(forceRetry = false) {
|
||
if (!hasSelectedCoord.value || mapCollapsed.value) return;
|
||
if (h5Map && !forceRetry) {
|
||
syncH5MapView(false);
|
||
return;
|
||
}
|
||
h5MapState.value = 'loading';
|
||
try {
|
||
const T = await loadTiandituScript();
|
||
await nextTick();
|
||
const container = document.getElementById('yjyf-tianditu-map');
|
||
if (!container) {
|
||
h5MapState.value = 'error';
|
||
return;
|
||
}
|
||
if (h5Map) {
|
||
try {
|
||
h5Map.clearOverLays && h5Map.clearOverLays();
|
||
} catch (e) {}
|
||
h5Map = null;
|
||
h5Circle = null;
|
||
}
|
||
const map = new T.Map('yjyf-tianditu-map');
|
||
const centerPt = new T.LngLat(Number(selectedLng.value), Number(selectedLat.value));
|
||
programmaticLockUntil = Date.now() + 700;
|
||
map.centerAndZoom(centerPt, 15);
|
||
map.enableDrag && map.enableDrag();
|
||
map.enableScrollWheelZoom && map.enableScrollWheelZoom();
|
||
|
||
map.addEventListener('dragstart', () => {
|
||
mapDragging.value = true;
|
||
});
|
||
map.addEventListener('moveend', () => {
|
||
mapDragging.value = false;
|
||
if (Date.now() < programmaticLockUntil) return;
|
||
const c = map.getCenter && map.getCenter();
|
||
if (!c) return;
|
||
const nextLat = Number(Number(c.getLat ? c.getLat() : c.lat).toFixed(6));
|
||
const nextLng = Number(Number(c.getLng ? c.getLng() : c.lng).toFixed(6));
|
||
if (!Number.isFinite(nextLat) || !Number.isFinite(nextLng)) return;
|
||
if (Math.abs(nextLat - Number(selectedLat.value)) < 0.00015 && Math.abs(nextLng - Number(selectedLng.value)) < 0.00015) {
|
||
return;
|
||
}
|
||
onMapCenterDragged(nextLat, nextLng);
|
||
});
|
||
|
||
h5Map = map;
|
||
h5MapState.value = 'ready';
|
||
drawH5ServiceCircle(T);
|
||
} catch (e) {
|
||
h5MapState.value = 'error';
|
||
}
|
||
}
|
||
|
||
function drawH5ServiceCircle(TInstance) {
|
||
const T = TInstance || (typeof window !== 'undefined' ? window.T : null);
|
||
if (!h5Map || !T || !hasSelectedCoord.value) return;
|
||
try {
|
||
if (h5Circle) {
|
||
h5Map.removeOverLay(h5Circle);
|
||
h5Circle = null;
|
||
}
|
||
const center = new T.LngLat(Number(selectedLng.value), Number(selectedLat.value));
|
||
h5Circle = new T.Circle(center, serveRadius.value * 1000, {
|
||
color: '#F0710D',
|
||
weight: 2,
|
||
opacity: 0.72,
|
||
fillColor: '#F0710D',
|
||
fillOpacity: 0.14
|
||
});
|
||
h5Map.addOverLay(h5Circle);
|
||
} catch (e) {}
|
||
}
|
||
|
||
function syncH5MapView(adjustZoomForRadius = false) {
|
||
if (!hasSelectedCoord.value) return;
|
||
if (!h5Map) {
|
||
initH5Map();
|
||
return;
|
||
}
|
||
const T = typeof window !== 'undefined' ? window.T : null;
|
||
if (!T) return;
|
||
try {
|
||
programmaticLockUntil = Date.now() + 700;
|
||
const pt = new T.LngLat(Number(selectedLng.value), Number(selectedLat.value));
|
||
if (adjustZoomForRadius) {
|
||
h5Map.centerAndZoom(pt, getZoomForRadius(serveRadius.value));
|
||
} else {
|
||
h5Map.panTo(pt);
|
||
}
|
||
drawH5ServiceCircle(T);
|
||
} catch (e) {}
|
||
}
|
||
// #endif
|
||
|
||
// #ifdef MP-WEIXIN
|
||
function onMpRegionChange(e) {
|
||
if (!e) return;
|
||
if (e.type === 'begin') {
|
||
mapDragging.value = true;
|
||
return;
|
||
}
|
||
if (e.type === 'end') {
|
||
mapDragging.value = false;
|
||
if (Date.now() < programmaticLockUntil) return;
|
||
const ctx = uni.createMapContext('yjyf-mp-map');
|
||
if (!ctx || typeof ctx.getCenterLocation !== 'function') return;
|
||
ctx.getCenterLocation({
|
||
success: (res) => {
|
||
const lat = Number(Number(res.latitude).toFixed(6));
|
||
const lng = Number(Number(res.longitude).toFixed(6));
|
||
if (Number.isFinite(lat) && Number.isFinite(lng)) {
|
||
onMapCenterDragged(lat, lng);
|
||
}
|
||
}
|
||
});
|
||
}
|
||
}
|
||
// #endif
|
||
|
||
function onMapCenterDragged(lat, lng) {
|
||
selectedLat.value = lat;
|
||
selectedLng.value = lng;
|
||
locationSource.value = 'drag';
|
||
selectedPoiIdx.value = 0;
|
||
// #ifdef H5
|
||
drawH5ServiceCircle();
|
||
// #endif
|
||
if (dragTimer) clearTimeout(dragTimer);
|
||
dragTimer = setTimeout(() => {
|
||
if (activeTab.value === 'saved') {
|
||
activeTab.value = 'all';
|
||
}
|
||
loadLocationContext(true);
|
||
}, 320);
|
||
}
|
||
|
||
function toggleMapCollapsed() {
|
||
mapCollapsed.value = !mapCollapsed.value;
|
||
// #ifdef H5
|
||
if (!mapCollapsed.value && hasSelectedCoord.value) {
|
||
nextTick(() => {
|
||
setTimeout(() => {
|
||
if (h5Map && typeof h5Map.checkResize === 'function') {
|
||
h5Map.checkResize();
|
||
syncH5MapView(false);
|
||
} else {
|
||
initH5Map();
|
||
}
|
||
}, 180);
|
||
});
|
||
}
|
||
// #endif
|
||
}
|
||
|
||
async function loadLocationContext(updateAnchorFromCenter = true) {
|
||
const seq = ++contextSeq;
|
||
const category = activeTab.value === 'saved' ? 'all' : activeTab.value;
|
||
if (activeTab.value !== 'saved') {
|
||
loadingNearby.value = true;
|
||
nearbyError.value = '';
|
||
}
|
||
try {
|
||
const params = {
|
||
category,
|
||
serve_radius: serveRadius.value
|
||
};
|
||
if (hasSelectedCoord.value) {
|
||
params.lat = selectedLat.value;
|
||
params.lng = selectedLng.value;
|
||
}
|
||
if (activeCity.value) {
|
||
params.city = activeCity.value;
|
||
}
|
||
const res = await api.masterLocationContext(params);
|
||
if (seq !== contextSeq || !res) return;
|
||
|
||
if (Array.isArray(res.active_cities)) {
|
||
activeCities.value = res.active_cities;
|
||
}
|
||
if (res.master_city) {
|
||
masterCity.value = res.master_city;
|
||
}
|
||
if (res.order_stats) {
|
||
orderStats.value = res.order_stats;
|
||
}
|
||
|
||
if (!hasSelectedCoord.value && res.has_coord && res.lat && res.lng) {
|
||
selectedLat.value = res.lat;
|
||
selectedLng.value = res.lng;
|
||
if (!locationSource.value) {
|
||
locationSource.value = 'saved';
|
||
}
|
||
}
|
||
|
||
if (res.center && updateAnchorFromCenter) {
|
||
if (res.center.city) activeCity.value = res.center.city;
|
||
if (res.center.district) selectedDistrict.value = res.center.district;
|
||
selectedName.value = res.center.name || res.center.poi || res.center.district || activeCity.value || '已选位置';
|
||
selectedAddress.value = res.center.address || res.center.formatted_address || '';
|
||
}
|
||
|
||
nearbyList.value = Array.isArray(res.nearby_list) ? res.nearby_list : [];
|
||
selectedPoiIdx.value = 0;
|
||
|
||
// #ifdef H5
|
||
if (hasSelectedCoord.value && !mapCollapsed.value) {
|
||
nextTick(() => initH5Map());
|
||
}
|
||
// #endif
|
||
} catch (e) {
|
||
if (seq === contextSeq && activeTab.value !== 'saved') {
|
||
nearbyError.value = e?.msg || e?.message || '周边地标加载失败';
|
||
}
|
||
} finally {
|
||
if (seq === contextSeq) {
|
||
loadingNearby.value = false;
|
||
}
|
||
}
|
||
}
|
||
|
||
async function refreshOrderStats() {
|
||
if (!hasSelectedCoord.value && !activeCity.value) return;
|
||
try {
|
||
const res = await api.masterLocationStats({
|
||
lat: hasSelectedCoord.value ? selectedLat.value : '',
|
||
lng: hasSelectedCoord.value ? selectedLng.value : '',
|
||
city: activeCity.value || '',
|
||
serve_radius: serveRadius.value
|
||
});
|
||
if (res) {
|
||
orderStats.value = res;
|
||
}
|
||
} catch (e) {}
|
||
}
|
||
|
||
async function loadSavedExtras() {
|
||
try {
|
||
const [meRes, addrRes] = await Promise.allSettled([
|
||
api.masterInfo(),
|
||
api.addressList()
|
||
]);
|
||
if (meRes.status === 'fulfilled' && meRes.value && meRes.value.master) {
|
||
const m = meRes.value.master;
|
||
if (m.city) masterCity.value = m.city;
|
||
if (!hasSelectedCoord.value && m.lat && m.lng) {
|
||
selectedLat.value = m.lat;
|
||
selectedLng.value = m.lng;
|
||
}
|
||
if (m.serve_radius && Number(m.serve_radius) >= 5 && !serveRadiusChangedByUser) {
|
||
serveRadius.value = Number(m.serve_radius);
|
||
}
|
||
}
|
||
if (addrRes.status === 'fulfilled' && addrRes.value && Array.isArray(addrRes.value.list)) {
|
||
addressBookList.value = addrRes.value.list.slice(0, 6);
|
||
}
|
||
} catch (e) {}
|
||
}
|
||
|
||
let serveRadiusChangedByUser = false;
|
||
|
||
function changeServeRadius(r) {
|
||
if (serveRadius.value === r) return;
|
||
serveRadiusChangedByUser = true;
|
||
serveRadius.value = r;
|
||
// #ifdef H5
|
||
if (hasSelectedCoord.value && !mapCollapsed.value) {
|
||
syncH5MapView(true);
|
||
}
|
||
// #endif
|
||
refreshOrderStats();
|
||
}
|
||
|
||
function switchPoiTab(key) {
|
||
if (activeTab.value === key) return;
|
||
activeTab.value = key;
|
||
if (key !== 'saved') {
|
||
loadLocationContext(false);
|
||
} else {
|
||
recentLocations.value = getRecentLocations();
|
||
}
|
||
}
|
||
|
||
function selectNearbyPoi(poi, idx) {
|
||
if (!poi || !poi.lat || !poi.lng) return;
|
||
selectedPoiIdx.value = idx;
|
||
selectedLat.value = Number(poi.lat);
|
||
selectedLng.value = Number(poi.lng);
|
||
selectedName.value = poi.name || selectedName.value;
|
||
selectedAddress.value = poi.address || selectedAddress.value;
|
||
if (poi.city) activeCity.value = poi.city;
|
||
if (poi.district) selectedDistrict.value = poi.district;
|
||
locationSource.value = poi.is_center ? (locationSource.value || 'drag') : 'search';
|
||
// #ifdef H5
|
||
syncH5MapView(false);
|
||
// #endif
|
||
refreshOrderStats();
|
||
}
|
||
|
||
function onSearchInput() {
|
||
if (searchTimer) clearTimeout(searchTimer);
|
||
const kw = searchKeyword.value.trim();
|
||
if (kw.length < 2) {
|
||
searchResults.value = [];
|
||
searchError.value = '';
|
||
return;
|
||
}
|
||
searchTimer = setTimeout(() => {
|
||
executeSearch();
|
||
}, 360);
|
||
}
|
||
|
||
async function executeSearch() {
|
||
const kw = searchKeyword.value.trim();
|
||
if (kw.length < 2) {
|
||
uni.showToast({ title: '请输入至少 2 个字的地点名称', icon: 'none' });
|
||
return;
|
||
}
|
||
searching.value = true;
|
||
searchError.value = '';
|
||
try {
|
||
const res = await api.masterSearchLocation({
|
||
keyword: kw,
|
||
city: activeCity.value || '',
|
||
lat: hasSelectedCoord.value ? selectedLat.value : '',
|
||
lng: hasSelectedCoord.value ? selectedLng.value : ''
|
||
});
|
||
searchResults.value = (res && Array.isArray(res.list)) ? res.list : [];
|
||
} catch (e) {
|
||
searchError.value = e?.msg || e?.message || '地点搜索失败,请重试';
|
||
searchResults.value = [];
|
||
} finally {
|
||
searching.value = false;
|
||
}
|
||
}
|
||
|
||
function clearSearch() {
|
||
if (searchTimer) {
|
||
clearTimeout(searchTimer);
|
||
searchTimer = null;
|
||
}
|
||
searchKeyword.value = '';
|
||
searchResults.value = [];
|
||
searchError.value = '';
|
||
}
|
||
|
||
async function pickSearchResult(item) {
|
||
if (!item || !item.lat || !item.lng) return;
|
||
selectedLat.value = Number(item.lat);
|
||
selectedLng.value = Number(item.lng);
|
||
selectedName.value = item.name || item.address || '已选位置';
|
||
selectedAddress.value = item.address || '';
|
||
if (item.city) activeCity.value = item.city;
|
||
if (item.district) selectedDistrict.value = item.district;
|
||
locationSource.value = 'search';
|
||
clearSearch();
|
||
if (activeTab.value === 'saved') {
|
||
activeTab.value = 'all';
|
||
}
|
||
// #ifdef H5
|
||
syncH5MapView(false);
|
||
// #endif
|
||
await loadLocationContext(false);
|
||
}
|
||
|
||
async function handleLocateDevice() {
|
||
if (locating.value) return;
|
||
|
||
// #ifdef MP-WEIXIN
|
||
if (locationStatus.value === 'denied') {
|
||
locating.value = true;
|
||
openMiniProgramLocationSettingSync().then(async (res) => {
|
||
locating.value = false;
|
||
if (res && res.ok && res.lat && res.lng) {
|
||
locationStatus.value = 'granted';
|
||
await applyLocatedCoordinates(res.lat, res.lng);
|
||
} else {
|
||
uni.showToast({ title: (res && res.message) || '请在微信设置中开启定位权限', icon: 'none' });
|
||
}
|
||
});
|
||
return;
|
||
}
|
||
// #endif
|
||
|
||
locating.value = true;
|
||
try {
|
||
const res = await getCurrentCoordinates({ timeout: 5500, enableHighAccuracy: true });
|
||
if (res && res.ok && res.lat && res.lng) {
|
||
locationStatus.value = 'granted';
|
||
await applyLocatedCoordinates(res.lat, res.lng);
|
||
uni.showToast({ title: '已定位到当前位置', icon: 'none' });
|
||
} else {
|
||
if (res && res.reason === 'denied') {
|
||
locationStatus.value = 'denied';
|
||
}
|
||
uni.showToast({ title: (res && res.message) || '定位未开启,请搜索或选择城市', icon: 'none' });
|
||
}
|
||
} finally {
|
||
locating.value = false;
|
||
}
|
||
}
|
||
|
||
async function applyLocatedCoordinates(lat, lng) {
|
||
selectedLat.value = Number(lat);
|
||
selectedLng.value = Number(lng);
|
||
locationSource.value = 'realtime';
|
||
if (activeTab.value === 'saved') {
|
||
activeTab.value = 'all';
|
||
}
|
||
// #ifdef H5
|
||
syncH5MapView(false);
|
||
// #endif
|
||
await loadLocationContext(true);
|
||
}
|
||
|
||
function openCityDrawer() {
|
||
showCityDrawer.value = true;
|
||
}
|
||
|
||
function openFullRegionPicker() {
|
||
showCityDrawer.value = false;
|
||
showRegionDrawer.value = true;
|
||
}
|
||
|
||
function onRegionConfirm(reg) {
|
||
if (!reg) return;
|
||
const target = [reg.city || reg.province, reg.district].filter(Boolean).join('');
|
||
if (target) {
|
||
jumpToCity(target, reg.city || reg.province || '');
|
||
}
|
||
}
|
||
|
||
async function jumpToCity(cityQuery, displayCity = '') {
|
||
showCityDrawer.value = false;
|
||
clearSearch();
|
||
uni.showLoading({ title: '定位城市中...' });
|
||
try {
|
||
const res = await api.masterLocateCity({ city: cityQuery });
|
||
if (res && res.lat && res.lng) {
|
||
selectedLat.value = Number(res.lat);
|
||
selectedLng.value = Number(res.lng);
|
||
activeCity.value = displayCity || res.city || cityQuery;
|
||
selectedDistrict.value = res.district || '';
|
||
selectedName.value = res.city || cityQuery;
|
||
selectedAddress.value = res.address || cityQuery;
|
||
locationSource.value = 'city';
|
||
if (activeTab.value === 'saved') {
|
||
activeTab.value = 'all';
|
||
}
|
||
// #ifdef H5
|
||
syncH5MapView(false);
|
||
// #endif
|
||
await loadLocationContext(true);
|
||
}
|
||
} catch (e) {
|
||
uni.showToast({ title: e?.msg || '切换城市失败', icon: 'none' });
|
||
} finally {
|
||
uni.hideLoading();
|
||
}
|
||
}
|
||
|
||
async function selectRecentPlace(rec) {
|
||
if (!rec || !rec.lat || !rec.lng) return;
|
||
selectedLat.value = Number(rec.lat);
|
||
selectedLng.value = Number(rec.lng);
|
||
selectedName.value = rec.name || '常用位置';
|
||
selectedAddress.value = rec.address || '';
|
||
if (rec.city) activeCity.value = rec.city;
|
||
if (rec.district) selectedDistrict.value = rec.district;
|
||
locationSource.value = 'saved';
|
||
activeTab.value = 'all';
|
||
// #ifdef H5
|
||
syncH5MapView(false);
|
||
// #endif
|
||
await loadLocationContext(false);
|
||
}
|
||
|
||
function handleRemoveRecent(key) {
|
||
recentLocations.value = removeRecentLocation(key);
|
||
}
|
||
|
||
function handleClearRecent() {
|
||
recentLocations.value = clearRecentLocations();
|
||
}
|
||
|
||
async function selectAddressBookItem(addr) {
|
||
if (!addr) return;
|
||
if (addr.lat && addr.lng && Number(addr.lat) !== 0) {
|
||
selectedLat.value = Number(addr.lat);
|
||
selectedLng.value = Number(addr.lng);
|
||
selectedName.value = addr.address || '地址簿位置';
|
||
selectedAddress.value = [addr.province, addr.city, addr.district, addr.address].filter(Boolean).join(' ');
|
||
if (addr.city) activeCity.value = addr.city;
|
||
if (addr.district) selectedDistrict.value = addr.district;
|
||
locationSource.value = 'saved';
|
||
activeTab.value = 'all';
|
||
// #ifdef H5
|
||
syncH5MapView(false);
|
||
// #endif
|
||
await loadLocationContext(false);
|
||
return;
|
||
}
|
||
const query = [addr.city, addr.district, addr.address].filter(Boolean).join(' ');
|
||
if (query) {
|
||
searchKeyword.value = query;
|
||
await executeSearch();
|
||
}
|
||
}
|
||
|
||
async function confirmAndSave() {
|
||
if (!hasSelectedCoord.value || saving.value) return;
|
||
saving.value = true;
|
||
const finalLabel = selectedName.value || activeCity.value || '已选位置';
|
||
const payloadCity = activeCity.value || '';
|
||
const payloadDistrict = selectedDistrict.value || '';
|
||
try {
|
||
const res = await api.masterUpdateLocation({
|
||
lat: Number(selectedLat.value),
|
||
lng: Number(selectedLng.value),
|
||
city: payloadCity,
|
||
district: payloadDistrict,
|
||
label: finalLabel,
|
||
serve_radius: serveRadius.value
|
||
});
|
||
const finalCity = (res && res.location_city) || payloadCity;
|
||
const finalRadius = (res && res.serve_radius) || serveRadius.value;
|
||
const savedLabel = finalLabel || (res && res.location_label) || finalCity;
|
||
|
||
saveManualLocation({
|
||
lat: Number(selectedLat.value),
|
||
lng: Number(selectedLng.value),
|
||
label: savedLabel,
|
||
city: finalCity,
|
||
district: (res && res.location_district) || payloadDistrict,
|
||
serveRadius: finalRadius
|
||
});
|
||
recentLocations.value = saveRecentLocation({
|
||
lat: Number(selectedLat.value),
|
||
lng: Number(selectedLng.value),
|
||
name: savedLabel,
|
||
address: selectedAddress.value || [finalCity, payloadDistrict].filter(Boolean).join(' '),
|
||
city: finalCity,
|
||
district: (res && res.location_district) || payloadDistrict
|
||
});
|
||
|
||
uni.$emit('masterLocationUpdated', {
|
||
lat: Number(selectedLat.value),
|
||
lng: Number(selectedLng.value),
|
||
label: savedLabel,
|
||
city: finalCity,
|
||
serveRadius: finalRadius
|
||
});
|
||
|
||
uni.showToast({ title: `已更新位置:${savedLabel}`, icon: 'none' });
|
||
setTimeout(() => {
|
||
const pages = getCurrentPages() || [];
|
||
if (pages.length > 1) {
|
||
uni.navigateBack();
|
||
} else {
|
||
uni.reLaunch({ url: '/pages/master/hall' });
|
||
}
|
||
}, 360);
|
||
} catch (e) {
|
||
uni.showToast({ title: e?.msg || e?.message || '保存位置失败,请重试', icon: 'none' });
|
||
} finally {
|
||
saving.value = false;
|
||
}
|
||
}
|
||
|
||
onLoad(async (query) => {
|
||
if (!isLogin()) {
|
||
toLogin('/pages/master/location');
|
||
return;
|
||
}
|
||
locationStatus.value = await checkLocationPermissionStatus();
|
||
|
||
if (query && query.lat && query.lng && Number(query.lat) !== 0 && Number(query.lng) !== 0) {
|
||
selectedLat.value = Number(query.lat);
|
||
selectedLng.value = Number(query.lng);
|
||
locationSource.value = 'saved';
|
||
} else {
|
||
const cached = getSavedManualLocation();
|
||
if (cached) {
|
||
selectedLat.value = cached.lat;
|
||
selectedLng.value = cached.lng;
|
||
selectedName.value = cached.label || '';
|
||
activeCity.value = cached.city || '';
|
||
if (cached.serveRadius) {
|
||
serveRadius.value = cached.serveRadius;
|
||
}
|
||
locationSource.value = 'saved';
|
||
}
|
||
}
|
||
|
||
if (query && query.city) activeCity.value = decodeURIComponent(query.city);
|
||
if (query && query.label) selectedName.value = decodeURIComponent(query.label);
|
||
if (query && query.radius && Number(query.radius) >= 5) {
|
||
serveRadius.value = Number(query.radius);
|
||
serveRadiusChangedByUser = true;
|
||
}
|
||
|
||
await loadSavedExtras();
|
||
await loadLocationContext(!selectedName.value);
|
||
});
|
||
|
||
onBeforeUnmount(() => {
|
||
if (searchTimer) clearTimeout(searchTimer);
|
||
if (dragTimer) clearTimeout(dragTimer);
|
||
// #ifdef H5
|
||
h5Map = null;
|
||
h5Circle = null;
|
||
// #endif
|
||
});
|
||
</script>
|
||
|
||
<style lang="scss" scoped>
|
||
@import '@/uni.scss';
|
||
|
||
.location-page {
|
||
height: 100vh;
|
||
height: 100dvh;
|
||
display: flex;
|
||
flex-direction: column;
|
||
overflow: hidden;
|
||
background: $yjyf-bg-page;
|
||
width: 100%;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
/* 2. 顶部搜索与城市切换栏 */
|
||
.search-header {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: $yjyf-space-sm;
|
||
padding: 16rpx $yjyf-space-md;
|
||
background: $yjyf-bg-card;
|
||
border-bottom: 1rpx solid $yjyf-border-color;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.city-pill {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 6rpx;
|
||
height: 68rpx;
|
||
padding: 0 18rpx;
|
||
background: $yjyf-bg-page;
|
||
border-radius: $yjyf-radius-pill;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.city-pill-txt {
|
||
font-size: 26rpx;
|
||
font-weight: 600;
|
||
color: $yjyf-text-main;
|
||
max-width: 140rpx;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.city-caret {
|
||
width: 22rpx;
|
||
height: 22rpx;
|
||
}
|
||
|
||
.search-input-box {
|
||
flex: 1;
|
||
min-width: 0;
|
||
height: 68rpx;
|
||
background: $yjyf-bg-page;
|
||
border-radius: $yjyf-radius-pill;
|
||
padding: 0 16rpx 0 22rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 10rpx;
|
||
}
|
||
|
||
.search-ico {
|
||
width: 28rpx;
|
||
height: 28rpx;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.search-input {
|
||
flex: 1;
|
||
min-width: 0;
|
||
height: 68rpx;
|
||
font-size: 26rpx;
|
||
color: $yjyf-text-main;
|
||
}
|
||
|
||
.search-ph {
|
||
color: $yjyf-text-muted;
|
||
font-size: 25rpx;
|
||
}
|
||
|
||
.clear-btn {
|
||
padding: 8rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
.clear-ico {
|
||
width: 28rpx;
|
||
height: 28rpx;
|
||
}
|
||
|
||
.search-action {
|
||
height: 68rpx;
|
||
padding: 0 22rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
background: $yjyf-bg-page;
|
||
flex-shrink: 0;
|
||
|
||
&.primary {
|
||
background: $yjyf-gradient-primary;
|
||
}
|
||
}
|
||
|
||
.search-action-txt {
|
||
font-size: 25rpx;
|
||
font-weight: 600;
|
||
color: $yjyf-text-regular;
|
||
|
||
&.primary {
|
||
color: $yjyf-text-inverse;
|
||
}
|
||
}
|
||
|
||
/* 3. 搜索模式面板 */
|
||
.search-mode-panel {
|
||
flex: 1;
|
||
height: 0;
|
||
display: flex;
|
||
flex-direction: column;
|
||
background: $yjyf-bg-card;
|
||
}
|
||
|
||
.search-scope-bar {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
padding: 16rpx $yjyf-space-lg;
|
||
background: $yjyf-primary-bg;
|
||
border-bottom: 1rpx solid $yjyf-border-color;
|
||
}
|
||
|
||
.scope-txt {
|
||
font-size: $yjyf-font-sub;
|
||
color: $yjyf-text-regular;
|
||
}
|
||
|
||
.scope-switch {
|
||
font-size: $yjyf-font-sub;
|
||
color: $yjyf-primary;
|
||
font-weight: 600;
|
||
}
|
||
|
||
.search-scroll {
|
||
flex: 1;
|
||
height: 0;
|
||
}
|
||
|
||
/* 4A. 交互式地图区 */
|
||
.map-stage {
|
||
position: relative;
|
||
width: 100%;
|
||
height: 410rpx;
|
||
background: #EAECEF;
|
||
flex-shrink: 0;
|
||
overflow: hidden;
|
||
transition: height 0.25s ease;
|
||
|
||
&.collapsed {
|
||
height: 92rpx;
|
||
}
|
||
}
|
||
|
||
.map-placeholder {
|
||
width: 100%;
|
||
height: 100%;
|
||
background: $yjyf-primary-bg;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
justify-content: center;
|
||
padding: 24rpx $yjyf-space-lg;
|
||
text-align: center;
|
||
}
|
||
|
||
.map-ph-ico {
|
||
width: 56rpx;
|
||
height: 56rpx;
|
||
margin-bottom: 10rpx;
|
||
}
|
||
|
||
.map-ph-title {
|
||
font-size: 28rpx;
|
||
font-weight: 700;
|
||
color: $yjyf-text-main;
|
||
margin-bottom: 6rpx;
|
||
}
|
||
|
||
.map-ph-sub {
|
||
font-size: $yjyf-font-sub;
|
||
color: $yjyf-text-secondary;
|
||
margin-bottom: 20rpx;
|
||
}
|
||
|
||
.map-ph-actions {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 16rpx;
|
||
}
|
||
|
||
.map-ph-btn {
|
||
height: 64rpx;
|
||
padding: 0 28rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: $yjyf-bg-card;
|
||
border: 1rpx solid $yjyf-primary-border;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
|
||
&.primary {
|
||
background: $yjyf-gradient-primary;
|
||
border-color: transparent;
|
||
}
|
||
}
|
||
|
||
.map-ph-btn-txt {
|
||
font-size: 24rpx;
|
||
font-weight: 600;
|
||
color: $yjyf-primary;
|
||
|
||
&.primary {
|
||
color: $yjyf-text-inverse;
|
||
}
|
||
}
|
||
|
||
.h5-map-wrap,
|
||
.mp-map-canvas {
|
||
position: relative;
|
||
width: 100%;
|
||
height: 100%;
|
||
}
|
||
|
||
.h5-map-canvas {
|
||
display: block;
|
||
width: 100%;
|
||
height: 100%;
|
||
}
|
||
|
||
.map-loading-mask,
|
||
.map-fallback-card {
|
||
position: absolute;
|
||
inset: 0;
|
||
background: rgba(245, 246, 248, 0.94);
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
justify-content: center;
|
||
z-index: 4;
|
||
padding: 20rpx;
|
||
}
|
||
|
||
.map-loading-txt,
|
||
.mf-coord {
|
||
font-size: 24rpx;
|
||
color: $yjyf-text-secondary;
|
||
margin-top: 8rpx;
|
||
}
|
||
|
||
.mf-title {
|
||
font-size: 28rpx;
|
||
font-weight: 600;
|
||
color: $yjyf-text-main;
|
||
}
|
||
|
||
.mf-btn {
|
||
margin-top: 18rpx;
|
||
padding: 12rpx 28rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: $yjyf-primary-bg;
|
||
border: 1rpx solid $yjyf-primary-border;
|
||
}
|
||
|
||
.mf-btn-txt {
|
||
font-size: 24rpx;
|
||
font-weight: 600;
|
||
color: $yjyf-primary;
|
||
}
|
||
|
||
.center-pin-wrap {
|
||
position: absolute;
|
||
left: 50%;
|
||
top: 50%;
|
||
transform: translate(-50%, -88%);
|
||
z-index: 6;
|
||
pointer-events: none;
|
||
transition: transform 0.16s ease;
|
||
|
||
&.moving {
|
||
transform: translate(-50%, -112%) scale(1.06);
|
||
}
|
||
}
|
||
|
||
.center-pin-ico {
|
||
width: 68rpx;
|
||
height: 86rpx;
|
||
}
|
||
|
||
.map-stats-pill {
|
||
position: absolute;
|
||
left: 20rpx;
|
||
top: 20rpx;
|
||
z-index: 7;
|
||
background: rgba(31, 31, 31, 0.78);
|
||
padding: 10rpx 20rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
}
|
||
|
||
.map-stats-txt {
|
||
font-size: $yjyf-font-micro;
|
||
font-weight: 600;
|
||
color: $yjyf-text-inverse;
|
||
}
|
||
|
||
.map-collapse-pill {
|
||
position: absolute;
|
||
right: 20rpx;
|
||
top: 20rpx;
|
||
z-index: 7;
|
||
background: rgba(255, 255, 255, 0.94);
|
||
border: 1rpx solid $yjyf-border-color;
|
||
padding: 10rpx 18rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 6rpx;
|
||
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
|
||
}
|
||
|
||
.collapse-ico {
|
||
width: 24rpx;
|
||
height: 24rpx;
|
||
transition: transform 0.2s ease;
|
||
|
||
&.down {
|
||
transform: rotate(180deg);
|
||
}
|
||
}
|
||
|
||
.collapse-txt {
|
||
font-size: $yjyf-font-micro;
|
||
font-weight: 600;
|
||
color: $yjyf-text-regular;
|
||
}
|
||
|
||
.recenter-btn {
|
||
position: absolute;
|
||
right: 20rpx;
|
||
bottom: 20rpx;
|
||
z-index: 7;
|
||
width: 76rpx;
|
||
height: 76rpx;
|
||
border-radius: 50%;
|
||
background: rgba(255, 255, 255, 0.96);
|
||
border: 1rpx solid $yjyf-border-color;
|
||
box-shadow: 0 6rpx 18rpx rgba(0, 0, 0, 0.12);
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
.recenter-ico {
|
||
width: 38rpx;
|
||
height: 38rpx;
|
||
}
|
||
|
||
/* 4B. 选中位置详情与服务半径卡片 */
|
||
.anchor-card {
|
||
background: $yjyf-bg-card;
|
||
padding: 20rpx $yjyf-space-md;
|
||
border-bottom: 1rpx solid $yjyf-border-color;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.anchor-top {
|
||
display: flex;
|
||
align-items: flex-start;
|
||
justify-content: space-between;
|
||
gap: 16rpx;
|
||
padding-bottom: 16rpx;
|
||
border-bottom: 1rpx solid $yjyf-border-color;
|
||
}
|
||
|
||
.anchor-info {
|
||
flex: 1;
|
||
min-width: 0;
|
||
}
|
||
|
||
.anchor-title-row {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 12rpx;
|
||
flex-wrap: wrap;
|
||
}
|
||
|
||
.anchor-name {
|
||
font-size: 30rpx;
|
||
font-weight: 700;
|
||
color: $yjyf-text-main;
|
||
line-height: 1.35;
|
||
}
|
||
|
||
.anchor-source {
|
||
font-size: $yjyf-font-micro;
|
||
color: $yjyf-primary;
|
||
background: $yjyf-primary-bg;
|
||
border: 1rpx solid $yjyf-primary-border;
|
||
padding: 2rpx 12rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
font-weight: 600;
|
||
}
|
||
|
||
.anchor-addr {
|
||
display: block;
|
||
margin-top: 6rpx;
|
||
font-size: $yjyf-font-sub;
|
||
color: $yjyf-text-secondary;
|
||
line-height: 1.4;
|
||
}
|
||
|
||
.anchor-relocate {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 6rpx;
|
||
padding: 10rpx 18rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: $yjyf-primary-bg;
|
||
border: 1rpx solid $yjyf-primary-border;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.relocate-ico {
|
||
width: 26rpx;
|
||
height: 26rpx;
|
||
}
|
||
|
||
.relocate-txt {
|
||
font-size: $yjyf-font-micro;
|
||
font-weight: 600;
|
||
color: $yjyf-primary;
|
||
}
|
||
|
||
.radius-box {
|
||
padding-top: 14rpx;
|
||
}
|
||
|
||
.radius-head {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
gap: 12rpx;
|
||
margin-bottom: 12rpx;
|
||
}
|
||
|
||
.radius-label-wrap {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 8rpx;
|
||
}
|
||
|
||
.radius-ico {
|
||
width: 28rpx;
|
||
height: 28rpx;
|
||
}
|
||
|
||
.radius-label {
|
||
font-size: 25rpx;
|
||
font-weight: 600;
|
||
color: $yjyf-text-main;
|
||
}
|
||
|
||
.radius-summary {
|
||
font-size: $yjyf-font-micro;
|
||
color: $yjyf-primary;
|
||
font-weight: 600;
|
||
}
|
||
|
||
.radius-chips {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 12rpx;
|
||
flex-wrap: wrap;
|
||
}
|
||
|
||
.radius-chip {
|
||
padding: 8rpx 20rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: $yjyf-bg-page;
|
||
border: 1rpx solid transparent;
|
||
|
||
&.active {
|
||
background: $yjyf-primary-bg;
|
||
border-color: $yjyf-primary-border;
|
||
|
||
.radius-chip-txt {
|
||
color: $yjyf-primary;
|
||
font-weight: 700;
|
||
}
|
||
}
|
||
}
|
||
|
||
.radius-chip-txt {
|
||
font-size: $yjyf-font-micro;
|
||
color: $yjyf-text-regular;
|
||
}
|
||
|
||
/* 4C. 周边地标与常用位置 Tab 区 */
|
||
.poi-section {
|
||
flex: 1;
|
||
height: 0;
|
||
display: flex;
|
||
flex-direction: column;
|
||
background: $yjyf-bg-card;
|
||
margin-top: $yjyf-space-sm;
|
||
}
|
||
|
||
.poi-tabs-scroll {
|
||
width: 100%;
|
||
white-space: nowrap;
|
||
border-bottom: 1rpx solid $yjyf-border-color;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.poi-tabs {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
padding: 0 $yjyf-space-md;
|
||
gap: 28rpx;
|
||
}
|
||
|
||
.poi-tab {
|
||
position: relative;
|
||
padding: 20rpx 4rpx;
|
||
flex-shrink: 0;
|
||
|
||
&.active {
|
||
.poi-tab-txt {
|
||
color: $yjyf-primary;
|
||
font-weight: 700;
|
||
}
|
||
|
||
&::after {
|
||
content: '';
|
||
position: absolute;
|
||
left: 0;
|
||
right: 0;
|
||
bottom: 0;
|
||
height: 5rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: $yjyf-primary;
|
||
}
|
||
}
|
||
}
|
||
|
||
.poi-tab-txt {
|
||
font-size: 26rpx;
|
||
color: $yjyf-text-secondary;
|
||
}
|
||
|
||
.poi-list-scroll {
|
||
flex: 1;
|
||
height: 0;
|
||
}
|
||
|
||
.poi-list,
|
||
.search-list {
|
||
padding: 8rpx $yjyf-space-md 24rpx;
|
||
}
|
||
|
||
.poi-row {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 16rpx;
|
||
padding: 22rpx 0;
|
||
border-bottom: 1rpx solid $yjyf-border-color;
|
||
|
||
&:last-child {
|
||
border-bottom: none;
|
||
}
|
||
|
||
&.active {
|
||
.poi-name {
|
||
color: $yjyf-primary;
|
||
font-weight: 700;
|
||
}
|
||
}
|
||
}
|
||
|
||
.poi-ico {
|
||
width: 34rpx;
|
||
height: 34rpx;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.poi-main {
|
||
flex: 1;
|
||
min-width: 0;
|
||
}
|
||
|
||
.poi-top {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 10rpx;
|
||
}
|
||
|
||
.poi-center-badge {
|
||
font-size: 20rpx;
|
||
color: $yjyf-primary;
|
||
background: $yjyf-primary-bg;
|
||
padding: 2rpx 10rpx;
|
||
border-radius: 8rpx;
|
||
font-weight: 600;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.poi-name {
|
||
font-size: 27rpx;
|
||
font-weight: 600;
|
||
color: $yjyf-text-main;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.poi-addr {
|
||
display: block;
|
||
margin-top: 6rpx;
|
||
font-size: 23rpx;
|
||
color: $yjyf-text-secondary;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.poi-dist {
|
||
font-size: $yjyf-font-micro;
|
||
color: $yjyf-text-muted;
|
||
flex-shrink: 0;
|
||
|
||
&.active {
|
||
color: $yjyf-primary;
|
||
font-weight: 600;
|
||
}
|
||
}
|
||
|
||
.poi-pick-tag {
|
||
font-size: $yjyf-font-micro;
|
||
font-weight: 600;
|
||
color: $yjyf-primary;
|
||
background: $yjyf-primary-bg;
|
||
padding: 8rpx 18rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
/* 常用与历史列表样式 */
|
||
.history-pane {
|
||
padding: 16rpx $yjyf-space-md 28rpx;
|
||
}
|
||
|
||
.saved-block {
|
||
margin-bottom: 24rpx;
|
||
}
|
||
|
||
.saved-block-head {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
}
|
||
|
||
.saved-block-title {
|
||
display: block;
|
||
font-size: 24rpx;
|
||
font-weight: 700;
|
||
color: $yjyf-text-secondary;
|
||
margin-bottom: 12rpx;
|
||
}
|
||
|
||
.saved-clear {
|
||
font-size: 23rpx;
|
||
color: $yjyf-text-muted;
|
||
margin-bottom: 12rpx;
|
||
}
|
||
|
||
.saved-city-row {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 16rpx;
|
||
padding: 20rpx;
|
||
background: $yjyf-primary-bg;
|
||
border: 1rpx solid $yjyf-primary-border;
|
||
border-radius: $yjyf-radius-sm;
|
||
}
|
||
|
||
.saved-ico {
|
||
width: 36rpx;
|
||
height: 36rpx;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.saved-info {
|
||
flex: 1;
|
||
min-width: 0;
|
||
}
|
||
|
||
.saved-name {
|
||
display: block;
|
||
font-size: 27rpx;
|
||
font-weight: 700;
|
||
color: $yjyf-text-main;
|
||
}
|
||
|
||
.saved-sub {
|
||
display: block;
|
||
margin-top: 4rpx;
|
||
font-size: $yjyf-font-micro;
|
||
color: $yjyf-text-secondary;
|
||
}
|
||
|
||
.saved-action {
|
||
font-size: 23rpx;
|
||
font-weight: 600;
|
||
color: $yjyf-primary;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.saved-empty {
|
||
padding: 28rpx 20rpx;
|
||
background: $yjyf-bg-page;
|
||
border-radius: $yjyf-radius-sm;
|
||
text-align: center;
|
||
}
|
||
|
||
.saved-empty-txt {
|
||
font-size: 23rpx;
|
||
color: $yjyf-text-muted;
|
||
}
|
||
|
||
.rec-del-btn {
|
||
padding: 12rpx;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.rec-del-ico {
|
||
width: 28rpx;
|
||
height: 28rpx;
|
||
}
|
||
|
||
/* 状态盒 */
|
||
.state-box {
|
||
padding: 88rpx $yjyf-space-lg;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
text-align: center;
|
||
|
||
&.compact {
|
||
padding: 56rpx $yjyf-space-lg;
|
||
}
|
||
}
|
||
|
||
.state-ico {
|
||
width: 64rpx;
|
||
height: 64rpx;
|
||
margin-bottom: 16rpx;
|
||
opacity: 0.7;
|
||
}
|
||
|
||
.state-title {
|
||
font-size: 27rpx;
|
||
font-weight: 600;
|
||
color: $yjyf-text-regular;
|
||
}
|
||
|
||
.state-sub {
|
||
margin-top: 8rpx;
|
||
font-size: 23rpx;
|
||
color: $yjyf-text-muted;
|
||
line-height: 1.5;
|
||
}
|
||
|
||
.state-retry {
|
||
margin-top: 20rpx;
|
||
padding: 12rpx 32rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: $yjyf-primary-bg;
|
||
border: 1rpx solid $yjyf-primary-border;
|
||
}
|
||
|
||
.state-retry-txt {
|
||
font-size: 24rpx;
|
||
font-weight: 600;
|
||
color: $yjyf-primary;
|
||
}
|
||
|
||
/* 5. 底部固定确认栏 */
|
||
.bottom-bar {
|
||
flex-shrink: 0;
|
||
background: $yjyf-bg-card;
|
||
border-top: 1rpx solid $yjyf-border-color;
|
||
box-shadow: $yjyf-shadow-bar;
|
||
padding: 16rpx $yjyf-space-lg;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
gap: 20rpx;
|
||
}
|
||
|
||
.bottom-summary {
|
||
flex: 1;
|
||
min-width: 0;
|
||
}
|
||
|
||
.bottom-loc-name {
|
||
display: block;
|
||
font-size: 26rpx;
|
||
font-weight: 700;
|
||
color: $yjyf-text-main;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.bottom-loc-meta {
|
||
display: block;
|
||
margin-top: 4rpx;
|
||
font-size: $yjyf-font-micro;
|
||
color: $yjyf-text-secondary;
|
||
}
|
||
|
||
.confirm-btn {
|
||
height: 80rpx;
|
||
padding: 0 36rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: $yjyf-gradient-primary;
|
||
box-shadow: $yjyf-shadow-button;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
flex-shrink: 0;
|
||
|
||
&.disabled {
|
||
opacity: 0.45;
|
||
box-shadow: none;
|
||
}
|
||
}
|
||
|
||
.confirm-btn-txt {
|
||
font-size: 27rpx;
|
||
font-weight: 700;
|
||
color: $yjyf-text-inverse;
|
||
}
|
||
|
||
/* 6. 切换接单城市抽屉 */
|
||
.city-drawer-mask {
|
||
position: fixed;
|
||
inset: 0;
|
||
z-index: 950;
|
||
background: rgba(15, 23, 42, 0.5);
|
||
display: flex;
|
||
align-items: flex-end;
|
||
}
|
||
|
||
.city-drawer-sheet {
|
||
width: 100%;
|
||
background: $yjyf-bg-card;
|
||
border-radius: $yjyf-radius-lg $yjyf-radius-lg 0 0;
|
||
padding: 28rpx $yjyf-space-lg 36rpx;
|
||
}
|
||
|
||
.city-drawer-hd {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
margin-bottom: 24rpx;
|
||
}
|
||
|
||
.city-drawer-title {
|
||
font-size: 30rpx;
|
||
font-weight: 700;
|
||
color: $yjyf-text-main;
|
||
}
|
||
|
||
.city-drawer-close {
|
||
width: 52rpx;
|
||
height: 52rpx;
|
||
border-radius: 50%;
|
||
background: $yjyf-bg-page;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
.city-drawer-close-ico {
|
||
width: 26rpx;
|
||
height: 26rpx;
|
||
}
|
||
|
||
.city-section {
|
||
margin-bottom: 24rpx;
|
||
}
|
||
|
||
.city-section-label {
|
||
display: block;
|
||
font-size: 23rpx;
|
||
font-weight: 600;
|
||
color: $yjyf-text-secondary;
|
||
margin-bottom: 14rpx;
|
||
}
|
||
|
||
.city-chips {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
gap: 14rpx;
|
||
}
|
||
|
||
.city-chip {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 8rpx;
|
||
padding: 12rpx 24rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: $yjyf-bg-page;
|
||
border: 1rpx solid transparent;
|
||
|
||
&.active {
|
||
background: $yjyf-primary-bg;
|
||
border-color: $yjyf-primary-border;
|
||
|
||
.city-chip-txt {
|
||
color: $yjyf-primary;
|
||
font-weight: 700;
|
||
}
|
||
}
|
||
}
|
||
|
||
.city-chip-txt {
|
||
font-size: 25rpx;
|
||
color: $yjyf-text-main;
|
||
}
|
||
|
||
.city-chip-badge {
|
||
font-size: 20rpx;
|
||
color: $yjyf-primary;
|
||
background: rgba(240, 113, 13, 0.12);
|
||
padding: 2rpx 10rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
}
|
||
|
||
.city-all-btn {
|
||
margin-top: 8rpx;
|
||
padding: 24rpx 28rpx;
|
||
background: $yjyf-bg-page;
|
||
border-radius: $yjyf-radius-md;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
}
|
||
|
||
.city-all-txt {
|
||
font-size: 26rpx;
|
||
font-weight: 600;
|
||
color: $yjyf-primary;
|
||
}
|
||
|
||
.city-all-arrow {
|
||
width: 24rpx;
|
||
height: 24rpx;
|
||
}
|
||
</style>
|