xiaozhiyong 8 months ago
parent 0907abab72
commit 3c1fc03e1f
  1. 47
      BagAuth/pages/login/login.vue
  2. 2
      BagAuth/pages/login/oldLogin.vue
  3. 12
      pages/tabbar/home/home.vue
  4. 9
      utils/tool.js

@ -23,24 +23,23 @@
<view class="gray-text">加载中...</view> <view class="gray-text">加载中...</view>
</view> </view>
<view class="margin-lg flex flex-direction text-center"> <view class="margin-lg flex flex-direction text-center">
<button v-if="checked" @click="decryptPhoneNumber" class="cu-btn round bg-main-oil lg text-lg" <button v-if="checked" class="cu-btn round bg-main-oil lg text-lg" open-type="getPhoneNumber"
open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber"> @getphonenumber="decryptPhoneNumber">
<text class="cuIcon-weixin padding-right-xs"> </text>
<text> <text>
微信用户一键登录 一键登录
</text> </text>
</button> </button>
<button v-else class="cu-btn round bg-main-oil lg text-lg" @click="$refs.popup.open('center')"> <button v-else class="cu-btn round bg-main-oil lg text-lg" @click="$refs.popup.open('center')">
<text class="cuIcon-weixin padding-right-xs"> </text> <!-- <text class="cuIcon-weixin padding-right-xs"> </text> -->
<text> <text>
微信用户一键登录 一键登录
</text> </text>
</button> </button>
<button class="cu-btn margin-top round lg" @tap="refuseEmpower"> <button class="cu-btn margin-top round lg" @tap="refuseEmpower">
输入手机号码登录 输入手机号码登录
</button> </button>
<button class="cu-btn bg-0 margin-top round text-sm" @tap="refuseLogin"> <button class="cu-btn bg-0 margin-top round text-sm" @tap="refuseLogin">
跳过 跳过登录
</button> </button>
</view> </view>
<loginBottom ref='loginBottom' :checked='checked' @onCheck="checkAgree" /> <loginBottom ref='loginBottom' :checked='checked' @onCheck="checkAgree" />
@ -174,13 +173,8 @@
}) })
}, },
decryptPhoneNumber(e) { decryptPhoneNumber(e) {
if (!this.checked) { uni.getSetting({
uni.showToast({ success: () => {
title: '请您阅读并同意协议',
icon: 'none'
})
return
}
if (e.detail.errMsg === 'getPhoneNumber:ok') { if (e.detail.errMsg === 'getPhoneNumber:ok') {
const data1 = { const data1 = {
...e.detail, ...e.detail,
@ -188,14 +182,27 @@
unionId: uni.getStorageSync('unionid'), unionId: uni.getStorageSync('unionid'),
openId: uni.getStorageSync('openid'), openId: uni.getStorageSync('openid'),
} }
let url1 = 0 == this.TabCur ? 'bindLoginByPhonePersonal' : 'bindLoginByPhoneCompany' let url1 = 0 == this.TabCur ? 'bindLoginByPhonePersonal' :
'bindLoginByPhoneCompany'
this.bindLoginByPhone(data1, url1) this.bindLoginByPhone(data1, url1)
} else {
uni.showModal({
title: '用户拒绝手机号的授权',
content: `请输入手机号码登录,如有疑问,请联系客服处理`
})
} }
}
})
// if (!this.checked) {
// uni.showToast({
// title: '',
// icon: 'none'
// })
// return
// }
// else {
// uni.showModal({
// title: '',
// content: ``
// })
// }
}, },
bindLoginByPhone(data, url) { bindLoginByPhone(data, url) {
if (this.count < 1) { if (this.count < 1) {

@ -465,7 +465,7 @@
} else { } else {
this.userHandle = true this.userHandle = true
uni.showModal({ uni.showModal({
title: '用户拒绝了手机号的授权,并给你一个大耳巴子', title: '用户拒绝了手机号的授权',
content: `如有疑问,请联系客服处理` content: `如有疑问,请联系客服处理`
}) })
} }

@ -318,12 +318,18 @@
success: (res) => { success: (res) => {
if (!res.authSetting['scope.userLocation']) { if (!res.authSetting['scope.userLocation']) {
uni.showModal({ uni.showModal({
title: '请您打开定位权限', title: '提示',
content: '用于获取您当前位置附近的油站', content: '您暂无授权定位权限,将无法显示附近油站',
confirmText: '去设置', confirmText: '去设置',
success: (resSec) => { success: (resSec) => {
if (resSec.confirm) { if (resSec.confirm) {
uni.openSetting({}) uni.openSetting({
success:(resThird) => {
if (resThird.authSetting['scope.userLocation']) {
this.refreshLocation()
}
}
})
} }
} }
}) })

@ -222,22 +222,21 @@ export default {
success(res) { success(res) {
console.log(res.authSetting,'res.authSetting') console.log(res.authSetting,'res.authSetting')
if (!res.authSetting[ 'scope.userLocation']) { if (!res.authSetting[ 'scope.userLocation']) {
console.log('用户没有授权用户没有授权用户没有授权用户没有授权') // console.log('用户没有授权用户没有授权用户没有授权用户没有授权')
// 用户没有授权 // 用户没有授权
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '您暂无授权定位权限,将无法显示油站距离', content: '您暂无授权定位权限,将无法显示附近油站',
confirmText: '去设置',
success(res) { success(res) {
if (res.confirm) { if (res.confirm) {
wx.openSetting({ wx.openSetting({
success(res) { success(res) {
if (res.authSetting['scope.userLocation']) { if (res.authSetting['scope.userLocation']) {
re() re()
// 授权成功,重新定位
} else { } else {
// 没有允许定位权限
wx.showToast({ wx.showToast({
title: '您拒绝了定位权限,将无法使用附近电站站功能', title: '您拒绝了定位权限',
icon: 'none' icon: 'none'
}); });
rj('拒绝了定位权限') rj('拒绝了定位权限')

Loading…
Cancel
Save