This commit is contained in:
parent
677be5d3eb
commit
2d128b3c7d
|
@ -409,7 +409,8 @@
|
|||
parType:'',
|
||||
contentVideo:'',
|
||||
Key2:'ad684a15ebbb6f5d12c407a3d593c949',
|
||||
latadd:''
|
||||
latadd:'',
|
||||
cityname:''
|
||||
}
|
||||
},
|
||||
onShareAppMessage(res) { //发送给朋友
|
||||
|
@ -464,28 +465,39 @@
|
|||
}
|
||||
}
|
||||
})
|
||||
uni.getLocation({
|
||||
type: 'gcj02',
|
||||
geocode: true, //设置该参数为true可直接获取经纬度及城市信息
|
||||
highAccuracyExpireTime: 500,
|
||||
success: function(res) {
|
||||
console.log(res, '地理位置')
|
||||
that.latitude = res.latitude
|
||||
that.longitude = res.longitude
|
||||
uni.setStorageSync('latitude', res.latitude)
|
||||
uni.setStorageSync('longitude', res.longitude)
|
||||
that.getHomeNearbyList();
|
||||
that.selectCity(that.longitude,that.latitude)
|
||||
},
|
||||
fail: function(e) {
|
||||
that.cuowu=e
|
||||
that.getHomeNearbyList();
|
||||
console.log("获取信息失败,请重试!",e)
|
||||
// #ifdef APP-PLUS
|
||||
that.checkPermission();
|
||||
// #endif
|
||||
}
|
||||
})
|
||||
var add=uni.getStorageSync('cityAdderss');
|
||||
if(add!=''){
|
||||
that.city=add.name;
|
||||
that.cityname=add.cityname;
|
||||
var location=add.location.split(",")
|
||||
that.longitude = location[0]
|
||||
that.latitude = location[1]
|
||||
console.log("onLoad=========>",add)
|
||||
}else{
|
||||
uni.getLocation({
|
||||
type: 'gcj02',
|
||||
geocode: true, //设置该参数为true可直接获取经纬度及城市信息
|
||||
highAccuracyExpireTime: 500,
|
||||
success: function(res) {
|
||||
console.log(res, '地理位置')
|
||||
that.latitude = res.latitude
|
||||
that.longitude = res.longitude
|
||||
uni.setStorageSync('latitude', res.latitude)
|
||||
uni.setStorageSync('longitude', res.longitude)
|
||||
that.getHomeNearbyList();
|
||||
that.selectCity(that.longitude,that.latitude)
|
||||
},
|
||||
fail: function(e) {
|
||||
that.cuowu=e
|
||||
that.getHomeNearbyList();
|
||||
console.log("获取信息失败,请重试!",e)
|
||||
// #ifdef APP-PLUS
|
||||
that.checkPermission();
|
||||
// #endif
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
that.getVideo()
|
||||
},
|
||||
onShow() {
|
||||
|
@ -496,23 +508,21 @@
|
|||
var add=uni.getStorageSync('cityAdderss');
|
||||
if(add!=''){
|
||||
that.city=add.name;
|
||||
that.cityname=add.cityname;
|
||||
var location=add.location.split(",")
|
||||
that.longitude = location[0]
|
||||
that.latitude = location[1]
|
||||
console.log("location=========>",location)
|
||||
console.log("onShow=========>",add)
|
||||
}
|
||||
that.getTpMy();
|
||||
that.getTpCount();
|
||||
// this.checkNewUser();
|
||||
// that.getTpCount();
|
||||
// #ifdef MP-WEIXIN
|
||||
//订阅
|
||||
if (that.showModal) {
|
||||
that.openMsg()
|
||||
}
|
||||
// #endif
|
||||
// this.city = uni.getStorageSync('city')//测试用的 测试结束关闭
|
||||
that.getIsVip()
|
||||
// that.getKTCityList();
|
||||
that.getHomeArtificerList();
|
||||
that.getHomeNearbyList();
|
||||
}else{
|
||||
|
@ -528,7 +538,45 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
selectCity(longitude, latitude) {
|
||||
var that=this;
|
||||
var longitude = that.longitude;
|
||||
var latitude = that.latitude;
|
||||
let amapKey = that.Key2; // 替换为你的高德地图API Key
|
||||
let url = `https://restapi.amap.com/v3/geocode/regeo?key=${amapKey}&location=${longitude},${latitude}&radius=1000`;
|
||||
uni.request({
|
||||
url: url,
|
||||
success: (response) => {
|
||||
if(response.data && response.data.regeocode) {
|
||||
let address = response.data.regeocode.formatted_address;
|
||||
let province = response.data.regeocode.addressComponent.province;
|
||||
let city = response.data.regeocode.addressComponent.city;
|
||||
let district = response.data.regeocode.addressComponent.district;
|
||||
let township = response.data.regeocode.addressComponent.township;
|
||||
let streetNumber = response.data.regeocode.addressComponent.streetNumber.street;
|
||||
let number = response.data.regeocode.addressComponent.streetNumber.number;
|
||||
that.city = address.replace(province,'').replace(city,'').replace(district,'').replace(streetNumber,'').replace(number,'').replace(township,'')
|
||||
that.cityname=add.city;
|
||||
var add=uni.getStorageSync('cityAdderss');
|
||||
if(add!=''){
|
||||
that.city=add.name;
|
||||
that.cityname=add.cityname;
|
||||
var location=add.location.split(",")
|
||||
that.longitude = location[0]
|
||||
that.latitude = location[1]
|
||||
console.log("location=========>",location)
|
||||
}
|
||||
that.page = 1;
|
||||
// that.getTpCount();
|
||||
} else {
|
||||
console.log('逆地理编码失败', response.data);
|
||||
}
|
||||
},
|
||||
fail: (error) => {
|
||||
console.log('网络请求失败', error);
|
||||
}
|
||||
});
|
||||
},
|
||||
guanbi(){
|
||||
this.playShow=false;
|
||||
const videoContext = uni.createVideoContext('myVideo', this);
|
||||
|
@ -609,47 +657,7 @@
|
|||
url:'/pages/index/searchAddress?text='+'index'
|
||||
})
|
||||
},
|
||||
selectCity(longitude, latitude) {
|
||||
var that=this;
|
||||
var longitude = that.longitude;
|
||||
var latitude = that.latitude;
|
||||
let amapKey = that.Key2; // 替换为你的高德地图API Key
|
||||
let url = `https://restapi.amap.com/v3/geocode/regeo?key=${amapKey}&location=${longitude},${latitude}&radius=1000`;
|
||||
uni.request({
|
||||
url: url,
|
||||
success: (response) => {
|
||||
if(response.data && response.data.regeocode) {
|
||||
let address = response.data.regeocode.formatted_address;
|
||||
let province = response.data.regeocode.addressComponent.province;
|
||||
let city = response.data.regeocode.addressComponent.city;
|
||||
let district = response.data.regeocode.addressComponent.district;
|
||||
let township = response.data.regeocode.addressComponent.township;
|
||||
let streetNumber = response.data.regeocode.addressComponent.streetNumber.street;
|
||||
let number = response.data.regeocode.addressComponent.streetNumber.number;
|
||||
that.city = address.replace(province,'').replace(city,'').replace(district,'').replace(streetNumber,'').replace(number,'').replace(township,'')
|
||||
that.page = 1;
|
||||
that.getTpCount();
|
||||
} else {
|
||||
console.log('逆地理编码失败', response.data);
|
||||
}
|
||||
},
|
||||
fail: (error) => {
|
||||
console.log('网络请求失败', error);
|
||||
}
|
||||
});
|
||||
// that.$Request.get('/app/Login/selectCity?lat=' + latitude + '&lng=' + longitude).then(res => {
|
||||
// if (res.code == 0) {
|
||||
// console.log("我的地址",res)
|
||||
// let chinaAddressParts = res.data.address.match(/^(?<province>[^省]+省|[^自]+自治区|[^市]+市|[^县]+县|[^区]+区|[^town]+town|[^镇]+镇)?(?<city>[^市]+市|[^县]+县|[^区]+区|[^town]+town|[^镇]+镇)?(?<district>[^区]+区|[^县]+县|[^乡]+乡|[^街道]+街道)?(?<street>.+)$/);
|
||||
|
||||
// that.city=chinaAddressParts.groups.street
|
||||
// that.page = 1
|
||||
|
||||
// that.getKTCityList();
|
||||
|
||||
// }
|
||||
// });
|
||||
},
|
||||
|
||||
searchBtn(){//搜索按钮
|
||||
uni.navigateTo({
|
||||
url:'/pages/my/fuwuGengduo?searchValue='+this.searchValue
|
||||
|
@ -1011,7 +1019,7 @@
|
|||
var data={
|
||||
isStart: 1,
|
||||
status: 1,
|
||||
// city: this.city,
|
||||
// city:this.cityname,
|
||||
longitude:this.longitude,
|
||||
latitude:this.latitude,
|
||||
page: 1,
|
||||
|
@ -1046,7 +1054,7 @@
|
|||
var data={
|
||||
isStart: 1,
|
||||
status: 1,
|
||||
// city: this.city,
|
||||
// city:this.cityname,
|
||||
longitude:this.longitude,
|
||||
latitude:this.latitude,
|
||||
page: 1,
|
||||
|
|
|
@ -72,16 +72,17 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="flex thera-lin thera-bottom">
|
||||
<view class="flex" v-if="item.consortiaName">
|
||||
<image class="therapist-bottom-img" src="../../static/dituzhaoren5.png"></image>
|
||||
<view v-if="item.consortiaName" class="therapist-mian-bottom-text">{{item.consortiaName}}</view>
|
||||
</view>
|
||||
<view class="flex align-center" v-if="item.distance">
|
||||
<image class="therapist-bottom-dingwei" src="../../static/dituzhaoren6.png"></image>
|
||||
<view class="therapist-bottom-dingwei-text">
|
||||
{{ item.distance }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex" v-if="item.consortiaName">
|
||||
<image class="therapist-bottom-img" src="../../static/dituzhaoren5.png"></image>
|
||||
<view v-if="item.consortiaName" class="therapist-mian-bottom-text">{{item.consortiaName}}</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -168,16 +169,17 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="flex thera-lin thera-bottom">
|
||||
<view class="flex" v-if="getOrderByCurrentMarkerIndex().consortiaName">
|
||||
<image class="therapist-bottom-img" src="../../static/dituzhaoren5.png"></image>
|
||||
<view v-if="getOrderByCurrentMarkerIndex().consortiaName" class="therapist-mian-bottom-text">{{getOrderByCurrentMarkerIndex().consortiaName}}</view>
|
||||
</view>
|
||||
<view class="flex align-center" v-if="getOrderByCurrentMarkerIndex().distance">
|
||||
<image class="therapist-bottom-dingwei" src="../../static/dituzhaoren6.png"></image>
|
||||
<view class="therapist-bottom-dingwei-text">
|
||||
{{ getOrderByCurrentMarkerIndex().distance }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex" v-if="getOrderByCurrentMarkerIndex().consortiaName">
|
||||
<image class="therapist-bottom-img" src="../../static/dituzhaoren5.png"></image>
|
||||
<view v-if="getOrderByCurrentMarkerIndex().consortiaName" class="therapist-mian-bottom-text">{{getOrderByCurrentMarkerIndex().consortiaName}}</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<!-- <view class="therapist-mian-bottom">
|
||||
<view class="flex flex-wrap align-center" v-if="getOrderByCurrentMarkerIndex().consortiaName">
|
||||
|
@ -329,6 +331,9 @@ import permision from "@/components/permission.js";
|
|||
|
||||
onLoad(e) {
|
||||
let that = this
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
})
|
||||
that.massageTypeId = e.massageTypeId;
|
||||
// that.getLocation();//低精度,快就完事了
|
||||
// that.getLocation(true);//高精度,慢慢查询
|
||||
|
@ -352,7 +357,6 @@ import permision from "@/components/permission.js";
|
|||
that.infoWindow.setPosition(new TMap.LatLng(res.latitude, res.longitude));
|
||||
}
|
||||
that.page = 1;
|
||||
console.log(333333)
|
||||
that.selectCity(that.longitude,that.latitude)
|
||||
},
|
||||
fail: function(e) {
|
||||
|
@ -388,6 +392,9 @@ import permision from "@/components/permission.js";
|
|||
},
|
||||
onShow() {
|
||||
let that = this
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
})
|
||||
that.XCXIsSelect = this.$queue.getData("XCXIsSelect");
|
||||
var add=uni.getStorageSync('cityTherapist');
|
||||
if(add!=''){
|
||||
|
@ -415,9 +422,7 @@ import permision from "@/components/permission.js";
|
|||
that.page = 1
|
||||
// that.selectCity(that.latitude,that.longitude)
|
||||
that.getlist()
|
||||
console.log(11111111)
|
||||
} else {
|
||||
console.log(22222222)
|
||||
uni.getLocation({
|
||||
type: 'gcj02',
|
||||
highAccuracyExpireTime: 500,
|
||||
|
@ -477,16 +482,23 @@ import permision from "@/components/permission.js";
|
|||
let number = response.data.regeocode.addressComponent.streetNumber.number;
|
||||
that.cityname = address.replace(province,'').replace(city,'').replace(district,'').replace(streetNumber,'').replace(number,'').replace(township,'')
|
||||
that.city=city
|
||||
that.page = 1
|
||||
that.getlist()
|
||||
// that.getKTCityList();
|
||||
var add=uni.getStorageSync('cityTherapist');
|
||||
console.log('getStorageSync===========', add);
|
||||
if(add!=''){
|
||||
that.cityname=add.name;
|
||||
that.city=add.cityname;
|
||||
var location=add.location.split(",")
|
||||
that.longitude = location[0]
|
||||
that.latitude = location[1]
|
||||
}
|
||||
that.page = 1
|
||||
that.getlist()
|
||||
} else {
|
||||
console.log('逆地理编码失败', response.data);
|
||||
}
|
||||
},
|
||||
fail: (error) => {
|
||||
uni.hideLoading();
|
||||
console.log('网络请求失败', error);
|
||||
}
|
||||
});
|
||||
|
@ -515,7 +527,8 @@ import permision from "@/components/permission.js";
|
|||
console.log("that.current=======",that.current)
|
||||
console.log("that.page=======",that.page)
|
||||
that.$Request.get("/app/artificer/selectArtificerList", data).then(res => {
|
||||
that.loading = false;
|
||||
// that.loading = false;
|
||||
uni.hideLoading();
|
||||
if (res.code == 0) {
|
||||
for (var i = 0; i < res.data.list.length; i++) {
|
||||
if (res.data.list[i].lifePhoto) {
|
||||
|
@ -690,7 +703,7 @@ import permision from "@/components/permission.js";
|
|||
this.getTpCount();
|
||||
this.getTpMy();
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
// uni.hideLoading();
|
||||
uni.showModal({
|
||||
showCancel: false,
|
||||
title: '投票失败',
|
||||
|
@ -866,6 +879,19 @@ import permision from "@/components/permission.js";
|
|||
}
|
||||
})
|
||||
}
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: this.arr,
|
||||
success(re) {
|
||||
console.log(JSON.stringify(re), 111111111111)
|
||||
var datas = JSON.stringify(re);
|
||||
if (datas.indexOf("accept") != -1) {
|
||||
// console.log(re)
|
||||
}
|
||||
},
|
||||
fail: (res) => {
|
||||
// console.log(res)
|
||||
}
|
||||
})
|
||||
this.defaultIndex = [0, 0, 0]
|
||||
// this.$refs.uDropdown.close();
|
||||
this.page = 1
|
||||
|
@ -946,7 +972,6 @@ import permision from "@/components/permission.js";
|
|||
|
||||
//地图初始化,
|
||||
getLocation(isHighAccuracy = false) {
|
||||
console.log('获取地理位置,精度:', isHighAccuracy);
|
||||
let that = this;
|
||||
//获取地理坐标
|
||||
uni.getLocation({
|
||||
|
@ -957,11 +982,8 @@ import permision from "@/components/permission.js";
|
|||
success: function(res) {
|
||||
let longitude = res.longitude;
|
||||
let latitude = res.latitude;
|
||||
console.log('当前位置的经度:' + longitude);
|
||||
console.log('当前位置的纬度:' + latitude);
|
||||
getApp().globalData['longitude'] = longitude;
|
||||
getApp().globalData['latitude'] = latitude;
|
||||
console.log('定位成功', latitude, longitude);
|
||||
if (that.amap) {
|
||||
uni.amap.setCenter([longitude, latitude])
|
||||
}
|
||||
|
@ -984,7 +1006,6 @@ import permision from "@/components/permission.js";
|
|||
this.amap = amap;
|
||||
let that = this;
|
||||
setTimeout(() => {
|
||||
uni.hideLoading();
|
||||
this.current = 0;
|
||||
uni.getLocation({
|
||||
// type: 'wgs84',
|
||||
|
@ -992,6 +1013,7 @@ import permision from "@/components/permission.js";
|
|||
highAccuracyExpireTime: 3000,
|
||||
isHighAccuracy: true,
|
||||
success: function(res) {
|
||||
// uni.hideLoading();
|
||||
let longitude = res.longitude;
|
||||
let latitude = res.latitude;
|
||||
console.log('当前位置的经度=========1:' + longitude);
|
||||
|
@ -1004,12 +1026,11 @@ import permision from "@/components/permission.js";
|
|||
that.latitude = location[1]
|
||||
console.log("locationlocationlocationlocation>",location)
|
||||
uni.amap.setCenter([location[0],location[1]])
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
fail(res) {
|
||||
// uni.hideLoading();
|
||||
console.log('定位失败!', res);
|
||||
}
|
||||
});
|
||||
|
@ -1027,8 +1048,6 @@ import permision from "@/components/permission.js";
|
|||
},
|
||||
creatMarker(map) {
|
||||
let that = this;
|
||||
console.log("uni.amap=============>",uni.amap)
|
||||
console.log("map=============>",map)
|
||||
webMap.addMarker(uni.amap, map, this.orderList, (e, udata) => {
|
||||
that.currentMarkerIndex = udata.userId;
|
||||
that.showPopup = true;
|
||||
|
|
|
@ -63,17 +63,17 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="therapist-mian-bottom">
|
||||
<view class="flex flex-wrap align-center" v-if="item.consortiaName">
|
||||
<image class="therapist-bottom-img" src="../../static/dituzhaoren5.png">
|
||||
</image>
|
||||
<view class="therapist-mian-bottom-text">{{item.consortiaName}}</view>
|
||||
</view>
|
||||
<view class="flex align-center">
|
||||
<image class="therapist-bottom-dingwei" src="../../static/dituzhaoren6.png"></image>
|
||||
<view class="therapist-bottom-dingwei-text">
|
||||
{{ item.distance }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex flex-wrap align-center" v-if="item.consortiaName">
|
||||
<image class="therapist-bottom-img" src="../../static/dituzhaoren5.png">
|
||||
</image>
|
||||
<view class="therapist-mian-bottom-text">{{item.consortiaName}}</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="terap-button" v-if="item.status == 1" @click.stop="goOrder(item)">
|
||||
确认
|
||||
|
|
Loading…
Reference in New Issue