Commit 93fb9aea authored by 刘用法's avatar 刘用法

定位权限问题

parent a44c4882
......@@ -170,9 +170,27 @@
dataValue.push(res.latitude)
self.dataValue = dataValue
},
fail(err) {
complete: function(res) {
if (res.errMsg.indexOf('auth') != -1) {
uni.showModal({
title: '提示',
content: '获取权限失败,请到设置页面开启权限',
confirmText: '好的',
success(res) {
if (res.confirm) {
uni.openSetting({
success(res) {
console.log(res.authSetting)
}
});
}
}
})
}
},
fail: function(err) {
}
});
},
......
......@@ -34,7 +34,7 @@
<u-icon name="map" size="28"></u-icon>
<text class="address-txt">{{ order.contactAddress }}</text>
</view>
<u-image width="48rpx" height="48rpx" :src="navigationIcon" @click="openLocation"></u-image>
<u-image width="48rpx" height="48rpx" :src="navigationIcon" @click="openLocation(order.contactAddress)"></u-image>
</view>
<!-- <u-read-more ref="uReadMore" :show-height="40" :shadowStyle="{paddingTop: '0rpx',marginTop: '0rpx'}" close-text="查看更多" open-text="点击收起" toggle color="#2272FF" font-size="26"> -->
<view v-if="readMore" @click="readMore = false" class="read-more-toggle">
......@@ -268,7 +268,7 @@
}
},
methods: {
openLocation(){
openLocation(address){
if(this.isAllowDianhuaAndDaohang){
uni.getLocation({
type: 'gcj02', //返回可以用于uni.openLocation的经纬度
......@@ -281,7 +281,38 @@
success: function () {
console.log('success');
}
});
},
complete: function(res) {
console.log('-------complete-----', res)
if (res.errMsg.indexOf('auth') != -1) {
uni.showModal({
title: '提示',
content: '获取权限失败,请到设置页面开启权限',
confirmText: '好的',
success(res) {
if (res.confirm) {
uni.openSetting({
success(res) {
console.log(res.authSetting)
}
});
}
}
})
} else {
uni.setClipboardData({
data: address,
success: function () {
console.log('success');
},
complete: function(res) {
console.log(res)
}
});
}
}
});
}
......@@ -789,6 +820,9 @@
line-height: 24rpx;
margin-top: 20rpx;
margin-bottom: 40rpx;
display: flex;
justify-content: space-between;
align-items: center;
.left {
.address-txt {
margin-left: 8rpx;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment