<view class="server_flex">
<view class="server_item" bindtap="tel">一键拨号</view>
<view class="server_item" bindtap="toNavigator">一键导航</view>
<view class="server_item" bindtap="toGuiHua">规划设计</view>
<button open-type='contact' class="server_item" type="primary">客服咨询</button>
</view>
//点击导航
toNavigator() {
var that = this
const {company}=this.data;
const latitude=company.longitude,
longitude=company.longitude,
name=company.name;
wx.getSetting({
success: (res) => {
if (res.authSetting['scope.userLocation'] != undefined && res.authSetting['scope.userLocation'] != true) {
wx.showModal({
title: '是否授权当前位置',
content: '需要获取您的地理位置,请确认授权,否则地图定位功能将无法使用',
success: function (res) {
if (res.cancel) {
wx.showToast({
title: '授权失败',
icon: 'none',
duration: 5000
})
} else if (res.confirm) {
wx.openSetting({
success: function (data) {
if (data.authSetting["scope.userLocation"] == true) {
wx.showToast({
title: '授权成功',
icon: 'success',
duration: 5000
})
wx.openLocation({
latitude: parseFloat(latitude),
longitude: parseFloat(longitude),
name: name,
scale: 28
})
} else {
wx.showToast({
title: '授权失败',
icon: 'success',
duration: 5000
})
}
}
})
}
}
})
} else {
wx.openLocation({
latitude: parseFloat(latitude),
longitude: parseFloat(longitude),
name: name,
scale: 28
})
}
}
})
},