|
@@ -25,14 +25,9 @@
|
|
|
<script>
|
|
|
import serviceItem from '@/components/service/index.vue';
|
|
|
import goodsItem from "@/components/service/goodsItem.vue"
|
|
|
- import {
|
|
|
- maintainFavoritePaging,
|
|
|
- getFavouriteGoods
|
|
|
- } from '@/api/client/mine.js';
|
|
|
- import {
|
|
|
- getCurrentLocation
|
|
|
- } from '@/api/client/home';
|
|
|
-
|
|
|
+ import { maintainFavoritePaging, getFavouriteGoods } from '@/api/client/mine.js';
|
|
|
+ import { getCurrentLocation } from '@/api/client/home';
|
|
|
+ import { mapGetters } from "vuex"
|
|
|
export default {
|
|
|
components: {
|
|
|
serviceItem,
|
|
@@ -43,9 +38,9 @@
|
|
|
queryParams: {
|
|
|
size: 10,
|
|
|
type: 'MERCHANT',
|
|
|
- region: null || '370705', //地区编码
|
|
|
- longitude: null || '119.13279', //经度
|
|
|
- latitude: null || '36.70864', //纬度
|
|
|
+ region: null, //地区编码
|
|
|
+ longitude: null , //经度
|
|
|
+ latitude: null, //纬度
|
|
|
},
|
|
|
init_list: [],
|
|
|
listCollect: [{
|
|
@@ -61,34 +56,17 @@
|
|
|
|
|
|
};
|
|
|
},
|
|
|
- onLoad() {
|
|
|
- this.handlerInitLocation();
|
|
|
- },
|
|
|
+ mounted() {
|
|
|
+ let { latitude , longitude , region } = this.location
|
|
|
+ this.queryParams.latitude = latitude
|
|
|
+ this.queryParams.longitude = longitude
|
|
|
+ this.queryParams.region = region
|
|
|
+ this.handlerInitList();
|
|
|
+ },
|
|
|
+ computed:{
|
|
|
+ ...mapGetters(['location'])
|
|
|
+ },
|
|
|
methods: {
|
|
|
- // 获取当前经纬度
|
|
|
- handlerInitLocation() {
|
|
|
- // uni.getLocation({
|
|
|
- // type: 'gcj02',
|
|
|
- // success: res => {
|
|
|
- // this.queryParams.longitude = res.longitude;
|
|
|
- // this.queryParams.latitude = res.latitude;
|
|
|
- // let point = {
|
|
|
- // latitude: res.latitude,
|
|
|
- // longitude: res.longitude,
|
|
|
- // };
|
|
|
- // getCurrentLocation(point).then(rc => {
|
|
|
- // this.queryParams.region = rc.data.id;
|
|
|
- this.handlerInitList();
|
|
|
- // });
|
|
|
- // },
|
|
|
- // fail: rs => {
|
|
|
- // uni.showToast({
|
|
|
- // title: rs,
|
|
|
- // icon: 'none',
|
|
|
- // });
|
|
|
- // },
|
|
|
- // });
|
|
|
- },
|
|
|
// 初始化商家列表信息
|
|
|
handlerInitList() {
|
|
|
maintainFavoritePaging(this.queryParams).then(res => {
|
|
@@ -132,7 +110,6 @@
|
|
|
}
|
|
|
},
|
|
|
uploadIniList(e) {
|
|
|
- // console.log("@@@e", e);
|
|
|
this.init_list = []
|
|
|
if (e == 1) {
|
|
|
this.handlerInitGoodsList()
|