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

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

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

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

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

@ -3,8 +3,8 @@ import utils from '@/utils/encode'
// const env = process.env.NODE_ENV // const env = process.env.NODE_ENV
// const env = 'production'/* */ // const env = 'production'/* */
const env = 'production' const env = 'test'
const testUrl = 'http://192.168.110.10:38080' const testUrl = 'http://192.168.110.230:38080'
// const productUrl = 'http://121.196.213.68/adminapi' //预生产 // const productUrl = 'http://121.196.213.68/adminapi' //预生产
// const productUrl = 'https://www.xingoil.com/adminapi' // 生产,加密 new // const productUrl = 'https://www.xingoil.com/adminapi' // 生产,加密 new
@ -12,7 +12,7 @@ const productUrl = 'http://uat.xingoil.com/adminapi' // 生产,加密 new
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
}) })
var url = '' var url = ''

Loading…
Cancel
Save