flat: 地图修改

This commit is contained in:
Apcallover
2024-06-11 10:10:29 +08:00
parent 4dce135e0d
commit d19b4d502b
15 changed files with 1564 additions and 42 deletions

View File

@@ -102,7 +102,7 @@
</view>
<view class="map">
<super-map ref="uMap" style="width: 100%;height: 100%;" :latitude="latitude" :longitude="longitude"
:open="true" :zoom="14" :min-zoom="10" :max-zoom="20" :MapUrl="$config.supperMap"
:open="true" :zoom="14" :min-zoom="10" :max-zoom="20" :MapUrl="$config.supperMap" :init="false"
:flag-tip="false"></super-map>
</view>
<!-- <map class="map" :latitude="latitude" :longitude="longitude" :markers="covers"></map> -->
@@ -324,19 +324,23 @@
detail(self.missionNo).then(res => {
self.info = res.data.data;
self.status = res.data.data.detailStatus;
AddressToLocation({
smart_address: res.data.data.address
}).then((result) => {
console.log('result', result)
self.latitude = result.location.lat;
self.longitude = result.location.lon;
self.covers[0].latitude = result.location.lat;
self.covers[0].longitude = result.location.lon;
})
// AddressToLocation({
// smart_address: res.data.data.address
// }).then((result) => {
// console.log('result', result)
// self.latitude = result.location.lat;
// self.longitude = result.location.lon;
// self.covers[0].latitude = result.location.lat;
// self.covers[0].longitude = result.location.lon;
// })
// self.latitude = self.info.lat;
// self.longitude = self.info.lon;
// self.covers[0].latitude = self.info.lat;
// self.covers[0].longitude = self.info.lon;
self.$refs.uMap.initMap({
lat: self.info.lat,
lon: self.info.lon,
})
self.showDetail = true;
self.getCollectStatus();
if (self.type === 1) {

View File

@@ -104,8 +104,9 @@
详细地址{{info.address || '暂无'}}
</view>
<view class="map">
<!-- <seeLocation ref="cMap" :apikey="$config.apiKey"></seeLocation> -->
<super-map ref="uMap" style="width: 100%;height: 100%;" :latitude="latitude" :longitude="longitude"
:open="true" :zoom="14" :min-zoom="10" :max-zoom="20" :MapUrl="$config.supperMap"
:open="true" :zoom="14" :min-zoom="10" :max-zoom="20" :MapUrl="$config.supperMap" :init="false"
:flag-tip="false"></super-map>
</view>
<!-- <map class="map" :latitude="latitude" :longitude="longitude" :markers="covers"></map> -->
@@ -221,6 +222,7 @@
} from '@/api/userrecruit.js'
import uniMask from '@/components/uni-mask/mask.vue'
import validCode from '@/components/p-valid-code/p-valid-code.vue'
import seeLocation from '@/components/sylj-selectLocation/seeLocation.vue';
import {
getuserrecruitDetailApp
} from '@/api/userrecruit.js'
@@ -235,8 +237,8 @@
maskShow: false,
nextBtn: false,
loading: false,
latitude: 31.126855, //中心点
longitude: 104.397894,
latitude: 30.70032, //中心点
longitude: 104.05235,
covers: [{ //marker标记位置
id: 0,
latitude: 0,
@@ -258,7 +260,8 @@
},
components: {
uniMask,
validCode
validCode,
seeLocation
},
onLoad: function(option) { //option为object类型会序列化上个页面传递的参数
// this.$store.dispatch('setAutograph')
@@ -329,10 +332,15 @@
self.info = resData.data.data;
self.status = resData.data.data.status;
self.missionNo = resData.data.data.missionNo;
// self.latitude = self.info.lat;
// self.longitude = self.info.lon;
// self.covers[0].latitude = self.info.lat;
// self.covers[0].longitude = self.info.lon;
self.latitude = self.info.lat;
self.longitude = self.info.lon;
self.covers[0].latitude = self.info.lat;
self.covers[0].longitude = self.info.lon;
self.$refs.uMap.initMap({
lat: self.info.lat,
lon: self.info.lon,
})
// this.$refs.cMap.open()
self.showDetail = true;
if (!this.seeDeatil) {
self.getCollectStatus();

View File

@@ -110,7 +110,7 @@
</view>
<view class="map">
<super-map ref="uMap" style="width: 100%;height: 100%;" :latitude="latitude" :longitude="longitude"
:open="true" :zoom="14" :min-zoom="10" :max-zoom="20" @regionchange="show = false"
:open="true" :zoom="14" :min-zoom="10" :max-zoom="20" @regionchange="show = false" :init="false"
:MapUrl="$config.supperMap" :flag-tip="false"></super-map>
</view>
<!-- <map class="map" :latitude="latitude" :longitude="longitude" :markers="covers"></map> -->
@@ -334,10 +334,14 @@
self.info = resData.data.data;
self.status = resData.data.data.status;
self.missionNo = resData.data.data.missionNo;
// self.latitude = self.info.lat;
// self.longitude = self.info.lon;
// self.covers[0].latitude = self.info.lat;
// self.covers[0].longitude = self.info.lon;
self.latitude = self.info.lat;
self.longitude = self.info.lon;
self.covers[0].latitude = self.info.lat;
self.covers[0].longitude = self.info.lon;
self.$refs.uMap.initMap({
lat: self.info.lat,
lon: self.info.lon,
})
self.showDetail = true;
if (!this.seeDeatil) {
self.getCollectStatus();

View File

@@ -107,7 +107,7 @@
</view>
<view class="map">
<super-map ref="uMap" style="width: 100%;height: 100%;" :latitude="latitude" :longitude="longitude"
:open="true" :zoom="14" :min-zoom="10" :max-zoom="20" @regionchange="show = false"
:open="true" :zoom="14" :min-zoom="10" :max-zoom="20" @regionchange="show = false" :init="false"
:MapUrl="$config.supperMap" :flag-tip="false"></super-map>
</view>
</view>
@@ -316,10 +316,14 @@
self.info = res.data.data;
self.status = res.data.data.status;
self.missionNo = res.data.data.missionNo;
// self.latitude = self.info.lat;
// self.longitude = self.info.lon;
// self.covers[0].latitude = self.info.lat;
// self.covers[0].longitude = self.info.lon;
self.latitude = self.info.lat;
self.longitude = self.info.lon;
self.covers[0].latitude = self.info.lat;
self.covers[0].longitude = self.info.lon;
self.$refs.uMap.initMap({
lat: self.info.lat,
lon: self.info.lon,
})
self.showDetail = true;
self.getCollectStatus();
if (self.type === 1) {

View File

@@ -132,16 +132,18 @@
</PickerTree>
</u-form-item>
<u-form-item label="详细地址" prop="address" borderBottom labelWidth="80" ref="item1">
<u--input v-model="info.address" border="none" placeholder="请输入详细地址"></u--input>
<view class="addressinfo" @click="selectMap">{{info.address}}</view>
<!-- <textarea placeholder-style="color: rgb(192, 196, 204); fontSize: 15px" @focus="selectMap"
v-model="info.address" placeholder="请输入详细地址" style="width: 100%;" /> -->
<!-- <lin-select :list="addressOptions" value-key="location" name-key="title" max-height="180"
:loading="loading" loading-text="数据加载中" placeholder="请输入详细地址" @input="selectInput"
v-model="info.address" @confirm="selectConfirm" /> -->
</u-form-item>
<view class="map">
<!-- <view class="map">
<super-map ref="uMap" style="width: 100%;height: 100%;" :latitude="latitude" :longitude="longitude"
:open="true" :zoom="14" :min-zoom="10" :max-zoom="20" @regionchange="show = false"
:MapUrl="$config.supperMap" :flag-tip="false"></super-map>
</view>
</view> -->
<!-- <map class="map" :latitude="latitude" :longitude="longitude" :markers="covers"></map> -->
</u--form>
<u-button type="primary" text="提交" customStyle="margin-top: 50px" @click="submit"></u-button>
@@ -171,6 +173,9 @@
@confirm="stimeConfirm" @cancel="stimeClose" @close="stimeClose"></u-datetime-picker>
<u-datetime-picker :show="showEtime" :value="birthday" mode="date" closeOnClickOverlay
@confirm="etimeConfirm" @cancel="etimeClose" @close="etimeClose"></u-datetime-picker>
<sylj-selectLocation ref="selectLocationPop" @ok="selectedOk"
:apikey="$config.apiKey"></sylj-selectLocation>
</view>
</view>
</template>
@@ -185,6 +190,7 @@
getDeptAllTree
} from '@/api/userrecruit.js'
import PickerTree from './enterpriceCertification/pickerTree.vue'
import syljSelectLocation from '@/components/sylj-selectLocation/sylj-selectLocation.vue'
import {
mapGetters
} from 'vuex'
@@ -441,6 +447,44 @@
},
methods: {
selectedOk(data) {
const {
infomation,
location,
name,
address
} = data
const {
lon,
lat
} = location
this.latitude = lat
this.longitude = lon
this.info.address = `${data.address}${ data.name && '(' + data.name + ')' }`
},
selectMap() {
const that = this
// uni.getLocation({
// type: 'wgs84',
// success: function(res) {
// console.log(res)
// uni.hideLoading();
// console.log('当前位置的经度:' + res.longitude);
// console.log('当前位置的纬度:' + res.latitude);
// // that.$refs.selectLocationPop.open(res.longitude, res.latitude, that.$config.apiKey);
// },
// fail: function(err) {
// console.log('获取失败');
// uni.hideLoading();
// },
// });
that.$refs.selectLocationPop.open(that.longitude, that.latitude, that.$config.apiKey);
console.log(this.latitude, this.longitude)
console.log('聚焦')
},
async getTreeDept() {
let resData = await getDeptAllTree()
if (resData.data.code === 200) {
@@ -812,4 +856,10 @@
/deep/.wageunitLeft .u-form-item__body {
padding: 0;
}
.addressinfo {
width: 100%;
height: fit-content;
min-height: 21px;
}
</style>

View File

@@ -136,13 +136,14 @@
</PickerTree>
</u-form-item>
<u-form-item label="详细地址" prop="address" borderBottom labelWidth="80" ref="item1">
<u--input v-model="info.address" border="none" placeholder="请输入详细地址"></u--input>
<view class="addressinfo" @click="selectMap">{{info.address}}</view>
<!-- <u--input v-model="info.address" border="none" placeholder="请输入详细地址"></u--input> -->
</u-form-item>
<view class="map">
<!-- <view class="map">
<super-map ref="uMap" style="width: 100%;height: 100%;" :latitude="latitude" :longitude="longitude"
:open="true" :zoom="14" :min-zoom="10" :max-zoom="20" :MapUrl="$config.supperMap"
:flag-tip="false"></super-map>
</view>
</view> -->
<!-- <map class="map" :latitude="latitude" :longitude="longitude" :markers="covers"></map> -->
</u--form>
<u-button type="primary" text="提交" customStyle="margin-top: 50px" @click="submit"></u-button>
@@ -173,6 +174,7 @@
<u-datetime-picker :show="showEtime" :value="birthday" mode="date" closeOnClickOverlay
@confirm="etimeConfirm" @cancel="etimeClose" @close="etimeClose"></u-datetime-picker>
</view>
<sylj-selectLocation ref="selectLocationPop" @ok="selectedOk" :apikey="$config.apiKey"></sylj-selectLocation>
</view>
</template>
@@ -186,6 +188,7 @@
getDeptAllTree
} from '@/api/userrecruit.js'
import PickerTree from './enterpriceCertification/pickerTree.vue'
import syljSelectLocation from '@/components/sylj-selectLocation/sylj-selectLocation.vue'
import {
mapGetters
} from 'vuex'
@@ -412,7 +415,8 @@
}
},
components: {
PickerTree
PickerTree,
syljSelectLocation
},
computed: {
...mapGetters(['area'])
@@ -433,6 +437,42 @@
}
},
methods: {
selectedOk(data) {
const {
infomation,
location,
name,
address
} = data
const {
lon,
lat
} = location
this.latitude = lat
this.longitude = lon
this.info.address = `${data.address}${ data.name && '(' + data.name + ')' }`
},
selectMap() {
const that = this
// uni.getLocation({
// type: 'wgs84',
// success: function(res) {
// console.log(res)
// uni.hideLoading();
// console.log('当前位置的经度:' + res.longitude);
// console.log('当前位置的纬度:' + res.latitude);
// // that.$refs.selectLocationPop.open(res.longitude, res.latitude, that.$config.apiKey);
// },
// fail: function(err) {
// console.log('获取失败');
// uni.hideLoading();
// },
// });
that.$refs.selectLocationPop.open(that.longitude, that.latitude, that.$config.apiKey);
},
async getTreeDept() {
let resData = await getDeptAllTree()
if (resData.data.code === 200) {
@@ -801,4 +841,10 @@
/deep/.wageunitLeft .u-form-item__body {
padding: 0;
}
.addressinfo {
width: 100%;
height: fit-content;
min-height: 21px;
}
</style>