emis-sapp/pages/post/locus.vue

214 lines
5.4 KiB
Vue
Raw Normal View History

2023-12-13 17:06:13 +00:00
<template>
2024-06-03 08:45:36 +00:00
<tpx-page>
<tpx-layout>
<template v-slot:header></template>
<template v-slot:body>
<div style="min-height: 100%;display: flex;flex-direction: column;">
<view style="position: relative;">
2025-08-15 08:52:14 +00:00
<map
:polyline="[...polyline]"
:latitude="map.latitude"
:longitude="map.longitude"
:scale="map.scale"
style="width: 750rpx;height: 70vh;"
></map>
2024-06-03 08:45:36 +00:00
2025-08-15 06:54:04 +00:00
<view style="position: absolute;top:5px;width: 95%;padding-left: 8px;padding-right: 8px">
<view class="mp-base-block">
<bpd-map-reciever-panel :value="modelInfo"></bpd-map-reciever-panel>
</view>
2024-06-03 08:45:36 +00:00
</view>
2025-08-15 08:52:14 +00:00
<view style="position: absolute;top:62vh;width: 95%;padding-left: 8px;padding-right: 8px">
2025-08-15 06:54:04 +00:00
<view class="mp-base-block blackbg" @click="makePhoneCall(modelInfo.takePieceEmployeePhone)">
<u-row justify="between">
<u-row>
<tpx-image :src="getCdnUrl('post/run.png')" width="30" height="30"></tpx-image>
<view class="ml-20">探路小哥 - {{modelInfo.takePieceEmployeeName}}</view>
</u-row>
<tpx-image v-if="modelInfo.takePieceEmployeePhone" :src="getCdnUrl('post/call.png')" width="60" height="60"></tpx-image>
2024-06-03 08:45:36 +00:00
</u-row>
2025-08-15 06:54:04 +00:00
</view>
2024-06-03 08:45:36 +00:00
</view>
2023-12-13 17:06:13 +00:00
</view>
2024-06-03 08:45:36 +00:00
<view class="dt-block mt-20">
2025-08-19 14:09:42 +00:00
<view style="color: #b12d29;font-size: 10px;" >温馨提示:由于小程序腾讯地图局限,中国外地图道路可能显示不全,请通过网页查询。</view>
2024-06-03 08:45:36 +00:00
<view class="mb-20">
<buns-locus-pos :billCode="queryOption.billCode"></buns-locus-pos>
</view>
2023-12-13 17:06:13 +00:00
</view>
2024-06-03 08:45:36 +00:00
</div>
</template>
2025-08-15 08:52:14 +00:00
<!-- <template v-slot:footer>
2024-06-03 08:45:36 +00:00
<view class="blcok-white-noradius" style="margin-top: 0;">
<u-row justify="space-around">
<u-button @click="goBack()" :plain="true" size="large" shape="circle"
custom-style="margin: 0 10rpx;height:80rpx;font-size: 30rpx;">
返回
</u-button>
2024-06-03 09:50:32 +00:00
<u-button @click="goto(`post/post?copyBillCode=${queryOption.billCode}`)" type="primary" size="large" shape="circle"
2024-06-03 08:45:36 +00:00
custom-style="margin: 0 10rpx;height:80rpx;font-size: 30rpx;">再来一单
</u-button>
</u-row>
2023-12-13 17:06:13 +00:00
</view>
2025-08-15 08:52:14 +00:00
</template> -->
2024-06-03 08:45:36 +00:00
</tpx-layout>
</tpx-page>
2023-12-13 17:06:13 +00:00
</template>
<script>
2025-08-15 06:54:04 +00:00
import coordtransform from 'coordtransform';
2024-06-03 08:45:36 +00:00
import * as apiService from "@/common/api"
2025-08-15 06:22:35 +00:00
import BpdMapRecieverPanel from "@/components/buns-post-detail-templates/bpd-map-reciever-panel"
2023-12-16 17:34:29 +00:00
2023-12-13 17:06:13 +00:00
export default {
props: {
2024-06-03 08:45:36 +00:00
2023-12-13 17:06:13 +00:00
},
2024-06-03 08:45:36 +00:00
computed: {
dicData() {
return this.$store.getters.dicData
},
},
2025-08-15 08:52:14 +00:00
components: { BpdMapRecieverPanel },
2023-12-13 17:06:13 +00:00
data() {
return {
2024-06-03 08:45:36 +00:00
queryOption: {
billCode: '', // 运单id
},
modelInfo: {},
2025-08-15 06:22:35 +00:00
dataList:[],
2025-08-15 08:52:14 +00:00
polyline: [{
width: 4,
points: [],
arrowLine: true,
color: '#28f',
}],
2023-12-16 17:34:29 +00:00
map: {
latitude: 23.106574, //纬度
longitude: 113.324587, //经度
2025-08-15 08:52:14 +00:00
scale: 6, //缩放级别
2023-12-16 17:34:29 +00:00
}
2023-12-13 17:06:13 +00:00
}
},
onShareAppMessage() {
2024-06-03 08:45:36 +00:00
2023-12-13 17:06:13 +00:00
},
2024-06-03 08:45:36 +00:00
onLoad(option) {
this.queryOption = option
2023-12-13 17:06:13 +00:00
this.initData();
},
2023-12-16 17:34:29 +00:00
onUnload() {},
2024-06-03 08:45:36 +00:00
2023-12-13 17:06:13 +00:00
methods: {
2024-06-03 08:45:36 +00:00
async initData() {
let res = await apiService.getOrderDetail({billCode: this.queryOption.billCode, _loading: true})
// 通过对象合并才能修改父级 数据
Object.assign(this.modelInfo, res.data || {})
2025-08-15 06:22:35 +00:00
const resLbs = await apiService.getLbsRecordListByBillCode({
billCode: this.queryOption.billCode
});
if (resLbs && resLbs.code === 200) {
2025-08-15 08:52:14 +00:00
2025-08-15 06:22:35 +00:00
let lbsRecordList=resLbs.data.lbsRecordList;
if( lbsRecordList && lbsRecordList.length>0){
let currentInfo=lbsRecordList[lbsRecordList.length-1];
this.map.latitude=this.cvtToWgs84(currentInfo.longitude, currentInfo.latitude)[1];
this.map.longitude=this.cvtToWgs84(currentInfo.longitude, currentInfo.latitude)[0];
this.dataList=lbsRecordList;
2025-08-15 08:52:14 +00:00
let points = lbsRecordList.map(item => ({
2025-08-15 06:22:35 +00:00
latitude: this.cvtToWgs84(item.longitude, item.latitude)[1],
longitude: this.cvtToWgs84(item.longitude, item.latitude)[0]
}));
2025-08-15 08:52:14 +00:00
this.polyline[0].points=points;
2025-08-15 06:22:35 +00:00
}
}
},
cvtToWgs84(longitude, latitude) {
let lng = longitude / 1000000;
let lat = latitude / 1000000;
return coordtransform.wgs84togcj02(lng, lat);
2023-12-16 17:34:29 +00:00
}
2023-12-13 17:06:13 +00:00
}
}
</script>
<style lang="scss">
@import '@/common/uni-nvue.scss';
2023-12-16 17:34:29 +00:00
2023-12-13 17:06:13 +00:00
page {
background-color: #F6F6F6;
height: 100% !important;
}
</style>
<style scoped lang="scss">
2024-06-03 08:45:36 +00:00
.mp-base-block{
margin-top: 20rpx;
2023-12-16 17:34:29 +00:00
padding: 20rpx 30rpx;
background: #FFFFFF;
border-radius: 20rpx;
2024-06-03 08:45:36 +00:00
position: relative;
&.blackbg{
&::after{
border-radius: 36rpx;
content: ' ';
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: #0E0708;
opacity: 0.5;
z-index: -1;
}
}
2023-12-13 17:06:13 +00:00
}
2024-06-03 08:45:36 +00:00
2023-12-16 17:34:29 +00:00
.mp-kuadiyuan-mask{
padding: 12rpx 10rpx 12rpx 30rpx;
bottom: 20rpx;
color: #fff;
&::after{
border-radius: 36rpx;
content: ' ';
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: #0E0708;
opacity: 0.5;
z-index: -1;
}
}
.dt-block {
flex: 1;
border-radius: 30rpx 30rpx 0rpx 0rpx;
2023-12-13 17:06:13 +00:00
padding: 30rpx;
background-color: #FFF;
position: relative;
}
2023-12-16 17:34:29 +00:00
.dt-tle {
2023-12-13 17:06:13 +00:00
display: flex;
flex-direction: row;
2023-12-16 17:34:29 +00:00
justify-content: space-between;
.t1 {
font-size: 30rpx;
font-weight: 600;
2023-12-13 17:06:13 +00:00
}
2023-12-16 17:34:29 +00:00
.t2 {
font-size: 30rpx;
2023-12-13 17:06:13 +00:00
}
}
2023-12-16 17:34:29 +00:00
2023-12-13 17:06:13 +00:00
</style>