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