This commit is contained in:
caolc
2023-05-08 10:53:14 +08:00
commit 7d7462ff25
203 changed files with 38885 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
<template>
<view>
<cu-custom class="main-totextbar bg-main-oil" :isBack="true" bgColor="bg-main-oil">
<block slot="backText">返回</block>
<block slot="content">小星加油操作指南</block>
</cu-custom>
<web-view src="https://mp.weixin.qq.com/s/h1O_dFO1d3J0j4AjMuefHQ"></web-view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
</style>

View File

@@ -0,0 +1,29 @@
<template>
<view>
<cu-custom class="main-totextbar bg-main-oil" :isBack="true" bgColor="bg-main-oil">
<block slot="backText">返回</block>
<!-- <block slot="content">星卡互联平台用户服务协议</block> -->
</cu-custom>
<web-view :src="'https://www.xingoil.com/oilcommon/'+link+'.html'"></web-view>
</view>
</template>
<script>
export default {
data() {
return {
link:''
}
},
onLoad(option) {
this.link = option.link
},
methods: {
}
}
</script>
<style>
</style>

View File

@@ -0,0 +1,197 @@
<template>
<view class="content">
<cu-custom class="main-totextbar bg-main-oil" :isBack="true" bgColor="bg-main-oil">
<block slot="backText">返回</block>
<block slot="content">认证</block>
</cu-custom>
<view class="padding">
<view class="padding-left padding-bottom-xs">
<text>身份证</text>
</view>
<view class="shadow radius">
<view class="bg-white padding-sm ">
<view class="grid uplaod-container grid-square justify-between ">
<view class="bg-img basis-sm " v-for="(item,index) in imgList" :key="index" @tap="ViewImage" :data-url="imgList[index]">
<image :src="imgList[index]" mode="aspectFill"></image>
<view class="cu-tag bg-blue" @tap.stop="DelImg" :data-index="index">
<text class='cuIcon-close'></text>
</view>
</view>
<view class="solids oil-main-btn-color basis-sm" @tap="ChooseImage" v-if="imgList.length<1">
<text class='cuIcon-cameraadd oil-main-color'></text>
<view class="text-center upload-desc font-12">
身份证人像面
</view>
</view>
<view class="bg-img basis-sm" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" :data-url="imgList[index]">
<image :src="imgList[index]" mode="aspectFill"></image>
<view class="cu-tag bg-blue" @tap.stop="DelImg" :data-index="index">
<text class='cuIcon-close'></text>
</view>
</view>
<view class="solids oil-main-btn-color basis-sm" @tap="ChooseImage" v-if="imgList.length<1">
<text class='cuIcon-cameraadd oil-main-color'></text>
<view class="text-center upload-desc font-12">
<text>身份证国徽面</text>
</view>
</view>
</view>
</view>
<view class="cu-form-group">
<view class="title">车牌号</view>
<text v-if="!plateText" @tap="showPlateModal(true,false)" class="cuIcon-right oil-main-btn-color oil-main-color"></text>
<text v-else @tap="showPlateModal(true,false)" class=" oil-main-btn-color oil-main-color plate-name">{{plateText}}</text>
<input v-model="plateNo" :maxlength="6" @tap="showPlateModal(false,true)" read-only adjust-position class="margin-left"
placeholder="车牌号码" name="input"></input>
</view>
<view class="cu-form-group">
<view class="title">姓名</view>
<input adjust-position placeholder="两字短标题" name="input"></input>
</view>
<view class="cu-form-group">
<view class="title">性别</view>
<input adjust-position placeholder="两字短标题" name="input"></input>
</view>
<view class="cu-form-group">
<view class="title">身份证号</view>
<input adjust-position placeholder="两字短标题" name="input"></input>
</view>
<PlateNumberPicker @newPlate="showPlateModal(false,true)" @onDeleteInput="onDeleteInput" :showInputList="showInputList"
:showPlateList="showPlateList" @selectNo="selectNo" @selectName="selectText" @hideModal="showModel=''" :modalName="showModel" />
</view>
</view>
<view class="confirm-btn">
<button class="bg-main-oil margin">确定</button>
</view>
<view class="my-bg">
</view>
</view>
</template>
<script>
import PlateNumberPicker from '@/components/plate-number-picker/plate-number-picker.vue'
export default {
components: {
PlateNumberPicker
},
data() {
return {
showPlateList: true,
showInputList: false,
carNumber: '',
plateNo: '',
plateText: '',
imgList: [],
plateName: '',
showPlateList: true,
showInputList: false,
showModel: ''
}
},
methods: {
text() {
this.carNumber = this.plateText + this.plateNo
this.tsetPlate()
},
tsetPlate() {
this.carNumber = this.plateText + this.plateNo
this.testResult =
/^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/
.test(this.carNumber)
},
onDeleteInput() {
this.plateNo = this.plateNo.slice(0, -1)
},
selectText(item) {
this.plateText = item
this.showPlateList = false
this.showInputList = true
this.tsetPlate()
},
selectNo(item) {
if (this.plateNo.length >= 5) {
this.showModel = ''
}
this.plateNo = this.plateNo + item
this.tsetPlate()
},
showPlateModal(val1, val2) {
this.showPlateList = val1
this.showInputList = val2
this.showModel = 'show'
},
ChooseImage() {
uni.chooseImage({
count: 1, //默认9
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
success: (res) => {
if (this.imgList.length != 0) {
this.imgList = this.imgList.concat(res.tempFilePaths)
} else {
this.imgList = res.tempFilePaths
}
}
});
},
ViewImage(e) {
uni.previewImage({
urls: this.imgList,
current: e.currentTarget.dataset.url
});
},
DelImg(e) {
uni.showModal({
title: '召唤师',
content: '确定要删除这段回忆吗?',
cancelText: '再看看',
confirmText: '再见',
success: res => {
if (res.confirm) {
this.imgList.splice(e.currentTarget.dataset.index, 1)
}
}
})
},
}
}
</script>
<style scoped>
.bg-img {
min-height: 200rpx;
}
.uplaod-container {
min-height: 200upx;
}
.solids {
position: relative;
}
.upload-desc {
position: absolute;
top: 120rpx;
color: #FE0505;
width: 100%;
}
.content {
background-color: #f1f2f7;
min-height: 100%;
}
.plate-name {
display: inline-block;
padding: 0.15rem 0.4rem;
}
.confirm-btn {
background-color: #f1f2f7;
position: absolute;
width: 750upx;
bottom: 200rpx;
}
</style>

View File

@@ -0,0 +1,120 @@
<template>
<view>
<!-- <cu-custom class="main-totextbar bg-main-oil" :isBack="true" bgColor="bg-main-oil">
<block slot="backText">返回</block>
<block slot="content">人脸识别</block>
</cu-custom>
<button type="primary" @click="checkIsSupportSoterAuthentication">检查支持的认证方式</button>
<button type="primary" @click="checkIsSoterEnrolledInDeviceFingerPrint">检查是否录入指纹</button>
<button type="primary" @click="checkIsSoterEnrolledInDeviceFaceID">检查是否录入FaceID</button>
<button type="primary" @click="startSoterAuthenticationFingerPrint">开始指纹认证</button>
<button type="primary" @click="startSoterAuthenticationFaceID">开始FaceID认证</button>
<button type="primary" @tap="startAuth">start</button> -->
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
checkIsSupportSoterAuthentication() {
uni.checkIsSupportSoterAuthentication({
success(res) {
console.log(res);
},
fail(err) {
console.log(err);
},
complete(res) {
console.log(res);
}
})
},
checkIsSoterEnrolledInDeviceFingerPrint() {
uni.checkIsSoterEnrolledInDevice({
checkAuthMode: 'fingerPrint',
success(res) {
console.log(res);
},
fail(err) {
console.log(err);
},
complete(res) {
console.log(res);
}
})
},
checkIsSoterEnrolledInDeviceFaceID() {
uni.checkIsSoterEnrolledInDevice({
checkAuthMode: 'facial',
success(res) {
console.log(res);
},
fail(err) {
console.log(err);
},
complete(res) {
console.log(res);
}
})
},
startSoterAuthenticationFingerPrint() {
uni.startSoterAuthentication({
requestAuthModes: ['fingerPrint'],
challenge: '123456',
authContent: '请用指纹解锁',
success(res) {
console.log(res);
},
fail(err) {
console.log(err);
},
complete(res) {
console.log(res);
}
})
},
startSoterAuthenticationFaceID() {
uni.startSoterAuthentication({
requestAuthModes: ['facial'],
challenge: '123456',
authContent: '请用FaceID解锁',
success(res) {
console.log(res);
},
fail(err) {
console.log(err);
},
complete(res) {
console.log(res);
}
})
},
startAuth() {
uni.startSoterAuthentication({
requestAuthModes: ['facial', 'fingerPrint'],
challenge: '挑战因子。挑战因子为调用者为此次生物鉴权准备的用于签名的字符串关键识别信息,将作为 resultJSON 的一部分,供调用者识别本次请求。例如:如果场景为请求用户对某订单进行授权确认,则可以将订单号填入此参数。,',
authContent: '啦啦啦',
success: (res) => {
console.log(res)
},
fail: (err) => {
console.log(err)
},
complete: () => {
console.log('触发了')
}
})
}
}
}
</script>
<style>
</style>

View File

@@ -0,0 +1,25 @@
<template>
<view>
<cu-custom class="main-totextbar bg-main-oil" :isBack="true" bgColor="bg-main-oil">
<block slot="backText">返回</block>
<block slot="content">指纹识别</block>
</cu-custom>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
</style>

View File

@@ -0,0 +1,55 @@
<template>
<view class="bg-white bottom-part bg-white">
<view class=" text-center text-sm">
<view class="padding-xxs">
全国统一客服/投诉热线
<text class="oil-main-color" @tap="makeCall">{{hotline}}</text>
</view>
<view class="padding-xs">
<checkbox @tap="onChange" class='round red chagesize' :class="checked?'checked':''" :checked="checked?true:false"
value="C"></checkbox> 我已阅读并同意
<text @tap="toAgree('zhongpinUserAgree')" class="oil-main-color">用户协议</text><text @tap="toAgree('zhongpinPrivacyAgreement')" class="oil-main-color">隐私政策</text>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'loginBottom',
data() {
return {
count: 0,
hotline: '4008-56-5355'
}
},
methods: {
onChange() {
this.count++
this.$emit('onCheck', this.count % 2 != 0)
},
toAgree(link) {
uni.navigateTo({
url: `/BagAuth/pages/agreeMent/agreeMent?link=${link}`
})
},
makeCall() {
uni.makePhoneCall({
phoneNumber: this.hotline
})
}
},
}
</script>
<style>
.bottom-part {
width: 750upx;
position: absolute;
bottom: 60rpx;
}
.chagesize {
transform: scale(0.6, 0.6);
}
</style>

View File

@@ -0,0 +1,313 @@
<template>
<view class="login-page bg-white">
<view class="image login-bg">
<!-- <image :src="imgURL+'login-bg.png'" mode="widthFix"></image> -->
<!-- <image src="../../../BagStation/static/img/LV.png" mode="widthFix"></image> -->
<image src="../../../static/img/login-bg.png" mode="widthFix"></image>
</view>
<scroll-view scroll-x class=" bg-white nav padding">
<view class="flex text-center padding-bottom">
<view class="cu-item flex-sub">
</view>
<view class="cu-item flex-sub" :class="0==TabCur?'text-blues cur':''" @tap="tabSelect(0)">
个人账号
</view>
<view class="cu-item flex-sub">
</view>
<!-- <view class="cu-item flex-sub" :class="1==TabCur?'text-red cur':''" @tap="tabSelect(1)">
企业账号
</view>
-->
</view>
</scroll-view>
<view class="cu-load load-modal" v-if="loadModal">
<view class="gray-text">加载中...</view>
</view>
<view class="margin-lg flex flex-direction text-center">
<button 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 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 :check="loginOut" /> -->
</view>
</template>
<script>
// import uniteApi from '@/api/unite'
// import weixinApi from '@/api/weixin'
import loginBottom from './components/loginBottom.vue'
import oilIdentityApi from '@/api/oil-identity'
export default {
components: {
loginBottom
},
data() {
return {
// imgsrc:require('../../../BagStation/static/img/login-bg.png'),
userHandle: false,
TabCur: 0,
accuntSource: false,
imgURL: this.global.imgURL,
loadModal: false,
active: 0,
password: "",
random: '',
driver: {},
count: 0,
loginRes: {},
sessionKey: '',
nickName: '',
loginOut: uni.getStorageSync('loginOut') ? true : false
}
},
onLoad() {
uni.clearStorageSync()
this.refreshLocation()
uni.login({
provider: 'weixin',
success: (loginRes) => {
console.log(loginRes,'loginRes')
const code = loginRes.code
this.onceCode = code
console.log(this.onceCode,'----------')
oilIdentityApi.sendCode(this.onceCode).then(res => {
console.log(res,'sendCode')
if (res.code === 20000) {
this.sessionKey = res.data.sessionKey
uni.setStorageSync('openid', res.data.openId)
uni.setStorageSync('unionid', res.data.unionId)
this.autoLogin()
} else if (res.code == 1002) {
uni.showModal({
title: '微信登录失败提醒',
content: `${res.msg}如有疑问,请联系客服处理`
})
} else {
// console.log('res', res.code)
}
}).catch(err => {
console.log(err)
uni.reLaunch({
url: '/BagAuth/pages/login/boforeLogin/boforeLogin',
fail: (err) => {
// console.log(err)
}
})
})
},
fail: err => {},
})
},
methods: {
refuseLogin() {
uni.switchTab({
url: '/pages/tabbar/home/home'
})
},
refreshLocation() {
uni.getLocation({
type: 'wgs84',
success: function(res) {
uni.setStorageSync('location', res)
}
});
},
autoLogin() {
// let url = 'loginCompany'
let url = 'loginPersonal'
oilIdentityApi.autoLogin({
unionId: uni.getStorageSync('unionid')
}, url).then(res => {
if (res.code == 20000) {
this.loginSuccess(res)
}
})
},
refuseEmpower() {
uni.navigateTo({
url: '/BagAuth/pages/login/oldLogin'
})
},
decryptPhoneNumber(e) {
// console.log(e.detail)
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)
} else {
uni.showModal({
title: '用户拒绝手机号的授权',
content: `请输入手机号码登录,如有疑问,请联系客服处理`
})
}
},
bindLoginByPhone(data, url) {
if (this.count < 1) {
oilIdentityApi.bindLoginByPhone(data, url).then(res => {
console.log(res)
if (res.code == 20000) {
this.loginSuccess(res)
}
})
}
},
tabSelect(e) {
this.TabCur = e;
},
loginSuccess(res) {
let resData = res.data
if (resData.authTokenDTO.loginFlag) {
uni.setStorageSync('Authorization', resData.authTokenDTO.accessToken)
uni.setStorageSync('accountStatus', resData.isCompanyAccount)
let user = resData.authTokenDTO.loginUser
uni.setStorageSync('user', user)
setTimeout(() => {
uni.showToast({
title: res.msg,
icon: 'none',
complete: (err) => {
// console.log(err)
}
})
}, 1000);
// 这里有问题
uni.switchTab({
url: '/pages/tabbar/home/home'
})
}
},
}
}
</script>
<style>
.login-bg {
width: 100%;
}
.login-bg image {
width: 750upx;
vertical-align: bottom;
}
.login-page {
height: 750rpx;
background-color: #fff;
}
.bg-0{
background-color: transparent;
color: #555555;
}
</style>

View File

@@ -0,0 +1,594 @@
<!-- 验证码登录 账密登录 -->
<template>
<view class="login-page bg-white">
<cu-custom class="main-totextbar bg-main-oil" :isBack="true" bgColor="bg-white">
</cu-custom>
<view class="bg-img bg-mask flex align-center"
:style="'background-image: url('+imgURL+'login-bg-top.png);height: 480upx;'">
<view class="padding-xl ">
<view class="image login-bg">
<image :src="otherImgURL+'logo@ZP.png'" mode="widthFix"></image>
<view class="text-bold text-lg padding-top">
一路油你 中品加油
</view>
<view class="text-df text-grey padding-top-xs padding-bottom">
登录后加油更便捷
</view>
</view>
</view>
</view>
<scroll-view class="bg-white nav padding login-shadow">
<view class="flex text-center padding-bottom">
<view class="cu-item text-bold text-lg flex-sub">
</view>
<!-- <view class="cu-item text-bold text-lg flex-sub "
:class="[1==TabCur?'text-red cur':'',(animation=='animation-fades'&&1==TabCur)?'animation-fade':'']"
@tap="tabSelect(1)">
企业账号
</view> -->
<view class="cu-item text-bold text-lg flex-sub "
:class="[0==TabCur?'text-blues cur':'',(animation=='animation-fades'&&0==TabCur)?'animation-fade':'']"
@tap="tabSelect(0)">
个人账号
</view>
<view class="cu-item text-bold text-lg flex-sub">
</view>
</view>
<form v-if="0==TabCur">
<view class="cu-form-group padding-top yu-input" v-if="!person.sended">
<input placeholder="请输入手机号码" label="手机号" v-model="driver.username" type="number" name="input" />
</view>
<view class="" v-if="person.registered">
<view class="cu-form-group yu-input" v-if="showRandom">
<input placeholder="请输入验证码" type="number" v-model="person.random" name="input" />
<view class='oil-main-color' @tap="sendRandom"> {{person.tips}}</view>
</view>
<view class="cu-form-group yu-input" v-else>
<input placeholder="请输入密码" type="password" v-model="person.password" name="input" />
</view>
</view>
<view class="cu-form-group text-sm">
<view class="" v-if="showRandom" >
当前为验证码登录
</view>
<view class="" v-else >
当前为密码登录
</view>
</view>
<view class=" flex flex-direction padding-top-lg" v-if="!person.registered">
<button class="cu-btn margin bg-main-oil lg" v-show="!person.sended" @tap="ifRegistered">
下一步
</button>
</view>
<view view class=" flex flex-direction padding-top-lg" v-else>
<button class="cu-btn bg-main-oil lg" @tap="loginRandom" v-if="showRandom">
登录
</button>
<button v-else class="cu-btn bg-main-oil lg" @tap="loginPwd">
登录
</button>
</view>
</form>
<!-- <form v-if="1==TabCur">
<view class="cu-form-group yu-input padding-top" v-if="!company.sended">
<input name="手机号" label="手机号" type="number" placeholder="请输入企业下绑定手机号" v-model="driver.username" />
</view>
<view class="" v-if="company.registered">
<view class="cu-form-group yu-input" v-if="showRandom" v-show="company.sended">
<input placeholder="请输入验证码" type="number" v-model="company.random" />
<view class='oil-main-color' @tap="sendRandom"> {{company.tips}}</view>
</view>
<view class="cu-form-group yu-input" v-else>
<input placeholder="请输入密码" type="password" v-model="company.password" />
</view>
</view>
<view class="cu-form-group text-sm">
<view class="" v-if="showRandom" @tap="accuntSourceSelect">
当前为验证码登录
</view>
<view class="" v-else @tap="accuntSourceSelect">
当前为密码登录
</view>
</view>
<view class=" flex flex-direction padding-top-lg" v-if="!company.registered">
<button class="cu-btn margin bg-main-oil lg" v-show="!company.sended" @tap="ifRegistered">
下一步
</button>
</view>
<view class=" flex flex-direction padding-top-lg" v-else>
<button v-if="showRandom" class="cu-btn bg-main-oil lg" @tap="loginRandom">
登录
</button>
<button v-else class="cu-btn bg-main-oil lg" @tap="loginPwd">
登录
</button>
</view>
</form> -->
</scroll-view>
<view class="cu-load load-modal" v-if="loadModal">
</view>
<loginBottom @onCheck="checkAgree" />
</view>
</template>
<script>
import loginBottom from './components/loginBottom.vue'
import authApi from '@/api/auth.js'
import md5 from 'js-md5'
export default {
components: {
loginBottom
},
data() {
return {
showRandom: false,
animation: '',
hasPhone: false,
userHandle: false,
TabCur: 0,
verifyCodeToken: "",
accuntSource: false,
imgURL: this.global.imgURL,
otherImgURL: this.global.otherImgURL,
loadModal: false,
active: 0,
person: {
sended: false,
password: "",
tips: '发送验证码',
intervalID: '',
random: '',
registered: false
},
company: {
sended: false,
password: "",
tips: '发送验证码',
intervalID: '',
random: '',
registered: false
},
driver: {
username: ""
},
count: 0,
loginRes: {},
checked: false,
next: false
}
},
onShow() {},
methods: {
checkAgree(val) {
this.checked = val
// this.showRandom = true
},
ifRegistered() {
let that = this
if (this.driver.username.length != 11) {
uni.showToast({
title: '手机码验证不通过',
icon: 'none'
})
return false
}
if (this.showRandom) {
this.sendRandom()
} else {
let type = this.TabCur == 0 ? 'Personal' : 'Company'
authApi.loginByPhoneNext({
username: this.driver.username
}, type).then(res => {
if (res.code == 20000) {
// 存在 next
this.person.registered = true
this.next = true
} else if (res.code == 42008) {
uni.showModal({
title: res.msg,
confirmText: '立即注册',
confirmColor: '#FE0505',
success: (res) => {
if (res.confirm) {
uni.setStorageSync('username', that.driver.username)
uni.navigateTo({
url: '/BagAuth/pages/login/register'
})
}
}
})
}
})
}
},
sendRandom() {
// 判断该手机号是否已注册
if (1 == this.TabCur) {
// 1 企业 0个人
authApi.checkCompanyAccount({
username: this.driver.username
}).then(res => {
if (res.data != null) {
if (res.data.code == 40001) {
uni.showModal({
title: res.data.msg,
content: '企业账号只能由企业分配,请确认是否当前手机号,如有疑问,请联系客服处理',
showCancel: false,
confirmColor: '#1890FF',
success: (res) => {
if (confirm) {
}
}
})
} else if (res.code == 20000) {
this.company.registered = true
this.verifyCodeToken = res.data.verifyCodeToken
uni.showToast({
title: res.msg
})
this.showRandom = true
this.company.sended = true
this.sended = true
var second = 60
this.company.intervalID = setInterval(() => {
if (second > 0) {
this.company.tips = second + '秒后可重发'
console.log(this.tips)
second--
} else {
clearInterval(this.company.intervalID)
this.company.tips = '发送验证码'
}
}, 1000)
}
}
})
} else {
let that = this
authApi.checkPersonalAccount({
username: this.driver.username
}).then(res => {
if (res.data != null) {
if (res.data.code == 40001) {
uni.showModal({
title: res.data.msg,
confirmText: '立即注册',
confirmColor: '#1890FF',
success: (res) => {
if (res.confirm) {
uni.setStorageSync('username', that.driver.username)
uni.navigateTo({
url: '/BagAuth/pages/login/register'
})
}
}
})
} else if (res.code == 20000) {
this.person.registered = true
this.verifyCodeToken = res.data.verifyCodeToken
uni.showToast({
title: res.msg
})
this.showRandom = true
this.person.sended = true
this.sended = true
var second = 60
this.person.intervalID = setInterval(() => {
if (second > 0) {
this.person.tips = second + '秒后可重发'
second--
} else {
clearInterval(this.person.intervalID)
this.person.tips = '重发验证码'
}
}, 1000)
}
}
})
}
},
checkAccount() {
},
// sendRandom() {
// if (this.TabCur == 0) {
// if (this.company.tips == '重发验证码') {
// this.ifRegistered()
// return false
// }
// }
// if (this.TabCur == 1) {
// if (this.person.tips == '重发验证码') {
// this.ifRegistered()
// return false
// }
// }
// uni.showToast({
// title: '别急,等会儿再发哦',
// icon: 'none',
// position: 'bottom'
// })
// },
loginPwd() {
if (!this.checked) {
uni.showToast({
title: '请您阅读并同意协议',
icon: 'none'
})
return false
}
let data = {
username: this.driver.username,
password: this.TabCur == 0 ? md5(this.person.password) : md5(this.company.password),
unionId: uni.getStorageSync('unionid')
}
let type = this.TabCur == 0 ? 'Personal' : 'Company'
authApi.loginPwd(data, type).then(res => {
this.loginSuccess(res)
})
},
loginRandom() {
if (!this.checked) {
uni.showToast({
title: '请您阅读并同意协议',
icon: 'none'
})
return false
}
let data = {
verifyCodeToken: this.verifyCodeToken,
username: this.driver.username,
verifyCode: this.TabCur == 0 ? this.person.random : this.company.random,
unionId: uni.getStorageSync('unionid')
}
let type = this.TabCur == 0 ? 'Personal' : 'Company'
authApi.loginRandom(data, type).then(res => {
if (res.code == 20000) {
this.loginSuccess(res)
}
})
},
checkPersonal() {
if (this.accuntSource) {
authApi.checkPersonalRDM({
username: this.driver.username
}).then(res => {
})
} else {
authApi.checkPersonalPWD({
username: this.driver.username
}).then(res => {
if (res.code == 20000) {}
})
}
},
loginSuccess(res) {
let resData = res.data
if (resData.authTokenDTO.loginFlag) {
uni.setStorageSync('Authorization', resData.authTokenDTO.accessToken)
uni.setStorageSync('accountStatus', resData.isCompanyAccount)
uni.getUserProfile({
success: (res) => {
uni.setStorageSync('wxInfo', JSON.parse(res.rawData))
}
})
let user = resData.authTokenDTO.loginUser
uni.setStorageSync('user', user)
setTimeout(() => {
uni.showToast({
title: res.msg,
icon: 'none'
})
}, 1000);
// 这里有问题
uni.switchTab({
url: '/pages/tabbar/home/home'
})
}
},
checkCompany() {
if (this.accuntSource) {
authApi.checkCompanyRDM({
username: this.driver.username
}).then(res => {
})
} else {
authApi.checkCompanyPWD({
username: this.driver.username
}).then(res => {
})
}
},
// checkPersonalRDM(){
// authApi.checkPersonalRDM({username:this.driver.username}).then(res=>{
// })
// },
// checkPersonalRDM(){
// authApi.checkPersonalRDM({username:this.driver.username}).then(res=>{
// })
// },
getUserInfo() {
},
clearStorage() {
uni.clearStorage()
},
decryptPhoneNumber(e) {
// console.log(e.detail)
if (e.detail.errMsg === 'getPhoneNumber:ok') {
const data1 = {
...this.loginRes,
...e.detail
}
this.bindLoginByPhone(data1)
} else {
this.userHandle = true
uni.showModal({
title: '用户拒绝了手机号的授权,并给你一个大耳巴子',
content: `如有疑问,请联系客服处理`
})
}
},
bindLoginByPhone(data) {
if (this.count < 1) {
oilIdentityApi.bindLoginByPhone(data).then(res => {
if (res.code == '000') {
this.bindLoginByPhone(data)
this.count++
}
})
}
},
loginWeixin() {
uni.login({
provider: 'weixin',
success: loginRes => {
const code = loginRes.code
}
})
},
// reqRandom() {
// if (this.driver.phone && this.driver.phone.length === 11) {
// uni.showToast({
// title: '发送中...',
// duration: 0,
// icon: 'loding',
// mask: true
// })
// this.phoneError = ''
// this.disabled = true
// this.btnColor = '#333'
// const data2 = {
// ...this.driver,
// IMEI: this.IMEI,
// serviceCode: 'LSM_SENDMESSAGES',
// type: 'LSM_APP_LOGIN'
// }
// authApi.api(data2).then(res => {
// console.log('验证码参数', data2)
// console.log('验证码返回参数res', res)
// if (res.code === '1000') {
// this.disabled = true
// uni.hideLoading()
// uni.showToast({
// title: '验证码发送成功',
// icon: 'success',
// position: 'bottom'
// })
// this.btnColor = '#333'
// let second = 60
// const timer = setInterval(() => {
// second--
// if (second) {
// this.tips = `${second}秒后重发`
// } else {
// clearInterval(timer)
// this.tips = `发送验证码`
// this.disabled = false
// this.btnColor = '#FE0505'
// }
// }, 1000)
// }
// })
// } else {
// uni.showToast({
// title: '请输入正确手机号',
// icon: 'none'
// })
// }
// },
tabSelect(e) {
this.TabCur = e;
var anmiaton = 'animation-fades'
this.animation = anmiaton;
setTimeout(() => {
this.animation = '';
}, 1000)
},
accuntSourceSelect() {
this.showRandom = !this.showRandom
},
ifSuccess(code, data) {
if (code === '1000') {
// // // // console.log('122')
uni.showToast({
title: `登录成功!`
})
uni.navigateTo({
url: 'pages/index/index'
})
}
}
}
}
</script>
<style>
.login-bg {
width: 100%;
}
.login-bg image {
width: 100upx;
vertical-align: bottom;
}
.login-page {
height: 750rpx;
background-color: #fff;
}
.login-shadow {
border-radius: 50upx 50upx 0 0;
box-shadow: 0px -10px 20px 2px rgba(0, 0, 0, 0.06);
margin-top: -50upx;
position: relative;
z-index: 2;
}
.bg-mask {
background-color: transparent;
}
.bg-mask::after {
background-color: transparent;
}
.yu-input {
background: #FAFAFA
}
</style>

View File

@@ -0,0 +1,242 @@
<!-- 验证码登录 账密登录 -->
<template>
<view class="login-page bg-white">
<cu-custom class="main-totextbar bg-main-oil" :isBack="true" bgColor="bg-white">
</cu-custom>
<view class="bg-img bg-mask flex align-center"
:style="'background-image: url('+imgURL+'login-bg-top.png);height: 480upx;'">
<view class="padding-xl ">
<view class="image login-bg">
<image :src="imgURL+'new-logo.png'" mode="widthFix"></image>
<view class="text-bold text-lg padding-top">
一路油你 中品加油
</view>
<view class="text-df text-grey padding-top-xs padding-bottom">
注册为个人会员
</view>
</view>
</view>
</view>
<scroll-view class="bg-white nav padding login-shadow">
<view v-show="!setPwd">
<view class="flex text-center padding-bottom" v-if="!sended">
<view class="cu-item text-bold text-lg flex-sub">
</view>
<view class="cu-item text-red cur text-bold text-lg flex-sub ">
个人账号
</view>
<view class="cu-item text-bold text-lg flex-sub">
</view>
</view>
<view class="text-grey padding" v-else>
验证码已发送至 <text class="padding-left-sm">{{driver.username|phoneHide}}</text>
</view>
<form>
<view class=" cu-form-group padding-top yu-input" v-if="!sended">
<input placeholder="请输入手机号码" label="手机号" v-model="driver.username" type="number" name="input" />
</view>
<view class="cu-form-group yu-input" v-if="sended">
<input placeholder="请输入验证码" type="number" v-model="random" name="input" />
<view class='oil-main-color' @tap="sendRandom"> {{tips}}</view>
</view>
</form>
<view class=" flex flex-direction">
<button class="cu-btn margin bg-main-oil lg" @tap="sendRandom" v-if="!sended">
下一步
</button>
<button class="cu-btn margin bg-main-oil lg" @tap="userRegister" v-else>
确定
</button>
</view>
</view>
<view class="" v-show="setPwd">
<view class="text-grey padding">
设置登录密码
</view>
<form>
<view class=" cu-form-group padding-top yu-input">
<input placeholder="6-16位密码" v-model="password" name="input" />
</view>
</form>
<view class=" flex flex-direction">
<button class="cu-btn margin bg-main-oil lg" @tap="savePwd">
保存
</button>
<button class="cu-btn margin lg" @tap="skipPwd">
跳过
</button>
</view>
</view>
</scroll-view>
<view class="cu-load load-modal" v-if="loadModal">
</view>
<loginBottom @onCheck="checkAgree" />
</view>
</template>
<script>
import loginBottom from './components/loginBottom.vue'
import authApi from '@/api/auth.js'
export default {
components: {
loginBottom
},
data() {
return {
tips: '发送验证码',
accuntSource: false,
imgURL: this.global.imgURL,
password: "",
random: '',
driver: {
username: uni.getStorageSync('username') ? uni.getStorageSync('username') : ''
},
sended: false,
intervalID: '',
setPwd: false,
verifyCodeToken:''
}
},
onShow() {},
methods: {
savePwd() {
},
skipPwd() {
uni.switchTab({
url: '/pages/tabbar/home/home'
})
},
sendRandom() {
if (this.tips == '发送验证码') {
authApi.getRegisterRandom({
username: this.driver.username
}).then(res => {
if (res.code == 20000) {
this.sended = true
var second = 60
this.verifyCodeToken = res.data.verifyCodeToken
this.intervalID = setInterval(() => {
if (second > 0) {
this.tips = second + '秒后可重发'
second--
} else {
clearInterval(this.intervalID)
this.tips = '发送验证码'
}
}, 1000)
}
})
} else {
uni.showToast({
title: '别急,等会儿再发哦',
icon: 'none',
position: 'bottom'
})
}
},
loginSuccess(res) {
let resData = res.data
if (resData.authTokenDTO.loginFlag) {
uni.setStorageSync('Authorization', resData.authTokenDTO.accessToken)
uni.setStorageSync('accountStatus', resData.isCompanyAccount)
uni.getUserProfile({
success: (res) => {
uni.setStorageSync('wxInfo', JSON.parse(res.rawData))
}
})
let user = resData.oilCustomerAccount
uni.setStorageSync('user', user)
setTimeout(() => {
uni.showToast({
title: res.msg,
icon: 'none',
complete: (err) => {
}
})
}, 1000);
this.setPwd = true
// 这里有问题
// uni.reLaunch({
// url: '/pages/tabbar/home/home'
// })
}
},
userRegister() {
authApi.userRegister({
username: this.driver.username,
verifyCode: this.random,
verifyCodeToken:this.verifyCodeToken,
unionId: uni.getStorageSync('unionid')
}).then(res => {
if (res.code == 20000) {
this.sended = true
this.loginSuccess(res)
}
})
},
checkAgree(val) {
this.checked = val
},
},
filters: {
phoneHide(value) {
if (value) {
var pat = /(\d{3})\d*(\d{4})/
var b = value.replace(pat, '$1****$2');
return b
} else {
return value
}
}
}
}
</script>
<style>
.login-bg {
width: 100%;
}
.login-bg image {
width: 100upx;
vertical-align: bottom;
}
.login-page {
height: 750rpx;
background-color: #fff;
}
.login-shadow {
border-radius: 50upx 50upx 0 0;
box-shadow: 0px -10px 20px 2px rgba(0, 0, 0, 0.06);
margin-top: -50upx;
position: relative;
z-index: 2;
}
.bg-mask {
background-color: transparent;
}
.bg-mask::after {
background-color: transparent;
}
.yu-input {
background: #FAFAFA
}
</style>

View File

@@ -0,0 +1,104 @@
<template>
<view class="page-content my-bg">
<cu-custom class="main-totextbar bg-main-oil" :isBack="true" bgColor="bg-main-oil">
<block slot="backText">返回</block>
<block slot="content">个人中</block>
</cu-custom>
<view class="cu-list menu-avatar">
<view class="cu-item arrow">
<view class="cu-avatar round lg" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg);"></view>
<view class="content">
<view class="text-grey">用户姓名</view>
<view class="text-gray text-sm flex">
<view class="text-cut">
<!-- <text class="cuIcon-infofill text-red margin-right-xs"></text> -->
当前个人账户
</view>
</view>
</view>
<view class="action">
<text class="cuIcon-right text-grey "></text>
</view>
</view>
</view>
<view class="cu-list menu ">
<view class="cu-item ">
<view class="content">
<text class="color-000">手机号</text>
</view>
<view class="action">
<text class="text-grey text-sm">111111111</text>
</view>
</view>
<view class="cu-item ">
<view class="content">
<text class="color-000">身份证号</text>
</view>
<view class="action">
<text class="text-grey text-sm">3102***5411</text>
</view>
</view>
<view class="cu-item ">
<view class="content">
<text class="color-000">车牌号</text>
</view>
<view class="action">
<text class="text-grey text-sm">皖ADW857</text>
</view>
</view>
<view class="cu-item arrow">
<view class="content">
<text class="color-000">登入密码</text>
</view>
<view class="action">
<text class="text-grey text-sm">管理登入密码</text>
</view>
</view>
<view class="cu-item arrow">
<view class="content">
<text class="color-000">支付密码</text>
</view>
<view class="action">
<text class="text-grey text-sm">设置支付密码</text>
</view>
</view>
</view>
<view class="padding margin-top bg-white margin-bottom">
<view class="cu-item text-center">
<text class="color-000 text-center">切换账号</text>
</view>
</view>
<view class="padding bg-white">
<view class="cu-item text-center">
<text class="color-000 text-center">退出</text>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style scoped>
.cu-list+.cu-list {
margin-top: 0;
}
.page-content {
min-height: 100%;
}
</style>