修改首页获取定位

This commit is contained in:
lcc
2025-10-16 09:21:57 +08:00
parent aee5e9af08
commit 4b51d24d21
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -47,6 +47,7 @@ import { useUserStore } from '@/stores/user';
import { useCityStore } from '../stores/city';
import api from '@/utils/api';
import WechatUtils,{ WechatLocation } from '@/utils/wechat'
import { getCookie, setCookie } from '@/utils/cookie'
export default {
name: 'CityChooseList',
data() {
@@ -103,8 +104,8 @@ export default {
};
// localStorage.setItem('cityInfo', JSON.stringify(result.data));
// localStorage.setItem('userLocation', JSON.stringify({ ...location, time: new Date().getTime() }));
setCookie('cityInfo', JSON.stringify(result.data),1);
setCookie('userLocation', JSON.stringify({...location, time: new Date().getTime()},1));
// setCookie('cityInfo', JSON.stringify(result.data),1);
// setCookie('userLocation', JSON.stringify({...location, time: new Date().getTime()},1));
userStore.setCity(result.data);
this.$emit('cityItem',{
cityName: result.data.cityName,
+1 -1
View File
@@ -490,7 +490,7 @@ const handleBrandItem = (item) => {
getProductList();
}
const handleCityItem = (item) => {
const handleCityItem = (item) => {
const userStore = useUserStore();
query_data.cityId = item.cityId;
query_data.page = 1;