Commit 4473daa3 authored by 肖健's avatar 肖健

授权登录页面调整

parent 15fb2b08
...@@ -20,7 +20,13 @@ ...@@ -20,7 +20,13 @@
</view> --> </view> -->
<view v-if="isCanUse2"> <view v-if="isCanUse2">
<view> <view>
<button class="login__btn" :disabled="!checked" hover-class="none" type='primary' open-type="getPhoneNumber" @getphonenumber="getPhoneNumber"> <button class="login__btn" v-if="!checked" @click="" hover-class="none" type='primary'
@click="checkLogin">
微信一键登录
</button>
<button class="login__btn" v-if="checked" @click="" hover-class="none" type='primary'
open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
微信一键登录 微信一键登录
</button> </button>
</view> </view>
...@@ -42,48 +48,50 @@ ...@@ -42,48 +48,50 @@
export default { export default {
data() { data() {
return { return {
checked: true, checked: false,
code: "", code: "",
isCanUse: false, //默认为true isCanUse: false, //默认为true
isCanUse2: false, //默认为true isCanUse2: false, //默认为true
openid: '', openid: '',
nc_protocol : false, nc_protocol : false,
//扫描二维码参数 //扫描二维码参数
scene : "", scene : "",
//检查绑定挪车码 //检查绑定挪车码
checkCode: {}, checkCode: {},
}; };
}, },
methods: { methods: {
changeBtn() { changeBtn() {
this.checked = !this.checked; this.checked = !this.checked;
}, },
//登录 //登录
login() { checkLogin() {
let _this = this; uni.showToast({
uni.showLoading({ title: "请先阅读并同意《京东用户注册协议》、《京东隐私政策》",
title: '登录中...' icon: 'none',
duration: 2000,
});
},
//检查挪车码存在、是否绑定
getCheckMoveCode(){
let opts = { url: '/app/index/check/move/code', method: 'post' };
this.http.httpTokenRequest(opts, {code:this.scene}).then(res => {
if (res.data.code == 200) {
this.checkCode = res.data.data
//未绑定了的情况
if(!this.checkCode.bindFlag){
uni.navigateTo({
url: '/pagesB/pages/move-car/scan?moveCode=' + this.checkCode.code
})
}else if(this.checkCode.selfFlag){
}else{
}
}
}) })
}, },
//检查挪车码存在、是否绑定
getCheckMoveCode(){
let opts = { url: '/app/index/check/move/code', method: 'post' };
this.http.httpTokenRequest(opts, {code:this.scene}).then(res => {
if (res.data.code == 200) {
this.checkCode = res.data.data
//未绑定了的情况
if(!this.checkCode.bindFlag){
uni.navigateTo({
url: '/pagesB/pages/move-car/scan?moveCode=' + this.checkCode.code
})
}else if(this.checkCode.selfFlag){
}else{
}
}
})
},
async wechatLogin() { async wechatLogin() {
wx.login({ wx.login({
success: (res) => { success: (res) => {
...@@ -206,8 +214,6 @@ export default { ...@@ -206,8 +214,6 @@ export default {
this.scene = scene; this.scene = scene;
} }
this.wechatLogin() this.wechatLogin()
let userToken = uni.getStorageSync('userToken') let userToken = uni.getStorageSync('userToken')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment