From 466ddb451b981d4e3371f80419d03f243535e9d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=87?= Date: Thu, 13 Mar 2025 18:47:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E4=BD=8D=E5=A4=B1=E8=B4=A5=E5=BC=95?= =?UTF-8?q?=E5=AF=BC=EF=BC=8C=E7=99=BB=E5=BD=95=E5=8D=8F=E8=AE=AE=E9=93=BE?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 3 ++- pages/login/login.js | 20 +++++++++++++++- pages/login/login.wxml | 4 ++-- pages/my/promation/wx-group/index.js | 33 ++++++++++++++++++++++---- pages/my/promation/wx-group/index.wxml | 11 +++++---- pages/my/setting/index/index.js | 4 ---- project.private.config.json | 3 ++- 7 files changed, 60 insertions(+), 18 deletions(-) diff --git a/app.json b/app.json index c85952c..c2546f8 100644 --- a/app.json +++ b/app.json @@ -30,7 +30,8 @@ "window": { "navigationBarTextStyle": "black", "navigationBarTitleText": "", - "navigationBarBackgroundColor": "#ffffff" + "navigationBarBackgroundColor": "#ffffff", + "backgroundColor": "#F5F5F5" }, "tabBar": { "color": "#222222", diff --git a/pages/login/login.js b/pages/login/login.js index 3164f60..ead4371 100644 --- a/pages/login/login.js +++ b/pages/login/login.js @@ -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({ diff --git a/pages/login/login.wxml b/pages/login/login.wxml index ce34d5b..1d4d057 100644 --- a/pages/login/login.wxml +++ b/pages/login/login.wxml @@ -15,8 +15,8 @@ diff --git a/pages/my/promation/wx-group/index.js b/pages/my/promation/wx-group/index.js index 84377dc..5815c85 100644 --- a/pages/my/promation/wx-group/index.js +++ b/pages/my/promation/wx-group/index.js @@ -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 + }) + } + } + }) }, /** diff --git a/pages/my/promation/wx-group/index.wxml b/pages/my/promation/wx-group/index.wxml index 2342655..c736599 100644 --- a/pages/my/promation/wx-group/index.wxml +++ b/pages/my/promation/wx-group/index.wxml @@ -18,18 +18,21 @@ - - + + 定位失败 + + 打开定位权限 + 超出服务距离 无法显示二维码 - - 点击图中二维码识别 + 长按图中二维码识别 \ No newline at end of file diff --git a/pages/my/setting/index/index.js b/pages/my/setting/index/index.js index 6deae99..3240e8e 100644 --- a/pages/my/setting/index/index.js +++ b/pages/my/setting/index/index.js @@ -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}`, }) diff --git a/project.private.config.json b/project.private.config.json index cccaf2b..bcc545f 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -31,5 +31,6 @@ } ] } - } + }, + "libVersion": "3.7.10" } \ No newline at end of file