Commit e481bae592e8838e3be56dc80c377bdfb005575e

Authored by vking
1 parent f69ba6e2

new 2.0

... ... @@ -4,7 +4,10 @@ Component({
* 组件的属性列表
*/
properties: {
hasFailPop:{//授权失败是否弹框
type:Boolean,
value:false,
},
},
/**
... ... @@ -18,6 +21,7 @@ Component({
*/
methods: {
getPosDo(timeout=3000){
//timeout=0
return new Promise(function(success,fail){
let timer1=setTimeout(()=>{
fail('timeout')
... ... @@ -25,14 +29,14 @@ Component({
wx.getLocation({
type: 'gcj02',
success: (res) => {
getApp().location=res
getApp().location = res
success(res)
},
fail: (res) => {
fail(res)
},
complete:()=>{
if(timer1) clearTimeout(timer1)
complete: () => {
if (timer1) clearTimeout(timer1)
}
});
})
... ... @@ -46,7 +50,7 @@ Component({
timeout=86400;
}
if(res.authSetting['scope.userLocation']===false){
if(fouce){
if(fouce || this.data.hasFailPop){
this.selectComponent('#confirm').options({
header: '定位失败',
body: '请开启定位,为您查询附近餐厅。'
... ... @@ -73,6 +77,16 @@ Component({
});
}).catch(res=>{
console.log('getPos.catch',res)
if(this.data.hasFailPop){
if ('getLocation:fail auth deny' == res.errMsg
|| 'getLocation:fail:auth denied' == res.errMsg
|| 'getLocation:fail authorize no response' == res.errMsg) {
this.selectComponent('#confirm').options({
header: '定位失败',
body: '请开启定位,为您查询附近餐厅。'
}).show();
}
}
this.triggerEvent("pos",{
latitude: '',
longitude: '',
... ...
... ... @@ -14,10 +14,12 @@
subkey="SDEBZ-I74W4-QLGUX-XXYXU-HIR23-3QFBJ"
layer-style="2"
style="width: 100%; height: 30vh;position: relative;">
</map>
<view class="moveToLocationView">
<view bindtap="moveToLocation" class="view moveToLocation flex align-center justify-center">
<image class="moveToLocation-image" src="http://nosqn.colorcun.com/2.0/home%20%2811%29.png"></image>
</view>
</map>
</view>
<view class="view content padding-top-xs" style="height: 70vh;">
<filter-group height="{{height}}"
id="filter-group"
... ... @@ -76,7 +78,7 @@
</block>
</view>
<getpos bindpos="onpos" id="getpos" hasAllowLoading="{{false}}"></getpos>
<getpos bindpos="onpos" id="getpos" hasFailPop></getpos>
<navigator url="/pages/me/index" hover-class="navigator-hover">
<view style="top:{{meTop}}px;"
class="me view flex flex-direction align-center justify-center bg-white round">
... ...
... ... @@ -4,12 +4,17 @@ page{
background-color: #efefef;
/*--barHeight: calc(98rpx + env(safe-area-inset-bottom));*/
}
.moveToLocationView{
width: 100%;
height: 0;
position: relative;
}
.moveToLocation{
position: absolute;
width: 80rpx;
height: 80rpx;
right:0rpx;
bottom:0;
top:-80rpx;
}
.moveToLocation-image{
width: 40rpx;
... ...