2 Commits

Author SHA1 Message Date
xiaozhiyong
da0f4e6589 更新 2024-04-09 14:35:06 +08:00
xiaozhiyong
3c1fc03e1f 更新 2024-04-08 10:43:56 +08:00
6 changed files with 84 additions and 42 deletions

View File

@@ -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) {

View File

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

View File

@@ -308,7 +308,7 @@
if (!user) { if (!user) {
uni.showModal({ uni.showModal({
title: '请您登录', title: '请您登录',
content: "登录佰川加油才可以加油 |˛˙꒳​˙)♡", content: "登录中品加油才可以加油 |˛˙꒳​˙)♡",
confirmText: '去登陆', confirmText: '去登陆',
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {

View File

@@ -88,8 +88,11 @@
url: '/pages/tabbar/home/home', url: '/pages/tabbar/home/home',
}) })
} else { } else {
uni.redirectTo({ // uni.redirectTo({
url: '/BagAuth/pages/login/login' // url: '/BagAuth/pages/login/login'
// })
uni.switchTab({
url: '/pages/tabbar/home/home',
}) })
} }
} }

View File

@@ -318,12 +318,21 @@
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()
}
}
})
} }
} }
}) })
@@ -370,10 +379,26 @@
showQr() { showQr() {
const user = uni.getStorageSync('user');
if (!user) {
uni.showToast({
title: '请先登录!',
icon: 'none'
})
return
}
this.showThreeSites = true this.showThreeSites = true
}, },
toCards() { toCards() {
const user = uni.getStorageSync('user');
if (!user) {
uni.showToast({
title: '请先登录!',
icon: 'none'
})
return
}
uni.navigateTo({ uni.navigateTo({
url: '/BagMoney/pages/oilCards/oilCards' url: '/BagMoney/pages/oilCards/oilCards'
}) })
@@ -488,6 +513,14 @@
}, },
openScan() { openScan() {
const user = uni.getStorageSync('user');
if (!user) {
uni.showToast({
title: '请先登录!',
icon: 'none'
})
return
}
uni.scanCode({ uni.scanCode({
scanType: 'qrCode', scanType: 'qrCode',
onlyFromCamera: false, onlyFromCamera: false,

View File

@@ -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('拒绝了定位权限')