Compare commits

...

2 Commits

Author SHA1 Message Date
xiaozhiyong da0f4e6589 更新 7 months ago
xiaozhiyong 3c1fc03e1f 更新 7 months ago
  1. 65
      BagAuth/pages/login/login.vue
  2. 2
      BagAuth/pages/login/oldLogin.vue
  3. 2
      BagStation/pages/stationDetail/stationDetail.vue
  4. 7
      pages/index/startPage/startPage.vue
  5. 41
      pages/tabbar/home/home.vue
  6. 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: `如有疑问,请联系客服处理`
})
}

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

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

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

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