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

@@ -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>