更新
This commit is contained in:
68
App.vue
68
App.vue
@@ -85,29 +85,32 @@
|
||||
const pages = getCurrentPages() //获取加载的页面
|
||||
const view = pages[pages.length - 1] //获取当前页面的对象
|
||||
if (!view) return false //如果不存在页面对象 则返回
|
||||
// 若想给个别页面做特殊处理 可以给特殊页面加isOverShare为true 就不会重写了
|
||||
// const data = view.data
|
||||
// if (!data.isOverShare) {
|
||||
// data.isOverShare = true
|
||||
view.onShareAppMessage = () => { //重写分享配置
|
||||
return {
|
||||
title: '一路油你,星油能源',
|
||||
path: "/pages/index/startPage/startPage", //若无path 默认跳转分享页
|
||||
// imageUrl:'/image/onshowMessage.png' //若无imageUrl 截图当前页面
|
||||
path: "/pages/index/startPage/startPage",
|
||||
imageUrl: 'https://xoi-support.oss-cn-hangzhou.aliyuncs.com/星油admin小程序/xxxxx.png',
|
||||
}
|
||||
}
|
||||
if (view.route != 'pages/index/startPage/startPage' && view.route.indexOf('BagAuth') == -1) {
|
||||
const token = uni.getStorageSync('Authorization')
|
||||
const openid = uni.getStorageSync('openid')
|
||||
if (token && openid) {
|
||||
|
||||
let white = ['pages/index/startPage/startPage']
|
||||
if(view.route === 'BagStation/pages/stationDetail/stationDetail') {
|
||||
uni.removeStorageSync('refuseLogin')
|
||||
}
|
||||
// // 是否跳过登陆
|
||||
let isRefuseLogin = uni.getStorageSync('refuseLogin')
|
||||
if(isRefuseLogin || white.includes(view.route) || view.route.includes('BagAuth')) return
|
||||
this.getAmount()
|
||||
onlineTimer = setTimeout(() => {
|
||||
if (this.loginStatus == 'offline') {
|
||||
uni.clearStorageSync()
|
||||
})
|
||||
},
|
||||
// 是否token过期或ip更改
|
||||
getAmount() {
|
||||
// clearTimeout(loginTimer)
|
||||
accountApi.getTotalOilCardInfo().then(res => {
|
||||
if (res.code == 42011) {
|
||||
uni.showModal({
|
||||
title: '需要您重新登录',
|
||||
content: this.msg,
|
||||
content: res.msg,
|
||||
duration: '3000',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
@@ -115,46 +118,9 @@
|
||||
url: '/BagAuth/pages/login/login'
|
||||
})
|
||||
}
|
||||
},
|
||||
complete: () => {
|
||||
clearTimeout(onlineTimer)
|
||||
}
|
||||
})
|
||||
}
|
||||
}, 1000)
|
||||
|
||||
} else {
|
||||
// loginTimer = setTimeout(() => {
|
||||
// uni.showModal({
|
||||
// title: '请您登录',
|
||||
// content: '您还没有登录,暂时查不到油站哦',
|
||||
// duration: '3000',
|
||||
// success: function(res) {
|
||||
// if (res.confirm) {
|
||||
// uni.redirectTo({
|
||||
// url: '/BagAuth/pages/login/login'
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// }, 1000)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// }
|
||||
})
|
||||
},
|
||||
// 是否token过期或ip更改
|
||||
getAmount() {
|
||||
clearTimeout(loginTimer)
|
||||
accountApi.getTotalOilCardInfo().then(res => {
|
||||
if (res.code == 20000) {
|
||||
this.loginStatus = 'online'
|
||||
} else if (res.code == 42011) {
|
||||
this.loginStatus = 'offline'
|
||||
this.msg = res.msg
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
@@ -207,6 +207,7 @@
|
||||
})
|
||||
},
|
||||
refuseLogin(){
|
||||
uni.setStorageSync('refuseLogin',true)
|
||||
uni.switchTab({
|
||||
url: '/pages/tabbar/home/home'
|
||||
})
|
||||
|
||||
@@ -483,18 +483,19 @@
|
||||
oilSite = uni.getStorageSync(''),
|
||||
otherUser = uni.getStorageSync('otherUserInfo')
|
||||
if(otherUser){
|
||||
console.log('这里是卡里')
|
||||
// console.log('这里是卡里')
|
||||
this.isOtherUser = true
|
||||
}else{
|
||||
console.log('这里是非卡力')
|
||||
// console.log('这里是非卡力')
|
||||
}
|
||||
console.log('oilItem',oilItem)
|
||||
this.showtitles = oilItem.listTag;
|
||||
this.init()
|
||||
},
|
||||
watch: {
|
||||
activeChannelCode: {
|
||||
handler(newval) {
|
||||
console.log('activeChannelCode')
|
||||
// console.log('activeChannelCode')
|
||||
this.oilBar = ''
|
||||
setTimeout(async() => {
|
||||
this.checkBar = (this.typeChenk())? await this.dynamic() : this.calcBar()
|
||||
@@ -503,7 +504,7 @@
|
||||
},
|
||||
priceId: {
|
||||
handler(newval) {
|
||||
console.log('priceId')
|
||||
// console.log('priceId')
|
||||
this.oilBar = ''
|
||||
setTimeout(async() => {
|
||||
this.checkBar = (this.typeChenk())? await this.dynamic() : this.calcBar()
|
||||
@@ -540,12 +541,12 @@
|
||||
totalMoney() {
|
||||
// // console.log('this.oilSitePriceDetailsVo[this.radio]', this.oilSitePriceDetailsVo[this.radio])
|
||||
if (this.vol > 0 && this.oilSitePriceDetailsVo[this.radio]) {
|
||||
console.log('+++++++++++')
|
||||
console.log(this.vol)
|
||||
console.log(this.oilSitePriceDetailsVo[this.radio])
|
||||
console.log('+++++++++++')
|
||||
// console.log('+++++++++++')
|
||||
// console.log(this.vol)
|
||||
// console.log(this.oilSitePriceDetailsVo[this.radio])
|
||||
// console.log('+++++++++++')
|
||||
let numb = this.vol * this.oilSitePriceDetailsVo[this.radio].oilSitePrice
|
||||
console.log('++++++',numb)
|
||||
// console.log('++++++',numb)
|
||||
return this.vol * this.oilSitePriceDetailsVo[this.radio].oilSitePrice
|
||||
}
|
||||
},
|
||||
|
||||
@@ -184,11 +184,11 @@
|
||||
priceTab
|
||||
},
|
||||
onHide() {
|
||||
console.log('这里是hiden')
|
||||
// console.log('这里是hiden')
|
||||
this.innerAudioContext.stop()
|
||||
},
|
||||
onUnload() {
|
||||
console.log('这里是卸载页面')
|
||||
// console.log('这里是卸载页面')
|
||||
this.innerAudioContext.stop()
|
||||
},
|
||||
data() {
|
||||
@@ -217,14 +217,19 @@
|
||||
this.innerAudioContext.stop()
|
||||
},
|
||||
onLoad(option) {
|
||||
console.log(option)
|
||||
if(option.siteId) {
|
||||
this.siteId = option.siteId
|
||||
this.getSiteInfo(option.siteId)
|
||||
return
|
||||
}
|
||||
// console.log(option)
|
||||
if(option.channerCode == 'TY'){
|
||||
var oilItem = uni.getStorageSync('OtherSiteInfo')
|
||||
console.log(oilItem)
|
||||
// console.log(oilItem)
|
||||
}else{
|
||||
let obj = option.item,
|
||||
jss= JSON.parse(obj)
|
||||
console.log( '+++++++++',obj,jss,'----------')
|
||||
// console.log( '+++++++++',obj,jss,'----------')
|
||||
var oilItem = JSON.parse(option.item)
|
||||
}
|
||||
uni.setStorageSync('oilItem',oilItem)
|
||||
@@ -270,8 +275,7 @@
|
||||
console.log('开始播放');
|
||||
});
|
||||
this.innerAudioContext.onError((res) => {
|
||||
console.log(res.errMsg);
|
||||
console.log(res.errCode);
|
||||
console.log(res)
|
||||
});
|
||||
},
|
||||
hidendialog(){
|
||||
|
||||
@@ -12,7 +12,7 @@ const productUrl = 'http://uat.xingoil.com/adminapi'
|
||||
// const productUrl = 'http://192.168.0.191:38080'
|
||||
// const productUrl = 'http://121.196.213.68/adminapi'
|
||||
const service = axios.create({
|
||||
baseURL: env == 'production' ? productUrl : testUrl,,
|
||||
baseURL: env == 'production' ? productUrl : testUrl,
|
||||
// baseURL: testUrl,
|
||||
timeout: 5000
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user