pull/3/head
xiaozhiyong 2 years ago
parent a7ae4cd7d9
commit 4176a82927
  1. 117
      App.vue
  2. 1
      BagAuth/pages/login/login.vue
  3. 2
      BagStation/pages/stationDetail/stationDetail.vue
  4. 4
      components/site-item/site-item.vue
  5. 4
      pages/tabbar/home/home.vue
  6. 6
      utils/request.js

@ -100,7 +100,6 @@
this.menuList[1].detailList = this.menuList[1].detailList.concat(productCodes)
this.menuList[2].detailList = this.menuList[2].detailList.concat(siteBrands)
uni.setStorageSync('filterData', this.menuList)
console.log(uni.getStorageSync('filterData'),'pppppppppppppppppppppppp')
// this.$refs.slFilter.resetMenuList(this.menuList)
}
})
@ -108,15 +107,10 @@
onShareAppMessage() {
let that = this
wx.onAppRoute(() => {
let white = ['BagStation/pages/stationDetail/stationDetail']
// console.log(' onShareAppMessage')
const pages = getCurrentPages() //
const view = pages[pages.length - 1] //
if (!view) return false //
// isOverSharetrue
// const data = view.data
// if (!data.isOverShare) {
// data.isOverShare = true
if (!view) return false
view.onShareAppMessage = () => { //
return {
title: '中品加油',
@ -125,85 +119,47 @@
imageUrl: 'https://publicxingyou.oss-cn-hangzhou.aliyuncs.com/mp-oil/login-bg.png',
}
}
console.log(view.route)
// console.log(view.route)
clearTimeout(loginTimer)
clearTimeout(onlineTimer)
if (view.route != 'pages/index/startPage/startPage' && view.route.indexOf('BagAuth') == -1) {
const token = uni.getStorageSync('Authorization')
const openid = uni.getStorageSync('openid')
let jumpUrl = '/BagAuth/pages/login/login'
let target = {}
// if(view.route === 'BagStation/pages/stationDetail/stationDetail') {
// let urlTarget = this.obtainUrlPathParameterTarget(view.$page.fullPath)
// if(urlTarget.q) {
// let originLink = decodeURIComponent(decodeURIComponent(urlTarget.q))
// target = this.obtainUrlPathParameterTarget(originLink)
// target.siteId && (jumpUrl += `?scanningParams=${decodeURIComponent(urlTarget.q)}`)
// }
// }
if(view.route === 'pages/index/startPage/startPage' || view.route.includes('BagAuth')) return
const token = uni.getStorageSync('Authorization')
const openid = uni.getStorageSync('openid')
console.log('token',token)
console.log('openid',openid)
// console.log('jumpUrl',jumpUrl)
if (token && openid) {
this.getAmount()
// if(!white.includes(view.route) ){
// this.getAmount()
// }
// if(target.siteId || !white.includes(view.route) ){
// this.getAmount()
// }
if (token && openid) {
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: jumpUrl
})
}
},
complete: () => {
clearTimeout(onlineTimer)
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'
})
}
})
}else{
// if(!uni.getStorageSync('filterData')){
// that.getFilterData()
// }
}
}, 500)
} else {
target.siteId && uni.redirectTo({
url: jumpUrl
},
complete: () => {
clearTimeout(onlineTimer)
}
})
// loginTimer = setTimeout(() => {
// uni.showModal({
// title: '',
// content: '',
// duration: '3000',
// success: function(res) {
// if (res.confirm) {
// uni.redirectTo({
// url: '/BagAuth/pages/login/login'
// })
// }
// }
// })
// }, 1000)
}
}else{
}
}, 500)
} else {
}
// }
})
},
@ -216,16 +172,14 @@
target[item.split('=')[0]] = item.split('=')[1]
})
}
console.log('11target',target)
return target
},
// tokenip
getAmount() {
console.log('执行')
clearTimeout(loginTimer)
accountApi.getTotalOilCardInfo().then(res => {
console.log('res.code',res.code)
console.log(555)
if (res.code == 20000) {
this.loginStatus = 'online'
} else if (res.code == 42011) {
@ -241,7 +195,6 @@
},
onShow: function() {
console.log(12388)
uni.getLocation({
type: 'wgs84',
success: function(res) {
@ -251,7 +204,6 @@
})
}
});
console.log('onReady')
const token = uni.getStorageSync('Authorization')
const openid = uni.getStorageSync('openid')
let key = ''
@ -265,7 +217,6 @@
}
setTimeout(() => {
console.log(key)
if (key == '在线') {
} else {

@ -162,6 +162,7 @@
if(scanningParamsLocale || options.scanningParams) {
//
uni.setStorageSync('scanningParams',options.scanningParams || scanningParamsLocale)
console.log('login scanningParams',uni.getStorageSync('scanningParams'))
}
this.refreshLocation()
uni.login({

@ -191,9 +191,9 @@
if(option.q) {
uni.setStorageSync('scanningParams',option.q)
console.log('stationDetail scanningParams',uni.getStorageSync('scanningParams'))
let originLink = decodeURIComponent(option.q)
let target = this.obtainUrlPathParameterTarget(originLink)
console.log('target',target)
if(target.siteId) {
this.siteId = target.siteId
this.getSiteInfo(target.siteId)

@ -83,14 +83,14 @@
}
},
created() {
console.log(this.siteItem,'-----------------')
// console.log(this.siteItem,'-----------------')
},
methods: {
},
filters: {
channelCodeFamt(value) {
console.log(value)
// console.log(value)
if (!value) {
return '未知'
// ( XOIL WJY LV TY YDJY)

@ -357,7 +357,7 @@
// this.goCall()
// break;
default:
console.log('item.link')
// console.log('item.link')
uni.navigateTo({
url: '/pages/tabbar/home/link?url=' + encodeURIComponent(JSON.stringify(item.link))
})
@ -686,7 +686,7 @@
scanType: 'qrCode',
onlyFromCamera: false,
success: (res) => {
console.log(res.result)
// console.log(res.result)
this.getScanRes(res.result)
},
fail: (err) => {

@ -3,8 +3,8 @@ import utils from '@/utils/encode'
// const env = process.env.NODE_ENV
// const env = 'production'/* */
const env = 'production'
const testUrl = 'http://192.168.110.10:38080'
const env = 'test'
const testUrl = 'http://192.168.110.230:38080'
// const productUrl = 'http://121.196.213.68/adminapi' //预生产
// const productUrl = 'https://www.xingoil.com/adminapi' // 生产,加密 new
@ -12,7 +12,7 @@ const productUrl = 'http://uat.xingoil.com/adminapi' // 生产,加密 new
const service = axios.create({
baseURL: env == 'production' ? productUrl : testUrl,
// baseURL: testUrl,
timeout: 5000
timeout: 5000
})
var url = ''

Loading…
Cancel
Save