更新三轮车
This commit is contained in:
parent
b989761b83
commit
903cdffb4f
10
api/task.js
10
api/task.js
@ -15,3 +15,13 @@ export const taskInformationgist = (data) => oahttp.get('/task/informationg_list
|
|||||||
* 任务:片区交易
|
* 任务:片区交易
|
||||||
*/
|
*/
|
||||||
export const taskOrderDetail = (data) => oahttp.get('/task/order_detail', data)
|
export const taskOrderDetail = (data) => oahttp.get('/task/order_detail', data)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务:三轮游走获取地址
|
||||||
|
*/
|
||||||
|
export const taskTricycleDetail = (data) => oahttp.get('/task/tricycle_detail', data)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务:三轮游走上传位置
|
||||||
|
*/
|
||||||
|
export const taskAddTricycleCoordinate = (data) => oahttp.post('/task/add_tricycle_coordinate', data)
|
||||||
|
@ -122,16 +122,16 @@
|
|||||||
},
|
},
|
||||||
clickTask() {
|
clickTask() {
|
||||||
// console.log('点击', this.$props.datas);
|
// console.log('点击', this.$props.datas);
|
||||||
if ((this.$props.datas.type != 31) && this.$props.datas.status !== 2 && this.$props.datas.status !== 1) {
|
// if ((this.$props.datas.type != 31) && this.$props.datas.status !== 2 && this.$props.datas.status !== 1) {
|
||||||
return this.$props.datas.status == 3 ? Toast('任务已完成!') : Toast('任务已结束!');
|
// return this.$props.datas.status == 3 ? Toast('任务已完成!') : Toast('任务已结束!');
|
||||||
}
|
// }
|
||||||
if (this.$props.datas.type == 31) {
|
if (this.$props.datas.type == 31) {
|
||||||
// this.navTo('/subpkg/fileTask/fileTask?id=' + JSON.stringify(this.$props.datas?.extend?.informationg?.arr))
|
// this.navTo('/subpkg/fileTask/fileTask?id=' + JSON.stringify(this.$props.datas?.extend?.informationg?.arr))
|
||||||
if(this.$store.state.app.userInfo.admin_id)this.navTo(`/subpkg/captain/captain?task_id=${this.$props.datas?.id}`);
|
if(this.$store.state.app.userInfo.admin_id)this.navTo(`/subpkg/captain/captain?task_id=${this.$props.datas?.id}`);
|
||||||
else this.navTo(`/subpkg/archives/archives?task_id=${this.$props.datas?.id}`);
|
else this.navTo(`/subpkg/archives/archives?task_id=${this.$props.datas?.id}`);
|
||||||
} else if (this.$props.datas.type == 32) {
|
} else if (this.$props.datas.type == 32) {
|
||||||
// this.navTo('/subpkg/fileTask/fileTask?id=' + JSON.stringify(this.$props.datas?.extend?.informationg?.arr))
|
// this.navTo('/subpkg/fileTask/fileTask?id=' + JSON.stringify(this.$props.datas?.extend?.informationg?.arr))
|
||||||
this.navTo(`/subpkg/vehicle/vehicle?task_id=${this.$props.datas?.id}`)
|
this.navTo(`/subpkg/property/vehicle?task_id=${this.$props.datas?.id}`)
|
||||||
} else if(this.$props.datas.type == 33){
|
} else if(this.$props.datas.type == 33){
|
||||||
this.navTo(`/subpkg/blockTransaction/blockTransaction?task_id=${this.$props.datas?.id}`)
|
this.navTo(`/subpkg/blockTransaction/blockTransaction?task_id=${this.$props.datas?.id}`)
|
||||||
}
|
}
|
||||||
|
@ -498,7 +498,7 @@
|
|||||||
"path": "property/vehicle",
|
"path": "property/vehicle",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "三轮车游走",
|
"navigationBarTitleText": "三轮车游走",
|
||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": false,
|
||||||
"navigationBarBackgroundColor": "#0122C7",
|
"navigationBarBackgroundColor": "#0122C7",
|
||||||
"navigationBarTextStyle": "white"
|
"navigationBarTextStyle": "white"
|
||||||
}
|
}
|
||||||
|
@ -10,52 +10,55 @@
|
|||||||
<map :class="mapClass" id="map" @markertap='mapFun' :enable-zoom="true" :polyline="polyline"
|
<map :class="mapClass" id="map" @markertap='mapFun' :enable-zoom="true" :polyline="polyline"
|
||||||
:markers='markers' :scale="scale" style="width:100%;height: 100%;"
|
:markers='markers' :scale="scale" style="width:100%;height: 100%;"
|
||||||
:latitude="markers[0].latitude" :enable-scroll="true" :longitude="markers[0].longitude">
|
:latitude="markers[0].latitude" :enable-scroll="true" :longitude="markers[0].longitude">
|
||||||
<cover-image class="map_btn" @tap="test" src="../../static/img/logistics/DH.png">
|
|
||||||
</cover-image>
|
|
||||||
</map>
|
</map>
|
||||||
</view>
|
</view>
|
||||||
<view class="map_address">
|
<view class="map_address">
|
||||||
<view class="li">
|
<view class="li">
|
||||||
<view>
|
<view style="display: flex;justify-content: left;">
|
||||||
<text class="cir" style="background-color: #40BC5E;"></text>
|
<view style="flex-shrink: 0;margin-right: 14rpx;">
|
||||||
中转站: 恐惧发现不舒服1还得上课讲话方式打开就
|
<text class="cir" style="background-color: #40BC5E;"></text>
|
||||||
|
中转站:
|
||||||
|
</view>
|
||||||
|
<view v-if="address.terminus">{{address.terminus.address}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view :class="{lg_status1:true,lg_status2:false}">
|
<view :class="{lg_status1:address.terminus.status==2,lg_status2:address.terminus.status==1}">
|
||||||
<text class="cir" style="background-color: transparent;"></text>
|
<text class="cir" style="background-color: transparent;"></text>
|
||||||
<text>车辆状态</text>:<text v-if="true">已完成</text>
|
<text>车辆状态:</text><text v-if="address.terminus.status==2">已完成</text>
|
||||||
<text v-else style="color: #FF7C32;">进行中</text>
|
<text v-else style="color: #FF7C32;">进行中</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="li">
|
<view class="li">
|
||||||
<view>
|
<view style="display: flex;justify-content: left;">
|
||||||
<text class="cir" style="background-color: #FF7C32;"></text>
|
<view style="flex-shrink: 0;margin-right: 14rpx;">
|
||||||
终 点: 恐惧发现不舒服1还得上课讲话方式打开就
|
<text class="cir" style="background-color: #40BC5E;"></text>
|
||||||
</view>
|
终 点:
|
||||||
<view :class="{lg_status1:true,lg_status2:false}">
|
</view>
|
||||||
|
<view v-if="address.transfer">{{address.transfer.address}}</view>
|
||||||
|
</view>
|
||||||
|
<view :class="{lg_status1:address.transfer.status==2,lg_status2:address.transfer.status==1}">
|
||||||
<text class="cir" style="background-color: transparent;"></text>
|
<text class="cir" style="background-color: transparent;"></text>
|
||||||
<text class="status">车辆状态</text>:<text v-if="true">已完成</text>
|
<text class="status">车辆状态:</text><text v-if="address.transfer.status==2">已完成</text>
|
||||||
<text v-else style=" color: #FF7C32;">进行中</text>
|
<text v-else style=" color: #FF7C32;">进行中</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<mybtn v-if="status==1" position="position" @click="getFn" text="抵达地点(中转站) 1/2"></mybtn>
|
|
||||||
<mybtn v-else position="position" text="抵达地点(终点) 2/2"></mybtn>
|
|
||||||
</view>
|
</view>
|
||||||
|
<mybtn v-if="status==1" @click="getFn" text="抵达地点(中转站) 1/2"></mybtn>
|
||||||
|
<mybtn v-else @click="getFn" text="抵达地点(终点) 2/2"></mybtn>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import mybtn from "@/components/mybtn/mybtn.vue"
|
import mybtn from "@/components/mybtn/mybtn.vue"
|
||||||
import {
|
import {
|
||||||
getDetil
|
taskTricycleDetail,
|
||||||
} from "@/api/logistics.js"
|
taskAddTricycleCoordinate
|
||||||
import {
|
} from "@/api/task.js"
|
||||||
takeGoods
|
import { Toast } from "../../libs/uniApi";
|
||||||
} from "@/api/logistics.js"
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
mybtn
|
mybtn
|
||||||
@ -77,7 +80,7 @@
|
|||||||
longitude: 105.445717,
|
longitude: 105.445717,
|
||||||
iconPath: '../../static/img/logistics/SJ.png', //显示的图标
|
iconPath: '../../static/img/logistics/SJ.png', //显示的图标
|
||||||
},
|
},
|
||||||
// 骑手
|
// 当前所在位置
|
||||||
{
|
{
|
||||||
id: 2,
|
id: 2,
|
||||||
latitude: undefined,
|
latitude: undefined,
|
||||||
@ -85,12 +88,42 @@
|
|||||||
iconPath: '../../static/img/logistics/QS.png', //显示的图标
|
iconPath: '../../static/img/logistics/QS.png', //显示的图标
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
polyline: []
|
polyline: [],
|
||||||
|
task_id: -1,
|
||||||
|
address: {
|
||||||
|
terminus:{
|
||||||
|
status: 1
|
||||||
|
},
|
||||||
|
transfer:{
|
||||||
|
status: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onLoad(options){
|
||||||
|
this.task_id = options.task_id;
|
||||||
|
this.initPosition();
|
||||||
|
this.locationFn();
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取位置
|
// 获取位置
|
||||||
|
async initPosition(){
|
||||||
|
let res = await taskTricycleDetail({id: this.task_id});
|
||||||
|
this.address = res.data.extend;
|
||||||
|
if(res.data.extend?.update?.terminus?.lnglat[0]){ //已抵达中转站,更新目标点为终点
|
||||||
|
this.markers[0].latitude = +res.data.extend.transfer.lnglat[1];
|
||||||
|
this.markers[0].longitude = +res.data.extend.transfer.lnglat[0];
|
||||||
|
this.status = 2;
|
||||||
|
this.address.terminus['status'] = 2;
|
||||||
|
}else { // 未抵达中转站,设置中转站为目标点
|
||||||
|
this.markers[0].latitude = +res.data.extend.terminus.lnglat[1];
|
||||||
|
this.markers[0].longitude = +res.data.extend.terminus.lnglat[0];
|
||||||
|
this.address.terminus['status'] = 1;
|
||||||
|
}
|
||||||
|
if(res.data.extend?.update?.transfer?.lnglat[0]){
|
||||||
|
this.address.transfer['status'] = 2;
|
||||||
|
}else this.address.transfer['status'] = 1;
|
||||||
|
},
|
||||||
// 位置
|
// 位置
|
||||||
locationFn() {
|
locationFn() {
|
||||||
let that = this
|
let that = this
|
||||||
@ -184,18 +217,45 @@
|
|||||||
const distance = 6378137 * c;
|
const distance = 6378137 * c;
|
||||||
return distance;
|
return distance;
|
||||||
},
|
},
|
||||||
|
// 上报位置
|
||||||
getFn() {
|
getFn() {
|
||||||
|
uni.showLoading({
|
||||||
|
title: '上传中',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
this.locationFn()
|
this.locationFn()
|
||||||
console.log(545)
|
|
||||||
console.log()
|
|
||||||
// console.log(this.getDistance(this.markers[0], this.markers[1]))
|
// console.log(this.getDistance(this.markers[0], this.markers[1]))
|
||||||
if ((this.getDistance(this.markers[0], this.markers[1]) >> 0) > 300) {
|
if ((this.getDistance(this.markers[0], this.markers[1]) >> 0) > 10000) {
|
||||||
// return
|
return Toast('距离目标位置过远');
|
||||||
uni.showToast({
|
}else {
|
||||||
title: `距离目标位置过远`,
|
let data;
|
||||||
icon: 'none'
|
if(this.status==1)data = {
|
||||||
})
|
id: this.task_id,
|
||||||
}
|
terminus: {
|
||||||
|
lnglat: [
|
||||||
|
this.markers[1].longitude,
|
||||||
|
this.markers[1].latitude
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
else data = {
|
||||||
|
id: this.task_id,
|
||||||
|
transfer: {
|
||||||
|
lnglat: [
|
||||||
|
this.markers[1].longitude,
|
||||||
|
this.markers[1].latitude
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
taskAddTricycleCoordinate(data).then(()=>{
|
||||||
|
uni.hideLoading()
|
||||||
|
Toast('上传成功!')
|
||||||
|
if(this.status==1){
|
||||||
|
this.initPosition();
|
||||||
|
this.locationFn();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
getDriverLine() {
|
getDriverLine() {
|
||||||
const that = this;
|
const that = this;
|
||||||
@ -235,14 +295,6 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
|
||||||
onLoad(options) {
|
|
||||||
this.locationFn()
|
|
||||||
// console.log()
|
|
||||||
setTimeout(() => {
|
|
||||||
this.showLoading = true
|
|
||||||
}, 1000)
|
|
||||||
|
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
// this.getOrderList();
|
// this.getOrderList();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user