更新
This commit is contained in:
@@ -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>
|
||||||
@@ -275,12 +265,20 @@
|
|||||||
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 => {
|
||||||
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 {
|
||||||
@@ -290,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 && 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}`
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -327,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
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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