优化城市定位

This commit is contained in:
wangxiaowei
2026-03-19 14:01:40 +08:00
parent ed0ca952e7
commit 1164d9cd45

View File

@ -20,7 +20,7 @@
<view class="mt-52rpx mx-30rpx">
<view class="text-[#333] leading-42rpx text-30rpx font-bold">当前定位</view>
<view class="mt-40rpx">
<view class="bg-[#F8F9FA] rounded-28rpx w-162rpx h-56rpx text-[#606266] flex items-center justify-center">
<view class="bg-[#F8F9FA] rounded-28rpx w-162rpx h-56rpx text-[#606266] flex items-center justify-center" @click="City.handleInitDefaultCity" >
<wd-img width="28rpx" height="28rpx" :src="`${OSS}icon/icon_location2.png`"></wd-img>
<view class="text-26rpx text-[#606266] leading-36rpx">{{ city || LOCATION_DEFAULT_CITY }}</view>
</view>
@ -98,6 +98,16 @@
// uni.setStorageSync(LOCATION_LNG_KEY, item.longitude)
uni.setStorageSync(LOCATION_CITY_KEY, item.name)
router.navigateBack()
},
/**
* 初始化默认城市
*/
handleInitDefaultCity: () => {
City.handleChooseCity({
id: 0,
city: '嘉兴市'
})
}
}