KongDuo
xiaozhiyong 2 years ago
parent a8249b5de8
commit 4eaf549bbe
  1. 80
      App.vue
  2. 1
      BagAuth/pages/login/login.vue
  3. 19
      BagStation/pages/components/price-select-tab.vue
  4. 20
      BagStation/pages/stationDetail/stationDetail.vue
  5. 2
      utils/request.js

@ -85,75 +85,41 @@
const pages = getCurrentPages() // const pages = getCurrentPages() //
const view = pages[pages.length - 1] // const view = pages[pages.length - 1] //
if (!view) return false // if (!view) return false //
// isOverSharetrue
// const data = view.data
// if (!data.isOverShare) {
// data.isOverShare = true
view.onShareAppMessage = () => { // view.onShareAppMessage = () => { //
return { return {
title: '一路油你,星油能源', title: '一路油你,星油能源',
path: "/pages/index/startPage/startPage", //path path: "/pages/index/startPage/startPage",
// imageUrl:'/image/onshowMessage.png' //imageUrl
imageUrl: 'https://xoi-support.oss-cn-hangzhou.aliyuncs.com/星油admin小程序/xxxxx.png', 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') let white = ['pages/index/startPage/startPage']
const openid = uni.getStorageSync('openid') if(view.route === 'BagStation/pages/stationDetail/stationDetail') {
if (token && openid) { uni.removeStorageSync('refuseLogin')
this.getAmount()
onlineTimer = setTimeout(() => {
if (this.loginStatus == 'offline') {
uni.clearStorageSync()
uni.showModal({
title: '需要您重新登录',
content: this.msg,
duration: '3000',
success: function(res) {
if (res.confirm) {
uni.redirectTo({
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)
}
} }
// } // //
let isRefuseLogin = uni.getStorageSync('refuseLogin')
if(isRefuseLogin || white.includes(view.route) || view.route.includes('BagAuth')) return
this.getAmount()
}) })
}, },
// tokenip // tokenip
getAmount() { getAmount() {
clearTimeout(loginTimer) // clearTimeout(loginTimer)
accountApi.getTotalOilCardInfo().then(res => { accountApi.getTotalOilCardInfo().then(res => {
if (res.code == 20000) { if (res.code == 42011) {
this.loginStatus = 'online' uni.showModal({
} else if (res.code == 42011) { title: '需要您重新登录',
this.loginStatus = 'offline' content: res.msg,
this.msg = res.msg duration: '3000',
success: function(res) {
if (res.confirm) {
uni.redirectTo({
url: '/BagAuth/pages/login/login'
})
}
}
})
} }
}) })
}, },

@ -207,6 +207,7 @@
}) })
}, },
refuseLogin(){ refuseLogin(){
uni.setStorageSync('refuseLogin',true)
uni.switchTab({ uni.switchTab({
url: '/pages/tabbar/home/home' url: '/pages/tabbar/home/home'
}) })

@ -483,18 +483,19 @@
oilSite = uni.getStorageSync(''), oilSite = uni.getStorageSync(''),
otherUser = uni.getStorageSync('otherUserInfo') otherUser = uni.getStorageSync('otherUserInfo')
if(otherUser){ if(otherUser){
console.log('这里是卡里') // console.log('')
this.isOtherUser = true this.isOtherUser = true
}else{ }else{
console.log('这里是非卡力') // console.log('')
} }
console.log('oilItem',oilItem)
this.showtitles = oilItem.listTag; this.showtitles = oilItem.listTag;
this.init() this.init()
}, },
watch: { watch: {
activeChannelCode: { activeChannelCode: {
handler(newval) { handler(newval) {
console.log('activeChannelCode') // console.log('activeChannelCode')
this.oilBar = '' this.oilBar = ''
setTimeout(async() => { setTimeout(async() => {
this.checkBar = (this.typeChenk())? await this.dynamic() : this.calcBar() this.checkBar = (this.typeChenk())? await this.dynamic() : this.calcBar()
@ -503,7 +504,7 @@
}, },
priceId: { priceId: {
handler(newval) { handler(newval) {
console.log('priceId') // console.log('priceId')
this.oilBar = '' this.oilBar = ''
setTimeout(async() => { setTimeout(async() => {
this.checkBar = (this.typeChenk())? await this.dynamic() : this.calcBar() this.checkBar = (this.typeChenk())? await this.dynamic() : this.calcBar()
@ -540,12 +541,12 @@
totalMoney() { totalMoney() {
// // console.log('this.oilSitePriceDetailsVo[this.radio]', this.oilSitePriceDetailsVo[this.radio]) // // console.log('this.oilSitePriceDetailsVo[this.radio]', this.oilSitePriceDetailsVo[this.radio])
if (this.vol > 0 && this.oilSitePriceDetailsVo[this.radio]) { if (this.vol > 0 && this.oilSitePriceDetailsVo[this.radio]) {
console.log('+++++++++++') // console.log('+++++++++++')
console.log(this.vol) // console.log(this.vol)
console.log(this.oilSitePriceDetailsVo[this.radio]) // console.log(this.oilSitePriceDetailsVo[this.radio])
console.log('+++++++++++') // console.log('+++++++++++')
let numb = this.vol * this.oilSitePriceDetailsVo[this.radio].oilSitePrice let numb = this.vol * this.oilSitePriceDetailsVo[this.radio].oilSitePrice
console.log('++++++',numb) // console.log('++++++',numb)
return this.vol * this.oilSitePriceDetailsVo[this.radio].oilSitePrice return this.vol * this.oilSitePriceDetailsVo[this.radio].oilSitePrice
} }
}, },

@ -184,11 +184,11 @@
priceTab priceTab
}, },
onHide() { onHide() {
console.log('这里是hiden') // console.log('hiden')
this.innerAudioContext.stop() this.innerAudioContext.stop()
}, },
onUnload() { onUnload() {
console.log('这里是卸载页面') // console.log('')
this.innerAudioContext.stop() this.innerAudioContext.stop()
}, },
data() { data() {
@ -216,15 +216,20 @@
onHide() { onHide() {
this.innerAudioContext.stop() this.innerAudioContext.stop()
}, },
onLoad(option) { onLoad(option) {
console.log(option) if(option.siteId) {
this.siteId = option.siteId
this.getSiteInfo(option.siteId)
return
}
// console.log(option)
if(option.channerCode == 'TY'){ if(option.channerCode == 'TY'){
var oilItem = uni.getStorageSync('OtherSiteInfo') var oilItem = uni.getStorageSync('OtherSiteInfo')
console.log(oilItem) // console.log(oilItem)
}else{ }else{
let obj = option.item, let obj = option.item,
jss= JSON.parse(obj) jss= JSON.parse(obj)
console.log( '+++++++++',obj,jss,'----------') // console.log( '+++++++++',obj,jss,'----------')
var oilItem = JSON.parse(option.item) var oilItem = JSON.parse(option.item)
} }
uni.setStorageSync('oilItem',oilItem) uni.setStorageSync('oilItem',oilItem)
@ -270,8 +275,7 @@
console.log('开始播放'); console.log('开始播放');
}); });
this.innerAudioContext.onError((res) => { this.innerAudioContext.onError((res) => {
console.log(res.errMsg); console.log(res)
console.log(res.errCode);
}); });
}, },
hidendialog(){ hidendialog(){

@ -12,7 +12,7 @@ const productUrl = 'http://uat.xingoil.com/adminapi'
// const productUrl = 'http://192.168.0.191:38080' // const productUrl = 'http://192.168.0.191:38080'
// const productUrl = 'http://121.196.213.68/adminapi' // const productUrl = 'http://121.196.213.68/adminapi'
const service = axios.create({ const service = axios.create({
baseURL: env == 'production' ? productUrl : testUrl,, baseURL: env == 'production' ? productUrl : testUrl,
// baseURL: testUrl, // baseURL: testUrl,
timeout: 5000 timeout: 5000
}) })

Loading…
Cancel
Save