xiaozy_优化 #6
117
App.vue
117
App.vue
@@ -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 //如果不存在页面对象 则返回
|
||||
// 若想给个别页面做特殊处理 可以给特殊页面加isOverShare为true 就不会重写了
|
||||
// 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
|
||||
},
|
||||
|
||||
// 是否token过期或ip更改
|
||||
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 = ''
|
||||
|
||||
|
||||
Reference in New Issue
Block a user