pull/11/head
xiaozhiyong 2 years ago
parent e7f38adf34
commit 12d19c841d
  1. 111
      BagAuth/pages/login/login.vue

@ -1,127 +1,43 @@
<template> <template>
<view class="login-page bg-white"> <view class="login-page bg-white">
<view class="image login-bg"> <view class="image login-bg">
<!-- <image :src="imgURL+'login-bg.png'" mode="widthFix"></image> --> <!-- <image :src="imgURL+'login-bg.png'" mode="widthFix"></image> -->
<!-- <image src="../../../BagStation/static/img/LV.png" mode="widthFix"></image> --> <!-- <image src="../../../BagStation/static/img/LV.png" mode="widthFix"></image> -->
<image src="../../../static/img/login-bg.png" mode="widthFix"></image> <image src="../../../static/img/login-bg.png" mode="widthFix"></image>
</view> </view>
<scroll-view scroll-x class=" bg-white nav padding"> <scroll-view scroll-x class=" bg-white nav padding">
<view class="flex text-center padding-bottom"> <view class="flex text-center padding-bottom">
<view class="cu-item flex-sub"> <view class="cu-item flex-sub">
</view> </view>
<view class="cu-item flex-sub" :class="0==TabCur?'text-red cur':''" @tap="tabSelect(0)"> <view class="cu-item flex-sub" :class="0==TabCur?'text-red cur':''" @tap="tabSelect(0)">
个人账号 个人账号
</view> </view>
<view class="cu-item flex-sub"> <view class="cu-item flex-sub">
</view> </view>
<!--<view class="cu-item flex-sub" :class="1==TabCur?'text-red cur':''" @tap="tabSelect(1)">
<!-- <view class="cu-item flex-sub" :class="1==TabCur?'text-red cur':''" @tap="tabSelect(1)">
企业账号 企业账号
</view>-->
</view>
-->
</view> </view>
</scroll-view> </scroll-view>
<view class="cu-load load-modal" v-if="loadModal"> <view class="cu-load load-modal" v-if="loadModal">
<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 class="cu-btn round bg-main-oil lg text-lg" open-type="getPhoneNumber" <button class="cu-btn round bg-main-oil lg text-lg" open-type="getPhoneNumber"
@getphonenumber="decryptPhoneNumber"> @getphonenumber="decryptPhoneNumber">
<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 @onCheck="checkAgree" />
<!-- <loginBottom :check="loginOut" /> -->
</view> </view>
</template> </template>
@ -131,7 +47,6 @@
import loginBottom from './components/loginBottom.vue' import loginBottom from './components/loginBottom.vue'
import oilIdentityApi from '@/api/oil-identity' import oilIdentityApi from '@/api/oil-identity'
export default { export default {
components: { components: {
loginBottom loginBottom
@ -139,6 +54,7 @@
data() { data() {
return { return {
// imgsrc:require('../../../BagStation/static/img/login-bg.png'), // imgsrc:require('../../../BagStation/static/img/login-bg.png'),
checked:false,
userHandle: false, userHandle: false,
TabCur: 0, TabCur: 0,
accuntSource: false, accuntSource: false,
@ -161,12 +77,12 @@
uni.login({ uni.login({
provider: 'weixin', provider: 'weixin',
success: (loginRes) => { success: (loginRes) => {
console.log(loginRes,'+++++++') console.log(loginRes, '+++++++')
const code = loginRes.code const code = loginRes.code
this.onceCode = code this.onceCode = code
console.log(this.onceCode,'----------') console.log(this.onceCode, '----------')
oilIdentityApi.sendCode(this.onceCode).then(res => { oilIdentityApi.sendCode(this.onceCode).then(res => {
console.log(res,'++++++++++++++++') console.log(res, '++++++++++++++++')
if (res.code === 20000) { if (res.code === 20000) {
this.sessionKey = res.data.sessionKey this.sessionKey = res.data.sessionKey
uni.setStorageSync('openid', res.data.openId) uni.setStorageSync('openid', res.data.openId)
@ -198,6 +114,9 @@
}) })
}, },
methods: { methods: {
checkAgree(val) {
this.checked = val
},
refuseLogin() { refuseLogin() {
uni.switchTab({ uni.switchTab({
url: '/pages/tabbar/home/home' url: '/pages/tabbar/home/home'
@ -231,6 +150,13 @@
decryptPhoneNumber(e) { decryptPhoneNumber(e) {
if (!this.checked) {
uni.showToast({
title: '请您阅读并同意协议',
icon: 'none'
})
return
}
// console.log(e.detail) // console.log(e.detail)
if (e.detail.errMsg === 'getPhoneNumber:ok') { if (e.detail.errMsg === 'getPhoneNumber:ok') {
const data1 = { const data1 = {
@ -306,7 +232,8 @@
height: 750rpx; height: 750rpx;
background-color: #fff; background-color: #fff;
} }
.bg-0{
.bg-0 {
background-color: transparent; background-color: transparent;
color: #555555; color: #555555;
} }

Loading…
Cancel
Save