zyj #16

Merged
zhangyouji merged 2 commits from zyj into master 1 year ago
  1. 1
      Activity/pages/index/index.vue
  2. 37
      App.vue
  3. 27
      BagAuth/pages/login/login.vue
  4. 15
      BagAuth/pages/login/oldLogin.vue
  5. 3
      BagStation/orderDetail/orderDetail.vue
  6. 48
      BagStation/pages/stationDetail/stationDetail.vue
  7. 4
      components/three-sites.vue
  8. 3
      pages/tabbar/home/home.vue
  9. 10
      pages/tabbar/station/stationList.vue

@ -24,6 +24,7 @@
// sort: "juli", //String // ( price juli )
siteName: '',
clientBelong:'BAICHUAN',
bcDisable:'ENABLE',
...uni.getStorageSync('location'),
// ...this.filterData
// siteBrand: this.siteName ? '' : this.filterDatas

@ -99,10 +99,22 @@
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?loginType=true'
let urlTarget = this.obtainUrlPathParameterTarget(view.$page.fullPath)
console.log('urlTarget',urlTarget)
let target = {}
if(urlTarget.q) {
let originLink = decodeURIComponent(decodeURIComponent(urlTarget.q))
target = this.obtainUrlPathParameterTarget(originLink)
target.siteId && (jumpUrl += `?scanningParams=${decodeURIComponent(urlTarget.q)}`)
}
if (token && openid) {
if(!white.includes(view.route)){
this.getAmount()
}
this.getAmount()
// if(!white.includes(view.route)){
// this.getAmount()
// }
onlineTimer = setTimeout(() => {
if (this.loginStatus == 'offline') {
uni.clearStorageSync()
@ -113,7 +125,7 @@
success: function(res) {
if (res.confirm) {
uni.redirectTo({
url: '/BagAuth/pages/login/login?loginType=true'
url: jumpUrl
})
}
},
@ -125,6 +137,9 @@
}, 1000)
} else {
target.siteId && uni.redirectTo({
url: jumpUrl
})
// loginTimer = setTimeout(() => {
// uni.showModal({
// title: '',
@ -146,6 +161,20 @@
// }
})
},
obtainUrlPathParameterTarget(url) {
let target = {}
if(url.includes('?')) {
let paramsText = url.split("?")[1]
let paramsArr = paramsText.split("&")
paramsArr.forEach(item => {
target[item.split('=')[0]] = item.split('=')[1]
})
}
console.log('11target',target)
return target
},
// tokenip
getAmount() {
clearTimeout(loginTimer)

@ -89,26 +89,27 @@
loginRes: {},
sessionKey: '',
nickName: '',
loginOut: uni.getStorageSync('loginOut') ? true : false
loginOut: uni.getStorageSync('loginOut') ? true : false,
scanningParams:null
}
},
onLoad(e) {
if(e.loginType){
this.loginType = Boolean(e.loginType);
console.log(e.loginType,'e.loginType')
}
uni.clearStorageSync()
// this.refreshLocation()
uni.login({
provider: 'weixin',
success: (loginRes) => {
console.log(loginRes, '+++++++')
const code = loginRes.code
this.onceCode = code
console.log(this.onceCode, '----------')
this.onceCode = code
oilIdentityApi.sendCode(this.onceCode).then(res => {
console.log(res, '++++++++++++++++')
if (res.code === 20000) {
if(e.scanningParams) {
//
this.scanningParams = e.scanningParams
}
this.sessionKey = res.data.sessionKey
uni.setStorageSync('openid', res.data.openId)
uni.setStorageSync('unionid', res.data.unionId)
@ -125,7 +126,6 @@
}
}).catch(err => {
console.log(err)
uni.reLaunch({
url: '/BagAuth/pages/login/boforeLogin/boforeLogin',
fail: (err) => {
@ -170,7 +170,7 @@
},
refuseEmpower() {
uni.navigateTo({
url: '/BagAuth/pages/login/oldLogin'
url: `/BagAuth/pages/login/oldLogin?scanningParams=${this.scanningParams}`
})
},
@ -184,7 +184,6 @@
})
return
}
// console.log(e.detail)
if (e.detail.errMsg === 'getPhoneNumber:ok') {
const data1 = {
...e.detail,
@ -204,7 +203,6 @@
bindLoginByPhone(data, url) {
if (this.count < 1) {
oilIdentityApi.bindLoginByPhone(data, url).then(res => {
console.log(res)
if (res.code == 20000) {
this.loginSuccess(res)
}
@ -230,20 +228,23 @@
title: res.msg,
icon: 'none',
complete: (err) => {
// console.log(err)
}
})
}, 1000);
if(this.scanningParams) {
uni.redirectTo({
url: `/BagStation/pages/stationDetail/stationDetail?q=${this.scanningParams}`
})
return
}
//
uni.switchTab({
url: '/pages/tabbar/home/home'
})
}else{
console.log(this.loginType,'loginTypeloginTypeloginType')
if(!this.loginType){
this.refuseLogin()
}
console.log('禁摩登录i失败==================')
}
},
}

@ -170,7 +170,14 @@
count: 0,
loginRes: {},
checked: false,
next: false
next: false,
scanningParams:null
}
},
onLoad(options) {
if(options.scanningParams) {
//
this.scanningParams = options.scanningParams
}
},
onShow() {},
@ -401,6 +408,12 @@
icon: 'none'
})
}, 1000);
if(this.scanningParams) {
uni.redirectTo({
url: `/BagStation/pages/stationDetail/stationDetail?q=${this.scanningParams}`
})
return
}
//
uni.switchTab({
url: '/pages/tabbar/home/home'

@ -45,7 +45,7 @@
</view>
</view>
<view class="cu-list menu solid-bottom">
<view class="cu-item arrow" @tap="toDetail(order)">
<view class="cu-item " :class="order.bcDisable === 'DISABLE' ? '' :'arrow'"" @tap="toDetail(order)">
油站
<text class="fr">{{order.siteName?order.siteName:''}}</text>
</view>
@ -340,6 +340,7 @@
})
},
toDetail(item) {
if(item.bcDisable === 'DISABLE') return
var itemS = JSON.stringify(item)
uni.setStorageSync('siteInfo', itemS)
uni.navigateTo({

@ -185,14 +185,22 @@
}
},
onHide() {
console.log('这里是hiden')
this.innerAudioContext.stop()
this.innerAudioContext && this.innerAudioContext.stop()
},
onUnload() {
console.log('这里是卸载页面')
this.innerAudioContext.stop()
this.innerAudioContext && this.innerAudioContext.stop()
},
onLoad(option) {
if(option.q) {
let originLink = decodeURIComponent(option.q)
let target = this.obtainUrlPathParameterTarget(originLink)
if(target.siteId) {
this.siteId = target.siteId
this.getSiteInfo(target.siteId)
}
return
}
if (!option.item) {
let siteInfos = uni.getStorageSync('siteInfo')
var oilItem = JSON.parse(decodeURIComponent(siteInfos))
@ -214,6 +222,17 @@
this.ContextAudio(this.audioUrl)
},
methods: {
obtainUrlPathParameterTarget(url) {
let target = {}
if(url.includes('?')) {
let paramsText = url.split("?")[1]
let paramsArr = paramsText.split("&")
paramsArr.forEach(item => {
target[item.split('=')[0]] = item.split('=')[1]
})
}
return target
},
//
ContextAudio(url) {
this.innerAudioContext = uni.createInnerAudioContext();
@ -223,12 +242,11 @@
console.log('开始播放');
});
this.innerAudioContext.onError((res) => {
console.log(res.errMsg);
console.log(res.errCode);
console.log(res);
});
},
backTohome() {
this.innerAudioContext.stop()
this.innerAudioContext && this.innerAudioContext.stop()
uni.switchTab({
url: '../../../pages/tabbar/home/home'
})
@ -237,7 +255,7 @@
this.showtitle = false
},
gotoPay() {
this.innerAudioContext.stop()
this.innerAudioContext && this.innerAudioContext.stop()
uni.navigateTo({
url: `/BagStation/pages/makeOrder/makeOrder?siteId=${this.siteId}&activeCur=${this.activeCur}`
})
@ -247,14 +265,13 @@
this.secondChannelCode = sec
},
siteQrPay() {
this.innerAudioContext.stop()
this.innerAudioContext && this.innerAudioContext.stop()
// let siteId =
uni.navigateTo({
url: `/BagStation/pages/stationDetail/stieQr?siteId=${this.siteId}&activeChannelCode=${this.activeChannelCode}&secondChannelCode=${this.secondChannelCode}`
})
},
getSiteInfo(id, item) {
console.log('进入获取油站信息');
let user = uni.getStorageSync('user');
let data2 = {
...uni.getStorageSync('location'),
@ -262,7 +279,6 @@
}
if (user) {
oilSiteApi.getSiteDetails(data2).then(res => {
console.log('进入获取油站信息getSiteDetails', res)
if (res.code == 20000) {
this.siteInfo = res.data
}
@ -278,7 +294,7 @@
if (this.siteInfo.juli > 1000) {
this.showtitle = true
} else {
this.innerAudioContext.stop()
this.innerAudioContext && this.innerAudioContext.stop()
uni.navigateTo({
url: `/BagStation/pages/makeOrder/makeOrder?siteId=${this.siteId}&activeCur=${this.activeCur}`
})
@ -329,10 +345,10 @@
},
goBack() {
this.innerAudioContext.stop()
uni.navigateBack({
})
// this.innerAudioContext.stop()
uni.switchTab({
url: '/pages/tabbar/home/home'
});
},
selectRadio() {
this.radio === 'A' ? this.radio = '' : this.radio = 'A'

@ -75,7 +75,9 @@
params: { //Object //
sort: "juli", //String // ( price juli )
...uni.getStorageSync('location'),
...this.filterData
...this.filterData,
clientBelong:'BAICHUAN',
bcDisable:'ENABLE',
// siteBrand: "", // // ( 1- 2- 3- 4- 5- 6- 7- 8- )
// channelCode: "", // // ( OIL WJY LV TY YDJY)
// oilProductCode: "" // // ( 0# 92# 92#)

@ -560,7 +560,8 @@
// siteBrand: "", // // ( 1- 2- 3- 4- 5- 6- 7- 8- )
// channelCode: "", // // ( OIL WJY LV TY YDJY)
// oilProductCode: "0#" // // ( 0# 92# 92#)
comprehensiveSort: 1
comprehensiveSort: 1,
bcDisable: 'ENABLE'
}
}
if (!uni.getStorageSync('user')) {

@ -384,16 +384,14 @@
siteName: this.siteName,
...uni.getStorageSync('location'),
// ...this.filterData
siteBrand: this.siteName ? '' : this.filterData
.siteBrand, // // ( 1- 2- 3- 4- 5- 6- 7- 8- )
channelCode: this.siteName ? '' : this.filterData
.channelCode, // // ( OIL WJY LV TY YDJY)
oilProductCode: this.siteName ? '' : this.filterData
.oilProductCode, // // ( 0# 92# 92#)
siteBrand: this.siteName ? '' : this.filterData.siteBrand, // // ( 1- 2- 3- 4- 5- 6- 7- 8- )
channelCode: this.siteName ? '' : this.filterData.channelCode, // // ( OIL WJY LV TY YDJY)
oilProductCode: this.siteName ? '' : this.filterData.oilProductCode, // // ( 0# 92# 92#)
provinceCode: this.filterData.provinceCode,
cityCode: this.filterData.cityCode,
areaCode: this.filterData.areaCode,
distance: this.filterData.distance,
bcDisable:'ENABLE',
comprehensiveSort: this.filterData.comprehensiveSort ? this.filterData.comprehensiveSort : 1
}

Loading…
Cancel
Save