emis-sapp/pages/post/locus.vue
2025-08-15 14:22:35 +08:00

220 lines
5.4 KiB
Vue

<template>
<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;">
<maptalks-map
:dataList="dataList"
style="width: 750rpx;height: 70vh;"
></maptalks-map>
<!-- <map :markers="map.markers" :latitude="map.latitude" :longitude="map.longitude"
style="width: 750rpx;height: 400rpx;"
></map> -->
<view class="mp-base-block">
<bpd-send-reciever-tmp :value="modelInfo"></bpd-send-reciever-tmp>
</view>
<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>
</u-row>
</view>
</view>
<view class="dt-block mt-20">
<view class="mb-20">
<buns-locus-pos :billCode="queryOption.billCode"></buns-locus-pos>
</view>
</view>
</div>
</template>
<template v-slot:footer>
<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>
<u-button @click="goto(`post/post?copyBillCode=${queryOption.billCode}`)" type="primary" size="large" shape="circle"
custom-style="margin: 0 10rpx;height:80rpx;font-size: 30rpx;">再来一单
</u-button>
</u-row>
</view>
</template>
</tpx-layout>
</tpx-page>
</template>
<script>
import * as apiService from "@/common/api"
// import BpdSendRecieverTmp from "@/components/buns-post-detail-templates/bpd-send-reciever-tmp"
import BpdMapRecieverPanel from "@/components/buns-post-detail-templates/bpd-map-reciever-panel"
import maptalksMap from "@/components/map-talks/maptalks-panel"
export default {
props: {
},
computed: {
dicData() {
return this.$store.getters.dicData
},
},
components: { BpdMapRecieverPanel,maptalksMap },
data() {
return {
queryOption: {
billCode: '', // 运单id
},
modelInfo: {},
dataList:[],
map: {
latitude: 23.106574, //纬度
longitude: 113.324587, //经度
scale: 13, //缩放级别
markers: [{
latitude: 23.106574, //纬度
longitude: 113.324587, //经度
title: '出发地------',
iconPath: this.getCdnUrl('mine/kjcha.png'),
width: 50,
height: 50,
label: {
content: '发货地址',
color: '#fff',
borderRadius: '10',
bgColor: '#B12D29',
padding: '10'
}
}]
}
}
},
onShareAppMessage() {
},
onLoad(option) {
this.queryOption = option
this.initData();
},
onUnload() {},
methods: {
async initData() {
let res = await apiService.getOrderDetail({billCode: this.queryOption.billCode, _loading: true})
// 通过对象合并才能修改父级 数据
Object.assign(this.modelInfo, res.data || {})
const resLbs = await apiService.getLbsRecordListByBillCode({
billCode: this.queryOption.billCode
});
if (resLbs && resLbs.code === 200) {
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;
const points = lbsRecordList.map(item => ({
latitude: this.cvtToWgs84(item.longitude, item.latitude)[1],
longitude: this.cvtToWgs84(item.longitude, item.latitude)[0]
}));
this.map.polyline[0].points = points;
}
}
},
cvtToWgs84(longitude, latitude) {
let lng = longitude / 1000000;
let lat = latitude / 1000000;
return coordtransform.wgs84togcj02(lng, lat);
}
}
}
</script>
<style lang="scss">
@import '@/common/uni-nvue.scss';
page {
background-color: #F6F6F6;
height: 100% !important;
}
</style>
<style scoped lang="scss">
.mp-base-block{
margin-top: 20rpx;
padding: 20rpx 30rpx;
background: #FFFFFF;
border-radius: 20rpx;
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;
}
}
}
.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;
padding: 30rpx;
background-color: #FFF;
position: relative;
}
.dt-tle {
display: flex;
flex-direction: row;
justify-content: space-between;
.t1 {
font-size: 30rpx;
font-weight: 600;
}
.t2 {
font-size: 30rpx;
}
}
</style>