1
This commit is contained in:
@@ -17,16 +17,27 @@
|
||||
<script>
|
||||
export default {
|
||||
name: 'loginBottom',
|
||||
props:{
|
||||
checked:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
count: 0,
|
||||
hotline: '4008-56-5355'
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
checked(n){
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onChange() {
|
||||
this.count++
|
||||
this.$emit('onCheck', this.count % 2 != 0)
|
||||
onChange() {
|
||||
let checked = !this.checked
|
||||
this.$emit('onCheck', checked)
|
||||
},
|
||||
toAgree(link) {
|
||||
uni.navigateTo({
|
||||
|
||||
@@ -72,55 +72,45 @@
|
||||
|
||||
|
||||
<view class="margin-lg flex flex-direction text-center">
|
||||
|
||||
|
||||
|
||||
<button class="cu-btn round bg-main-oil lg text-lg" open-type="getPhoneNumber"
|
||||
<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>
|
||||
|
||||
|
||||
|
||||
<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>
|
||||
微信用户一键登录
|
||||
</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" />
|
||||
|
||||
|
||||
|
||||
<!-- <loginBottom :check="loginOut" /> -->
|
||||
|
||||
|
||||
<uni-popup ref='popup'>
|
||||
<view class="protocol_body">
|
||||
<view class="protocol_header">
|
||||
使用协议及隐私保护
|
||||
</view>
|
||||
<view class="protocol_content">
|
||||
为了更好地保障您的合法权益,请您阅读并同意 <text style=" color: black; font-weight: 600;"
|
||||
@click="$refs.loginBottom.toAgree('zhongpinUserAgree')">《用户协议》</text> 与 <text
|
||||
style=" color: black; font-weight: 600;"
|
||||
@click="$refs.loginBottom.toAgree('zhongpinPrivacyAgreement')">《隐私政策》</text>。
|
||||
</view>
|
||||
<view class="protocol_footer">
|
||||
<button @click="$refs.popup.close()" class="protocol_footer_close">取消</button>
|
||||
<button @click="checked=true;$refs.popup.close();" class="protocol_footer_confirm">确定</button>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
@@ -138,6 +128,7 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
checked: false,
|
||||
// imgsrc:require('../../../BagStation/static/img/login-bg.png'),
|
||||
userHandle: false,
|
||||
TabCur: 0,
|
||||
@@ -153,12 +144,12 @@
|
||||
sessionKey: '',
|
||||
nickName: '',
|
||||
loginOut: uni.getStorageSync('loginOut') ? true : false,
|
||||
scanningParams:null
|
||||
scanningParams: null
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
uni.clearStorageSync()
|
||||
this.refreshLocation()
|
||||
// this.refreshLocation()
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (loginRes) => {
|
||||
@@ -166,7 +157,7 @@
|
||||
this.onceCode = code
|
||||
oilIdentityApi.sendCode(this.onceCode).then(res => {
|
||||
if (res.code === 20000) {
|
||||
if(options.scanningParams) {
|
||||
if (options.scanningParams) {
|
||||
// 用于扫码进入油站详情页面
|
||||
this.scanningParams = options.scanningParams
|
||||
}
|
||||
@@ -199,6 +190,9 @@
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
checkAgree(val) {
|
||||
this.checked = val
|
||||
},
|
||||
refuseLogin() {
|
||||
uni.switchTab({
|
||||
url: '/pages/tabbar/home/home'
|
||||
@@ -232,6 +226,13 @@
|
||||
|
||||
|
||||
decryptPhoneNumber(e) {
|
||||
if (!this.checked) {
|
||||
uni.showToast({
|
||||
title: '请您阅读并同意协议',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (e.detail.errMsg === 'getPhoneNumber:ok') {
|
||||
const data1 = {
|
||||
...e.detail,
|
||||
@@ -276,15 +277,14 @@
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
complete: (err) => {
|
||||
}
|
||||
complete: (err) => {}
|
||||
})
|
||||
}, 1000);
|
||||
if(this.scanningParams) {
|
||||
if (this.scanningParams) {
|
||||
uni.redirectTo({
|
||||
url: `/BagStation/pages/stationDetail/stationDetail?q=${this.scanningParams}`
|
||||
})
|
||||
return
|
||||
return
|
||||
}
|
||||
// 这里有问题
|
||||
uni.switchTab({
|
||||
@@ -297,6 +297,56 @@
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.protocol_footer_close {
|
||||
width: 185rpx;
|
||||
border-radius: 94rpx 94rpx 94rpx 94rpx;
|
||||
opacity: 1;
|
||||
border: 1px solid #000000;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.protocol_footer_confirm {
|
||||
width: 185rpx;
|
||||
background: #1890FF;
|
||||
border-radius: 56rpx 56rpx 56rpx 56rpx;
|
||||
opacity: 1;
|
||||
font-size: 26rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.protocol_footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.protocol_content {
|
||||
font-size: 32rpx;
|
||||
font-family: PingFang SC-Medium, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
line-height: 46rpx;
|
||||
margin: 60rpx 0;
|
||||
}
|
||||
|
||||
.protocol_header {
|
||||
width: 330rpx;
|
||||
height: 32rpx;
|
||||
font-size: 36rpx;
|
||||
color: #000000;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.protocol_body {
|
||||
background: #FFFFFF;
|
||||
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
||||
opacity: 1;
|
||||
padding: 70rpx 50rpx;
|
||||
max-width: 634rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.login-bg {
|
||||
width: 100%;
|
||||
}
|
||||
@@ -310,8 +360,9 @@
|
||||
height: 750rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
.bg-0{
|
||||
|
||||
.bg-0 {
|
||||
background-color: transparent;
|
||||
color: #555555;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -409,16 +409,18 @@
|
||||
icon: 'none'
|
||||
})
|
||||
}, 1000);
|
||||
if(this.scanningParams) {
|
||||
console.log(this.scanningParams,'this.scanningParams')
|
||||
if(this.scanningParams&&this.scanningParams!=='null') {
|
||||
uni.redirectTo({
|
||||
url: `/BagStation/pages/stationDetail/stationDetail?q=${this.scanningParams}`
|
||||
})
|
||||
return
|
||||
}else{
|
||||
// 这里有问题
|
||||
uni.switchTab({
|
||||
url: '/pages/tabbar/home/home'
|
||||
})
|
||||
}
|
||||
// 这里有问题
|
||||
uni.switchTab({
|
||||
url: '/pages/tabbar/home/home'
|
||||
})
|
||||
|
||||
}
|
||||
},
|
||||
checkCompany() {
|
||||
|
||||
Reference in New Issue
Block a user