pull/17/head
zhangyouji 1 year ago
parent 6d88cd5659
commit 1c588d3c35
  1. 75
      BagStation/pages/stationDetail/stationDetail.vue
  2. 19
      utils/request.js

@ -101,20 +101,15 @@
</view>
<!-- 底部去支付 -->
<view class="" >
<view class="btn bg-white placeholder-hidden">
<!-- <view class="btn bg-white placeholder-hidden">
<view class="flex bg-white padding flex-direction">
<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>
一键支付
</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 class="btn bg-white fixed ">
<view class="flex bg-white padding flex-direction">
<button class="cu-btn block bg-main-oil lg" @tap="makePay">
@ -122,11 +117,6 @@
</image>
一键支付
</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>
@ -275,12 +265,20 @@
let user = uni.getStorageSync('user');
let data2 = {
...uni.getStorageSync('location'),
siteId: id
siteId: id,
clientBelong: "BAICHUAN"
}
if (user) {
oilSiteApi.getSiteDetails(data2).then(res => {
if (res.code == 20000) {
this.siteInfo = res.data
}else {
setTimeout(()=>{
uni.showToast({
title:res.msg,
icon:'none'
})
},1000)
}
})
} else {
@ -290,36 +288,28 @@
},
makePay() {
let user = uni.getStorageSync('user');
if (this.activePay && user) {
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}`
})
}
} else {
if(!user){
uni.showModal({
title: '请您登录',
content: "登录佰川加油才可以加油 |˛˙꒳˙)♡",
confirmText: '去登陆',
success: (res) => {
if (res.confirm) {
uni.reLaunch({
url: '../../../BagAuth/pages/login/login?loginType=true'
})
}
if(!user){
uni.showModal({
title: '请您登录',
content: "登录佰川加油才可以加油 |˛˙꒳˙)♡",
confirmText: '去登陆',
success: (res) => {
if (res.confirm) {
uni.reLaunch({
url: '../../../BagAuth/pages/login/login?loginType=true'
})
}
})
}else{
uni.showToast({
title:'暂无可选油品',
icon:'none'
})
}
}
})
return
}
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}`
})
}
},
@ -327,6 +317,7 @@
this.qrcodePay = val
},
onChangePay(val, active) {
console.log(val)
this.activePay = val
this.activeCur = active
},

@ -37,25 +37,17 @@ service.interceptors.request.use(
config.headers['dataSources'] = 'MP'
if (env === 'production') {
// 生产环境,加密,不输出任何东西
// 设置jsessionid和token
const JSESSIONID = utils.uuid()
config.headers['JSESSIONID'] = JSESSIONID
config.headers['token'] = utils.md5Salt(JSESSIONID)
// if ( encryptWhite.indexOf(config.url) < 0) {
// if (!notEncrypt && encryptWhite.indexOf(config.url) < 0) {
// 这是定义在哪的
const data = { // 用于存储加密
params: '' // 加密后的密文
}
// 要加密
data.params = utils.encrypt(JSON.stringify(config.data))
// console.log('参数', config.url, '参数加密前',config.data)
config.data = data
// }
} else {
console.log('\n\n-----------------------')
console.log('参数', config.url, '参数加密前', config.data)
url = config.url
}
@ -78,15 +70,10 @@ service.interceptors.response.use(
if (env === 'production') {
// 生产环境,进行加密解密,不输出日志
if (res.encrypt == 1) {
// 加密的数据,需要解密
const dataParam = JSON.parse(utils.decrypt(res.data))
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()
if(response.config.url.indexOf('/oil-site/oilSiteOrderInfo/getOrderQrCode') === -1){
@ -95,9 +82,7 @@ service.interceptors.response.use(
title: res.msg,
icon: "none"
})
}
}
return res
},

Loading…
Cancel
Save