Compare commits
1 Commits
2796a734f6
...
xiaozy_星油统
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a2a1d79c9 |
@@ -450,6 +450,7 @@
|
|||||||
this.changeChannel.username = this.loginUser.userPhone
|
this.changeChannel.username = this.loginUser.userPhone
|
||||||
uni.setStorageSync('channelId', items.channelId)
|
uni.setStorageSync('channelId', items.channelId)
|
||||||
oilIdentityApi.changeChannelLogin(this.changeChannel).then((res) => {
|
oilIdentityApi.changeChannelLogin(this.changeChannel).then((res) => {
|
||||||
|
|
||||||
if (res.code == 20000) {
|
if (res.code == 20000) {
|
||||||
uni.setStorageSync('siteOli', items.otherSiteName)
|
uni.setStorageSync('siteOli', items.otherSiteName)
|
||||||
this.accountName = items.otherSiteName
|
this.accountName = items.otherSiteName
|
||||||
@@ -462,7 +463,9 @@
|
|||||||
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,
|
||||||
|
channelCode: items.channelCode,
|
||||||
|
secondChannelCode: items.secondChannelCode
|
||||||
})
|
})
|
||||||
this.getSiteInfo(res.data.authTokenDTO.loginUser.channelId)
|
this.getSiteInfo(res.data.authTokenDTO.loginUser.channelId)
|
||||||
this.getUserInfo(id)
|
this.getUserInfo(id)
|
||||||
|
|||||||
@@ -199,9 +199,9 @@
|
|||||||
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)
|
||||||
}
|
}
|
||||||
@@ -227,21 +227,21 @@
|
|||||||
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: openId,
|
data: openId,
|
||||||
success: () => {
|
success: () => {
|
||||||
console.log('deviceopenid', openId)
|
// console.log('deviceopenid', openId)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
uni.setStorage({
|
uni.setStorage({
|
||||||
key: 'unionId',
|
key: 'unionId',
|
||||||
data: unionId,
|
data: unionId,
|
||||||
success: () => {
|
success: () => {
|
||||||
console.log('deviceunionId', unionId)
|
// console.log('deviceunionId', unionId)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
uni.setStorageSync('userMenu', res.data.authTokenDTO.loginUser.roleMenus) //获取权限菜单列表
|
uni.setStorageSync('userMenu', res.data.authTokenDTO.loginUser.roleMenus) //获取权限菜单列表
|
||||||
@@ -251,9 +251,9 @@
|
|||||||
userPhone: res.data.authTokenDTO.loginUser.userPhone
|
userPhone: res.data.authTokenDTO.loginUser.userPhone
|
||||||
})
|
})
|
||||||
//根据获取手机号 获取其号下的油站信息
|
//根据获取手机号 获取其号下的油站信息
|
||||||
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) //本地存储当前用户其下有多少油站,用于用户登录进入时选择进入油站
|
||||||
// 获取信息存储本地
|
// 获取信息存储本地
|
||||||
@@ -266,7 +266,7 @@
|
|||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/index/index',
|
url: '/pages/index/index',
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
console.log(err)
|
// console.log(err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@@ -342,8 +342,8 @@
|
|||||||
getUserInfo({
|
getUserInfo({
|
||||||
detail
|
detail
|
||||||
}) {
|
}) {
|
||||||
console.log('三方登录只演示登录api能力,暂未关联云端数据');
|
// console.log('三方登录只演示登录api能力,暂未关联云端数据');
|
||||||
console.log('detail', detail)
|
// console.log('detail', detail)
|
||||||
if (detail.userInfo) {
|
if (detail.userInfo) {
|
||||||
this.loginLocal(detail.userInfo.nickName);
|
this.loginLocal(detail.userInfo.nickName);
|
||||||
} else {
|
} else {
|
||||||
@@ -369,10 +369,10 @@
|
|||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/index/index',
|
url: '/pages/index/index',
|
||||||
success: () => {
|
success: () => {
|
||||||
console.log('success')
|
// console.log('success')
|
||||||
},
|
},
|
||||||
fail: err => {
|
fail: err => {
|
||||||
console.log(err)
|
// console.log(err)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -210,23 +210,22 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
checkOli(n) {
|
checkOli(n) {
|
||||||
|
if (!this.auth.phone) {
|
||||||
if (!this.checked) {
|
uni.showToast({
|
||||||
this.$refs.popup.open('center')
|
title: '请输入手机号',
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
this.checkType = n
|
this.checkType = n
|
||||||
if (n == 0) {
|
if (n == 0) {
|
||||||
this.loginRandom()
|
if (!this.checked) {
|
||||||
//console.log('这里是验证码登录')
|
this.$refs.popup.open('center')
|
||||||
} else {
|
|
||||||
if (!this.auth.phone) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请输入手机号',
|
|
||||||
icon: "none"
|
|
||||||
})
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
this.loginRandom()
|
||||||
|
} else {
|
||||||
if (!this.auth.password) {
|
if (!this.auth.password) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请输入密码',
|
title: '请输入密码',
|
||||||
@@ -234,6 +233,10 @@
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (!this.checked) {
|
||||||
|
this.$refs.popup.open('center')
|
||||||
|
return
|
||||||
|
}
|
||||||
this.loginPwd()
|
this.loginPwd()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -105,59 +105,65 @@
|
|||||||
scanType: 'qrCode',
|
scanType: 'qrCode',
|
||||||
onlyFromCamera: false,
|
onlyFromCamera: false,
|
||||||
success: (resResult) => {
|
success: (resResult) => {
|
||||||
console.log('%c 扫码结果↓','color:red;font-size:30px')
|
|
||||||
console.log(resResult)
|
|
||||||
// innerAudioContext.play()
|
|
||||||
console.log('play滴~')
|
|
||||||
let res = resResult.result
|
let res = resResult.result
|
||||||
console.log(res)
|
let loginUser = uni.getStorageSync('loginUser')
|
||||||
|
if (res.substring(0, 6) == 'XOILUC' && (loginUser.channelCode !== 'XOIL' || loginUser
|
||||||
|
.secondChannelCode)) {
|
||||||
|
uni.showModal({
|
||||||
|
content: '该油站不支持付款码支付',
|
||||||
|
showCancel:false,
|
||||||
|
complete:res => {
|
||||||
|
if(res.confirm) {
|
||||||
|
uni.navigateBack()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
uni.setStorageSync('qrCode', res)
|
uni.setStorageSync('qrCode', res)
|
||||||
this.once = true
|
this.once = true
|
||||||
let url = ''
|
let url = ''
|
||||||
// console.log('这里是顺丰测试',res.substring(0,7))
|
// console.log('这里是顺丰测试',res.substring(0,7))
|
||||||
const tag = res.substring(0, 2);
|
const tag = res.substring(0, 2);
|
||||||
// 老星油 XM , HT G7 , 则一 ZEYI , 新星油 XOIL new则一 XINGYOU
|
// 老星油 XM , HT G7 , 则一 ZEYI , 新星油 XOIL new则一 XINGYOU
|
||||||
if (res.indexOf('fykc') != -1 ){
|
if (res.indexOf('fykc') != -1) {
|
||||||
url = '/pages/stationDetail/ZYSite?type=fykc'
|
url = '/pages/stationDetail/ZYSite?type=fykc'
|
||||||
console.log('这里是测试福佑' ,res.substring(0,7))
|
// console.log('这里是测试福佑', res.substring(0, 7))
|
||||||
}else if (tag == "SP") {
|
} else if (tag == "SP") {
|
||||||
url = '/pages/stationDetail/ZYSite?type=G7'
|
url = '/pages/stationDetail/ZYSite?type=G7'
|
||||||
} else if (tag == "XM" || tag == "HT" || tag == "G7") {
|
} else if (tag == "XM" || tag == "HT" || tag == "G7") {
|
||||||
url = '/pages/stationDetail/stationDetail?type=G7'
|
url = '/pages/stationDetail/stationDetail?type=G7'
|
||||||
} else if (res.indexOf('ZEYI') != -1 ){
|
} else if (res.indexOf('ZEYI') != -1) {
|
||||||
console.log('这里是测试则一sss' ,res.substring(0,7))
|
// console.log('这里是测试则一sss', res.substring(0, 7))
|
||||||
url = '/pages/stationDetail/ZYSite?type=ZEYI'
|
url = '/pages/stationDetail/ZYSite?type=ZEYI'
|
||||||
} else if (res.substring(0, 4) == 'XING' || res.substring(0, 4) == 'XOIL' ) {
|
} else if (res.substring(0, 4) == 'XING' || res.substring(0, 4) == 'XOIL' || res.substring(
|
||||||
console.log('这里是测试XING' ,res.substring(0,7))
|
0, 6) == 'XOILUC') {
|
||||||
url = '/pages/stationDetail/ZYSite?type=xoli'
|
|
||||||
} else if (res.substring(0,8) == 'SHUNFENG') {
|
// console.log('这里是测试XING', res.substring(0, 7))
|
||||||
console.log('这里是顺丰')
|
url = '/pages/stationDetail/ZYSite?type=xoli'
|
||||||
|
} else if (res.substring(0, 8) == 'SHUNFENG') {
|
||||||
|
// console.log('这里是顺丰')
|
||||||
url = '/pages/stationDetail/ZYSite?type=shunfeng'
|
url = '/pages/stationDetail/ZYSite?type=shunfeng'
|
||||||
} else if (res.substring(0, 4) == 'RIRI'){
|
} else if (res.substring(0, 4) == 'RIRI') {
|
||||||
url = '/pages/stationDetail/ZYSite?type=RIRISHUN'
|
url = '/pages/stationDetail/ZYSite?type=RIRISHUN'
|
||||||
} else if (res.indexOf('OP') != -1 ){
|
} else if (res.indexOf('OP') != -1) {
|
||||||
url = '/pages/stationDetail/openStationDetail'
|
url = '/pages/stationDetail/openStationDetail'
|
||||||
}else{
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '未知二维码',
|
title: '未知二维码',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateBack({
|
uni.navigateBack({})
|
||||||
})
|
|
||||||
}, 800)
|
}, 800)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
console.log(tag)
|
// return
|
||||||
|
// console.log(tag)
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
// url: `/pages/stationDetail/stationDetail`,
|
// url: `/pages/stationDetail/stationDetail`,
|
||||||
url: url,
|
url: url
|
||||||
fail: (err) => {
|
|
||||||
// console.log(err)
|
|
||||||
},
|
|
||||||
success: (res) => {
|
|
||||||
// console.log('chengg', res)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user