|
@@ -37,6 +37,8 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <u-action-sheet :actions="list" :title="title" :show="show" @close='show=false'
|
|
|
+ @select="selectClick"></u-action-sheet>
|
|
|
<view class="btns">
|
|
|
<u-button v-if="dataForm.isReceived==='0'" type='error' :plain="true" text="拒绝"
|
|
|
@click="refuseTaskArrange"></u-button>
|
|
@@ -46,8 +48,8 @@
|
|
|
@click="receiveTaskArrange"></u-button>
|
|
|
<u-button class="custom-style" v-if="dataForm.isReceived==='6'" type="primary" text="完成"
|
|
|
@click="completeTaskArrange"></u-button>
|
|
|
- <span style="margin-left: 15rpx;width: 100%;">
|
|
|
- <u-button class="custom-style" type="primary" text="导航到起飞点" @click="toFly"></u-button>
|
|
|
+ <span style="margin-left: 15rpx;width: 300rpx;">
|
|
|
+ <u-button class="custom-style" type="primary" text="导航到起飞点" @click="selectClick"></u-button>
|
|
|
</span>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -57,6 +59,15 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ title: '导航到起飞点',
|
|
|
+ list: [{
|
|
|
+ name: '高德',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '百度',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ show: false,
|
|
|
dataForm: {},
|
|
|
isApp: false,
|
|
|
}
|
|
@@ -68,10 +79,32 @@
|
|
|
this.dataForm = JSON.parse(x.data)
|
|
|
},
|
|
|
methods: {
|
|
|
- toFly() {
|
|
|
+ selectClick(index) {
|
|
|
+ this.changelang(this.dataForm.takeoffLongitude, this.dataForm.takeoffLatitude)
|
|
|
+ // console.log(index);
|
|
|
+ // if (index.name == '高德') {
|
|
|
+ // } else {
|
|
|
+ // this.toFly(this.dataForm.takeoffLongitude, this.dataForm.takeoffLatitude)
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ changelang(long, lat) {
|
|
|
+ let that = this
|
|
|
+ uni.request({
|
|
|
+ url: `https://restapi.amap.com/v3/assistant/coordinate/convert?locations=${long},${lat}&coordsys=gps&key=74d5aa7c4270effe9a18d9cfa6149abf`,
|
|
|
+ success(res) {
|
|
|
+ console.log(res.data.locations);
|
|
|
+ let locations = res.data.locations.split(',')
|
|
|
+ that.toFly(locations[0], locations[1])
|
|
|
+ },
|
|
|
+ fail(fail) {
|
|
|
+ console.log(fail);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ toFly(lang, lat) {
|
|
|
// 定义目的地的坐标和名称
|
|
|
- const latitude = this.dataForm.takeoffLatitude; // 纬度
|
|
|
- const longitude = this.dataForm.takeoffLongitude; // 经度
|
|
|
+ const latitude = lat; // 纬度
|
|
|
+ const longitude = lang; // 经度
|
|
|
const name = '起飞点'; // 地点名称
|
|
|
const address = '起飞点'; // 地址
|
|
|
|