master
xiaozhiyong 4 months ago
parent ff2e39e15b
commit 6f434e41bb
  1. 8
      api/oil-finance.js
  2. 49
      pages/tabbar/home/home.vue

@ -17,6 +17,14 @@ export default {
method: 'GET',
})
},
// 返回当前油卡信息
getInfoByParam(params) {
return request({
url: '/oil-finance/oilCustomerCompanyAccount/getInfoByParam',
method: 'POST',
data:params
})
},
//确认切换油卡
chooseCompanyCard(data) {
return request({

@ -170,6 +170,7 @@
import msgModels from '../../components/showModels.vue'
import accountApi from '@/api/account.js'
import Financial from '@/api/Financial.js'
import financeServe from '@/api/oil-finance.js'
import threeSites from '@/components/three-sites.vue'
import oilSiteApi from '@/api/oil-site.js'
import siteItem from '@/components/site-item/site-item.vue'
@ -333,8 +334,8 @@
},
onReady() {
let _that = this
let IsOtherUser = _that.isOther
if (IsOtherUser) {
@ -366,7 +367,7 @@
},
onLoad(e) {
// uni.hideTabBar()
let _that = this
let IsOtherUser = _that.isOther
@ -410,6 +411,7 @@
const openid = uni.getStorageSync('openid')
if (token && openid) {
this.getAuthInfo()
this.refreshLocation()
} else {
uni.showToast({
@ -425,6 +427,42 @@
},
methods: {
logOut() {
accountApi.logout('authSystem').then(res => {
if (res.code == '20000') {
uni.showToast({
title: '该油卡已被禁用',
icon:'none'
})
uni.clearStorageSync()
uni.setStorageSync('loginOut', true)
setTimeout(() => {
uni.reLaunch({
url: '/BagAuth/pages/login/login'
})
}, 2000)
}
})
},
getInfoByParam() {
let storage = uni.getStorageSync('companyCard')
if (storage) {
let cardInfo = JSON.parse(storage)
// console.log('cardInfo',cardInfo)
financeServe.getInfoByParam({
companyId: cardInfo.companyId,
customerId: cardInfo.customerId
}).then(res => {
if (res.code === 20000) {
if(res.data.accountState == 0) {
this.logOut()
}
}
})
}
},
swiperClick(item, index) {
if (item?.JumpPage) {
switch (item.JumpPage) {
@ -519,7 +557,8 @@
}
this.getAmount()
this.getSiteList()
// realStatus: 0 vehicleStatus: 0
this.getInfoByParam()
if (this.showAuthFrzen <= new Date().getTime()) {
this.showAuthFrror = res.data.realStatus && res.data.vehicleStatus ? false :
true
@ -1040,4 +1079,4 @@
.my-icon-sm .text-sm {
line-height: 1rem;
}
</style>
</style>
Loading…
Cancel
Save