diff --git a/src/store/piniaIndex.js b/src/store/piniaIndex.js index da1de4e..1e3b42c 100644 --- a/src/store/piniaIndex.js +++ b/src/store/piniaIndex.js @@ -27,6 +27,8 @@ const instance = defineStore('user', { actions: { getPosition() { + this.position = { latitude: 36.636753, longitude: 119.11914 } + return initAMap().then(() => { // console.log(3) let AMap = Vue.prototype.$AMap diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 0be748e..8073a59 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -125,6 +125,30 @@ export default { return !position?.latitude && !position?.longitude ? true : false }, getlist() { + let position = { latitude: 36.636753, longitude: 119.11914 } + + this.page.params = Object.assign(this.page.params, position) + this.loading = true + oilSiteApi + .getSiteList(this.page) + .then(res => { + if (res.code == 20000) { + if (res.data.list.length < 10) { + this.finished = true + } + if (this.page.currentPage == 1) { + this.list = res.data.list + } else { + this.list = this.list.concat(res.data.list) + } + this.loading = false + this.refreshing = false + } + }) + .catch(error => { + this.finished = true + }) + return initAMap().then(() => { let AMap = this.$AMap let geolocation = new AMap.Geolocation({ diff --git a/vue.config.js b/vue.config.js index af9770d..413b3af 100644 --- a/vue.config.js +++ b/vue.config.js @@ -16,7 +16,7 @@ module.exports = defineConfig({ // https: true, proxy: { [process.env.VUE_APP_BASE_API]: { - // target: `http://192.168.110.230:38080`, + // target: `http://192.168.1.83:38080`, // target: `https://www.xingoil.com/adminapi`, target: `http://uat.xingoil.com/adminapi`, changeOrigin: true,