master #18
@@ -24,6 +24,7 @@
|
|||||||
// sort: "juli", //类型:String 必有字段 备注:// 智能排序 ( price:价格最低 juli:距离最近 ) 默认距离排序
|
// sort: "juli", //类型:String 必有字段 备注:// 智能排序 ( price:价格最低 juli:距离最近 ) 默认距离排序
|
||||||
siteName: '',
|
siteName: '',
|
||||||
clientBelong:'BAICHUAN',
|
clientBelong:'BAICHUAN',
|
||||||
|
bcDisable:'ENABLE',
|
||||||
...uni.getStorageSync('location'),
|
...uni.getStorageSync('location'),
|
||||||
// ...this.filterData
|
// ...this.filterData
|
||||||
// siteBrand: this.siteName ? '' : this.filterDatas
|
// siteBrand: this.siteName ? '' : this.filterDatas
|
||||||
|
|||||||
37
App.vue
37
App.vue
@@ -99,10 +99,22 @@
|
|||||||
if (view.route != 'pages/index/startPage/startPage' && view.route.indexOf('BagAuth') == -1) {
|
if (view.route != 'pages/index/startPage/startPage' && view.route.indexOf('BagAuth') == -1) {
|
||||||
const token = uni.getStorageSync('Authorization')
|
const token = uni.getStorageSync('Authorization')
|
||||||
const openid = uni.getStorageSync('openid')
|
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 (token && openid) {
|
||||||
if(!white.includes(view.route)){
|
this.getAmount()
|
||||||
this.getAmount()
|
// if(!white.includes(view.route)){
|
||||||
}
|
// this.getAmount()
|
||||||
|
// }
|
||||||
onlineTimer = setTimeout(() => {
|
onlineTimer = setTimeout(() => {
|
||||||
if (this.loginStatus == 'offline') {
|
if (this.loginStatus == 'offline') {
|
||||||
uni.clearStorageSync()
|
uni.clearStorageSync()
|
||||||
@@ -113,7 +125,7 @@
|
|||||||
success: function(res) {
|
success: function(res) {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: '/BagAuth/pages/login/login?loginType=true'
|
url: jumpUrl
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -125,6 +137,9 @@
|
|||||||
}, 1000)
|
}, 1000)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
target.siteId && uni.redirectTo({
|
||||||
|
url: jumpUrl
|
||||||
|
})
|
||||||
// loginTimer = setTimeout(() => {
|
// loginTimer = setTimeout(() => {
|
||||||
// uni.showModal({
|
// uni.showModal({
|
||||||
// title: '请您登录',
|
// 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
|
||||||
|
},
|
||||||
|
|
||||||
// 是否token过期或ip更改
|
// 是否token过期或ip更改
|
||||||
getAmount() {
|
getAmount() {
|
||||||
clearTimeout(loginTimer)
|
clearTimeout(loginTimer)
|
||||||
|
|||||||
@@ -89,26 +89,27 @@
|
|||||||
loginRes: {},
|
loginRes: {},
|
||||||
sessionKey: '',
|
sessionKey: '',
|
||||||
nickName: '',
|
nickName: '',
|
||||||
loginOut: uni.getStorageSync('loginOut') ? true : false
|
loginOut: uni.getStorageSync('loginOut') ? true : false,
|
||||||
|
scanningParams:null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
if(e.loginType){
|
if(e.loginType){
|
||||||
this.loginType = Boolean(e.loginType);
|
this.loginType = Boolean(e.loginType);
|
||||||
console.log(e.loginType,'e.loginType')
|
|
||||||
}
|
}
|
||||||
uni.clearStorageSync()
|
uni.clearStorageSync()
|
||||||
// this.refreshLocation()
|
// this.refreshLocation()
|
||||||
uni.login({
|
uni.login({
|
||||||
provider: 'weixin',
|
provider: 'weixin',
|
||||||
success: (loginRes) => {
|
success: (loginRes) => {
|
||||||
console.log(loginRes, '+++++++')
|
|
||||||
const code = loginRes.code
|
const code = loginRes.code
|
||||||
this.onceCode = code
|
this.onceCode = code
|
||||||
console.log(this.onceCode, '----------')
|
|
||||||
oilIdentityApi.sendCode(this.onceCode).then(res => {
|
oilIdentityApi.sendCode(this.onceCode).then(res => {
|
||||||
console.log(res, '++++++++++++++++')
|
|
||||||
if (res.code === 20000) {
|
if (res.code === 20000) {
|
||||||
|
if(e.scanningParams) {
|
||||||
|
// 用于扫码进入油站详情页面
|
||||||
|
this.scanningParams = e.scanningParams
|
||||||
|
}
|
||||||
this.sessionKey = res.data.sessionKey
|
this.sessionKey = res.data.sessionKey
|
||||||
uni.setStorageSync('openid', res.data.openId)
|
uni.setStorageSync('openid', res.data.openId)
|
||||||
uni.setStorageSync('unionid', res.data.unionId)
|
uni.setStorageSync('unionid', res.data.unionId)
|
||||||
@@ -125,7 +126,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err)
|
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/BagAuth/pages/login/boforeLogin/boforeLogin',
|
url: '/BagAuth/pages/login/boforeLogin/boforeLogin',
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
@@ -170,7 +170,7 @@
|
|||||||
},
|
},
|
||||||
refuseEmpower() {
|
refuseEmpower() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/BagAuth/pages/login/oldLogin'
|
url: `/BagAuth/pages/login/oldLogin?scanningParams=${this.scanningParams}`
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -184,7 +184,6 @@
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// console.log(e.detail)
|
|
||||||
if (e.detail.errMsg === 'getPhoneNumber:ok') {
|
if (e.detail.errMsg === 'getPhoneNumber:ok') {
|
||||||
const data1 = {
|
const data1 = {
|
||||||
...e.detail,
|
...e.detail,
|
||||||
@@ -204,7 +203,6 @@
|
|||||||
bindLoginByPhone(data, url) {
|
bindLoginByPhone(data, url) {
|
||||||
if (this.count < 1) {
|
if (this.count < 1) {
|
||||||
oilIdentityApi.bindLoginByPhone(data, url).then(res => {
|
oilIdentityApi.bindLoginByPhone(data, url).then(res => {
|
||||||
console.log(res)
|
|
||||||
if (res.code == 20000) {
|
if (res.code == 20000) {
|
||||||
this.loginSuccess(res)
|
this.loginSuccess(res)
|
||||||
}
|
}
|
||||||
@@ -230,20 +228,23 @@
|
|||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
complete: (err) => {
|
complete: (err) => {
|
||||||
// console.log(err)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
if(this.scanningParams) {
|
||||||
|
uni.redirectTo({
|
||||||
|
url: `/BagStation/pages/stationDetail/stationDetail?q=${this.scanningParams}`
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
// 这里有问题
|
// 这里有问题
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: '/pages/tabbar/home/home'
|
url: '/pages/tabbar/home/home'
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
console.log(this.loginType,'loginTypeloginTypeloginType')
|
|
||||||
if(!this.loginType){
|
if(!this.loginType){
|
||||||
this.refuseLogin()
|
this.refuseLogin()
|
||||||
}
|
}
|
||||||
console.log('禁摩登录i失败==================')
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -170,7 +170,14 @@
|
|||||||
count: 0,
|
count: 0,
|
||||||
loginRes: {},
|
loginRes: {},
|
||||||
checked: false,
|
checked: false,
|
||||||
next: false
|
next: false,
|
||||||
|
scanningParams:null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
if(options.scanningParams) {
|
||||||
|
// 用于扫码进入油站详情页面
|
||||||
|
this.scanningParams = options.scanningParams
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {},
|
onShow() {},
|
||||||
@@ -401,6 +408,12 @@
|
|||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
if(this.scanningParams) {
|
||||||
|
uni.redirectTo({
|
||||||
|
url: `/BagStation/pages/stationDetail/stationDetail?q=${this.scanningParams}`
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
// 这里有问题
|
// 这里有问题
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: '/pages/tabbar/home/home'
|
url: '/pages/tabbar/home/home'
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-list menu solid-bottom">
|
<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>
|
<text class="fr">{{order.siteName?order.siteName:''}}</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -340,6 +340,7 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
toDetail(item) {
|
toDetail(item) {
|
||||||
|
if(item.bcDisable === 'DISABLE') return
|
||||||
var itemS = JSON.stringify(item)
|
var itemS = JSON.stringify(item)
|
||||||
uni.setStorageSync('siteInfo', itemS)
|
uni.setStorageSync('siteInfo', itemS)
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|||||||
@@ -101,20 +101,15 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- 底部去支付 -->
|
<!-- 底部去支付 -->
|
||||||
<view class="" >
|
<view class="" >
|
||||||
<view class="btn bg-white placeholder-hidden">
|
<!-- <view class="btn bg-white placeholder-hidden">
|
||||||
<view class="flex bg-white padding flex-direction">
|
<view class="flex bg-white padding flex-direction">
|
||||||
<button class="cu-btn block bg-main-oil lg" v-if="activePay" @tap="makePay">
|
<button class="cu-btn block bg-main-oil lg" v-if="activePay" @tap="makePay">
|
||||||
<image class="site-icon margin-right-sm" :src="imgURL+'site-yz.png'" mode="widthFix">
|
<image class="site-icon margin-right-sm" :src="imgURL+'site-yz.png'" mode="widthFix">
|
||||||
</image>
|
</image>
|
||||||
一键支付
|
一键支付
|
||||||
</button>
|
</button>
|
||||||
<!-- <button v-if="qrcodePay" class="cu-btn block bg-main-oil margin-tb-sm lg" @tap="siteQrPay">
|
|
||||||
<image class="site-icon margin-right-sm" :src="imgURL+'site-qr.png'" mode="widthFix">
|
|
||||||
</image>
|
|
||||||
二维码支付
|
|
||||||
</button> -->
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
<view class="btn bg-white fixed ">
|
<view class="btn bg-white fixed ">
|
||||||
<view class="flex bg-white padding flex-direction">
|
<view class="flex bg-white padding flex-direction">
|
||||||
<button class="cu-btn block bg-main-oil lg" @tap="makePay">
|
<button class="cu-btn block bg-main-oil lg" @tap="makePay">
|
||||||
@@ -122,11 +117,6 @@
|
|||||||
</image>
|
</image>
|
||||||
一键支付
|
一键支付
|
||||||
</button>
|
</button>
|
||||||
<!-- <button v-if="qrcodePay" class="cu-btn block bg-main-oil margin-tb-sm lg" @tap="siteQrPay">
|
|
||||||
<image class="site-icon margin-right-sm" :src="imgURL+'site-qr.png'" mode="widthFix">
|
|
||||||
</image>
|
|
||||||
二维码支付
|
|
||||||
</button> -->
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -185,14 +175,22 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onHide() {
|
onHide() {
|
||||||
console.log('这里是hiden')
|
this.innerAudioContext && this.innerAudioContext.stop()
|
||||||
this.innerAudioContext.stop()
|
|
||||||
},
|
},
|
||||||
onUnload() {
|
onUnload() {
|
||||||
console.log('这里是卸载页面')
|
this.innerAudioContext && this.innerAudioContext.stop()
|
||||||
this.innerAudioContext.stop()
|
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
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) {
|
if (!option.item) {
|
||||||
let siteInfos = uni.getStorageSync('siteInfo')
|
let siteInfos = uni.getStorageSync('siteInfo')
|
||||||
var oilItem = JSON.parse(decodeURIComponent(siteInfos))
|
var oilItem = JSON.parse(decodeURIComponent(siteInfos))
|
||||||
@@ -214,6 +212,17 @@
|
|||||||
this.ContextAudio(this.audioUrl)
|
this.ContextAudio(this.audioUrl)
|
||||||
},
|
},
|
||||||
methods: {
|
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) {
|
ContextAudio(url) {
|
||||||
this.innerAudioContext = uni.createInnerAudioContext();
|
this.innerAudioContext = uni.createInnerAudioContext();
|
||||||
@@ -223,12 +232,11 @@
|
|||||||
console.log('开始播放');
|
console.log('开始播放');
|
||||||
});
|
});
|
||||||
this.innerAudioContext.onError((res) => {
|
this.innerAudioContext.onError((res) => {
|
||||||
console.log(res.errMsg);
|
console.log(res);
|
||||||
console.log(res.errCode);
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
backTohome() {
|
backTohome() {
|
||||||
this.innerAudioContext.stop()
|
this.innerAudioContext && this.innerAudioContext.stop()
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: '../../../pages/tabbar/home/home'
|
url: '../../../pages/tabbar/home/home'
|
||||||
})
|
})
|
||||||
@@ -237,7 +245,7 @@
|
|||||||
this.showtitle = false
|
this.showtitle = false
|
||||||
},
|
},
|
||||||
gotoPay() {
|
gotoPay() {
|
||||||
this.innerAudioContext.stop()
|
this.innerAudioContext && this.innerAudioContext.stop()
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/BagStation/pages/makeOrder/makeOrder?siteId=${this.siteId}&activeCur=${this.activeCur}`
|
url: `/BagStation/pages/makeOrder/makeOrder?siteId=${this.siteId}&activeCur=${this.activeCur}`
|
||||||
})
|
})
|
||||||
@@ -247,24 +255,30 @@
|
|||||||
this.secondChannelCode = sec
|
this.secondChannelCode = sec
|
||||||
},
|
},
|
||||||
siteQrPay() {
|
siteQrPay() {
|
||||||
this.innerAudioContext.stop()
|
this.innerAudioContext && this.innerAudioContext.stop()
|
||||||
// let siteId =
|
// let siteId =
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/BagStation/pages/stationDetail/stieQr?siteId=${this.siteId}&activeChannelCode=${this.activeChannelCode}&secondChannelCode=${this.secondChannelCode}`
|
url: `/BagStation/pages/stationDetail/stieQr?siteId=${this.siteId}&activeChannelCode=${this.activeChannelCode}&secondChannelCode=${this.secondChannelCode}`
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getSiteInfo(id, item) {
|
getSiteInfo(id, item) {
|
||||||
console.log('进入获取油站信息');
|
|
||||||
let user = uni.getStorageSync('user');
|
let user = uni.getStorageSync('user');
|
||||||
let data2 = {
|
let data2 = {
|
||||||
...uni.getStorageSync('location'),
|
...uni.getStorageSync('location'),
|
||||||
siteId: id
|
siteId: id,
|
||||||
|
clientBelong: "BAICHUAN"
|
||||||
}
|
}
|
||||||
if (user) {
|
if (user) {
|
||||||
oilSiteApi.getSiteDetails(data2).then(res => {
|
oilSiteApi.getSiteDetails(data2).then(res => {
|
||||||
console.log('进入获取油站信息getSiteDetails', res)
|
|
||||||
if (res.code == 20000) {
|
if (res.code == 20000) {
|
||||||
this.siteInfo = res.data
|
this.siteInfo = res.data
|
||||||
|
}else {
|
||||||
|
setTimeout(()=>{
|
||||||
|
uni.showToast({
|
||||||
|
title:res.msg,
|
||||||
|
icon:'none'
|
||||||
|
})
|
||||||
|
},1000)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@@ -274,36 +288,28 @@
|
|||||||
},
|
},
|
||||||
makePay() {
|
makePay() {
|
||||||
let user = uni.getStorageSync('user');
|
let user = uni.getStorageSync('user');
|
||||||
if (this.activePay && user) {
|
if(!user){
|
||||||
if (this.siteInfo.juli > 1000) {
|
uni.showModal({
|
||||||
this.showtitle = true
|
title: '请您登录',
|
||||||
} else {
|
content: "登录佰川加油才可以加油 |˛˙꒳˙)♡",
|
||||||
this.innerAudioContext.stop()
|
confirmText: '去登陆',
|
||||||
uni.navigateTo({
|
success: (res) => {
|
||||||
url: `/BagStation/pages/makeOrder/makeOrder?siteId=${this.siteId}&activeCur=${this.activeCur}`
|
if (res.confirm) {
|
||||||
})
|
uni.reLaunch({
|
||||||
}
|
url: '../../../BagAuth/pages/login/login?loginType=true'
|
||||||
} else {
|
})
|
||||||
if(!user){
|
|
||||||
uni.showModal({
|
|
||||||
title: '请您登录',
|
|
||||||
content: "登录佰川加油才可以加油 |˛˙꒳˙)♡",
|
|
||||||
confirmText: '去登陆',
|
|
||||||
success: (res) => {
|
|
||||||
if (res.confirm) {
|
|
||||||
uni.reLaunch({
|
|
||||||
url: '../../../BagAuth/pages/login/login?loginType=true'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
}else{
|
})
|
||||||
uni.showToast({
|
return
|
||||||
title:'暂无可选油品',
|
}
|
||||||
icon:'none'
|
if (this.siteInfo.juli > 1000) {
|
||||||
})
|
this.showtitle = true
|
||||||
}
|
} else {
|
||||||
|
this.innerAudioContext && this.innerAudioContext.stop()
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/BagStation/pages/makeOrder/makeOrder?siteId=${this.siteId}&activeCur=${this.activeCur}`
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -311,6 +317,7 @@
|
|||||||
this.qrcodePay = val
|
this.qrcodePay = val
|
||||||
},
|
},
|
||||||
onChangePay(val, active) {
|
onChangePay(val, active) {
|
||||||
|
console.log(val)
|
||||||
this.activePay = val
|
this.activePay = val
|
||||||
this.activeCur = active
|
this.activeCur = active
|
||||||
},
|
},
|
||||||
@@ -329,10 +336,10 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
goBack() {
|
goBack() {
|
||||||
this.innerAudioContext.stop()
|
// this.innerAudioContext.stop()
|
||||||
uni.navigateBack({
|
uni.switchTab({
|
||||||
|
url: '/pages/tabbar/home/home'
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
selectRadio() {
|
selectRadio() {
|
||||||
this.radio === 'A' ? this.radio = '' : this.radio = 'A'
|
this.radio === 'A' ? this.radio = '' : this.radio = 'A'
|
||||||
|
|||||||
@@ -75,7 +75,9 @@
|
|||||||
params: { //类型:Object 必有字段 备注:// 筛选对象
|
params: { //类型:Object 必有字段 备注:// 筛选对象
|
||||||
sort: "juli", //类型:String 必有字段 备注:// 智能排序 ( price:价格最低 juli:距离最近 ) 默认距离排序
|
sort: "juli", //类型:String 必有字段 备注:// 智能排序 ( price:价格最低 juli:距离最近 ) 默认距离排序
|
||||||
...uni.getStorageSync('location'),
|
...uni.getStorageSync('location'),
|
||||||
...this.filterData
|
...this.filterData,
|
||||||
|
clientBelong:'BAICHUAN',
|
||||||
|
bcDisable:'ENABLE',
|
||||||
// siteBrand: "", // 备注:// 石油品牌 ( 1-中国石油 2-中国石化 3-壳牌 4-民营 5-中海油 6-京博 7-中化石油 8-其他 )
|
// siteBrand: "", // 备注:// 石油品牌 ( 1-中国石油 2-中国石化 3-壳牌 4-民营 5-中海油 6-京博 7-中化石油 8-其他 )
|
||||||
// channelCode: "", // 备注:// 渠道编码 ( OIL:星油 WJY:万金油 LV:老吕(找油网) TY:团油 YDJY:一点加油(壳牌))
|
// channelCode: "", // 备注:// 渠道编码 ( OIL:星油 WJY:万金油 LV:老吕(找油网) TY:团油 YDJY:一点加油(壳牌))
|
||||||
// oilProductCode: "" // 备注:// 油号选择 ( 0# 92# 92#)
|
// oilProductCode: "" // 备注:// 油号选择 ( 0# 92# 92#)
|
||||||
|
|||||||
@@ -560,7 +560,8 @@
|
|||||||
// siteBrand: "", // 备注:// 石油品牌 ( 1-中国石油 2-中国石化 3-壳牌 4-民营 5-中海油 6-京博 7-中化石油 8-其他 )
|
// siteBrand: "", // 备注:// 石油品牌 ( 1-中国石油 2-中国石化 3-壳牌 4-民营 5-中海油 6-京博 7-中化石油 8-其他 )
|
||||||
// channelCode: "", // 备注:// 渠道编码 ( OIL:星油 WJY:万金油 LV:老吕(找油网) TY:团油 YDJY:一点加油(壳牌))
|
// channelCode: "", // 备注:// 渠道编码 ( OIL:星油 WJY:万金油 LV:老吕(找油网) TY:团油 YDJY:一点加油(壳牌))
|
||||||
// oilProductCode: "0#" // 备注:// 油号选择 ( 0# 92# 92#)
|
// oilProductCode: "0#" // 备注:// 油号选择 ( 0# 92# 92#)
|
||||||
comprehensiveSort: 1
|
comprehensiveSort: 1,
|
||||||
|
bcDisable: 'ENABLE'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!uni.getStorageSync('user')) {
|
if (!uni.getStorageSync('user')) {
|
||||||
|
|||||||
@@ -384,16 +384,14 @@
|
|||||||
siteName: this.siteName,
|
siteName: this.siteName,
|
||||||
...uni.getStorageSync('location'),
|
...uni.getStorageSync('location'),
|
||||||
// ...this.filterData
|
// ...this.filterData
|
||||||
siteBrand: this.siteName ? '' : this.filterData
|
siteBrand: this.siteName ? '' : this.filterData.siteBrand, // 备注:// 石油品牌 ( 1-中国石油 2-中国石化 3-壳牌 4-民营 5-中海油 6-京博 7-中化石油 8-其他 )
|
||||||
.siteBrand, // 备注:// 石油品牌 ( 1-中国石油 2-中国石化 3-壳牌 4-民营 5-中海油 6-京博 7-中化石油 8-其他 )
|
channelCode: this.siteName ? '' : this.filterData.channelCode, // 备注:// 渠道编码 ( OIL:星油 WJY:万金油 LV:老吕(找油网) TY:团油 YDJY:一点加油(壳牌))
|
||||||
channelCode: this.siteName ? '' : this.filterData
|
oilProductCode: this.siteName ? '' : this.filterData.oilProductCode, // 备注:// 油号选择 ( 0# 92# 92#)
|
||||||
.channelCode, // 备注:// 渠道编码 ( OIL:星油 WJY:万金油 LV:老吕(找油网) TY:团油 YDJY:一点加油(壳牌))
|
|
||||||
oilProductCode: this.siteName ? '' : this.filterData
|
|
||||||
.oilProductCode, // 备注:// 油号选择 ( 0# 92# 92#)
|
|
||||||
provinceCode: this.filterData.provinceCode,
|
provinceCode: this.filterData.provinceCode,
|
||||||
cityCode: this.filterData.cityCode,
|
cityCode: this.filterData.cityCode,
|
||||||
areaCode: this.filterData.areaCode,
|
areaCode: this.filterData.areaCode,
|
||||||
distance: this.filterData.distance,
|
distance: this.filterData.distance,
|
||||||
|
bcDisable:'ENABLE',
|
||||||
comprehensiveSort: this.filterData.comprehensiveSort ? this.filterData.comprehensiveSort : 1
|
comprehensiveSort: this.filterData.comprehensiveSort ? this.filterData.comprehensiveSort : 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,25 +37,17 @@ service.interceptors.request.use(
|
|||||||
config.headers['dataSources'] = 'MP'
|
config.headers['dataSources'] = 'MP'
|
||||||
|
|
||||||
if (env === 'production') {
|
if (env === 'production') {
|
||||||
// 生产环境,加密,不输出任何东西
|
|
||||||
// 设置jsessionid和token
|
|
||||||
const JSESSIONID = utils.uuid()
|
const JSESSIONID = utils.uuid()
|
||||||
config.headers['JSESSIONID'] = JSESSIONID
|
config.headers['JSESSIONID'] = JSESSIONID
|
||||||
config.headers['token'] = utils.md5Salt(JSESSIONID)
|
config.headers['token'] = utils.md5Salt(JSESSIONID)
|
||||||
// if ( encryptWhite.indexOf(config.url) < 0) {
|
|
||||||
// if (!notEncrypt && encryptWhite.indexOf(config.url) < 0) {
|
|
||||||
// 这是定义在哪的
|
|
||||||
const data = { // 用于存储加密
|
const data = { // 用于存储加密
|
||||||
params: '' // 加密后的密文
|
params: '' // 加密后的密文
|
||||||
}
|
}
|
||||||
// 要加密
|
// 要加密
|
||||||
data.params = utils.encrypt(JSON.stringify(config.data))
|
data.params = utils.encrypt(JSON.stringify(config.data))
|
||||||
// console.log('参数', config.url, '参数加密前',config.data)
|
|
||||||
config.data = data
|
config.data = data
|
||||||
// }
|
|
||||||
} else {
|
} else {
|
||||||
console.log('\n\n-----------------------')
|
|
||||||
console.log('参数', config.url, '参数加密前', config.data)
|
|
||||||
url = config.url
|
url = config.url
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,15 +70,10 @@ service.interceptors.response.use(
|
|||||||
if (env === 'production') {
|
if (env === 'production') {
|
||||||
// 生产环境,进行加密解密,不输出日志
|
// 生产环境,进行加密解密,不输出日志
|
||||||
if (res.encrypt == 1) {
|
if (res.encrypt == 1) {
|
||||||
// 加密的数据,需要解密
|
|
||||||
const dataParam = JSON.parse(utils.decrypt(res.data))
|
const dataParam = JSON.parse(utils.decrypt(res.data))
|
||||||
res.data = JSON.stringify(dataParam) === '{}' ? null : dataParam
|
res.data = JSON.stringify(dataParam) === '{}' ? null : dataParam
|
||||||
// console.log('返回', response.config.url, '返回结果',res)
|
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
console.log('返回', response.config.url, '返回结果未加密', res)
|
|
||||||
console.log('-------------------------------------------\n\n')
|
|
||||||
}
|
|
||||||
|
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
if(response.config.url.indexOf('/oil-site/oilSiteOrderInfo/getOrderQrCode') === -1){
|
if(response.config.url.indexOf('/oil-site/oilSiteOrderInfo/getOrderQrCode') === -1){
|
||||||
@@ -95,9 +82,7 @@ service.interceptors.response.use(
|
|||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: "none"
|
icon: "none"
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user