更新
This commit is contained in:
@@ -22,11 +22,22 @@
|
|||||||
4008-56-5355
|
4008-56-5355
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="text-center color-999" >
|
||||||
|
<checkbox @tap="onChange" class='round red chagesize' :class="checked?'checked':''" :checked="checked?true:false"
|
||||||
|
value="C"></checkbox> 我已阅读并同意
|
||||||
|
<text @tap="toAgree('xoilCloudUserAgree')" class="oil-main-color">《用户协议》</text>和<text @tap="toAgree('xoilCloudPrivacyAgreement')" class="oil-main-color">《隐私政策》</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
|
props:{
|
||||||
|
checked:{
|
||||||
|
type:Boolean,
|
||||||
|
default:false
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// key: value
|
// key: value
|
||||||
@@ -37,10 +48,22 @@
|
|||||||
uni.makePhoneCall({
|
uni.makePhoneCall({
|
||||||
phoneNumber: '4008-56-5355'
|
phoneNumber: '4008-56-5355'
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
toAgree(link) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/Auth/agreeMent/agreeMent?link=${link}`
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onChange() {
|
||||||
|
let checked = !this.checked
|
||||||
|
this.$emit('onCheck', checked)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
.chagesize {
|
||||||
|
transform: scale(0.6, 0.6);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
39
pages.json
39
pages.json
@@ -1,19 +1,19 @@
|
|||||||
{
|
{
|
||||||
"easycom": {
|
"easycom": {
|
||||||
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
|
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
|
||||||
},
|
},
|
||||||
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
||||||
{
|
{
|
||||||
"path": "pages/index/index",
|
"path": "pages/index/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "星油",
|
"navigationBarTitleText": "星油",
|
||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true,
|
||||||
"navigationStyle":"custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
"path": "pages/stationDetail/stationDetail",
|
"path": "pages/stationDetail/stationDetail",
|
||||||
"style": {}
|
"style": {}
|
||||||
},{
|
}, {
|
||||||
"path": "pages/login/boforeLogin/boforeLogin",
|
"path": "pages/login/boforeLogin/boforeLogin",
|
||||||
"style": {}
|
"style": {}
|
||||||
}, {
|
}, {
|
||||||
@@ -39,6 +39,9 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/Auth/Auth",
|
"path": "pages/Auth/Auth",
|
||||||
"style": {}
|
"style": {}
|
||||||
|
}, {
|
||||||
|
"path": "pages/Auth/agreeMent/agreeMent",
|
||||||
|
"style": {}
|
||||||
}, {
|
}, {
|
||||||
"path": "pages/test/test",
|
"path": "pages/test/test",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -60,31 +63,29 @@
|
|||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
|
|
||||||
}, {
|
}, {
|
||||||
"path": "pages/stationDetail/openStationDetail",
|
"path": "pages/stationDetail/openStationDetail",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
|
|
||||||
}, {
|
}, {
|
||||||
"path": "pages/TransactionStatistics/TransactionStatistics",
|
"path": "pages/TransactionStatistics/TransactionStatistics",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
"enablePullDownRefresh": true
|
"enablePullDownRefresh": true
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
"path": "pages/escalation/escalation",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "对账上报",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationStyle": "default"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
,{
|
],
|
||||||
"path" : "pages/escalation/escalation",
|
|
||||||
"style" :
|
|
||||||
{
|
|
||||||
"navigationBarTitleText": "对账上报",
|
|
||||||
"enablePullDownRefresh": false,
|
|
||||||
"navigationStyle":"default"
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"subPackages": [{
|
"subPackages": [{
|
||||||
"root": "packageOrders",
|
"root": "packageOrders",
|
||||||
"pages": [{
|
"pages": [{
|
||||||
@@ -127,7 +128,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
} ,
|
},
|
||||||
{
|
{
|
||||||
"root": "packageSecurity",
|
"root": "packageSecurity",
|
||||||
"pages": [{
|
"pages": [{
|
||||||
|
|||||||
29
pages/Auth/agreeMent/agreeMent.vue
Normal file
29
pages/Auth/agreeMent/agreeMent.vue
Normal 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>
|
||||||
@@ -3,7 +3,8 @@
|
|||||||
<cu-custom class="main-topbar bg-main-oil" bgColor="bg-main-oil">
|
<cu-custom class="main-topbar bg-main-oil" bgColor="bg-main-oil">
|
||||||
<block slot="content">星油云站</block>
|
<block slot="content">星油云站</block>
|
||||||
</cu-custom>
|
</cu-custom>
|
||||||
<view class="bg-img margin flex padding-lg radius align-center text-center" :style="'background-image: url('+mainURL+'login-bg.png)'">
|
<view class="bg-img margin flex padding-lg radius align-center text-center"
|
||||||
|
:style="'background-image: url('+mainURL+'login-bg.png)'">
|
||||||
<view class="padding-lg margin text-center text-lg text-white w100">
|
<view class="padding-lg margin text-center text-lg text-white w100">
|
||||||
<text class="">
|
<text class="">
|
||||||
油站工作人员绑定油站
|
油站工作人员绑定油站
|
||||||
@@ -25,16 +26,21 @@
|
|||||||
</view>
|
</view>
|
||||||
</view> -->
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="margin text-center">
|
<view class="margin text-center">
|
||||||
<button class="cu-btn round bg-main-oil lg text-lg" open-type="getPhoneNumber"
|
<button v-if="checked" 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 v-else class="cu-btn round bg-main-oil lg text-lg" @click="$refs.popup.open('center')">
|
||||||
|
<text>
|
||||||
|
手机号快捷登录
|
||||||
|
</text>
|
||||||
|
</button>
|
||||||
<!-- <button class="cu-btn round btnSize" open-type="getPhoneNumber"
|
<!-- <button class="cu-btn round btnSize" open-type="getPhoneNumber"
|
||||||
@getphonenumber="decryptPhoneNumber">
|
@getphonenumber="decryptPhoneNumber">
|
||||||
<text class="cuIcon-weixin text-green lg"></text>
|
<text class="cuIcon-weixin text-green lg"></text>
|
||||||
@@ -42,8 +48,26 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="bottom-part">
|
<view class="bottom-part">
|
||||||
<service-hotline />
|
<service-hotline ref="serviceHotline" :checked='checked' @onCheck="checkAgree" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<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.serviceHotline.toAgree('xoilCloudUserAgree')">《用户协议》</text> 与 <text
|
||||||
|
style=" color: black; font-weight: 600;"
|
||||||
|
@click="$refs.serviceHotline.toAgree('xoilCloudPrivacyAgreement')">《隐私政策》</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>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -52,7 +76,11 @@
|
|||||||
import loginApi from '@/api/login.js'
|
import loginApi from '@/api/login.js'
|
||||||
import oilIdentityApi from '@/api/oil-identity.js'
|
import oilIdentityApi from '@/api/oil-identity.js'
|
||||||
import oliUserApi from '@/api/oli-user.js'
|
import oliUserApi from '@/api/oli-user.js'
|
||||||
|
// import loginBottom from './components/loginBottom.vue'
|
||||||
export default {
|
export default {
|
||||||
|
// components:{
|
||||||
|
// loginBottom
|
||||||
|
// },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
count: 0,
|
count: 0,
|
||||||
@@ -60,8 +88,9 @@
|
|||||||
mainURL: this.global.mainURL,
|
mainURL: this.global.mainURL,
|
||||||
forcedLogin: true,
|
forcedLogin: true,
|
||||||
oilSiteNo: '',
|
oilSiteNo: '',
|
||||||
sessionKey:'',
|
sessionKey: '',
|
||||||
outType:'0'
|
outType: '0',
|
||||||
|
checked: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -69,9 +98,9 @@
|
|||||||
// this.loginWeixin()
|
// this.loginWeixin()
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
if(option.type == '1'){
|
if (option.type == '1') {
|
||||||
this.outType = option.type
|
this.outType = option.type
|
||||||
uni.clearStorageSync()//清除缓存
|
uni.clearStorageSync() //清除缓存
|
||||||
}
|
}
|
||||||
// this.refreshLocation()
|
// this.refreshLocation()
|
||||||
uni.login({ //微信登陆
|
uni.login({ //微信登陆
|
||||||
@@ -84,11 +113,11 @@
|
|||||||
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)
|
||||||
uni.setStorageSync('unionid', res.data.unionId)
|
uni.setStorageSync('unionid', res.data.unionId)
|
||||||
if(_that.outType !== '1'){
|
if (_that.outType !== '1') {
|
||||||
this.autoLogin()
|
this.autoLogin()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
} else if (res.code == 1002) {
|
} else if (res.code == 1002) {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '微信登录失败提醒',
|
title: '微信登录失败提醒',
|
||||||
@@ -96,7 +125,7 @@
|
|||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// console.log('res', res.code)
|
// console.log('res', res.code)
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/BagAuth/pages/login/boforeLogin/boforeLogin',
|
url: '/BagAuth/pages/login/boforeLogin/boforeLogin',
|
||||||
@@ -110,7 +139,18 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
decryptPhoneNumber(e) { // 通过用户授权获取到用户的手机号信息
|
checkAgree(val) {
|
||||||
|
this.checked = val
|
||||||
|
},
|
||||||
|
decryptPhoneNumber(e) {
|
||||||
|
if (!this.checked) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请您阅读并同意协议',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 通过用户授权获取到用户的手机号信息
|
||||||
if (e.detail.errMsg === 'getPhoneNumber:ok') {
|
if (e.detail.errMsg === 'getPhoneNumber:ok') {
|
||||||
const data1 = {
|
const data1 = {
|
||||||
...e.detail,
|
...e.detail,
|
||||||
@@ -126,7 +166,7 @@
|
|||||||
title: '您已拒绝授权手机号'
|
title: '您已拒绝授权手机号'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
bindLoginByPhone(data, url) { //绑定用户手机号
|
bindLoginByPhone(data, url) { //绑定用户手机号
|
||||||
if (this.count < 1) {
|
if (this.count < 1) {
|
||||||
oilIdentityApi.bindLoginByPhonePersonal(data, url).then(res => {
|
oilIdentityApi.bindLoginByPhonePersonal(data, url).then(res => {
|
||||||
@@ -134,10 +174,10 @@
|
|||||||
this.loginSuccess(res)
|
this.loginSuccess(res)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
loginSuccess(res) {//这里是绑定登录
|
loginSuccess(res) { //这里是绑定登录
|
||||||
if (res.data.authTokenDTO.loginFlag) {
|
if (res.data.authTokenDTO.loginFlag) {
|
||||||
this.setStored(res)
|
this.setStored(res)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -154,25 +194,25 @@
|
|||||||
url: url
|
url: url
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
autoLogin() { //根据登录时获取到的 unionid openid 自动登录
|
autoLogin() { //根据登录时获取到的 unionid openid 自动登录
|
||||||
let data={
|
let data = {
|
||||||
unionId:uni.getStorageSync('unionid'),
|
unionId: uni.getStorageSync('unionid'),
|
||||||
openId:uni.getStorageSync('openid')
|
openId: uni.getStorageSync('openid')
|
||||||
}
|
}
|
||||||
console.log(data,'这里是自动登录data')
|
console.log(data, '这里是自动登录data')
|
||||||
oilIdentityApi.loginPersonal(data).then(res => { //微信自动登录
|
oilIdentityApi.loginPersonal(data).then(res => { //微信自动登录
|
||||||
console.log(res,'这里是自动登录res')
|
console.log(res, '这里是自动登录res')
|
||||||
if (res.data.authTokenDTO.loginFlag == true) {
|
if (res.data.authTokenDTO.loginFlag == true) {
|
||||||
this.setStored(res)
|
this.setStored(res)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 存值本地 根据手机号获取其下的油站并且存储本地
|
// 存值本地 根据手机号获取其下的油站并且存储本地
|
||||||
setStored(res){
|
setStored(res) {
|
||||||
let user = res.data.authTokenDTO.loginUser,
|
let user = res.data.authTokenDTO.loginUser,
|
||||||
unionId = uni.getStorageSync('unionid'),
|
unionId = uni.getStorageSync('unionid'),
|
||||||
openId = uni.getStorageSync('openid'),
|
openId = uni.getStorageSync('openid'),
|
||||||
phone = res.data.sysCustomerInfo.phone //获取该用户手机号
|
phone = res.data.sysCustomerInfo.phone //获取该用户手机号
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
@@ -182,7 +222,7 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}, 1000);
|
}, 1000);
|
||||||
uni.setStorageSync('user', user)
|
uni.setStorageSync('user', user)
|
||||||
uni.setStorage({
|
uni.setStorage({
|
||||||
key: 'Authorization',
|
key: 'Authorization',
|
||||||
data: res.data.authTokenDTO.accessToken,
|
data: res.data.authTokenDTO.accessToken,
|
||||||
@@ -199,7 +239,7 @@
|
|||||||
})
|
})
|
||||||
uni.setStorage({
|
uni.setStorage({
|
||||||
key: 'unionId',
|
key: 'unionId',
|
||||||
data:unionId,
|
data: unionId,
|
||||||
success: () => {
|
success: () => {
|
||||||
console.log('deviceunionId', unionId)
|
console.log('deviceunionId', unionId)
|
||||||
}
|
}
|
||||||
@@ -212,12 +252,12 @@
|
|||||||
})
|
})
|
||||||
//根据获取手机号 获取其号下的油站信息
|
//根据获取手机号 获取其号下的油站信息
|
||||||
console.log('这里是获取手机号登录')
|
console.log('这里是获取手机号登录')
|
||||||
oliUserApi.getByPhone(phone).then((res)=>{
|
oliUserApi.getByPhone(phone).then((res) => {
|
||||||
console.log('这里是获取手机号登录',res)
|
console.log('这里是获取手机号登录', res)
|
||||||
if(res.code == 20000){
|
if (res.code == 20000) {
|
||||||
uni.setStorageSync('oliList',res.data)//本地存储当前用户其下有多少油站,用于用户登录进入时选择进入油站
|
uni.setStorageSync('oliList', res.data) //本地存储当前用户其下有多少油站,用于用户登录进入时选择进入油站
|
||||||
// 获取信息存储本地
|
// 获取信息存储本地
|
||||||
uni.setStorageSync('checkFirst',true) //进入前重置进入状态,判断用户是否是登录进入,用来做区分
|
uni.setStorageSync('checkFirst', true) //进入前重置进入状态,判断用户是否是登录进入,用来做区分
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
@@ -229,20 +269,20 @@
|
|||||||
console.log(err)
|
console.log(err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '未绑定油站请联系客服',
|
title: '未绑定油站请联系客服',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 1500
|
duration: 1500
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
nextStep() {
|
nextStep() {
|
||||||
if (this.oilSiteNo) {
|
if (this.oilSiteNo) {
|
||||||
cloudSiteApi.verifyOilSite({
|
cloudSiteApi.verifyOilSite({
|
||||||
oilSiteCode: this.oilSiteNo
|
oilSiteCode: this.oilSiteNo
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.code === 20000) {
|
if (res.code === 20000) {
|
||||||
//历史遗留代码---------------------------------
|
//历史遗留代码---------------------------------
|
||||||
// address: "安徽省合肥市庐阳区大杨镇"
|
// address: "安徽省合肥市庐阳区大杨镇"
|
||||||
@@ -345,9 +385,58 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.btnSize{
|
.protocol_footer_close {
|
||||||
font-size:60rpx;
|
width: 185rpx;
|
||||||
|
border-radius: 94rpx 94rpx 94rpx 94rpx;
|
||||||
|
opacity: 1;
|
||||||
|
border: 1px solid #000000;
|
||||||
|
font-size: 26rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.protocol_footer_confirm {
|
||||||
|
width: 185rpx;
|
||||||
|
background: #FD0505;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
.btnSize {
|
||||||
|
font-size: 60rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.page-content {
|
.page-content {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
<cu-custom class="main-topbar bg-main-oil" bgColor="bg-main-oil" :isBack="true">
|
<cu-custom class="main-topbar bg-main-oil" bgColor="bg-main-oil" :isBack="true">
|
||||||
<block slot="content">星油云站</block>
|
<block slot="content">星油云站</block>
|
||||||
</cu-custom>
|
</cu-custom>
|
||||||
<view class="bg-img margin flex padding-lg radius align-center text-center" :style="'background-image: url('+mainURL+'login-bg.png)'">
|
<view class="bg-img margin flex padding-lg radius align-center text-center"
|
||||||
|
:style="'background-image: url('+mainURL+'login-bg.png)'">
|
||||||
<view class="padding-lg margin text-center text-lg text-white w100">
|
<view class="padding-lg margin text-center text-lg text-white w100">
|
||||||
<text class>油站工作人员绑定油站</text>
|
<text class>油站工作人员绑定油站</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -42,7 +43,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="bottom-part">
|
<view class="bottom-part">
|
||||||
<service-hotline />
|
<service-hotline ref="serviceHotline" :checked='checked' @onCheck="checkAgree" />
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-modal" :class="modalName">
|
<view class="cu-modal" :class="modalName">
|
||||||
<view class="cu-dialog">
|
<view class="cu-dialog">
|
||||||
@@ -64,31 +65,36 @@
|
|||||||
<official-account @binderror="bindload" @bindload="binderror"></official-account>
|
<official-account @binderror="bindload" @bindload="binderror"></official-account>
|
||||||
<view class="text-center" @longpress="navToQr" @tap="toQr">
|
<view class="text-center" @longpress="navToQr" @tap="toQr">
|
||||||
<view class=" img-view">
|
<view class=" img-view">
|
||||||
<image height="200" src="https://xingka51.oss-cn-hangzhou.aliyuncs.com/applets/cloudSite/yunzhan.jpg" mode="widthFix"></image>
|
<image height="200"
|
||||||
|
src="https://xingka51.oss-cn-hangzhou.aliyuncs.com/applets/cloudSite/yunzhan.jpg"
|
||||||
|
mode="widthFix"></image>
|
||||||
星油云站公众号
|
星油云站公众号
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-center padding-top padding-bottom">
|
<view class="text-center padding-top padding-bottom">
|
||||||
<button class="cu-btn bg-red light round" open-type='contact' @tap="hideModal">未解决,联系在线客服</button>
|
<button class="cu-btn bg-red light round" open-type='contact'
|
||||||
|
@tap="hideModal">未解决,联系在线客服</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-modal" :class="checkList">
|
<view class="cu-modal" :class="checkList">
|
||||||
<view class="cu-dialog">
|
<view class="cu-dialog">
|
||||||
<view class="cu-bar bg-red justify-end">
|
<view class="cu-bar bg-red justify-end">
|
||||||
<view class="content " >
|
<view class="content ">
|
||||||
{{ titleText }}
|
{{ titleText }}
|
||||||
</view>
|
</view>
|
||||||
<view class="action" @tap="hidecheckList">
|
<view class="action" @tap="hidecheckList">
|
||||||
<text class="cuIcon-close text-white"></text>
|
<text class="cuIcon-close text-white"></text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-left padding-xl padding-bottom padding-top bg-white">
|
<view class="text-left padding-xl padding-bottom padding-top bg-white">
|
||||||
<view class="flex align-center justify-between margin-bottom-sm " v-for="(list,i) in oliList" :key='list' v-if="checkUser">
|
<view class="flex align-center justify-between margin-bottom-sm " v-for="(list,i) in oliList"
|
||||||
|
:key='list' v-if="checkUser">
|
||||||
<view class=""> {{list.otherSiteName}}</view>
|
<view class=""> {{list.otherSiteName}}</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
<view class=" bg-red cu-btn text-white text-center btn-radius-10 text-sm" @tap="checkLists(list.channelId)">
|
<view class=" bg-red cu-btn text-white text-center btn-radius-10 text-sm"
|
||||||
|
@tap="checkLists(list.channelId)">
|
||||||
进入
|
进入
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -101,6 +107,23 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<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.serviceHotline.toAgree('xoilCloudUserAgree')">《用户协议》</text> 与 <text
|
||||||
|
style=" color: black; font-weight: 600;"
|
||||||
|
@click="$refs.serviceHotline.toAgree('xoilCloudPrivacyAgreement')">《隐私政策》</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>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -114,11 +137,11 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
titleText:"",
|
titleText: "",
|
||||||
errMsg:'',
|
errMsg: '',
|
||||||
checkUser:false,
|
checkUser: false,
|
||||||
checkType:0,
|
checkType: 0,
|
||||||
checkList:'',
|
checkList: '',
|
||||||
modalName: '',
|
modalName: '',
|
||||||
baseURL: this.global.baseURL,
|
baseURL: this.global.baseURL,
|
||||||
mainURL: this.global.mainURL,
|
mainURL: this.global.mainURL,
|
||||||
@@ -128,49 +151,51 @@
|
|||||||
auth: {},
|
auth: {},
|
||||||
tips: '发送验证码',
|
tips: '发送验证码',
|
||||||
frozen: false, // 二维码冷却时间
|
frozen: false, // 二维码冷却时间
|
||||||
oliList:[
|
oliList: [{
|
||||||
{
|
|
||||||
|
}],
|
||||||
}
|
checked: false
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
uni.showShareMenu()
|
uni.showShareMenu()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
bulrInput(){
|
checkAgree(val) {
|
||||||
if(!this.auth.phone ){
|
this.checked = val
|
||||||
|
},
|
||||||
|
bulrInput() {
|
||||||
|
if (!this.auth.phone) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title:'请输入手机号',
|
title: '请输入手机号',
|
||||||
icon:'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
console.log('-------------')
|
console.log('-------------')
|
||||||
return
|
return
|
||||||
}else{
|
} else {
|
||||||
console.log(this.auth.phone)
|
console.log(this.auth.phone)
|
||||||
console.log('+++++++++++++')
|
console.log('+++++++++++++')
|
||||||
oliUserApi.getByPhone(this.auth.phone).then((res)=>{
|
oliUserApi.getByPhone(this.auth.phone).then((res) => {
|
||||||
if(res.code == 20000){
|
if (res.code == 20000) {
|
||||||
uni.setStorageSync('oliList',res.data)
|
uni.setStorageSync('oliList', res.data)
|
||||||
this.oliList = res.data
|
this.oliList = res.data
|
||||||
this.checkUser = true
|
this.checkUser = true
|
||||||
// this.checkList = 'show'
|
// this.checkList = 'show'
|
||||||
this.titleText = '油站时间'
|
this.titleText = '油站时间'
|
||||||
}else{
|
} else {
|
||||||
let _that= this
|
let _that = this
|
||||||
_that.auth.phone = ''
|
_that.auth.phone = ''
|
||||||
//console.log(this.auth.phone)
|
//console.log(this.auth.phone)
|
||||||
this.errMsg =res.msg
|
this.errMsg = res.msg
|
||||||
this.checkUser = false
|
this.checkUser = false
|
||||||
this.checkList = 'show'
|
this.checkList = 'show'
|
||||||
this.titleText = '提示'
|
this.titleText = '提示'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//console.log('input失焦')
|
//console.log('input失焦')
|
||||||
},
|
},
|
||||||
checkLists(id){
|
checkLists(id) {
|
||||||
uni.setStorage({
|
uni.setStorage({
|
||||||
key: 'channelId',
|
key: 'channelId',
|
||||||
data: id,
|
data: id,
|
||||||
@@ -178,40 +203,41 @@
|
|||||||
//console.log('channelId成功', id)
|
//console.log('channelId成功', id)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if(this.checkType == 0 ){
|
if (this.checkType == 0) {
|
||||||
|
|
||||||
}else{
|
} else {
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
checkOli(n){
|
|
||||||
// if(!this.checkUser){
|
|
||||||
// this.checkList = 'show'
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
this.checkType = n
|
|
||||||
if(n == 0 ){
|
|
||||||
this.loginRandom( )
|
|
||||||
//console.log('这里是验证码登录')
|
|
||||||
}else{
|
|
||||||
if(!this.auth.phone){
|
|
||||||
uni.showToast({
|
|
||||||
title:'请输入手机号',
|
|
||||||
icon:"none"
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if(!this.auth.password){
|
|
||||||
uni.showToast({
|
|
||||||
title:'请输入密码',
|
|
||||||
icon:"none"
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.loginPwd( )
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
hidecheckList(){
|
checkOli(n) {
|
||||||
|
|
||||||
|
if (!this.checked) {
|
||||||
|
this.$refs.popup.open('center')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.checkType = n
|
||||||
|
if (n == 0) {
|
||||||
|
this.loginRandom()
|
||||||
|
//console.log('这里是验证码登录')
|
||||||
|
} else {
|
||||||
|
if (!this.auth.phone) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请输入手机号',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!this.auth.password) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请输入密码',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.loginPwd()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
hidecheckList() {
|
||||||
this.checkList = ''
|
this.checkList = ''
|
||||||
},
|
},
|
||||||
toQr() {
|
toQr() {
|
||||||
@@ -220,8 +246,8 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 根据用户手机查询油站
|
// 根据用户手机查询油站
|
||||||
getByPhone(){
|
getByPhone() {
|
||||||
|
|
||||||
},
|
},
|
||||||
navToQr() {
|
navToQr() {
|
||||||
uni.setClipboardData({
|
uni.setClipboardData({
|
||||||
@@ -246,155 +272,86 @@
|
|||||||
binderror() {
|
binderror() {
|
||||||
//console.log('组件夹杂失败')
|
//console.log('组件夹杂失败')
|
||||||
},
|
},
|
||||||
// loginWeixin() {
|
|
||||||
// uni.login({
|
|
||||||
// provider: 'weixin',
|
|
||||||
// success: loginRes => {
|
|
||||||
// const code = loginRes.code
|
|
||||||
// //console.log('启动页code', code)
|
|
||||||
// oilIdentityApi.loginPersonal(code).then(res => {
|
|
||||||
// //console.log(res)
|
|
||||||
// if (res.code === 20000) {
|
|
||||||
// uni.reLaunch({
|
|
||||||
// url: '/pages/index/index',
|
|
||||||
// fail: (err) => {
|
|
||||||
// //console.log(err)
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// uni.showToast({
|
|
||||||
// title: res.msg,
|
|
||||||
// icon: 'success',
|
|
||||||
// duration: 3000
|
|
||||||
// })
|
|
||||||
// uni.setStorage({
|
|
||||||
// key: 'Authorization',
|
|
||||||
// data: res.data.authTokenDTO.accessToken,
|
|
||||||
// success: () => {
|
|
||||||
// //console.log('Authorization成功', res.data.authTokenDTO.accessToken)
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// uni.setStorage({
|
|
||||||
// key: 'unionId',
|
|
||||||
// data: res.data.unionId,
|
|
||||||
// success: () => {
|
|
||||||
// //console.log('deviceunionId', res.data.unionId)
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// uni.setStorage({
|
|
||||||
// key: 'device',
|
|
||||||
// data: res.data.openid,
|
|
||||||
// success: () => {
|
|
||||||
// //console.log('deviceopenid', res.data.openid)
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// uni.setStorageSync('userMenu', res.data.authTokenDTO.loginUser.roleMenus)
|
|
||||||
// uni.setStorageSync('loginUser', {
|
|
||||||
// id: res.data.authTokenDTO.loginUser.id,
|
|
||||||
// name: res.data.authTokenDTO.loginUser.name,
|
|
||||||
// userPhone: res.data.authTokenDTO.loginUser.userPhone
|
|
||||||
// })
|
|
||||||
// } else {
|
|
||||||
// uni.reLaunch({
|
|
||||||
// url: '/pages/login/boforeLogin/boforeLogin',
|
|
||||||
// fail: (err) => {
|
|
||||||
// //console.log(err)
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// //console.log('res', res.code)
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
loginPwd(channelId) {
|
||||||
// }).catch(err => {
|
|
||||||
// uni.reLaunch({
|
|
||||||
// url: '/pages/login/boforeLogin/boforeLogin',
|
|
||||||
// fail: (err) => {
|
|
||||||
// //console.log(err)
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// })
|
|
||||||
// },
|
|
||||||
// fail: err => {
|
|
||||||
// //console.log(err)
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
loginPwd(channelId) {
|
|
||||||
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
|
||||||
oilIdentityApi.sendCode(code).then((res)=>{
|
oilIdentityApi.sendCode(code).then((res) => {
|
||||||
//console.log('这里是登录返回值')
|
//console.log('这里是登录返回值')
|
||||||
//console.log(res.data.unionId)
|
//console.log(res.data.unionId)
|
||||||
//console.log(res.data.openId)
|
//console.log(res.data.openId)
|
||||||
const data3 = {
|
const data3 = {
|
||||||
username: this.auth.phone,
|
username: this.auth.phone,
|
||||||
password: md5(this.auth.password),
|
password: md5(this.auth.password),
|
||||||
channelId:channelId,
|
channelId: channelId,
|
||||||
code: code,
|
code: code,
|
||||||
unionId:res.data.unionId,
|
unionId: res.data.unionId,
|
||||||
openId:res.data.openId
|
openId: res.data.openId
|
||||||
}
|
}
|
||||||
uni.setStorage({
|
uni.setStorage({
|
||||||
key: 'device',
|
key: 'device',
|
||||||
data: res.data.openId,
|
data: res.data.openId,
|
||||||
success: () => {
|
success: () => {
|
||||||
//console.log('deviceopenid', res.data.openId)
|
//console.log('deviceopenid', res.data.openId)
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
uni.setStorageSync('checkFirst', true)
|
||||||
|
uni.setStorage({
|
||||||
|
key: 'unionId',
|
||||||
|
data: res.data.unionId,
|
||||||
|
success: () => {
|
||||||
|
//console.log('deviceunionId', res.data.unionId)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
//console.log('这里是请求发送内容',data3)
|
||||||
|
oilIdentityApi.loginByPhonePwd(data3).then(res => {
|
||||||
|
//console.log('res', res)
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none'
|
||||||
})
|
})
|
||||||
uni.setStorageSync('checkFirst',true)
|
//console.log('oilSiteCode', this.oilSiteNo)
|
||||||
uni.setStorage({
|
if (res.code === 20000) {
|
||||||
key: 'unionId',
|
|
||||||
data: res.data.unionId,
|
uni.reLaunch({
|
||||||
success: () => {
|
url: '/pages/index/index',
|
||||||
//console.log('deviceunionId', res.data.unionId)
|
fail: (err) => {
|
||||||
}
|
//console.log(err)
|
||||||
})
|
}
|
||||||
//console.log('这里是请求发送内容',data3)
|
})
|
||||||
oilIdentityApi.loginByPhonePwd(data3).then(res => {
|
|
||||||
//console.log('res', res)
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: 'none'
|
icon: 'success',
|
||||||
|
duration: 3000
|
||||||
})
|
})
|
||||||
//console.log('oilSiteCode', this.oilSiteNo)
|
uni.setStorage({
|
||||||
if (res.code === 20000) {
|
key: 'Authorization',
|
||||||
|
data: res.data.authTokenDTO.accessToken,
|
||||||
uni.reLaunch({
|
success: () => {
|
||||||
url: '/pages/index/index',
|
//console.log('Authorization成功', res.data.authTokenDTO.accessToken)
|
||||||
fail: (err) => {
|
}
|
||||||
//console.log(err)
|
})
|
||||||
}
|
|
||||||
})
|
uni.setStorageSync('userMenu', res.data.authTokenDTO
|
||||||
uni.showToast({
|
.loginUser.roleMenus)
|
||||||
title: res.msg,
|
//console.log( '这里是获取userMenu处',res.data.authTokenDTO.loginUser.roleMenus)
|
||||||
icon: 'success',
|
uni.setStorageSync('loginUser', {
|
||||||
duration: 3000
|
id: res.data.authTokenDTO.loginUser.id,
|
||||||
})
|
name: res.data.authTokenDTO.loginUser.name,
|
||||||
uni.setStorage({
|
userPhone: res.data.authTokenDTO.loginUser
|
||||||
key: 'Authorization',
|
.userPhone
|
||||||
data: res.data.authTokenDTO.accessToken,
|
})
|
||||||
success: () => {
|
}
|
||||||
//console.log('Authorization成功', res.data.authTokenDTO.accessToken)
|
})
|
||||||
}
|
})
|
||||||
})
|
},
|
||||||
|
fail: err => {
|
||||||
uni.setStorageSync('userMenu', res.data.authTokenDTO.loginUser.roleMenus)
|
//console.log(err)
|
||||||
//console.log( '这里是获取userMenu处',res.data.authTokenDTO.loginUser.roleMenus)
|
}
|
||||||
uni.setStorageSync('loginUser', {
|
});
|
||||||
id: res.data.authTokenDTO.loginUser.id,
|
|
||||||
name: res.data.authTokenDTO.loginUser.name,
|
|
||||||
userPhone: res.data.authTokenDTO.loginUser.userPhone
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} )
|
|
||||||
},
|
|
||||||
fail: err => {
|
|
||||||
//console.log(err)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
loginWeixin() {
|
loginWeixin() {
|
||||||
uni.login({
|
uni.login({
|
||||||
@@ -402,61 +359,63 @@
|
|||||||
success: loginRes => {
|
success: loginRes => {
|
||||||
const code = loginRes.code
|
const code = loginRes.code
|
||||||
//console.log(code)
|
//console.log(code)
|
||||||
oilIdentityApi.sendCode(code).then((res)=>{
|
oilIdentityApi.sendCode(code).then((res) => {
|
||||||
|
|
||||||
oilIdentityApi.loginPersonal().then(res => {
|
oilIdentityApi.loginPersonal().then(res => {
|
||||||
if (res.code === 20000) {
|
if (res.code === 20000) {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/index/index',
|
url: '/pages/index/index',
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
//console.log(err)
|
//console.log(err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
duration: 3000
|
duration: 3000
|
||||||
})
|
})
|
||||||
uni.setStorage({
|
uni.setStorage({
|
||||||
key: 'Authorization',
|
key: 'Authorization',
|
||||||
data: res.data.authTokenDTO.accessToken,
|
data: res.data.authTokenDTO.accessToken,
|
||||||
success: () => {
|
success: () => {
|
||||||
//console.log('Authorization成功', res.data.authTokenDTO.accessToken)
|
//console.log('Authorization成功', res.data.authTokenDTO.accessToken)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
uni.setStorage({
|
uni.setStorage({
|
||||||
key: 'device',
|
key: 'device',
|
||||||
data: res.data.openid,
|
data: res.data.openid,
|
||||||
success: () => {
|
success: () => {
|
||||||
//console.log('deviceopenid', res.data.openid)
|
//console.log('deviceopenid', res.data.openid)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
uni.setStorageSync('userMenu', res.data.authTokenDTO.loginUser.roleMenus)
|
uni.setStorageSync('userMenu', res.data.authTokenDTO
|
||||||
uni.setStorageSync('loginUser', {
|
.loginUser.roleMenus)
|
||||||
id: res.data.authTokenDTO.loginUser.id,
|
uni.setStorageSync('loginUser', {
|
||||||
name: res.data.authTokenDTO.loginUser.name,
|
id: res.data.authTokenDTO.loginUser.id,
|
||||||
userPhone: res.data.authTokenDTO.loginUser.userPhone
|
name: res.data.authTokenDTO.loginUser.name,
|
||||||
})
|
userPhone: res.data.authTokenDTO.loginUser
|
||||||
uni.setStorage({
|
.userPhone
|
||||||
key: 'unionId',
|
})
|
||||||
data: res.data.unionId,
|
uni.setStorage({
|
||||||
success: () => {
|
key: 'unionId',
|
||||||
//console.log('deviceunionId', res.data.unionId)
|
data: res.data.unionId,
|
||||||
}
|
success: () => {
|
||||||
})
|
//console.log('deviceunionId', res.data.unionId)
|
||||||
} else {
|
}
|
||||||
//console.log('res', res.code)
|
})
|
||||||
uni.showToast({
|
} else {
|
||||||
title: '未绑定微信',
|
//console.log('res', res.code)
|
||||||
icon: 'none',
|
uni.showToast({
|
||||||
duration: 1500
|
title: '未绑定微信',
|
||||||
})
|
icon: 'none',
|
||||||
}
|
duration: 1500
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
|
||||||
|
|
||||||
},
|
},
|
||||||
fail: err => {
|
fail: err => {
|
||||||
//console.log(err)
|
//console.log(err)
|
||||||
@@ -464,7 +423,7 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
sendMsg() {
|
sendMsg() {
|
||||||
if(!this.checkUser){
|
if (!this.checkUser) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!this.frozen) {
|
if (!this.frozen) {
|
||||||
@@ -473,7 +432,6 @@
|
|||||||
username: this.auth.phone
|
username: this.auth.phone
|
||||||
}
|
}
|
||||||
oilIdentityApi.getVerifyCode(data2).then(res => {
|
oilIdentityApi.getVerifyCode(data2).then(res => {
|
||||||
//console.log('res', res)
|
|
||||||
this.auth.verifyCodeToken = res.data.verifyCodeToken
|
this.auth.verifyCodeToken = res.data.verifyCodeToken
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
@@ -497,11 +455,8 @@
|
|||||||
this.btnColor = '#FE0505'
|
this.btnColor = '#FE0505'
|
||||||
}
|
}
|
||||||
}, 1000)
|
}, 1000)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请输入您的账号',
|
title: '请输入您的账号',
|
||||||
@@ -524,18 +479,16 @@
|
|||||||
// code: code //类型:String 必有字段 备注:微信code
|
// code: code //类型:String 必有字段 备注:微信code
|
||||||
// }
|
// }
|
||||||
// sendCode 在传值时在接口文件里添加了一个appid与code一起传到后台
|
// sendCode 在传值时在接口文件里添加了一个appid与code一起传到后台
|
||||||
oilIdentityApi.sendCode(code).then((res)=>{
|
oilIdentityApi.sendCode(code).then((res) => {
|
||||||
const userData ={
|
const userData = {
|
||||||
username: this.auth.phone, //类型:String 必有字段 备注:手机号
|
username: this.auth.phone, //类型:String 必有字段 备注:手机号
|
||||||
verifyCode: this.auth.captcha, //类型:String 必有字段 备注:验证码
|
verifyCode: this.auth.captcha, //类型:String 必有字段 备注:验证码
|
||||||
// code: code //类型:String 必有字段 备注:微信code
|
// code: code //类型:String 必有字段 备注:微信code
|
||||||
unionId:res.data.unionId, //根据code接收后台返回的值
|
unionId: res.data.unionId, //根据code接收后台返回的值
|
||||||
channelId:channelId, //所选油站channelId
|
channelId: channelId, //所选油站channelId
|
||||||
verifyCodeToken: this.auth.verifyCodeToken ,//验证码
|
verifyCodeToken: this.auth.verifyCodeToken, //验证码
|
||||||
openId:res.data.openId
|
openId: res.data.openId
|
||||||
}
|
}
|
||||||
//console.log('device')
|
|
||||||
//console.log(res.data.openId)
|
|
||||||
uni.setStorage({
|
uni.setStorage({
|
||||||
key: 'unionId',
|
key: 'unionId',
|
||||||
data: res.data.unionId,
|
data: res.data.unionId,
|
||||||
@@ -550,16 +503,12 @@
|
|||||||
//console.log('deviceopenid', res.data.openId)
|
//console.log('deviceopenid', res.data.openId)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
uni.setStorageSync('checkFirst',true)
|
uni.setStorageSync('checkFirst', true)
|
||||||
oilIdentityApi.verifyCodeLogin(userData).then(res => {
|
oilIdentityApi.verifyCodeLogin(userData).then(res => {
|
||||||
//console.log('res', res)
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
//console.log('Authorization')
|
|
||||||
//console.log(res.data.authTokenDTO.loginUser.accessToken)
|
|
||||||
//console.log('oilSiteCode', this.oilSiteNo)
|
|
||||||
if (res.code === 20000) {
|
if (res.code === 20000) {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/index/index',
|
url: '/pages/index/index',
|
||||||
@@ -579,18 +528,19 @@
|
|||||||
//console.log('Authorization成功', res.data.authTokenDTO.accessToken)
|
//console.log('Authorization成功', res.data.authTokenDTO.accessToken)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
uni.setStorageSync('userMenu', res.data.authTokenDTO
|
||||||
uni.setStorageSync('userMenu', res.data.authTokenDTO.loginUser.roleMenus)
|
.loginUser.roleMenus)
|
||||||
uni.setStorageSync('loginUser', {
|
uni.setStorageSync('loginUser', {
|
||||||
id: res.data.authTokenDTO.loginUser.id,
|
id: res.data.authTokenDTO.loginUser.id,
|
||||||
name: res.data.authTokenDTO.loginUser.name,
|
name: res.data.authTokenDTO.loginUser.name,
|
||||||
userPhone: res.data.authTokenDTO.loginUser.userPhone
|
userPhone: res.data.authTokenDTO.loginUser
|
||||||
|
.userPhone
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
fail: err => {
|
fail: err => {
|
||||||
//console.log(err)
|
//console.log(err)
|
||||||
@@ -653,12 +603,63 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.textshowCheck{
|
.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: #FD0505;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
.textshowCheck {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-content {
|
.page-content {
|
||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
@@ -688,7 +689,8 @@
|
|||||||
width: 200upx;
|
width: 200upx;
|
||||||
height: 200rpx;
|
height: 200rpx;
|
||||||
}
|
}
|
||||||
.btn-radius-10{
|
|
||||||
|
.btn-radius-10 {
|
||||||
border-radius: 20upx;
|
border-radius: 20upx;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user