flat: 地图

This commit is contained in:
史典卓
2024-10-24 14:42:47 +08:00
parent ba14872e89
commit 7845b6333c
36 changed files with 6301 additions and 5312 deletions

View File

@@ -12,10 +12,10 @@
<view v-if="loading" class="btn nocheck" loading="true"></view>
<view v-else-if="validate" class="btn" @click="login">立即登录</view>
<view v-else class="btn nocheck">立即登录</view>
<!-- <view class="changeLogintype">
<view class="" @click="goReg">手机注册</view>
<view class="" @click="goForget">忘记密码</view>
</view> -->
<view class="changeLogintype">
<view class="" @click="goReg">手机注册</view>
<view class="" @click="goForget">忘记密码</view>
</view>
</login-template>
</template>
@@ -74,8 +74,8 @@
},
login(e) {
if (this.validate) {
this.userChecked = true;
console.log(this.userChecked)
// this.userChecked = true;
// console.log(this.userChecked)
// if (!this.userChecked) {
// uni.showToast({
// title:'请先阅读并同意《服务及隐私协议》',
@@ -169,4 +169,15 @@
}
/* #endif */
.changeLogintype {
margin: 0 auto;
font-family: PingFangSC-Regular;
font-size: 14px;
color: #1B66FF;
margin-top: 15px;
display: flex;
align-items: center;
justify-content: space-between;
}
</style>

View File

@@ -1,106 +1,113 @@
<template>
<view class="login-body">
<view class="nothing" style="height: 100rpx;"></view>
<view class="titleText">{{title}}</view>
<slot></slot>
<view v-if="!hideBottom" class="bottomt">
<view class="bottomt-box">
<!-- <view class="check-icon" @click="checkChanged">
<image v-if="userChecked" src="../../static/img/checkOk.png" style="width: 30rpx;height:30rpx;"></image>
<view class="noneCheck" v-else></view>
</view>
已阅读并同意<text class="bottomtText" @click="goMent">服务及隐私协议</text> -->
</view>
</view>
</view>
</template>
<script>
import {mapGetters} from 'vuex'
export default {
data(){
return{
}
},
props: {
title: String,
hideBottom: Boolean
},
methods: {
goMent() {
uni.navigateTo({
url: '/pages/user/agreement'
})
},
checkChanged(){
let checkedValue=!this.userChecked;
this.$store.dispatch('UserCheckedBtn',checkedValue)
}
},
computed:{
...mapGetters(['userChecked'])
},
mounted() {
},
}
</script>
<style lang="scss">
.login-body {
min-height: 880rpx;
height: 100%;
position: relative;
width: 80%;
margin: 0 auto;
}
.titleText {
font-family: PingFangSC-Medium;
font-size: 46rpx;
color: #333333;
font-weight: bold;
padding: 30rpx 0;
}
.bottomtText {
color: #151515;
}
.bottomt {
font-family: PingFangSC-Regular;
font-size: 24rpx;
color: #999999;
position: absolute;
bottom: 80rpx;
left: 0;
width: 100%;
text-align: center;
.bottomt-box{
display: flex;
justify-content: center;
align-items: center;
}
}
.check-icon{
font-size: 28rpx;
font-weight: 400;
color: #999999;
align-items: center;
width: 30rpx;
height: 30rpx;
margin-right: 12rpx;
.noneCheck{
width: 26rpx;
height: 26rpx;
border-radius: 50%;
border: 2rpx solid #999999;
margin-right:12rpx;
}
}
</style>
<template>
<view class="login-body">
<view class="nothing" style="height: 100rpx;"></view>
<view class="titleText">{{title}}</view>
<slot></slot>
<view v-if="!hideBottom" class="bottomt">
<view class="bottomt-box">
<view class="check-icon" @click="checkChanged">
<image v-if="userChecked" :src="checked" style="width: 30rpx;height:30rpx;">
</image>
<view class="noneCheck" v-else></view>
</view>
已阅读并同意<text class="bottomtText" @click="goMent">服务及隐私协议</text>
</view>
</view>
</view>
</template>
<script>
import checked from '../../static/img/checkOk.png'
import {
mapGetters
} from 'vuex'
export default {
data() {
return {
checked
}
},
props: {
title: String,
hideBottom: Boolean
},
methods: {
goMent() {
uni.navigateTo({
url: '/pages/user/agreement'
})
},
checkChanged() {
let checkedValue = !this.userChecked;
this.$store.dispatch('UserCheckedBtn', checkedValue)
}
},
computed: {
...mapGetters(['userChecked'])
},
mounted() {
},
}
</script>
<style lang="scss">
.login-body {
min-height: 880rpx;
height: 100%;
position: relative;
width: 80%;
margin: 0 auto;
}
.titleText {
font-family: PingFangSC-Medium;
font-size: 46rpx;
color: #333333;
font-weight: bold;
padding: 30rpx 0;
}
.bottomtText {
color: #151515;
}
.bottomt {
font-family: PingFangSC-Regular;
font-size: 24rpx;
color: #999999;
position: absolute;
bottom: 80rpx;
left: 0;
width: 100%;
text-align: center;
.bottomt-box {
display: flex;
justify-content: center;
align-items: center;
}
}
.check-icon {
font-size: 28rpx;
font-weight: 400;
color: #999999;
align-items: center;
width: 30rpx;
height: 30rpx;
margin-right: 12rpx;
.noneCheck {
width: 26rpx;
height: 26rpx;
border-radius: 50%;
border: 2rpx solid #999999;
margin-right: 12rpx;
}
}
</style>

View File

@@ -133,7 +133,7 @@
getLocation: function() {
var that = this;
uni.getLocation({
type: 'gcj02',
type: 'wgs84',
success: function(res) {
//初始化当前点
var point = {

View File

@@ -1,404 +1,417 @@
<template>
<view class="app_container">
<view class="app-top">
<view class="top-search">
<view class="top-input">
<input class="put" type="text" placeholder-class="put-pla" v-model="searchValue"
placeholder="搜索附近岗位或任务">
<button class="input-btn" @tap="search">搜索</button>
</view>
</view>
</view>
<view class="view-map">
<super-map ref="uMap" style="width: 100%;height: 100%;" :latitude="latitude" :longitude="longitude"
:zoom="14" :min-zoom="10" :max-zoom="20" @markertap="clickmark" @regionchange="show = false"
:MapUrl="$config.supperMap" :flag-tip="false"></super-map>
<!-- <view id="map" ></view> -->
<!-- <map style="width: 100%;height: 100%;" scale="16" :latitude="latitude" :longitude="longitude"
:markers="covers" @markertap="clickmark" @regionchange="show = false"></map> -->
<view class="position-bottom" v-if="show">
<view class="uni-margin-wrap">
<swiper class="swiper" circular :interval="2000" :duration="500">
<swiper-item class="wiperItem">
<view class="swiper-item uni-bg-red">
<view class="item-content">
<view class="content-title"> {{productInfo.missionTitle}} </view>
<view class="color_999999 fs_12 mar_top5">
<uni-icons type="location" color="#999999" size="12"></uni-icons>
{{ productInfo.cityId }} {{productInfo.address}} 距离{{distance}}
</view>
<view class="color_999999 fs_12 mar_top5">
<uni-icons type="map-pin-ellipse" color="#999999" size="12"></uni-icons>
招聘时间: {{productInfo.stime}}-{{productInfo.etime}}
</view>
<view class="color_999999 fs_12 mar_top5">
<uni-icons type="map-pin-ellipse" color="#999999" size="12"></uni-icons>
{{productInfo.experienceDesc}} | {{education[productInfo.education]}}
</view>
<button class="btns" hover-class="active" @tap="openMap">
<image class="btn-img" src="../../static/img/direction2.png" />查看详情
</button>
</view>
</view>
</swiper-item>
</swiper>
</view>
</view>
</view>
</view>
</template>
<script>
import {
addZeroPrefix,
getDistanceFromLatLonInKm
} from '@/untils/tools.js'
import testData from '@/common/textdata.js';
import {
geQueryJobsByNearby
} from '@/api/map.js'
let taskpoint = require('../../static/img/taskpoint.png');
let gwpoint = require('../../static/img/gwpoint.png');
let mypoint = require('../../static/img/mypoint.png');
export default {
data() {
return {
education: testData.education,
show: false,
ID: 1,
searchValue: '',
latitude: 31.133980,
longitude: 104.404419,
covers: [],
rateValue: 2,
productInfo: {},
};
},
computed: {
distance() {
const {
lon,
lat
} = this.productInfo
if (lon) {
const {
m,
km
} = getDistanceFromLatLonInKm(lat, lon, this.latitude, this.longitude)
return m > 1000 ? `${km.toFixed(2)}km` : `${m.toFixed(2)}m`
}
return '无'
}
},
mounted() {
const _this = this
uni.getLocation({
type: 'gcj02',
success: function(res) {
const {
longitude,
latitude
} = res
_this.latitude = latitude
_this.longitude = longitude
_this.getList(longitude, latitude).then((covers) => {
_this.$refs.uMap.addFeature(covers)
})
},
fail: function(err) {
_this.$api.msg('无法获得周边信息')
},
complete: function(e) {}
})
},
onShow() {
// const _this = this
// this.mockGetLocation().then((myPoint) => {
// this.latitude = myPoint.latitude
// this.longitude = myPoint.longitude
// _this.getList(_this.longitude, _this.latitude).then((covers) => {
// _this.$api.msg('成功获得周边信息')
// console.log(covers)
// _this.$refs.uMap.addFeature(covers)
// })
// })
},
methods: {
openMap(lon, lat) {
//打开地图,并将门店位置传入
// type: post 岗位 mission 任务
switch (this.productInfo.type) {
case 'post':
const no = encodeURIComponent(1)
uni.navigateTo({
url: `/pages/projectInfo/workInfo?workId=${encodeURIComponent(no)}&isCan=${1}`
})
break
case 'mission':
const no1 = encodeURIComponent(this.productInfo.missionNo)
uni.navigateTo({
url: `/pages/projectInfo/projectInfo?missionNo=${no1}&isCan=${1}`
})
break
}
},
search() {
const _this = this
uni.getLocation({
type: 'gcj02',
success: function(res) {
const {
longitude,
latitude
} = res
_this.latitude = latitude
_this.longitude = longitude
_this.getList(longitude, latitude).then((covers) => {
_this.$api.msg('成功获得周边信息')
_this.$refs.uMap.addFeature(covers)
})
},
fail: function(err) {
_this.$api.msg('无法获得周边信息')
},
complete: function(e) {}
})
// this.getList(this.longitude, this.latitude).then((covers) => {
// this.$api.msg('成功获得周边信息')
// console.log(covers)
// this.$refs.uMap.addFeature(covers)
// })
},
clickmark(cover) {
if (cover.markerId === 1) return
this.show = true;
this.productInfo = cover.info
},
mockGetLocation() {
return new Promise((resolve) => {
resolve({
"longitude": 104.40632,
"latitude": 31.122989,
"altitude": null,
"accuracy": 25.998,
"altitudeAccuracy": null,
"heading": null,
"speed": null,
"errMsg": "getLocation:ok",
"verticalAccuracy": 0,
"horizontalAccuracy": 25.998
})
})
},
async getList(lon, lat) {
return new Promise(async (resolve) => {
let params = {
lon,
lat,
distanceRange: 20,
taskTitle: this.searchValue
}
let resData = await geQueryJobsByNearby(params)
if (resData.data.code === 200) {
const arr = resData.data.data.map((item) => ({
id: item.id,
longitude: item.lon,
latitude: item.lat,
iconPath: item.type === 'post' ? gwpoint : taskpoint,
width: 20,
height: 20,
title: item.missionTitle,
callout: {
content: item.missionTitle,
fontSize: 10,
borderColor: 'blue',
},
info: item
}))
arr.push({
id: 1,
latitude: lat,
longitude: lon,
iconPath: mypoint,
title: '我的位置',
width: 20,
height: 20
})
resolve(arr)
}
})
}
}
}
</script>
<style lang="scss" scoped>
.color_999999 {
color: #999999;
}
.fs_12 {
font-size: 24rpx;
}
.mar_top5 {
margin-top: 10rpx;
}
.active {
background: #EAEAEA !important;
color: #AFAFAF;
}
.card_mark {
.mark_l {
width: 56rpx;
height: 28rpx;
border-radius: 12rpx 0 12rpx 12rpx;
background: linear-gradient(157deg, #A043C1 0%, #4133A2 100%);
font-size: 28rpx;
font-family: PingFang-SC-Bold, PingFang-SC;
font-weight: bold;
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
}
}
.position-bottom {
position: absolute;
left: 0;
right: 0;
height: 406rpx;
bottom: 50rpx;
.uni-margin-wrap {
height: 406rpx;
.swiper {
height: 406rpx;
.wiperItem {
padding-left: 50rpx;
height: 406rpx;
width: 660rpx !important;
.swiper-item {
width: 660rpx;
height: 406rpx;
background: #FFFFFF;
box-shadow: 0rpx 2rpx 4rpx 0rpx rgba(0, 0, 0, 0.5);
border-radius: 27rpx;
overflow: hidden;
.item-top {
display: flex;
align-content: center;
justify-content: space-between;
.top-img {
width: 215rpx;
height: 120rpx;
}
}
.item-content {
padding: 15rpx 33rpx;
.content-title {
font-size: 32rpx;
}
.btns {
margin-top: 20rpx;
display: flex;
align-items: center;
justify-content: center;
width: 223rpx;
height: 64rpx;
background: linear-gradient(to right, #A043C1 0%, #4133A2 100%);
border-radius: 15rpx;
color: #FFFFFF;
font-size: 26rpx;
font-weight: 800;
color: #FFFFFF;
line-height: 64rpx;
.btn-img {
width: 32rpx;
height: 32rpx;
}
}
}
}
}
}
}
}
.app_container {
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
display: flex;
flex-direction: column;
.app-top {
display: flex;
background: linear-gradient(to right, #e8e8e8, #e8e8e8);
padding-bottom: 16rpx;
padding-top: 24rpx;
.top-search {
position: relative;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
.top-input {
width: 710rpx;
.put {
padding-left: 30rpx;
height: 72rpx;
background: #FFFFFF;
border-radius: 36rpx;
}
/deep/ .put-pla {
height: 33rpx;
font-size: 24rpx;
font-weight: 400;
color: #999999;
line-height: 33rpx;
}
.input-btn {
position: absolute;
right: 30rpx;
top: 50%;
transform: translate(0, -50%);
color: #FFFFFF;
width: 120rpx;
height: 56rpx;
line-height: 56rpx;
font-size: 28rpx;
background: linear-gradient(157deg, #A043C1 0%, #4133A2 100%);
border-radius: 29rpx;
}
}
}
}
.view-map {
flex: 1;
}
}
</style>
<template>
<view class="app_container">
<view class="app-top">
<view class="top-search">
<view class="top-input">
<input
class="put"
type="text"
placeholder-class="put-pla"
v-model="searchValue"
placeholder="搜索附近岗位或任务"
/>
<button class="input-btn" @tap="search">搜索</button>
</view>
</view>
</view>
<view class="view-map">
<!-- <super-map ref="uMap" style="width: 100%;height: 100%;" :latitude="latitude" :longitude="longitude"
:zoom="14" :min-zoom="10" :max-zoom="20" @markertap="clickmark" @regionchange="show = false"
:MapUrl="$config.supperMap" :flag-tip="false"></super-map> -->
<zhuo-tianditu-MultiPoint-Mapper
ref="tMap"
@onSelect="clickmark"
:api-key="$config.apiKey"
></zhuo-tianditu-MultiPoint-Mapper>
<!-- <view id="map" ></view> -->
<!-- <map style="width: 100%;height: 100%;" scale="16" :latitude="latitude" :longitude="longitude"
:markers="covers" @markertap="clickmark" @regionchange="show = false"></map> -->
<view class="position-bottom" v-if="show">
<view class="uni-margin-wrap">
<swiper class="swiper" circular :interval="2000" :duration="500">
<swiper-item class="wiperItem">
<view class="swiper-item uni-bg-red">
<view class="item-content">
<view class="content-title">{{ productInfo.missionTitle }}</view>
<view class="color_999999 fs_12 mar_top5">
<uni-icons type="location" color="#999999" size="12"></uni-icons>
{{ productInfo.cityId }} {{ productInfo.address }} 距离{{ distance }}
</view>
<view class="color_999999 fs_12 mar_top5">
<uni-icons type="map-pin-ellipse" color="#999999" size="12"></uni-icons>
招聘时间: {{ productInfo.stime }}-{{ productInfo.etime }}
</view>
<view class="color_999999 fs_12 mar_top5">
<uni-icons type="map-pin-ellipse" color="#999999" size="12"></uni-icons>
{{ productInfo.experienceDesc }} | {{ education[productInfo.education] }}
</view>
<button class="btns" hover-class="active" @tap="openMap">
<image class="btn-img" src="../../static/img/direction2.png" />
查看详情
</button>
</view>
</view>
</swiper-item>
</swiper>
</view>
</view>
</view>
</view>
</template>
<script>
import { addZeroPrefix, getDistanceFromLatLonInKm } from '@/untils/tools.js';
import testData from '@/common/textdata.js';
import { geQueryJobsByNearby } from '@/api/map.js';
import { mapGetters } from 'vuex';
let taskpoint = require('../../static/img/taskpoint.png');
let gwpoint = require('../../static/img/gwpoint.png');
let mypoint = require('../../static/img/mypoint.png');
export default {
data() {
return {
education: testData.education,
show: false,
ID: 1,
searchValue: '',
latitude: 31.13398,
longitude: 104.404419,
covers: [],
rateValue: 2,
productInfo: {},
};
},
computed: {
...mapGetters(['userLocation']),
distance() {
const { lon, lat } = this.productInfo;
if (lon) {
const { m, km } = getDistanceFromLatLonInKm(lat, lon, this.latitude, this.longitude);
return m > 1000 ? `${km.toFixed(2)}km` : `${m.toFixed(2)}m`;
}
return '无';
},
},
mounted() {
const _this = this;
uni.getLocation({
type: 'wgs84',
success: function (res) {
console.log(res, '成功获得周边信息');
const { longitude, latitude } = res;
_this.latitude = latitude;
_this.longitude = longitude;
_this.getList(longitude, latitude).then((covers) => {
_this.covers = covers;
_this.$nextTick(() => {
_this.$refs.tMap.addFeature(covers);
});
});
},
fail: function (err) {
console.log(err, '无法获得周边信息');
_this.$api.msg('无法获得周边信息');
},
complete: function (e) {},
});
console.log('userLocation', this.userLocation);
if (this.userLocation) {
const { longitude, latitude } = this.userLocation;
this.$refs.tMap.open(longitude, latitude);
} else {
this.$store.dispatch('getUserLocation');
}
},
onShow() {
// const _this = this
// this.mockGetLocation().then((myPoint) => {
// this.latitude = myPoint.latitude
// this.longitude = myPoint.longitude
// _this.getList(_this.longitude, _this.latitude).then((covers) => {
// _this.$api.msg('成功获得周边信息')
// console.log(covers)
// _this.$refs.uMap.addFeature(covers)
// })
// })
},
methods: {
onSelect(item) {},
openMap(lon, lat) {
//打开地图,并将门店位置传入
// type: post 岗位 mission 任务
switch (this.productInfo.type) {
case 'post':
const no = encodeURIComponent(this.productInfo.id);
uni.navigateTo({
url: `/pages/projectInfo/workInfo?workId=${encodeURIComponent(no)}&isCan=${1}`,
});
break;
case 'mission':
const no1 = encodeURIComponent(this.productInfo.missionNo);
uni.navigateTo({
url: `/pages/projectInfo/projectInfo?missionNo=${no1}&isCan=${1}`,
});
break;
}
},
search() {
const _this = this;
uni.getLocation({
type: 'wgs84',
success: function (res) {
const { longitude, latitude } = res;
_this.latitude = latitude;
_this.longitude = longitude;
_this.getList(longitude, latitude).then((covers) => {
_this.$api.msg('成功获得周边信息');
_this.$refs.uMap.addFeature(covers);
});
},
fail: function (err) {
_this.$api.msg('无法获得周边信息');
},
complete: function (e) {},
});
// this.getList(this.longitude, this.latitude).then((covers) => {
// this.$api.msg('成功获得周边信息')
// console.log(covers)
// this.$refs.uMap.addFeature(covers)
// })
},
clickmark(cover) {
if (cover.markerId === 1) return;
this.show = true;
this.productInfo = cover.info;
},
mockGetLocation() {
return new Promise((resolve) => {
resolve({
longitude: 104.40632,
latitude: 31.122989,
altitude: null,
accuracy: 25.998,
altitudeAccuracy: null,
heading: null,
speed: null,
errMsg: 'getLocation:ok',
verticalAccuracy: 0,
horizontalAccuracy: 25.998,
});
});
},
async getList(lon, lat) {
return new Promise(async (resolve) => {
let params = {
lon,
lat,
distanceRange: 20,
taskTitle: this.searchValue,
};
let resData = await geQueryJobsByNearby(params);
if (resData.data.code === 200) {
const arr = resData.data.data.map((item) => ({
id: item.id,
longitude: item.lon,
latitude: item.lat,
lon: item.lon,
lat: item.lat,
label: item.missionTitle,
iconPath: item.type === 'post' ? gwpoint : taskpoint,
width: 20,
height: 20,
title: item.missionTitle,
callout: {
content: item.missionTitle,
fontSize: 10,
borderColor: 'blue',
},
info: item,
}));
arr.push({
id: 1,
latitude: lat,
longitude: lon,
iconPath: mypoint,
title: '我的位置',
width: 20,
height: 20,
lon: lat,
lat: lon,
label: '我的位置',
});
resolve(arr);
}
});
},
},
};
</script>
<style lang="scss" scoped>
.color_999999 {
color: #999999;
}
.fs_12 {
font-size: 24rpx;
}
.mar_top5 {
margin-top: 10rpx;
}
.active {
background: #eaeaea !important;
color: #afafaf;
}
.card_mark {
.mark_l {
width: 56rpx;
height: 28rpx;
border-radius: 12rpx 0 12rpx 12rpx;
background: linear-gradient(157deg, #a043c1 0%, #4133a2 100%);
font-size: 28rpx;
font-family: PingFang-SC-Bold, PingFang-SC;
font-weight: bold;
color: #ffffff;
display: flex;
align-items: center;
justify-content: center;
}
}
.position-bottom {
position: absolute;
left: 0;
right: 0;
height: 406rpx;
bottom: 50rpx;
.uni-margin-wrap {
height: 406rpx;
.swiper {
height: 406rpx;
.wiperItem {
padding-left: 50rpx;
height: 406rpx;
width: 660rpx !important;
.swiper-item {
width: 660rpx;
height: 406rpx;
background: #ffffff;
box-shadow: 0rpx 2rpx 4rpx 0rpx rgba(0, 0, 0, 0.5);
border-radius: 27rpx;
overflow: hidden;
.item-top {
display: flex;
align-content: center;
justify-content: space-between;
.top-img {
width: 215rpx;
height: 120rpx;
}
}
.item-content {
padding: 15rpx 33rpx;
.content-title {
font-size: 32rpx;
}
.btns {
margin-top: 20rpx;
display: flex;
align-items: center;
justify-content: center;
width: 223rpx;
height: 64rpx;
background: linear-gradient(to right, #a043c1 0%, #4133a2 100%);
border-radius: 15rpx;
color: #ffffff;
font-size: 26rpx;
font-weight: 800;
color: #ffffff;
line-height: 64rpx;
.btn-img {
width: 32rpx;
height: 32rpx;
}
}
}
}
}
}
}
}
.app_container {
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
display: flex;
flex-direction: column;
.app-top {
display: flex;
background: linear-gradient(to right, #e8e8e8, #e8e8e8);
padding-bottom: 16rpx;
padding-top: 24rpx;
.top-search {
position: relative;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
.top-input {
width: 710rpx;
.put {
padding-left: 30rpx;
height: 72rpx;
background: #ffffff;
border-radius: 36rpx;
}
/deep/ .put-pla {
height: 33rpx;
font-size: 24rpx;
font-weight: 400;
color: #999999;
line-height: 33rpx;
}
.input-btn {
position: absolute;
right: 30rpx;
top: 50%;
transform: translate(0, -50%);
color: #ffffff;
width: 120rpx;
height: 56rpx;
line-height: 56rpx;
font-size: 28rpx;
background: linear-gradient(157deg, #a043c1 0%, #4133a2 100%);
border-radius: 29rpx;
}
}
}
}
.view-map {
flex: 1;
}
}
</style>

View File

@@ -31,7 +31,7 @@
<block v-if="activeTab == 0">
<view v-if="newList.length > 0">
<block v-for="(item, index) in newList" :key="index">
<companyList :companyitem="item"></companyList>
<companyList :companyitem="item" :position="userLocation"></companyList>
</block>
</view>
<view v-else>
@@ -51,7 +51,7 @@
<view v-if="companyList.length > 0">
<block v-for="(item, index) in companyList" :key="item.id">
<workList :companyitem="item" :near="activeTab === 0"></workList>
<workList :companyitem="item" :position="userLocation" :near="activeTab === 0"></workList>
</block>
</view>
<view v-else>
@@ -109,7 +109,9 @@
getcoder
} from "@/api/map.js";
import verticalMenu from '@/components/vertical-menu/vertical-menu.vue';
import {
mapGetters
} from 'vuex'
export default {
components: {
vTabs,
@@ -117,15 +119,16 @@
verticalMenu,
workList
},
computed: {
...mapGetters(['userLocation']),
},
data() {
return {
policyContentList: [],
activeTab: 0,
activeTab: '0',
companyList: [],
recommendList: [],
newList: [],
nearPage: {
current: 1,
size: 10,
@@ -142,10 +145,7 @@
total: 0
},
currentAddress: '',
currentPoint: {
latitude: 0,
longitude: 0
},
key: 'FW3BZ-6JTK6-GCUS5-MZCRR-3GPR5-HJFEI',
open: false,
showPopUp: false,
@@ -157,10 +157,11 @@
if (option.tabIndex) {
this.activeTab = option.tabIndex
}
this.getData()
this.getPolicy()
this.$store.dispatch('getUserLocation')
this.download()
},
onShow: function() {
const enumTitle = {
"0": '最新零工岗位',
"1": '最新全职岗位',
@@ -169,7 +170,7 @@
uni.setNavigationBarTitle({
title: enumTitle[this.activeTab]
})
if (this.$store.state.user.token) {
if (this.$api.haslogin()) {
this.$store.dispatch('refreshAuthState').then((e) => {
var auth = this.$store.state.auth
if (!auth.bankCardState) {
@@ -177,7 +178,6 @@
}
})
}
const value = uni.getStorageSync('active');
if (value) {
this.activeTab = value;
@@ -190,13 +190,7 @@
},
/*下拉刷新*/
onPullDownRefresh: function() {
if (!this.$store.state.user.token) {
uni.redirectTo({
url: "/pages/login/login"
});
} else {
this.download();
}
this.download();
},
methods: {
step() {
@@ -228,30 +222,6 @@
url: '/pageMy/my/resume/addSkill'
})
},
/*定位*/
getLocation: function() {
var that = this;
uni.getLocation({
type: 'gcj02',
success: function(res) {
that.currentPoint = {
latitude: res.latitude,
longitude: res.longitude
}
// that.getAddrByPoint(res);
that.getNearList(that.currentPoint)
},
complete: function(e) {}
});
},
/*逆地址解析*/
getAddrByPoint: function(point) {
var that = this;
var location = point.latitude + ',' + point.longitude
getcoder(location, encodeURI(that.key), 0).then(res => {
that.currentAddress = res.data.result.address
});
},
goSeach: function() {
uni.navigateTo({
url: '../seach/seach'
@@ -271,8 +241,8 @@
this.activeTab = e;
},
//附近任务;
getNearList: function(point) {
nearMission(this.nearPage.current, this.nearPage.size).then(res => {
getNearList: function() {
nearMission(this.nearPage.current, this.nearPage.size, 1).then(res => {
if (this.nearPage.current === 1) {
this.companyList = [];
}
@@ -313,7 +283,7 @@
},
//最新任务;
getNewList: function() {
newMissionAll(this.newPage.current, this.newPage.size, '').then(res => {
newMissionAll(this.newPage.current, this.newPage.size, '', 1).then(res => {
if (this.newPage.current === 1) {
this.newList = [];
}
@@ -326,32 +296,31 @@
},
//上拉加载
upLoad: function() {
if (this.activeTab === 0) {
if (this.nearPage.current <= Math.ceil(this.nearPage.total / this.nearPage.size)) {
this.getNearList(this.currentPoint);
} else {
uni.showToast({
icon: "none",
title: '已经是最后一页',
})
}
return
}
if (this.activeTab === 1) {
if (this.recommendPage.current <= Math.ceil(this.recommendPage.total / this.recommendPage
.size)) {
this.getRecommendList();
} else {
uni.showToast({
icon: "none",
title: '已经是最后一页',
})
}
return
}
if (this.activeTab === 2) {
if (this.activeTab === '0') {
if (this.newPage.current <= Math.ceil(this.newPage.total / this.newPage.size)) {
this.getNewList();
this.getNewList()
} else {
uni.showToast({
icon: "none",
title: '已经是最后一页',
})
}
return
}
if (this.activeTab === '1') {
if (this.nearPage.current <= Math.ceil(this.nearPage.total / this.nearPage.size)) {
this.getNearList();
} else {
uni.showToast({
icon: "none",
title: '已经是最后一页',
})
}
return
}
if (this.activeTab === '2') {
if (this.newPage.current <= Math.ceil(this.newPage.total / this.newPage.size)) {
this.getPolicy();
} else {
uni.showToast({
icon: "none",
@@ -365,25 +334,24 @@
download: function() {
console.log(this.activeTab)
if (this.activeTab === '0') {
this.nearPage.current = 1;
console.log('123123')
this.getLocation();
this.newPage.current = 1;
this.getNewList();
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
return
}
if (this.activeTab === '1') {
this.recommendPage.current = 1;
this.getRecommendList();
this.nearPage.current = 1;
this.getNearList();
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
return
}
if (this.activeTab === '2') {
this.newPage.current = 1;
this.getNewList();
// this.newPage.current = 1;
this.getPolicy();
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
@@ -391,20 +359,13 @@
}
},
getData: function() {
if (!this.$store.state.user.token) {
uni.redirectTo({
url: "/pages/login/login"
});
} else {
uni.$emit('newsReadChange');
this.nearPage.current = 1;
this.recommendPage.current = 1;
this.newPage.current = 1;
this.getLocation();
this.getRecommendList();
this.getNewList();
this.getNearList();
}
uni.$emit('newsReadChange');
this.nearPage.current = 1;
this.recommendPage.current = 1;
this.newPage.current = 1;
this.getRecommendList();
this.getNewList();
this.getNearList();
},
@@ -442,7 +403,8 @@
.content {
background-color: #f3f4f8;
padding-top: 20rpx;
min-height: 80vh;
/* min-height: 80vh; */
min-height: calc(100vh - var(--window-top) - var(--status-bar-height) - var(--window-bottom));
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -101,9 +101,10 @@
工作地址{{info.address || '暂无'}}
</view>
<view class="map">
<super-map ref="uMap" style="width: 100%;height: 100%;" :latitude="latitude" :longitude="longitude"
<!-- <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" :init="false"
:flag-tip="false"></super-map>
:flag-tip="false"></super-map> -->
<zhuo-tianditu-MultiPoint-Mapper ref="tMap" :api-key="$config.apiKey"></zhuo-tianditu-MultiPoint-Mapper>
</view>
<!-- <map class="map" :latitude="latitude" :longitude="longitude" :markers="covers"></map> -->
</view>
@@ -324,6 +325,8 @@
detail(self.missionNo).then(res => {
self.info = res.data.data;
self.status = res.data.data.detailStatus;
this.$refs.tMap.open(self.info.lon, self.info.lat)
// AddressToLocation({
// smart_address: res.data.data.address
// }).then((result) => {
@@ -337,13 +340,18 @@
// self.longitude = self.info.lon;
// self.covers[0].latitude = self.info.lat;
// self.covers[0].longitude = self.info.lon;
if (!(self.info.lat && self.info.lat === -1)) {
self.$refs.uMap.initMap({
lat: self.info.lat,
lon: self.info.lon,
if (self.info.lon > 1 && self.info.lat > 1) {
self.$nextTick(() => {
self.$api.sleep(500).then(() => {
this.$refs.tMap.addFeature([{
id: self.info.id,
label: self.info.missionTitle,
lat: self.info.lat,
lon: self.info.lon,
}])
})
})
}
self.showDetail = true;
self.getCollectStatus();
if (self.type === 1) {

View File

@@ -105,9 +105,10 @@
</view>
<view class="map">
<!-- <seeLocation ref="cMap" :apikey="$config.apiKey"></seeLocation> -->
<super-map ref="uMap" style="width: 100%;height: 100%;" :latitude="latitude" :longitude="longitude"
<!-- <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" :init="false"
:flag-tip="false"></super-map>
:flag-tip="false"></super-map> -->
<zhuo-tianditu-MultiPoint-Mapper ref="tMap" :api-key="$config.apiKey"></zhuo-tianditu-MultiPoint-Mapper>
</view>
<!-- <map class="map" :latitude="latitude" :longitude="longitude" :markers="covers"></map> -->
</view>
@@ -332,14 +333,21 @@
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;
if (!(self.info.lat && self.info.lat === -1)) {
self.$refs.uMap.initMap({
lat: self.info.lat,
lon: 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;
this.$refs.tMap.open(self.info.lon, self.info.lat)
if (self.info.lon > 1 && self.info.lat > 1) {
this.$nextTick(() => {
self.$api.sleep(1000).then(() => {
this.$refs.tMap.addFeature([{
id: self.info.id,
label: self.info.jobName,
lat: self.info.lat,
lon: self.info.lon,
}])
})
})
}
// this.$refs.cMap.open()

View File

@@ -109,9 +109,10 @@
工作地址{{info.address || '暂无'}}
</view>
<view class="map">
<super-map ref="uMap" style="width: 100%;height: 100%;" :latitude="latitude" :longitude="longitude"
<!-- <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" :init="false"
:MapUrl="$config.supperMap" :flag-tip="false"></super-map>
:MapUrl="$config.supperMap" :flag-tip="false"></super-map> -->
<zhuo-tianditu-MultiPoint-Mapper ref="tMap" :api-key="$config.apiKey"></zhuo-tianditu-MultiPoint-Mapper>
</view>
<!-- <map class="map" :latitude="latitude" :longitude="longitude" :markers="covers"></map> -->
</view>
@@ -338,10 +339,17 @@
self.longitude = self.info.lon;
self.covers[0].latitude = self.info.lat;
self.covers[0].longitude = self.info.lon;
if (!(self.info.lat && self.info.lat === -1)) {
self.$refs.uMap.initMap({
lat: self.info.lat,
lon: self.info.lon,
this.$refs.tMap.open(self.info.lon, self.info.lat)
if (self.info.lon > 1 && self.info.lat > 1) {
self.$nextTick(() => {
self.$api.sleep(1000).then(() => {
this.$refs.tMap.addFeature([{
id: self.info.id,
label: self.info.jobName,
lat: self.info.lat,
lon: self.info.lon,
}])
})
})
}
self.showDetail = true;

View File

@@ -106,9 +106,10 @@
工作地址{{info.address || '暂无'}}
</view>
<view class="map">
<super-map ref="uMap" style="width: 100%;height: 100%;" :latitude="latitude" :longitude="longitude"
<!-- <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" :init="false"
:MapUrl="$config.supperMap" :flag-tip="false"></super-map>
:MapUrl="$config.supperMap" :flag-tip="false"></super-map> -->
<zhuo-tianditu-MultiPoint-Mapper ref="tMap" :api-key="$config.apiKey"></zhuo-tianditu-MultiPoint-Mapper>
</view>
</view>
<view class="" style="height:200rpx;background-color: #f6f6f6;" v-if="isShow!=='0'"></view>
@@ -272,6 +273,7 @@
this.id = option.id; //消息id
}
},
mounted() {},
onShow: function() {
this.showDetail = true
this.getData();
@@ -316,14 +318,22 @@
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;
if (!(self.info.lat && self.info.lat === -1)) {
self.$refs.uMap.initMap({
lat: self.info.lat,
lon: self.info.lon,
this.$refs.tMap.open(self.info.lon, self.info.lat)
// self.latitude = self.info.lat;
// self.longitude = self.info.lon;
// self.covers[0].latitude = self.info.lat;
// self.covers[0].longitude = self.info.lon;
if (self.info.lon > 1 && self.info.lat > 1) {
self.$nextTick(() => {
self.$api.sleep(1000).then(() => {
this.$refs.tMap.addFeature([{
id: self.info.id,
label: self.info.jobName,
lat: self.info.lat,
lon: self.info.lon,
}])
})
})
}
self.showDetail = true;

View File

@@ -87,9 +87,10 @@
任务地址{{ info.address }}
</view>
<view class="map">
<super-map ref="uMap" style="width: 100%;height: 100%;" :latitude="latitude" :longitude="longitude"
<!-- <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>
:flag-tip="false"></super-map> -->
<zhuo-tianditu-MultiPoint-Mapper ref="tMap" :api-key="$config.apiKey"></zhuo-tianditu-MultiPoint-Mapper>
</view>
<!-- <map class="map" :latitude="latitude" :longitude="longitude" :markers="covers"></map> -->
</view>
@@ -282,10 +283,23 @@
recruit_missionDetail(self.missionNo, self.type).then(res => {
self.info = res.data.data;
self.status = res.data.data.detailStatus;
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;
this.$refs.tMap.open(self.info.lon, self.info.lat)
if (self.info.lon > 1 && self.info.lat > 1) {
self.$nextTick(() => {
self.$api.sleep(1000).then(() => {
this.$refs.tMap.addFeature([{
id: self.info.id,
label: self.info.missionTitle,
lat: self.info.lat,
lon: self.info.lon,
}])
})
})
}
self.showDetail = true;
if (self.type === 1) {
// 设置已读

View File

@@ -95,9 +95,10 @@
岗位地址{{ info.address }}
</view>
<view class="map">
<super-map ref="uMap" style="width: 100%;height: 100%;" :latitude="latitude" :longitude="longitude"
<!-- <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>
:flag-tip="false"></super-map> -->
<zhuo-tianditu-MultiPoint-Mapper ref="tMap" :api-key="$config.apiKey"></zhuo-tianditu-MultiPoint-Mapper>
</view>
<!-- <map class="map" :latitude="latitude" :longitude="longitude" :markers="covers"></map> -->
</view>
@@ -263,10 +264,23 @@
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;
this.$refs.tMap.open(self.info.lon, self.info.lat)
if (self.info.lon > 1 && self.info.lat > 1) {
self.$nextTick(() => {
self.$api.sleep(1000).then(() => {
this.$refs.tMap.addFeature([{
id: self.info.id,
label: self.info.jobName,
lat: self.info.lat,
lon: self.info.lon,
}])
})
})
}
self.showDetail = true;
}
},

View File

@@ -95,9 +95,10 @@
岗位地址{{ info.address }}
</view>
<view class="map">
<super-map ref="uMap" style="width: 100%;height: 100%;" :latitude="latitude" :longitude="longitude"
<!-- <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>
:flag-tip="false"></super-map> -->
<zhuo-tianditu-MultiPoint-Mapper ref="tMap" :api-key="$config.apiKey"></zhuo-tianditu-MultiPoint-Mapper>
</view>
<!-- <map class="map" :latitude="latitude" :longitude="longitude" :markers="covers"></map> -->
</view>
@@ -250,10 +251,23 @@
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;
this.$refs.tMap.open(self.info.lon, self.info.lat)
if (self.info.lon > 1 && self.info.lat > 1) {
self.$nextTick(() => {
self.$api.sleep(1000).then(() => {
this.$refs.tMap.addFeature([{
id: self.info.id,
label: self.info.jobName,
lat: self.info.lat,
lon: self.info.lon,
}])
})
})
}
self.showDetail = true;
}, error => {
console.log(error);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff