定位失败引导,登录协议链接

This commit is contained in:
2025-03-13 18:47:02 +08:00
parent b7a6c87612
commit 466ddb451b
7 changed files with 60 additions and 18 deletions

View File

@ -30,7 +30,8 @@
"window": { "window": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "", "navigationBarTitleText": "",
"navigationBarBackgroundColor": "#ffffff" "navigationBarBackgroundColor": "#ffffff",
"backgroundColor": "#F5F5F5"
}, },
"tabBar": { "tabBar": {
"color": "#222222", "color": "#222222",

View File

@ -6,12 +6,20 @@ Page({
isAgree: false, isAgree: false,
loging:false, loging:false,
animation:null, animation:null,
userCode:'' userCode:'',
appConfig:{}
}, },
onLoad(options){ onLoad(options){
this.setData({ this.setData({
userCode:options.shared_user_code||'' userCode:options.shared_user_code||''
}); });
app.getAppConfig().then((data)=>{
console.log(data);
this.setData({
appConfig:data
})
})
}, },
radioChange(event){ radioChange(event){
this.setData({ 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(){ shake(){
if(!this.animation){ if(!this.animation){
this.animation = wx.createAnimation({ this.animation = wx.createAnimation({

View File

@ -15,8 +15,8 @@
<label class="policy" animation="{{animation}}"> <label class="policy" animation="{{animation}}">
<radio class="radio" value="agree"></radio> <radio class="radio" value="agree"></radio>
<label>我已阅读并同意</label> <label>我已阅读并同意</label>
<navigator class="yellow">《用户协议》</navigator>与 <label class="yellow" capture-catch:tap="navToAgreement">《用户协议》</label>与
<label class="yellow">《隐私政策》</label> <label class="yellow" capture-catch:tap="navToPrivacy">《隐私政策》</label>
</label> </label>
</radio-group> </radio-group>
</view> </view>

View File

@ -9,9 +9,11 @@ Page({
data: { data: {
detail:{}, detail:{},
communityId:'', communityId:'',
positioning:false, positioning:true,
positioningError:false, positioningError:false,
qrcodeLoading:false qrcodeLoading:false,
isOpenLocation:false
}, },
/** /**
@ -19,11 +21,12 @@ Page({
*/ */
onLoad(options) { onLoad(options) {
this.data.communityId = options.communityId; this.data.communityId = options.communityId;
this.getWxGroupQrcode(); },
openSetting(){
wx.openSetting()
}, },
getWxGroupQrcode(){ getWxGroupQrcode(){
this.setData({ this.setData({
positioning:true,
qrcodeLoading:true qrcodeLoading:true
}) })
app.getLocation().then((data)=>{ app.getLocation().then((data)=>{
@ -47,6 +50,12 @@ Page({
detail:res, detail:res,
qrcodeLoading:false qrcodeLoading:false
}) })
}).catch(()=>{
this.setData({
positioning:false,
qrcodeLoading:false,
positioningError:true
})
}) })
}, },
/** /**
@ -60,7 +69,21 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
wx.getSetting({
success:(res)=>{
const isOpenLocation = res.authSetting['scope.userLocation'];
this.setData({
isOpenLocation
})
if(isOpenLocation){
this.getWxGroupQrcode();
}else{
this.setData({
positioning:false
})
}
}
})
}, },
/** /**

View File

@ -18,11 +18,14 @@
</view> </view>
<view class="bottom"> <view class="bottom">
<view class="qrcode-area"> <view class="qrcode-area">
<view class="weui-loading" wx:if="{{qrcodeLoading}}"></view> <view class="weui-loading" wx:if="{{qrcodeLoading||positioning}}"></view>
<view class="error" wx:elif="{{positioningError||!detail.show_qrcode}}"> <view class="error" wx:elif="{{positioningError||!detail.show_qrcode||!isOpenLocation}}">
<view bind:tap="getWxGroupQrcode" class="retry" wx:if="{{positioningError}}"> <view bind:tap="getWxGroupQrcode" class="retry" wx:if="{{positioningError}}">
定位失败 定位失败
</view> </view>
<view bind:tap="openSetting" class="retry" wx:elif="{{!isOpenLocation}}">
打开定位权限
</view>
<view wx:else>超出服务距离</view> <view wx:else>超出服务距离</view>
<view>无法显示二维码</view> <view>无法显示二维码</view>
</view> </view>
@ -30,6 +33,6 @@
src="{{detail.community.optimized_qy_group_qrcode}}"/> src="{{detail.community.optimized_qy_group_qrcode}}"/>
</view> </view>
<view class="tips" wx:if="{{detail&&detail.show_qrcode}}">点击图中二维码识别</view> <view class="tips" wx:if="{{detail&&detail.show_qrcode}}">长按图中二维码识别</view>
</view> </view>
</view> </view>

View File

@ -96,10 +96,6 @@ Page({
}, },
navToPrivacy(){ navToPrivacy(){
// wx.navigateTo({
// url: `/pages/browser/index?url=${encodeURIComponent('https://beefast.co/#/how-to-use')}`,
// })
// return;
wx.navigateTo({ wx.navigateTo({
url: `/pages/browser/index?url=${this.data.appConfig.url_user_privacy}`, url: `/pages/browser/index?url=${this.data.appConfig.url_user_privacy}`,
}) })

View File

@ -31,5 +31,6 @@
} }
] ]
} }
} },
"libVersion": "3.7.10"
} }