修改首页获取定位
This commit is contained in:
@@ -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
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user