定位失败引导,登录协议链接
This commit is contained in:
parent
b7a6c87612
commit
466ddb451b
3
app.json
3
app.json
@ -30,7 +30,8 @@
|
||||
"window": {
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "",
|
||||
"navigationBarBackgroundColor": "#ffffff"
|
||||
"navigationBarBackgroundColor": "#ffffff",
|
||||
"backgroundColor": "#F5F5F5"
|
||||
},
|
||||
"tabBar": {
|
||||
"color": "#222222",
|
||||
|
||||
@ -6,12 +6,20 @@ Page({
|
||||
isAgree: false,
|
||||
loging:false,
|
||||
animation:null,
|
||||
userCode:''
|
||||
userCode:'',
|
||||
appConfig:{}
|
||||
},
|
||||
onLoad(options){
|
||||
this.setData({
|
||||
userCode:options.shared_user_code||''
|
||||
});
|
||||
|
||||
app.getAppConfig().then((data)=>{
|
||||
console.log(data);
|
||||
this.setData({
|
||||
appConfig:data
|
||||
})
|
||||
})
|
||||
},
|
||||
radioChange(event){
|
||||
this.setData({
|
||||
@ -62,6 +70,16 @@ Page({
|
||||
})
|
||||
})
|
||||
},
|
||||
navToPrivacy(){
|
||||
wx.navigateTo({
|
||||
url: `/pages/browser/index?url=${this.data.appConfig.url_user_privacy}`,
|
||||
})
|
||||
},
|
||||
navToAgreement(){
|
||||
wx.navigateTo({
|
||||
url: `/pages/browser/index?url=${this.data.appConfig.url_user_agreement}`,
|
||||
})
|
||||
},
|
||||
shake(){
|
||||
if(!this.animation){
|
||||
this.animation = wx.createAnimation({
|
||||
|
||||
@ -15,8 +15,8 @@
|
||||
<label class="policy" animation="{{animation}}">
|
||||
<radio class="radio" value="agree"></radio>
|
||||
<label>我已阅读并同意</label>
|
||||
<navigator class="yellow">《用户协议》</navigator>与
|
||||
<label class="yellow">《隐私政策》</label>
|
||||
<label class="yellow" capture-catch:tap="navToAgreement">《用户协议》</label>与
|
||||
<label class="yellow" capture-catch:tap="navToPrivacy">《隐私政策》</label>
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
|
||||
@ -9,9 +9,11 @@ Page({
|
||||
data: {
|
||||
detail:{},
|
||||
communityId:'',
|
||||
positioning:false,
|
||||
positioning:true,
|
||||
positioningError:false,
|
||||
qrcodeLoading:false
|
||||
qrcodeLoading:false,
|
||||
|
||||
isOpenLocation:false
|
||||
},
|
||||
|
||||
/**
|
||||
@ -19,11 +21,12 @@ Page({
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.data.communityId = options.communityId;
|
||||
this.getWxGroupQrcode();
|
||||
},
|
||||
openSetting(){
|
||||
wx.openSetting()
|
||||
},
|
||||
getWxGroupQrcode(){
|
||||
this.setData({
|
||||
positioning:true,
|
||||
qrcodeLoading:true
|
||||
})
|
||||
app.getLocation().then((data)=>{
|
||||
@ -47,6 +50,12 @@ Page({
|
||||
detail:res,
|
||||
qrcodeLoading:false
|
||||
})
|
||||
}).catch(()=>{
|
||||
this.setData({
|
||||
positioning:false,
|
||||
qrcodeLoading:false,
|
||||
positioningError:true
|
||||
})
|
||||
})
|
||||
},
|
||||
/**
|
||||
@ -60,7 +69,21 @@ Page({
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
wx.getSetting({
|
||||
success:(res)=>{
|
||||
const isOpenLocation = res.authSetting['scope.userLocation'];
|
||||
this.setData({
|
||||
isOpenLocation
|
||||
})
|
||||
if(isOpenLocation){
|
||||
this.getWxGroupQrcode();
|
||||
}else{
|
||||
this.setData({
|
||||
positioning:false
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@ -18,18 +18,21 @@
|
||||
</view>
|
||||
<view class="bottom">
|
||||
<view class="qrcode-area">
|
||||
<view class="weui-loading" wx:if="{{qrcodeLoading}}"></view>
|
||||
<view class="error" wx:elif="{{positioningError||!detail.show_qrcode}}">
|
||||
<view class="weui-loading" wx:if="{{qrcodeLoading||positioning}}"></view>
|
||||
<view class="error" wx:elif="{{positioningError||!detail.show_qrcode||!isOpenLocation}}">
|
||||
<view bind:tap="getWxGroupQrcode" class="retry" wx:if="{{positioningError}}">
|
||||
定位失败
|
||||
</view>
|
||||
<view bind:tap="openSetting" class="retry" wx:elif="{{!isOpenLocation}}">
|
||||
打开定位权限
|
||||
</view>
|
||||
<view wx:else>超出服务距离</view>
|
||||
<view>无法显示二维码</view>
|
||||
</view>
|
||||
<image wx:else class="image" show-menu-by-longpress
|
||||
<image wx:else class="image" show-menu-by-longpress
|
||||
src="{{detail.community.optimized_qy_group_qrcode}}"/>
|
||||
|
||||
</view>
|
||||
<view class="tips" wx:if="{{detail&&detail.show_qrcode}}">点击图中二维码识别</view>
|
||||
<view class="tips" wx:if="{{detail&&detail.show_qrcode}}">长按图中二维码识别</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -96,10 +96,6 @@ Page({
|
||||
},
|
||||
|
||||
navToPrivacy(){
|
||||
// wx.navigateTo({
|
||||
// url: `/pages/browser/index?url=${encodeURIComponent('https://beefast.co/#/how-to-use')}`,
|
||||
// })
|
||||
// return;
|
||||
wx.navigateTo({
|
||||
url: `/pages/browser/index?url=${this.data.appConfig.url_user_privacy}`,
|
||||
})
|
||||
|
||||
@ -31,5 +31,6 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"libVersion": "3.7.10"
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user