<view style='margin-left:10rpx;'>订单号: {{der_num}}</view>
<view class='page_row'>
<view class='centent'>
<view style='margin-left:10rpx;' wx:if='{{item.server_info.linkman}}'>下单⼈: {{item.server_info.linkman}}
<text style='color:#999;margin-left:40rpx;font-size:32rpx;' wx:if='{{item.l}}'>: {{item.l}}</text>
</view>
<view style='color:#999;margin-top:15rpx;' wx:if='{{item.car_info.title}}'>
<view style='color:#999;margin-left:10rpx;font-size:28rpx' bindtap='apen_add'data-name='{{item.server_info.address}}' data-latitude_siji='{{item.dinate_start}}'><image style='width:32rpx;height:32rpx' src='../../image/location.png'/> 导航⾄起始      </view>
<view style='color:#999;margin-top:15rpx;' wx:if='{{item.car_info.title}}'>
<view style='color:#999;margin-left:10rpx;font-size:28rpx' bindtap='apen_add' data-name='{{item.server_info.address_end_text}}' data-longitude_siji='{{item.dinate_end}}'><image style='width:32rpx;height:32rpx' src='/image/location.png'/> 导航      </view>
<view style='color:#999;margin-top:15rpx;' wx:if='{{item.car_info.title}}'>
<view style='color:#999;margin-left:10rpx;font-size:28rpx'> 分配时间:{{item.time_tired}}</view>
</view>
</view>
</view>
<view class='xxx'></view>
</block>
apen_add: function (e) {
var that = this
var latitude, longitude
var name = e.currentTarget.dataset.name
if (e.currentTarget.dataset.latitude_siji) {
var latitude_siji = e.currentTarget.dataset.latitude_siji.split(',')
latitude = Number(latitude_siji[0])
longitude = Number(latitude_siji[1])
}
if (e.currentTarget.dataset.longitude_siji) {
var longitude_siji = e.currentTarget.dataset.longitude_siji.split(',')
latitude = Number(longitude_siji[0])
longitude = Number(longitude_siji[1])
}
success: (res) => {
if (res.authSetting['scope.userLocation'] != undefined && res.authSetting['scope.userLocation'] != true) {
wx.showModal({
title: '是否授权当前位置',
content: '需要获取您的地理位置,请确认授权,否则地图定位功能将⽆法使⽤',
success: function (res) {
if (res.cancel) {
console.info("1授权失败返回数据");
} else if (firm) {
//village_LBS(that);
wx.openSetting({
success: function (data) {
if (data.authSetting["scope.userLocation"] == true) {
wx.showToast({
title: '授权成功',
icon: 'success',
duration: 5000
})
wx.openLocation({
latitude: latitude,
longitude: longitude,
name: name,
scale: 28
})
} else {
wx.showToast({
title: '授权失败',
icon: 'success',
duration: 5000
})
}
}
})
}
}
})
} else {
wx.openLocation({
latitude: latitude,
longitude: longitude,
name: name,
scale: 28
})
}
}
})
},
数据请求
show_data: function () {
var that = this;
if (wx.getStorageSync('register') != '司机') {
var data = {
openid: app._openid,
program_id: app.jtappid,
only_num: app._openid,
online_code: wx.getStorageSync('online_code')
}
var url = '/pg.php/CarTrailer/roder_list';
verse()
for (var i = 0; i < res.data.length; i++) {
res.data[i].time_xd = util.js_date_time(res.data[i].time_xd)
switch (res.data[i].state) {
case '1':
that.setData({
data_1: that.data.at(res.data[i]),
})
break;
case '2':写文章的小程序
that.setData({
data_2: that.data.at(res.data[i]),
})
break;
case '3':
that.setData({
data_3: that.data.at(res.data[i]),
})
break;
case '4':
that.setData({
data_4: that.data.at(res.data[i]),
})
break;
}
}
})
} else {
var data = {
openid: app._openid,
program_id: app.jtappid,
online_code: wx.getStorageSync('online_code')
}
var url = '/pg.php/CarTrailer/driver_order_list';
for (var i = 0; i < res.data.length; i++) {
res.data[i].time_tired = util.js_date_time(res.data[i].time_tired)
}
verse()
that.setData({
siji: true
})
for (var i = 0; i < res.data.length; i++) {
switch (res.data[i].state) {
case '1':
that.setData({
data_1: that.data.at(res.data[i]),
})
break;
case '2':
that.setData({
data_2: that.data.at(res.data[i]),
})
break;
case '3':
that.setData({
data_3: that.data.at(res.data[i]),
})
break;
case '4':
that.setData({
data_4: that.data.at(res.data[i]),
})
break;
}
}
})
}
},
以上所述是⼩编给⼤家介绍的⼩程序地图导航功能实现详解整合,希望对⼤家有所帮助,如果⼤家有任何疑问请给我留⾔,⼩编会及时回复⼤家的。在此也⾮常感谢⼤家对⽹站的⽀持!

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。

新媒体运营专员工作的主要岗位职责(精选21篇)
« 上一篇
小程序设计
下一篇 »

发表评论

推荐文章

热门文章

最新文章

标签列表