完善功能

This commit is contained in:
wangxiaowei
2026-04-17 21:52:51 +08:00
parent c3639526d1
commit 7f8f15b809
12 changed files with 1364 additions and 426 deletions

View File

@ -63,7 +63,7 @@
<script>
import { mapActions, mapMutations, mapGetters } from 'vuex'
import { getCityLists } from "@/api/store.js"
import { getCityLists, getHotCityLists } from "@/api/store.js"
import { currentPage, toast } from "@/utils/tools.js"
import cache from "@/utils/cache"
@ -75,24 +75,31 @@
labelList: [],
historyList: [],
hotList: [
{ name: '北京市', gcj02_lat: "39.929986", gcj02_lng: "116.395645", id: 110100 },
{ name: '上海市', gcj02_lat: "31.249162", gcj02_lng: "121.487899", id: 310100 },
{ name: '广州市', gcj02_lat: "23.120049", gcj02_lng: "113.30765", id: 440100 },
{ name: '深圳市', gcj02_lat: "22.546054", gcj02_lng: "114.025974", id: 440300 },
{ name: '重庆市', gcj02_lat: "29.544606", gcj02_lng: "106.530635", id: 110100 },
{ name: '成都市', gcj02_lat: "30.679943", gcj02_lng: "104.067923", id: 510100 },
{ name: '杭州市', gcj02_lat: "30.259244", gcj02_lng: "120.219375", id: 110100 },
{ name: '苏州市', gcj02_lat: "31.317987", gcj02_lng: "120.619907", id: 320500 },
{ name: '武汉市', gcj02_lat: "30.581084", gcj02_lng: "114.3162", id: 420100 },
{ name: '沈阳市', gcj02_lat: "41.808645", gcj02_lng: "123.432791", id: 210100 }
// { name: '上海市', gcj02_lat: "31.231706", gcj02_lng: "121.472644", id: 310100 },
// { name: '北京市', gcj02_lat: "39.904989", gcj02_lng: "116.405285", id: 110100 },
// { name: '广州市', gcj02_lat: "23.125178", gcj02_lng: "113.280637", id: 440100 },
// { name: '深圳市', gcj02_lat: "22.546054", gcj02_lng: "114.025974", id: 440300 },
// { name: '杭州市', gcj02_lat: "30.259244", gcj02_lng: "120.219375", id: 110100 },
// { name: '嘉兴市', gcj02_lat: "30.259244", gcj02_lng: "120.219375", id: 110100 },
// { name: '泉州市', gcj02_lat: "30.259244", gcj02_lng: "120.219375", id: 110100 },
// { name: '漳州市', gcj02_lat: "30.259244", gcj02_lng: "120.219375", id: 110100 },
// { name: '西安市', gcj02_lat: "30.259244", gcj02_lng: "120.219375", id: 110100 },
// { name: '苏州市', gcj02_lat: "31.317987", gcj02_lng: "120.619907", id: 320500 },
// { name: '哈尔滨市', gcj02_lat: "31.317987", gcj02_lng: "120.619907", id: 320500 },
// { name: '菏泽市', gcj02_lat: "31.317987", gcj02_lng: "120.619907", id: 320500 },
// { name: '惠州市', gcj02_lat: "31.317987", gcj02_lng: "120.619907", id: 320500 },
// { name: '厦门市', gcj02_lat: "31.317987", gcj02_lng: "120.619907", id: 320500 },
// { name: '济宁市', gcj02_lat: "31.317987", gcj02_lng: "120.619907", id: 320500 },
// { name: '威海市', gcj02_lat: "31.317987", gcj02_lng: "120.619907", id: 320500 },
// { name: '福州市', gcj02_lat: "31.317987", gcj02_lng: "120.619907", id: 320500 },
],
isFirstLoading: true,
touchmove: false,
touchmoveIndex: 0,
}
},
onLoad() {
this.getHotCityListsFunc()
this.getCityListsFunc()
this.historyList = cache.get('HISTORY') || []
},
@ -105,6 +112,13 @@
methods: {
...mapActions(['initLocationFunc']),
...mapMutations(['setCityInfo']),
async getHotCityListsFunc() {
const { code, data } = await getHotCityLists()
if (code == 1) {
this.hotList = data;
}
},
async reLocationFunc() {
this.isLoading = true;