视频圈 地位

This commit is contained in:
Mr.jiang 2024-08-02 21:05:22 +08:00
parent 4f3d568a76
commit 725c1c10fa
8 changed files with 307 additions and 295 deletions

View File

@ -96,6 +96,7 @@ export default {
}); });
this.isSwitch = this.defaultSwitch; this.isSwitch = this.defaultSwitch;
this.changeAnimation(); this.changeAnimation();
console.log("开关--------------",this.isSwitch)
}, },
methods: { methods: {
changeSwitch(isSwitch) { changeSwitch(isSwitch) {

View File

@ -404,7 +404,8 @@
type:'center', type:'center',
parType:'', parType:'',
contentVideo:'', contentVideo:'',
type:'center' Key2:'ad684a15ebbb6f5d12c407a3d593c949',
latadd:''
} }
}, },
onShareAppMessage(res) { // onShareAppMessage(res) { //
@ -460,70 +461,16 @@
} }
}) })
uni.getLocation({ uni.getLocation({
type: 'wgs84', type: 'gcj02',
geocode: true, //true geocode: true, //true
highAccuracyExpireTime: 500,
success: function(res) { success: function(res) {
console.log(res, '地理位置') console.log(res, '地理位置')
that.latitude = res.latitude that.latitude = res.latitude
that.longitude = res.longitude that.longitude = res.longitude
uni.setStorageSync('latitude', res.latitude) uni.setStorageSync('latitude', res.latitude)
uni.setStorageSync('longitude', res.longitude) uni.setStorageSync('longitude', res.longitude)
// #ifdef APP-PLUS
that.city = res.address.city
// that.selectCity(that.longitude, that.latitude);
uni.setStorageSync('city', res.address.city)
// that.page = 1
// that.getorderlist('')
that.getKTCityList();
// #endif
that.selectCity(that.longitude,that.latitude) that.selectCity(that.longitude,that.latitude)
// var dizhi={
// key:'4f23770b6e53b96e7d0661a7ccfb9c21',
// location:that.longitude+','+res.latitude,
// radius:'1000',
// extensions:'all',
// output:'JSON'
// }
// uni.request({
// url: 'https://restapi.amap.com/v3/geocode/regeo',
// data:dizhi,
// method:'GET',
// success(rea) {
// console.log("", rea)
// if (rea.statusCode ==200) {
// that.city = rea.data.regeocode.addressComponent.township;
// // uni.setStorageSync('citySou',rea.data.regeocode.addressComponent.city)
// } else {
// console.log("")
// }
// }
// });
// #ifdef H5
// that.city = that.latitude+','+that.longitude
// that.selectCity(that.longitude, that.latitude);
// #endif
// #ifdef MP-WEIXIN
uni.request({
url: 'https://apis.map.qq.com/ws/geocoder/v1/?location=' + that.latitude +
',' + that.longitude + '&key=' + that.txAppKey,
success(re) {
if (re.statusCode === 200) {
let citydata = re.data.result.address_component.city
// console.log("", citydata)/
that.city = citydata ? citydata : '未知'
uni.setStorageSync('city', citydata)
that.getKTCityList();
// that.page = 1
// that.getorderlist('')
} else {
console.log("获取信息失败,请重试!")
}
}
});
// #endif
}, },
fail: function(e) { fail: function(e) {
this.cuowu=e this.cuowu=e
@ -540,6 +487,14 @@
that.XCXIsSelect = this.$queue.getData("XCXIsSelect"); that.XCXIsSelect = this.$queue.getData("XCXIsSelect");
let userId = uni.getStorageSync('userId') let userId = uni.getStorageSync('userId')
if (userId) { if (userId) {
var add=uni.getStorageSync('cityAdderss');
if(add!=''){
that.city=add.name;
var location=add.location.split(",")
that.longitude = location[0]
that.latitude = location[1]
console.log("location=========>",location)
}
this.getTpMy(); this.getTpMy();
this.getTpCount(); this.getTpCount();
// this.checkNewUser(); // this.checkNewUser();
@ -554,8 +509,7 @@
this.getKTCityList(); this.getKTCityList();
this.getHomeArtificerList(); this.getHomeArtificerList();
this.getHomeNearbyList(); this.getHomeNearbyList();
this.latitude = uni.getStorageSync('latitude')
this.longitude = uni.getStorageSync('longitude')
}else{ }else{
uni.navigateTo({ uni.navigateTo({
url: '/pages/public/login' url: '/pages/public/login'
@ -646,32 +600,50 @@
goCity(){ goCity(){
var that = this var that = this
uni.navigateTo({ uni.navigateTo({
url:'/pages/index/searchAddress' url:'/pages/index/searchAddress?text='+'index'
}) })
// uni.chooseLocation({
// success: function(res) {
// console.log('' + res);
// that.detailaddress = res.name
// that.latitude = res.latitude
// that.longitude = res.longitude
// that.selectCity(res.longitude, res.latitude);
// }
// });
}, },
selectCity(longitude, latitude) { selectCity(longitude, latitude) {
var that=this; var that=this;
that.$Request.get('/app/Login/selectCity?lat=' + latitude + '&lng=' + longitude).then(res => { var longitude = that.longitude;
if (res.code == 0) { var latitude = that.latitude;
let chinaAddressParts = res.data.address.match(/^(?<province>[^省]+省|[^自]+自治区|[^市]+市|[^县]+县|[^区]+区|[^town]+town|[^镇]+镇)?(?<city>[^市]+市|[^县]+县|[^区]+区|[^town]+town|[^镇]+镇)?(?<district>[^区]+区|[^县]+县|[^乡]+乡|[^街道]+街道)?(?<street>.+)$/); let amapKey = that.Key2; // API Key
// uni.setStorageSync('city', res.data.province) let url = `https://restapi.amap.com/v3/geocode/regeo?key=${amapKey}&location=${longitude},${latitude}&radius=1000`;
that.city=chinaAddressParts.groups.street uni.request({
that.page = 1 url: url,
// that.getorderlist('') success: (response) => {
that.getKTCityList(); 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.city=that.latadd
that.page = 1
that.getKTCityList();
} 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(){// searchBtn(){//
uni.navigateTo({ uni.navigateTo({

View File

@ -1,13 +1,28 @@
<template> <template>
<view class="content"> <view class="content">
<view class="flex align-center index-mian"> <view class="flex align-center index-mian">
<uni-search-bar placeholder="请输入项目名称" @service="serviceTrue" @confirm="search" :cancelext="'取消'" v-model="searchValue" @input="input" <uni-search-bar placeholder="请输入地址" @service="serviceTrue" @confirm="search" :cancelext="'取消'" v-model="searchValue" @input="input"
@clear="clear"> @clear="clear">
</uni-search-bar> </uni-search-bar>
<view class="search-btn" @click="searchBtn" > <view class="search-btn" @click="searchBtn" >
搜索 搜索
</view> </view>
</view> </view>
<view class="content-list">
<view class="content-list-top">
<view class="list-left">
<image class="tubiao" src="../../static/orderDetail/dingwei.png" mode=""></image>
<span>{{adderssData[0].name}}</span>
</view>
<view class="list-right" @click="shuaxin">
<span>重新定位</span>
<image class="tubiao" src="../../static/shuaxin.png" mode=""></image>
</view>
</view>
<view class="list" @click="activeAdder(item)" v-for="(item,index) in adderssData" :key="index">
{{item.name}}
</view>
</view>
</view> </view>
</template> </template>
@ -15,27 +30,39 @@
export default{ export default{
data(){ data(){
return{ return{
latitude:'43.812042', latitude:'43.896819',
longitude:'125.438430', longitude:'125.430478',
serviceTrue:true, serviceTrue:true,
searchValue: '中意国际', searchValue: '',
address:'https://restapi.amap.com/v3/geocode/regeo', address:'https://restapi.amap.com/v3/geocode/regeo',
gaojiIp:'https://restapi.amap.com/v5/place/text' gaojiIp:'https://restapi.amap.com/v5/place/text',
gaojiIp1:'https://restapi.amap.com/v5/ip/location',
gaojiIp2:'https://restapi.amap.com/v3/geocode/geo',
Key1:'4f23770b6e53b96e7d0661a7ccfb9c21',
Key2:'ad684a15ebbb6f5d12c407a3d593c949',
adderssData:[],
textAdderss:'',
current:''
} }
}, },
onLoad() { onLoad(e) {
var that=this; var that=this;
that.getAdderrs() if(e){
that.textAdderss=e.text
that.current=e.current
}
uni.showLoading({
title: '加载中...'
})
// that.getDingwei()
uni.getLocation({ uni.getLocation({
type: 'wgs84', type: 'gcj02',
geocode: true, //true geocode: true, //true
highAccuracyExpireTime: 500,
success: function(res) { success: function(res) {
console.log(res, '地理位置') that.latitude = res.latitude
// that.latitude = res.latitude that.longitude = res.longitude
// that.longitude = res.longitude that.getDingwei()
// that.getAdderrs()
}, },
fail: function(e) { fail: function(e) {
console.log("获取信息失败,请重试!",e) console.log("获取信息失败,请重试!",e)
@ -43,36 +70,85 @@
}) })
}, },
methods:{ methods:{
activeAdder(item){
if(this.textAdderss=='index'){
uni.setStorageSync('cityAdderss',item)
uni.switchTab({
url:'/pages/index/index'
})
}else{
item.current=this.current
uni.setStorageSync('cityTherapist',item)
uni.switchTab({
url:'/pages/therapist/therapist'
})
}
},
shuaxin(){
this.getDingwei()
},
getDingwei(){
var that=this;
let longitude = that.longitude;
let latitude = that.latitude;
let amapKey = that.Key2; // API Key
let url = `https://restapi.amap.com/v3/geocode/regeo?key=${amapKey}&location=${longitude},${latitude}&radius=3000`;
uni.request({
url: url,
success: (response) => {
uni.hideLoading();
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 latadd = address.replace(province,'').replace(city,'').replace(district,'').replace(township,'')
that.getAdderrs(latadd,city)
//
} else {
uni.hideLoading();
uni.showToast({
icon:'error',
title:'逆地理编码失败'
})
console.log('逆地理编码失败', response.data);
}
},
fail: (error) => {
uni.hideLoading();
uni.showToast({
icon:'error',
title:'网络请求失败'
})
console.log('网络请求失败', error);
}
});
},
input(res) {// input(res) {//
this.searchValue=res; this.searchValue=res;
}, },
searchBtn(){// searchBtn(){//
this.getAdderrs() this.getDingwei()
}, },
getAdderrs(){ getAdderrs(latadd,city){
var that=this; var that=this;
// var dizhi={
// keyword:that.searchValue,
// key:'4f23770b6e53b96e7d0661a7ccfb9c21',
// location:that.longitude+','+that.latitude,
// radius:'1000',
// extensions:'all',
// output:'JSON'
// }
var dizhi={ var dizhi={
keywords:that.searchValue, key:that.Key2,
key:'4f23770b6e53b96e7d0661a7ccfb9c21', keywords:that.searchValue!=''?that.searchValue:latadd,
location:that.longitude+','+that.latitude, // types:'120000',
region:city,
city_limit:true,
show_fields: "name,address",
} }
uni.request({ uni.request({
url:that.gaojiIp, url:that.gaojiIp,
data:dizhi, data:dizhi,
method:'GET', method:'GET',
success(rea) { success(res) {
console.log("获取城市名称成功", rea) if (res.statusCode ==200) {
if (rea.statusCode ==200) { console.log("获取城市名称成功", res.data.pois)
// that.city = rea.data.regeocode.addressComponent.township; that.adderssData=res.data.pois
// uni.setStorageSync('citySou',rea.data.regeocode.addressComponent.city)
} else { } else {
console.log("获取信息失败,请重试!") console.log("获取信息失败,请重试!")
} }
@ -84,7 +160,41 @@
</script> </script>
<style scoped> <style scoped>
.list-left,.list-right{
display: flex;
flex-direction: row;
align-items: center;
}
.list-left span{
margin-left: 5px;
}
.list-right span{
margin-right: 5px;
}
.tubiao{
width: 15px;
height: 18px;
}
.content-list-top{
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
margin: 20px 0px;
}
.list{
width: 100%;
height: 40px;
line-height: 40px;
color: #000;
font-size: 14px;
border-bottom: 1px solid #ccc;
}
.content-list{
width: 95%;
margin: 0 auto;
}
/deep/.uni-searchbar__cancel{ /deep/.uni-searchbar__cancel{
display: none; display: none;
} }
@ -149,5 +259,6 @@
.content{ .content{
width: 100%; width: 100%;
height: 100vh; height: 100vh;
background-color: #fff;
} }
</style> </style>

View File

@ -289,15 +289,6 @@
} }
}, },
methods: { methods: {
itemClick(item) { //
if(item.type){
}
uni.navigateTo({
url: '/pages/my/fuwuDateil?id=' + item.id + '&limit=' + '10' + '&page=' +
'1'
})
},
goMsg() { // goMsg() { //
let data = { let data = {
userId: uni.getStorageSync('userId'), userId: uni.getStorageSync('userId'),

View File

@ -12,12 +12,8 @@
action-text="搜索" @custom="onSearch()"> action-text="搜索" @custom="onSearch()">
</u-search> </u-search>
<view class="flex align-center justify-between" style="margin-left: 8rpx;"> <view class="flex align-center justify-between" style="margin-left: 8rpx;">
<selectSwitchDitu @change="switch1Change" :switchList="switchList"/> <selectSwitchDitu :key="componentKey" @change="switch1Change" :switchList="switchList"/>
</view> </view>
<!--<view class="map-list">
<image class="map-img" src="../../static/map1.png"></image>
<image class="map-img" src="../../static/map2.png"></image>
</view>-->
</view> </view>
<view class="fenlei"> <view class="fenlei">
<image class="fenlei-img" src="../../static/excel1.png"></image> <image class="fenlei-img" src="../../static/excel1.png"></image>
@ -36,9 +32,7 @@
<image class="touxiang-left-content-img" v-if="item.isHot == 1" <image class="touxiang-left-content-img" v-if="item.isHot == 1"
src="https://admin.sjajk.com/file/uploadPath/2023/02/16/9ae1b7e9fa931b5fc24cd8edecc10d9f.png"> src="https://admin.sjajk.com/file/uploadPath/2023/02/16/9ae1b7e9fa931b5fc24cd8edecc10d9f.png">
</image> </image>
<!-- <view class="zpmore_view_left" v-if="item.technicianType==1" @click.stop="saveImgss(item.technicianType, 0)">
<image src="../../static/dituzhaoren1.png" mode=""></image>
</view> -->
<image class="touxiang-frame" :src="technicianType=='3'?'../../static/vip/grade1-1.gif':technicianType=='4'?'../../static/vip/grade2-1.gif':'../../static/vip/grade3-1.gif'"></image> <image class="touxiang-frame" :src="technicianType=='3'?'../../static/vip/grade1-1.gif':technicianType=='4'?'../../static/vip/grade2-1.gif':'../../static/vip/grade3-1.gif'"></image>
</view> </view>
<view class="list-right"> <view class="list-right">
@ -54,13 +48,7 @@
<view class="timea-time" v-if="item.status == 1">{{item.time}}</view> <view class="timea-time" v-if="item.status == 1">{{item.time}}</view>
</view> </view>
</view> </view>
<!--<view class="keyuyue">
<view class="flex">
<image class="timea-img"></image>
<view class="timea-fu">{{item.state == 1?"可服务":item.state == 2?"今日可约":"休息中"}}</view>
<view v-if="item.status == 1 && item.time">{{ item.time}}</view>
</view>
</view>-->
</view> </view>
</view> </view>
</view> </view>
@ -69,16 +57,14 @@
</view> </view>
<view class="therapist-mian-top"> <view class="therapist-mian-top">
<view class="therap-pin"> <view class="therap-pin">
<!--<image style="width: 33rpx; height: 33rpx; margin-right: 3rpx;" src="../../static/dituzhaoren3.png" mode="">
</image>-->
<span>评论</span> <span>评论</span>
<span class="therapist-mian-view-text"> <span class="therapist-mian-view-text">
{{ item.commentCount ? item.commentCount : 0 }} {{ item.commentCount ? item.commentCount : 0 }}
</span> </span>
</view> </view>
<view class="therap-pin"> <view class="therap-pin">
<!--<image style="width: 32rpx; height: 32rpx; margin-right: 3rpx;" src="../../static/dituzhaoren4.png" mode="">
</image>-->
<span>收藏</span> <span>收藏</span>
<span class="therapist-mian-view-text"> <span class="therapist-mian-view-text">
{{ item.collectCount ? item.collectCount : 0 }} {{ item.collectCount ? item.collectCount : 0 }}
@ -91,28 +77,16 @@
<view v-if="item.consortiaName" class="therapist-mian-bottom-text">{{item.consortiaName}}</view> <view v-if="item.consortiaName" class="therapist-mian-bottom-text">{{item.consortiaName}}</view>
</view> </view>
<view class="flex align-center" > <view class="flex align-center" >
<!--<image style="width: 24rpx; height: 26rpx; margin-right: 5rpx;" src="../../static/dituzhaoren6.png"></image>-->
<view class="therapist-bottom-dingwei-text"> <view class="therapist-bottom-dingwei-text">
{{ item.distance }} {{ item.distance }}
</view> </view>
</view> </view>
</view> </view>
<!---<view class="therapist-mian-bottom">
<view class="text-center make-now" v-if="item.status == 1" @click.stop="goOrder(item)">
立即预约
</view>
<view class="text-center make-now1" @click.stop="showTips()" v-else
style="">
立即预约
</view>
</view>-->
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<empty v-if="orderList.length == 0"></empty> <empty v-if="orderList.length == 0&&current == 0"></empty>
</view> </view>
<view v-show="current === 1"> <view v-show="current === 1">
<view class="flex text-center flex-wrap" <view class="flex text-center flex-wrap"
@ -235,7 +209,6 @@
import selectSwitchDitu from "@/components/xuan-switch/xuan-switch-ditu.vue"; import selectSwitchDitu from "@/components/xuan-switch/xuan-switch-ditu.vue";
import meTabs from "@/components/mescroll-uni/me-tabs/me-tabs.vue"; import meTabs from "@/components/mescroll-uni/me-tabs/me-tabs.vue";
import empty from '@/components/empty.vue' import empty from '@/components/empty.vue'
import RenDropdownFilter from '@/components/ren-dropdown-filter/ren-dropdown-filter.vue' import RenDropdownFilter from '@/components/ren-dropdown-filter/ren-dropdown-filter.vue'
import commonConfig from 'common/config.js'; import commonConfig from 'common/config.js';
@ -250,7 +223,7 @@ import permision from "@/components/permission.js";
meTabs, meTabs,
empty, empty,
RenDropdownFilter, RenDropdownFilter,
selectSwitchDitu selectSwitchDitu,
}, },
data() { data() {
return { return {
@ -285,39 +258,6 @@ import permision from "@/components/permission.js";
value3: '', value3: '',
game: [], game: [],
defaultIndex: [0, 0, 0], defaultIndex: [0, 0, 0],
filterData: [
[{
label: '推荐',
value: '',
}],
[{
label: '服务热度',
value: '0',
},
{
label: '从高到低',
value: '1',
},
{
label: '从低到高',
value: '2',
}
],
[{
label: '距离',
value: '0',
},
{
label: '从远到近',
value: '2',
},
{
label: '从近到远',
value: '1',
}
],
],
list: [{ list: [{
name: '综合', name: '综合',
id: 1 id: 1
@ -366,7 +306,10 @@ import permision from "@/components/permission.js";
currentMarkerIndex: -1, currentMarkerIndex: -1,
showPopup: false, showPopup: false,
dataIndex:'', dataIndex:'',
userId:'' userId:'',
Key2:'ad684a15ebbb6f5d12c407a3d593c949',
latadd:'',
componentKey:0
} }
}, },
@ -378,13 +321,11 @@ import permision from "@/components/permission.js";
if(e){ if(e){
this.artificerName=e.searchValue this.artificerName=e.searchValue
} }
that.getTypeList();
uni.getLocation({ uni.getLocation({
type: 'gcj02', type: 'gcj02',
geocode: true, //true geocode: true, //true
highAccuracyExpireTime: 500, highAccuracyExpireTime: 500,
success: function(res) { success: function(res) {
console.log(res, '地理位置-----------------------》')
that.latitude = res.latitude that.latitude = res.latitude
that.longitude = res.longitude that.longitude = res.longitude
@ -396,8 +337,9 @@ import permision from "@/components/permission.js";
if (that.infoWindow) { if (that.infoWindow) {
that.infoWindow.setPosition(new TMap.LatLng(res.latitude, res.longitude)); that.infoWindow.setPosition(new TMap.LatLng(res.latitude, res.longitude));
} }
that.page = 1 that.page = 1;
that.getTypeList(); that.getTypeList();
that.selectCity(that.longitude,that.latitude)
}, },
fail: function(e) { fail: function(e) {
console.log('获取地址失败1', e) console.log('获取地址失败1', e)
@ -433,7 +375,16 @@ import permision from "@/components/permission.js";
let that = this let that = this
that.getKTCityList(); that.getKTCityList();
that.XCXIsSelect = this.$queue.getData("XCXIsSelect"); that.XCXIsSelect = this.$queue.getData("XCXIsSelect");
that.city = uni.getStorageSync('city') ? uni.getStorageSync('city') : '请选择城市' var add=uni.getStorageSync('cityTherapist');
if(add!=''){
that.city=add.name
var location=add.location.split(",")
that.longitude = location[0]
that.latitude = location[1]
that.componentKey++
that.initMap();
}
that.getTpCount(); that.getTpCount();
that.getTpMy(); that.getTpMy();
that.userId = uni.getStorageSync('userId') that.userId = uni.getStorageSync('userId')
@ -453,7 +404,7 @@ import permision from "@/components/permission.js";
highAccuracyExpireTime: 500, highAccuracyExpireTime: 500,
geocode: true, //true geocode: true, //true
success: function(res) { success: function(res) {
console.log(res, '地理位置') console.log(res, '地理位置onShow')
that.latitude = res.latitude that.latitude = res.latitude
that.longitude = res.longitude that.longitude = res.longitude
that.page = 1 that.page = 1
@ -467,7 +418,6 @@ import permision from "@/components/permission.js";
} }
} }
that.myId = uni.getStorageSync('userId') that.myId = uni.getStorageSync('userId')
// console.log(that.showModal, '------', that.myId)
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
// //
if (that.myId) { if (that.myId) {
@ -479,8 +429,8 @@ import permision from "@/components/permission.js";
// #endif // #endif
}, },
onReady() { onReady() {
console.log('this ->', this, uni);
this.initMap(); this.initMap();
//this.initMapPointThread(); //this.initMapPointThread();
}, },
onUnload() { onUnload() {
@ -488,39 +438,26 @@ import permision from "@/components/permission.js";
}, },
methods: { methods: {
changeClick(index,item){ changeClick(index,item){
// this.classifyId=item.id
this.artificerName=''; this.artificerName='';
this.technicianType=item.id this.technicianType=item.id
console.log('this.technicianType===========>',this.technicianType)
this.getlist() this.getlist()
}, },
getlist() { getlist() {
// if (this.city === '') { var that=this;
// return;
// }
// if (this.tabIndex == 0) {
// return;
// }
// let index = this.list[this.listIndex].id
let index = 2 let index = 2
let data = { let data = {
// id: curTab, artificerName: that.artificerName,
artificerName: this.artificerName, classifyId: that.tabIndex,
classifyId: this.tabIndex, page: that.page,
page: this.page, limit: that.limit,
limit: this.limit, technicianType:that.technicianType,
technicianType:this.technicianType,
// massageTypeId: this.massageTypeId,
// condition: this.value1, //
// authentication: this.value2, //
by: index, // by: index, //
latitude: this.latitude, latitude: that.latitude,
longitude: this.longitude, longitude: that.longitude,
city: this.city city: that.city
} }
// console.log(data) that.$Request.get("/app/artificer/selectArtificerList", data).then(res => {
this.$Request.get("/app/artificer/selectArtificerList", data).then(res => { that.loading = false;
this.loading = false;
if (res.code == 0) { if (res.code == 0) {
for (var i = 0; i < res.data.list.length; i++) { for (var i = 0; i < res.data.list.length; i++) {
if (res.data.list[i].lifePhoto) { if (res.data.list[i].lifePhoto) {
@ -534,24 +471,24 @@ import permision from "@/components/permission.js";
} }
} }
if (this.page == 1) { if (that.page == 1) {
this.orderList = res.data.list that.orderList = res.data.list
} else { } else {
this.orderList = [...this.orderList, ...res.data.list] that.orderList = [...that.orderList, ...res.data.list]
} }
// //
if (this.amap) { if (that.amap) {
// debugger; // debugger;
console.log(this.orderList) console.log("that.orderList=========>",that.orderList)
if (this.orderList.length > 0) { if (that.orderList.length > 0) {
let rmap = {}; let rmap = {};
let onLineArtificerList = this.orderList.filter((item) => item.status == 1); let onLineArtificerList = that.orderList.filter((item) => item.status == 1);
onLineArtificerList.forEach(x => { onLineArtificerList.forEach(x => {
rmap[x.userId] = x.latitude + ',' + x.longitude; // rmap[x.userId] = x.latitude + ',' + x.longitude; //
}); });
console.log('在orderList初始化', JSON.parse(JSON.stringify(rmap))); console.log('在orderList初始化', JSON.parse(JSON.stringify(rmap)));
this.pointMap = rmap; that.pointMap = rmap;
this.creatMarker(rmap); that.creatMarker(rmap);
} }
} }
@ -596,7 +533,6 @@ import permision from "@/components/permission.js";
}else{ }else{
this.current = 0; this.current = 0;
} }
console.log('switch1 发生 change 事件,携带值为', Number(e),e)
}, },
showTips() { showTips() {
uni.showToast({ uni.showToast({
@ -616,7 +552,10 @@ import permision from "@/components/permission.js";
return; return;
} }
// #endif // #endif
this.Cityshow = true; var that = this
uni.navigateTo({
url:'/pages/index/searchAddress?text='+'therapist'+'&current='+that.current
})
}, },
async checkPermission() { async checkPermission() {
let status = permision.isIOS ? await permision.requestIOS('location') : await permision.requestAndroid( let status = permision.isIOS ? await permision.requestIOS('location') : await permision.requestAndroid(
@ -779,19 +718,36 @@ import permision from "@/components/permission.js";
} }
}); });
}, },
// selectCity(longitude, latitude) { selectCity(longitude, latitude) {
// this.$Request.get('/app/Login/selectCity?lat=' + latitude + '&lng=' + longitude).then(res => { var that=this;
// if (res.code == 0) { var longitude = that.longitude;
// // this.city = res.data.city ? res.data.city : '' var latitude = that.latitude;
// // uni.setStorageSync('city', res.data.city) let amapKey = that.Key2; // API Key
// let data = { let url = `https://restapi.amap.com/v3/geocode/regeo?key=${amapKey}&location=${longitude},${latitude}&radius=1000`;
// num: 1, uni.request({
// size: 10 url: url,
// } success: (response) => {
// this.getData(data) 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.city=that.latadd
that.page = 1
that.getKTCityList();
} else {
console.log('逆地理编码失败', response.data);
}
},
fail: (error) => {
console.log('网络请求失败', error);
}
});
},
tanChange(index, item) { tanChange(index, item) {
this.orderIndex = index this.orderIndex = index
this.tabIndex = item.id this.tabIndex = item.id
@ -897,36 +853,6 @@ import permision from "@/components/permission.js";
this.page = 1 this.page = 1
this.getlist() this.getlist()
}, },
//
goSelectCity() {
// uni.navigateTo({
// url: '/pages/index/citys/citys'
// });
let that = this
uni.chooseLocation({
success: function(res) {
console.log('位置名称:' + res.name);
console.log('详细地址:' + res.address);
console.log('纬度:' + res.latitude);
console.log('经度:' + res.longitude);
that.latitude = res.latitude
that.longitude = res.longitude
uni.setStorageSync('latitude', res.latitude)
uni.setStorageSync('longitude', res.longitude)
that.selectCity(that.longitude, that.latitude);
}
});
},
selectCity(longitude, latitude) {
this.$Request.get('/app/Login/selectCity?lat=' + latitude + '&lng=' + longitude).then(res => {
if (res.code == 0) {
this.city = res.data.city ? res.data.city : '未知'
uni.setStorageSync('city', res.data.city)
this.page = 1
this.getlist()
}
});
},
// //
goLowTaking() { goLowTaking() {
uni.navigateTo({ uni.navigateTo({
@ -1039,11 +965,19 @@ import permision from "@/components/permission.js";
success: function(res) { success: function(res) {
let longitude = res.longitude; let longitude = res.longitude;
let latitude = res.latitude; let latitude = res.latitude;
console.log('当前位置的经度:' + longitude); console.log('当前位置的经度=========1' + longitude);
console.log('当前位置的纬度:' + latitude); console.log('当前位置的纬度2=========' + latitude);
console.log('定位成功', latitude, longitude);
if (amap) { if (amap) {
uni.amap.setCenter([longitude, latitude]) var add=uni.getStorageSync('cityTherapist');
if(add!=''){
var location=add.location.split(",")
that.longitude = location[0]
that.latitude = location[1]
console.log("locationlocationlocationlocation>",location)
uni.amap.setCenter([location[0],location[1]])
}
} }
}, },
fail(res) { fail(res) {
@ -1064,6 +998,8 @@ import permision from "@/components/permission.js";
}, },
creatMarker(map) { creatMarker(map) {
let that = this; let that = this;
console.log("uni.amap=============>",uni.amap)
console.log("map=============>",map)
webMap.addMarker(uni.amap, map, this.orderList, (e, udata) => { webMap.addMarker(uni.amap, map, this.orderList, (e, udata) => {
that.currentMarkerIndex = udata.userId; that.currentMarkerIndex = udata.userId;
that.showPopup = true; that.showPopup = true;
@ -1263,6 +1199,18 @@ import permision from "@/components/permission.js";
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.localName{
width: 100px;
margin-left: 4rpx;
font-weight: bold;
font-size: 30rpx;
color: #333333;
margin-top: 1px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.fenlei-img{ .fenlei-img{
width: 170rpx; width: 170rpx;
height: 34rpx; height: 34rpx;
@ -1604,13 +1552,7 @@ import permision from "@/components/permission.js";
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
} }
.localName{
width: 160rpx;
margin-left: 4rpx;
font-weight: bold;
font-size: 30rpx;
color: #333;
}
.dingwei-img{ .dingwei-img{
width:33.33rpx; width:33.33rpx;
height:37.5rpx; height:37.5rpx;

View File

@ -1,6 +1,7 @@
<!-- 滑动切换选项卡+吸顶演示待完善 --> <!-- 滑动切换选项卡+吸顶演示待完善 -->
<template> <template>
<view class="content"> <view class="content">
<scroll-view v-if="getVideoData.length>0" scroll-y="true" class="scroll-Y" @scrolltolower="loadMore">
<view class="top-view"> <view class="top-view">
<image class="info-cover" <image class="info-cover"
src="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-5d36bb3d-8e98-4f00-ab8b-b018dc4f5dc6/17b0292c-8a63-4b7b-a6a6-724f416a9958.jpg" src="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-5d36bb3d-8e98-4f00-ab8b-b018dc4f5dc6/17b0292c-8a63-4b7b-a6a6-724f416a9958.jpg"
@ -66,7 +67,6 @@
</view> </view>
</view> </view>
<scroll-view v-if="getVideoData.length>0" scroll-y="true" class="scroll-Y" @scrolltolower="loadMore">
<template class="template-view"> <template class="template-view">
<view class="scroll-list" v-for="(item,index) in getVideoData" :key="index"> <view class="scroll-list" v-for="(item,index) in getVideoData" :key="index">
<view class="scroll-left"> <view class="scroll-left">
@ -490,14 +490,10 @@
width: 100%; width: 100%;
height: 700px; height: 700px;
background-color: #fff; background-color: #fff;
border-top: 6px solid #f7f7f7;
margin-top: 350px;
} }
.top-view { .top-view {
background-color: #fff; background-color: #fff;
position: fixed; border-bottom: 6px solid #f7f7f7;
top: 0;
z-index: 200;
} }
.playState{ .playState{
width: 100%; width: 100%;
@ -592,8 +588,7 @@
color: #fff; color: #fff;
} }
/deep/.uni-scroll-view-content{ /deep/.uni-scroll-view-content{
width: 96%; width: 100%;
margin: 0 auto;
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;

BIN
static/shuaxin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -13,7 +13,7 @@ export function creatAMap(key){
viewMode: '2D', //默认使用 2D 模式 viewMode: '2D', //默认使用 2D 模式
zoom: 11, //地图级别 zoom: 11, //地图级别
//center: [116.397428, 39.90923], //地图中心点 center: [116.397428, 39.90923], //地图中心点
}); });
// amapLocation(); // amapLocation();
amapLocation(map); amapLocation(map);