xiaozhiyong 8 months ago
parent 0907abab72
commit 3c1fc03e1f
  1. 65
      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>
<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"
open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">
<text class="cuIcon-weixin padding-right-xs"> </text>
<button v-if="checked" class="cu-btn round bg-main-oil lg text-lg" open-type="getPhoneNumber"
@getphonenumber="decryptPhoneNumber">
<text>
微信用户一键登录
一键登录
</text>
</button>
<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>
</button>
<button class="cu-btn margin-top round lg" @tap="refuseEmpower">
输入手机号码登录
</button>
<button class="cu-btn bg-0 margin-top round text-sm" @tap="refuseLogin">
跳过
跳过登录
</button>
</view>
<loginBottom ref='loginBottom' :checked='checked' @onCheck="checkAgree" />
@ -174,28 +173,36 @@
})
},
decryptPhoneNumber(e) {
if (!this.checked) {
uni.showToast({
title: '请您阅读并同意协议',
icon: 'none'
})
return
}
if (e.detail.errMsg === 'getPhoneNumber:ok') {
const data1 = {
...e.detail,
sessionKey: this.sessionKey,
unionId: uni.getStorageSync('unionid'),
openId: uni.getStorageSync('openid'),
uni.getSetting({
success: () => {
if (e.detail.errMsg === 'getPhoneNumber:ok') {
const data1 = {
...e.detail,
sessionKey: this.sessionKey,
unionId: uni.getStorageSync('unionid'),
openId: uni.getStorageSync('openid'),
}
let url1 = 0 == this.TabCur ? 'bindLoginByPhonePersonal' :
'bindLoginByPhoneCompany'
this.bindLoginByPhone(data1, url1)
}
}
let url1 = 0 == this.TabCur ? 'bindLoginByPhonePersonal' : 'bindLoginByPhoneCompany'
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) {
if (this.count < 1) {
@ -313,4 +320,4 @@
background-color: transparent;
color: #555555;
}
</style>
</style>

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

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

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

Loading…
Cancel
Save