|
|
@@ -317,7 +317,8 @@
|
|
|
:imgArr="fromValue.imgSed"
|
|
|
@newimgarr="newimgarr1"
|
|
|
:imgText="fromValue.ifJzStoreType != 1 ? '陈列照' : '立邦展厅照片'"
|
|
|
- :type="2"></upload-img>
|
|
|
+ :type="2"
|
|
|
+ :count="fromValue.ifJzStoreType != 1 ? 9 : 1"></upload-img>
|
|
|
</div>
|
|
|
</van-col>
|
|
|
</van-row>
|
|
|
@@ -581,6 +582,7 @@ import txmapimg1 from '@/assets/txmap1.svg';
|
|
|
import txmapimg2 from '@/assets/txmap2.svg';
|
|
|
import txmapimg3 from '@/assets/marker_blue.png';
|
|
|
import { valid } from '@/api/visitstore';
|
|
|
+import { getPosition, getTicketFun, getMapPoi, getkeywordPoi } from '@/utils/TXApiFun';
|
|
|
|
|
|
export default {
|
|
|
name: 'storeAdd',
|
|
|
@@ -709,28 +711,34 @@ export default {
|
|
|
pLot: '',
|
|
|
};
|
|
|
},
|
|
|
- created() {
|
|
|
- this.getTCFXList();
|
|
|
- this.getSJSList();
|
|
|
- this.getQGJZist();
|
|
|
- this.getDetail();
|
|
|
- this.getbrands();
|
|
|
- this.getStreetQuery();
|
|
|
- this.getCustomerInfoList();
|
|
|
- this.getManagementModelList();
|
|
|
- this.getMainRelationList();
|
|
|
- this.getMainProjectList();
|
|
|
- this.getCustomerNatureList();
|
|
|
- this.getpotentialCustomerTypeList();
|
|
|
- },
|
|
|
- watch: {
|
|
|
- $route(to, from) {
|
|
|
- if (to.path == '/storeEdit' && from.path == '/storeDetail') {
|
|
|
- this.getDetail();
|
|
|
- this.showmap = false;
|
|
|
- }
|
|
|
- },
|
|
|
+ activated() {
|
|
|
+ // 授权
|
|
|
+ getTicketFun(['getLocation', 'chooseImage', 'uploadImage']).then(() => {
|
|
|
+ this.getTCFXList();
|
|
|
+ this.getSJSList();
|
|
|
+ this.getQGJZist();
|
|
|
+ this.getDetail();
|
|
|
+ this.getbrands();
|
|
|
+ this.getStreetQuery();
|
|
|
+ this.getCustomerInfoList();
|
|
|
+ this.getManagementModelList();
|
|
|
+ this.getMainRelationList();
|
|
|
+ this.getMainProjectList();
|
|
|
+ this.getCustomerNatureList();
|
|
|
+ this.getpotentialCustomerTypeList();
|
|
|
+ this.showmap = false;
|
|
|
+ });
|
|
|
},
|
|
|
+ // created() {
|
|
|
+ // },
|
|
|
+ // watch: {
|
|
|
+ // $route(to, from) {
|
|
|
+ // if (to.path == '/storeEdit' && from.path == '/storeDetail') {
|
|
|
+ // this.getDetail();
|
|
|
+ // this.showmap = false;
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // },
|
|
|
methods: {
|
|
|
addressFns(val) {
|
|
|
var that = this;
|
|
|
@@ -745,13 +753,9 @@ export default {
|
|
|
},
|
|
|
]);
|
|
|
that.maplist = [];
|
|
|
- jsonp(
|
|
|
- 'https://apis.map.qq.com/ws/place/v1/search?boundary=nearby(' +
|
|
|
- val.location.lat +
|
|
|
- ',' +
|
|
|
- val.location.lng +
|
|
|
- ',1000,0)&page_size=20&page_index=1&orderby=_distance&output=jsonp&key=WLCBZ-HRM6L-YOMPV-ME62B-AQOG6-JUBW6'
|
|
|
- ).then((res) => {
|
|
|
+ // 地点搜索 获取500米范围poi点
|
|
|
+ getMapPoi({ latitude: val.location.lat, longitude: val.location.lng }).then((res) => {
|
|
|
+ console.log(res);
|
|
|
that.maplist = res.data;
|
|
|
that.marker.setGeometries([]);
|
|
|
setTimeout(() => {
|
|
|
@@ -765,24 +769,53 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
+ // jsonp(
|
|
|
+ // 'https://apis.map.qq.com/ws/place/v1/search?boundary=nearby(' +
|
|
|
+ // val.location.lat +
|
|
|
+ // ',' +
|
|
|
+ // val.location.lng +
|
|
|
+ // ',1000,0)&page_size=20&page_index=1&orderby=_distance&output=jsonp&key=WLCBZ-HRM6L-YOMPV-ME62B-AQOG6-JUBW6'
|
|
|
+ // ).then((res) => {
|
|
|
+ // that.maplist = res.data;
|
|
|
+ // that.marker.setGeometries([]);
|
|
|
+ // setTimeout(() => {
|
|
|
+ // for (let p = 0; p < res.data.length; p++) {
|
|
|
+ // that.marker.updateGeometries([
|
|
|
+ // {
|
|
|
+ // id: res.data[p].id,
|
|
|
+ // position: new TMap.LatLng(res.data[p].location.lat, res.data[p].location.lng),
|
|
|
+ // },
|
|
|
+ // ]);
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // });
|
|
|
that.addresssb = -1;
|
|
|
});
|
|
|
},
|
|
|
searchFn(val) {
|
|
|
this.searchSHow = false;
|
|
|
- var that = this;
|
|
|
- jsonp(
|
|
|
- 'https://apis.map.qq.com/ws/place/v1/suggestion?keyword=' +
|
|
|
- val +
|
|
|
- '&location=' +
|
|
|
- this.pLat +
|
|
|
- ',' +
|
|
|
- this.pLot +
|
|
|
- '&output=jsonp&key=WLCBZ-HRM6L-YOMPV-ME62B-AQOG6-JUBW6&page_size=20®ion_fix=1'
|
|
|
- ).then((res) => {
|
|
|
- this.searchSHow = true;
|
|
|
- that.mapsearchlist = res.data;
|
|
|
+ getkeywordPoi({ latitude: this.pLat, longitude: this.pLot }, val).then((res) => {
|
|
|
+ // 不显示下拉选择
|
|
|
+ if (!res.data.length && !val) {
|
|
|
+ this.searchSHow = false;
|
|
|
+ } else {
|
|
|
+ this.searchSHow = true;
|
|
|
+ }
|
|
|
+ // 联想下拉选
|
|
|
+ this.mapsearchlist = res.data;
|
|
|
});
|
|
|
+ // jsonp(
|
|
|
+ // 'https://apis.map.qq.com/ws/place/v1/suggestion?keyword=' +
|
|
|
+ // val +
|
|
|
+ // '&location=' +
|
|
|
+ // this.pLat +
|
|
|
+ // ',' +
|
|
|
+ // this.pLot +
|
|
|
+ // '&output=jsonp&key=WLCBZ-HRM6L-YOMPV-ME62B-AQOG6-JUBW6&page_size=20®ion_fix=1'
|
|
|
+ // ).then((res) => {
|
|
|
+ // this.searchSHow = true;
|
|
|
+ // that.mapsearchlist = res.data;
|
|
|
+ // });
|
|
|
},
|
|
|
mapselect(val) {
|
|
|
this.searchSHow = false;
|
|
|
@@ -818,97 +851,121 @@ export default {
|
|
|
},
|
|
|
fns() {
|
|
|
this.search = '';
|
|
|
- let loading1 = this.$toast.loading({
|
|
|
- duration: 0,
|
|
|
- message: '定位中...',
|
|
|
- forbidClick: true,
|
|
|
- });
|
|
|
- let url = window.location.href;
|
|
|
- let that = this;
|
|
|
- let qiyeData;
|
|
|
- const instance = axios.create();
|
|
|
- instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
|
|
|
- instance
|
|
|
- .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
|
|
|
- params: {
|
|
|
- url: url,
|
|
|
- },
|
|
|
- })
|
|
|
- .then((response) => {
|
|
|
- if (response.status == 200) {
|
|
|
- this.cont = 6;
|
|
|
- var flat = true;
|
|
|
- var times = setInterval(() => {
|
|
|
- this.cont--;
|
|
|
- if (this.cont == '0') {
|
|
|
- if (flat) {
|
|
|
- loading1.clear();
|
|
|
- clearInterval(times);
|
|
|
- that.$dialog
|
|
|
- .alert({
|
|
|
- message: '定位失败,请开启企微定位权限',
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.$router.go(-1);
|
|
|
- });
|
|
|
- } else {
|
|
|
- clearInterval(times);
|
|
|
- }
|
|
|
- }
|
|
|
- }, 1000);
|
|
|
- qiyeData = response.data.data;
|
|
|
- that.wx.config({
|
|
|
- beta: true,
|
|
|
- debug: false,
|
|
|
- appId: qiyeData.appId,
|
|
|
- timestamp: qiyeData.timestamp,
|
|
|
- nonceStr: qiyeData.nonceStr,
|
|
|
- signature: qiyeData.signature,
|
|
|
- jsApiList: ['ready', 'getLocation'],
|
|
|
- });
|
|
|
- that.wx.ready(function () {
|
|
|
- that.wx.getLocation({
|
|
|
- type: 'gcj02',
|
|
|
- success: function (res) {
|
|
|
- flat = false;
|
|
|
- loading1.clear();
|
|
|
- that.pLat = res.latitude;
|
|
|
- that.pLot = res.longitude;
|
|
|
- var location = that.CJ02BD(res.latitude, res.longitude);
|
|
|
- if (that.fromValue.lon == '') {
|
|
|
- that.fromValue.lon = location.lon;
|
|
|
- that.fromValue.lat = location.lat;
|
|
|
- }
|
|
|
- that.showmap = true;
|
|
|
- jsonp(
|
|
|
- 'https://apis.map.qq.com/ws/place/v1/search?boundary=nearby(' +
|
|
|
- res.latitude +
|
|
|
- ',' +
|
|
|
- res.longitude +
|
|
|
- ',1000,0)&page_size=10&page_index=1&orderby=_distance&output=jsonp&key=WLCBZ-HRM6L-YOMPV-ME62B-AQOG6-JUBW6'
|
|
|
- ).then((res) => {
|
|
|
- that.maplist = res.data;
|
|
|
- setTimeout(() => {
|
|
|
- that.addVisits1('1');
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
- fail: function () {
|
|
|
- loading1.clear();
|
|
|
- that.$dialog.alert({
|
|
|
- title: '系统提示',
|
|
|
- message: 'GPS未开启',
|
|
|
- });
|
|
|
- },
|
|
|
- });
|
|
|
- });
|
|
|
- that.wx.error(function (res) {
|
|
|
- this.$toast.fail('定位失败');
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.$toast.fail('接口异常');
|
|
|
+ getPosition()
|
|
|
+ .then((res) => {
|
|
|
+ let { TXisBD, resData } = res;
|
|
|
+ this.pLat = resData.latitude;
|
|
|
+ this.pLot = resData.longitude;
|
|
|
+ if (this.fromValue.lon == '') {
|
|
|
+ this.fromValue.lon = TXisBD.lon;
|
|
|
+ this.fromValue.lat = TXisBD.lat;
|
|
|
}
|
|
|
+ this.showmap = true;
|
|
|
+ // 地点搜索 获取500米范围poi点
|
|
|
+ getMapPoi({ latitude: this.pLat, longitude: this.pLot }).then((res) => {
|
|
|
+ console.log(res);
|
|
|
+ this.maplist = res.data;
|
|
|
+ setTimeout(() => {
|
|
|
+ this.addVisits1('1');
|
|
|
+ });
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ this.$dialog.alert({
|
|
|
+ message: error,
|
|
|
+ });
|
|
|
});
|
|
|
+ // let loading1 = this.$toast.loading({
|
|
|
+ // duration: 0,
|
|
|
+ // message: '定位中...',
|
|
|
+ // forbidClick: true,
|
|
|
+ // });
|
|
|
+ // let url = window.location.href;
|
|
|
+ // let that = this;
|
|
|
+ // let qiyeData;
|
|
|
+ // const instance = axios.create();
|
|
|
+ // instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
|
|
|
+ // instance
|
|
|
+ // .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
|
|
|
+ // params: {
|
|
|
+ // url: url,
|
|
|
+ // },
|
|
|
+ // })
|
|
|
+ // .then((response) => {
|
|
|
+ // if (response.status == 200) {
|
|
|
+ // this.cont = 6;
|
|
|
+ // var flat = true;
|
|
|
+ // var times = setInterval(() => {
|
|
|
+ // this.cont--;
|
|
|
+ // if (this.cont == '0') {
|
|
|
+ // if (flat) {
|
|
|
+ // loading1.clear();
|
|
|
+ // clearInterval(times);
|
|
|
+ // that.$dialog
|
|
|
+ // .alert({
|
|
|
+ // message: '定位失败,请开启企微定位权限',
|
|
|
+ // })
|
|
|
+ // .then(() => {
|
|
|
+ // this.$router.go(-1);
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // clearInterval(times);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }, 1000);
|
|
|
+ // qiyeData = response.data.data;
|
|
|
+ // that.wx.config({
|
|
|
+ // beta: true,
|
|
|
+ // debug: false,
|
|
|
+ // appId: qiyeData.appId,
|
|
|
+ // timestamp: qiyeData.timestamp,
|
|
|
+ // nonceStr: qiyeData.nonceStr,
|
|
|
+ // signature: qiyeData.signature,
|
|
|
+ // jsApiList: ['ready', 'getLocation'],
|
|
|
+ // });
|
|
|
+ // that.wx.ready(function () {
|
|
|
+ // that.wx.getLocation({
|
|
|
+ // type: 'gcj02',
|
|
|
+ // success: function (res) {
|
|
|
+ // flat = false;
|
|
|
+ // loading1.clear();
|
|
|
+ // that.pLat = res.latitude;
|
|
|
+ // that.pLot = res.longitude;
|
|
|
+ // var location = that.CJ02BD(res.latitude, res.longitude);
|
|
|
+ // if (that.fromValue.lon == '') {
|
|
|
+ // that.fromValue.lon = location.lon;
|
|
|
+ // that.fromValue.lat = location.lat;
|
|
|
+ // }
|
|
|
+ // that.showmap = true;
|
|
|
+ // jsonp(
|
|
|
+ // 'https://apis.map.qq.com/ws/place/v1/search?boundary=nearby(' +
|
|
|
+ // res.latitude +
|
|
|
+ // ',' +
|
|
|
+ // res.longitude +
|
|
|
+ // ',1000,0)&page_size=10&page_index=1&orderby=_distance&output=jsonp&key=WLCBZ-HRM6L-YOMPV-ME62B-AQOG6-JUBW6'
|
|
|
+ // ).then((res) => {
|
|
|
+ // that.maplist = res.data;
|
|
|
+ // setTimeout(() => {
|
|
|
+ // that.addVisits1('1');
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ // fail: function () {
|
|
|
+ // loading1.clear();
|
|
|
+ // that.$dialog.alert({
|
|
|
+ // title: '系统提示',
|
|
|
+ // message: 'GPS未开启',
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ // that.wx.error(function (res) {
|
|
|
+ // this.$toast.fail('定位失败');
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // this.$toast.fail('接口异常');
|
|
|
+ // }
|
|
|
+ // });
|
|
|
this.addresssb = -1;
|
|
|
},
|
|
|
addVisits1(val) {
|
|
|
@@ -1406,84 +1463,96 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
getLocation() {
|
|
|
- let url = window.location.href;
|
|
|
- this.list = [];
|
|
|
- let that = this;
|
|
|
- let qiyeData;
|
|
|
- const instance = axios.create();
|
|
|
- instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
|
|
|
- instance
|
|
|
- .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
|
|
|
- params: {
|
|
|
- url: url,
|
|
|
- },
|
|
|
+ getPosition()
|
|
|
+ .then((res) => {
|
|
|
+ let { TXisBD } = res;
|
|
|
+ this.location = TXisBD;
|
|
|
+ this.fromValue.lat = TXisBD.lat;
|
|
|
+ this.fromValue.lon = TXisBD.lon;
|
|
|
})
|
|
|
- .then((response) => {
|
|
|
- if (response.status == 200) {
|
|
|
- this.cont = 3;
|
|
|
- var flat = true;
|
|
|
- var times = setInterval(() => {
|
|
|
- this.cont--;
|
|
|
- if (this.cont == '0') {
|
|
|
- if (flat) {
|
|
|
- loading1.clear();
|
|
|
- clearInterval(times);
|
|
|
- that.$dialog
|
|
|
- .alert({
|
|
|
- message: '定位失败,请开启企微定位权限',
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.$router.go(-1);
|
|
|
- });
|
|
|
- } else {
|
|
|
- clearInterval(times);
|
|
|
- }
|
|
|
- }
|
|
|
- }, 1000);
|
|
|
- qiyeData = response.data.data;
|
|
|
- that.wx.config({
|
|
|
- beta: true,
|
|
|
- debug: false,
|
|
|
- appId: qiyeData.appId,
|
|
|
- timestamp: qiyeData.timestamp,
|
|
|
- nonceStr: qiyeData.nonceStr,
|
|
|
- signature: qiyeData.signature,
|
|
|
- jsApiList: ['ready', 'getLocation'],
|
|
|
- });
|
|
|
- that.wx.ready(function () {
|
|
|
- that.wx.getLocation({
|
|
|
- type: 'gcj02',
|
|
|
- success: function (res) {
|
|
|
- flat = false;
|
|
|
- var location = that.CJ02BD(res.latitude, res.longitude);
|
|
|
- that.location = location;
|
|
|
- that.fromValue.lat = that.location.lat;
|
|
|
- that.fromValue.lon = that.location.lon;
|
|
|
- },
|
|
|
- fail: function () {
|
|
|
- that.$dialog
|
|
|
- .confirm({
|
|
|
- confirmButtonText: '取消',
|
|
|
- cancelButtonText: '重新定位',
|
|
|
- title: '系统提示',
|
|
|
- message: 'GPS未开启',
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- console.log('取消');
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- that.getLocation();
|
|
|
- });
|
|
|
- },
|
|
|
- });
|
|
|
- });
|
|
|
- that.wx.error(function (res) {
|
|
|
- this.$toast.fail('定位失败');
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.$toast.fail('接口异常');
|
|
|
- }
|
|
|
+ .catch((error) => {
|
|
|
+ this.$dialog.alert({
|
|
|
+ message: error,
|
|
|
+ });
|
|
|
});
|
|
|
+ // let url = window.location.href;
|
|
|
+ // this.list = [];
|
|
|
+ // let that = this;
|
|
|
+ // let qiyeData;
|
|
|
+ // const instance = axios.create();
|
|
|
+ // instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
|
|
|
+ // instance
|
|
|
+ // .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
|
|
|
+ // params: {
|
|
|
+ // url: url,
|
|
|
+ // },
|
|
|
+ // })
|
|
|
+ // .then((response) => {
|
|
|
+ // if (response.status == 200) {
|
|
|
+ // this.cont = 3;
|
|
|
+ // var flat = true;
|
|
|
+ // var times = setInterval(() => {
|
|
|
+ // this.cont--;
|
|
|
+ // if (this.cont == '0') {
|
|
|
+ // if (flat) {
|
|
|
+ // loading1.clear();
|
|
|
+ // clearInterval(times);
|
|
|
+ // that.$dialog
|
|
|
+ // .alert({
|
|
|
+ // message: '定位失败,请开启企微定位权限',
|
|
|
+ // })
|
|
|
+ // .then(() => {
|
|
|
+ // this.$router.go(-1);
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // clearInterval(times);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }, 1000);
|
|
|
+ // qiyeData = response.data.data;
|
|
|
+ // that.wx.config({
|
|
|
+ // beta: true,
|
|
|
+ // debug: false,
|
|
|
+ // appId: qiyeData.appId,
|
|
|
+ // timestamp: qiyeData.timestamp,
|
|
|
+ // nonceStr: qiyeData.nonceStr,
|
|
|
+ // signature: qiyeData.signature,
|
|
|
+ // jsApiList: ['ready', 'getLocation'],
|
|
|
+ // });
|
|
|
+ // that.wx.ready(function () {
|
|
|
+ // that.wx.getLocation({
|
|
|
+ // type: 'gcj02',
|
|
|
+ // success: function (res) {
|
|
|
+ // flat = false;
|
|
|
+ // var location = that.CJ02BD(res.latitude, res.longitude);
|
|
|
+ // that.location = location;
|
|
|
+ // that.fromValue.lat = that.location.lat;
|
|
|
+ // that.fromValue.lon = that.location.lon;
|
|
|
+ // },
|
|
|
+ // fail: function () {
|
|
|
+ // that.$dialog
|
|
|
+ // .confirm({
|
|
|
+ // confirmButtonText: '取消',
|
|
|
+ // cancelButtonText: '重新定位',
|
|
|
+ // title: '系统提示',
|
|
|
+ // message: 'GPS未开启',
|
|
|
+ // })
|
|
|
+ // .then(() => {
|
|
|
+ // console.log('取消');
|
|
|
+ // })
|
|
|
+ // .catch(() => {
|
|
|
+ // that.getLocation();
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ // that.wx.error(function (res) {
|
|
|
+ // this.$toast.fail('定位失败');
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // this.$toast.fail('接口异常');
|
|
|
+ // }
|
|
|
+ // });
|
|
|
},
|
|
|
showPickerChainsListFn() {
|
|
|
if (this.fromValue.storeCategoryName == '') {
|