Merge pull request 'master' (#18) from master into xiaozy_大卫用户协议
Reviewed-on: #18
This commit was merged in pull request #18.
This commit is contained in:
@@ -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({
|
||||
|
||||
@@ -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>
|
||||
@@ -185,14 +175,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 +212,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 +232,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 +245,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,24 +255,30 @@
|
||||
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'),
|
||||
siteId: id
|
||||
siteId: id,
|
||||
clientBelong: "BAICHUAN"
|
||||
}
|
||||
if (user) {
|
||||
oilSiteApi.getSiteDetails(data2).then(res => {
|
||||
console.log('进入获取油站信息getSiteDetails', res)
|
||||
if (res.code == 20000) {
|
||||
this.siteInfo = res.data
|
||||
}else {
|
||||
setTimeout(()=>{
|
||||
uni.showToast({
|
||||
title:res.msg,
|
||||
icon:'none'
|
||||
})
|
||||
},1000)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
@@ -274,36 +288,28 @@
|
||||
},
|
||||
makePay() {
|
||||
let user = uni.getStorageSync('user');
|
||||
if (this.activePay && user) {
|
||||
if (this.siteInfo.juli > 1000) {
|
||||
this.showtitle = true
|
||||
} else {
|
||||
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}`
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
@@ -311,6 +317,7 @@
|
||||
this.qrcodePay = val
|
||||
},
|
||||
onChangePay(val, active) {
|
||||
console.log(val)
|
||||
this.activePay = val
|
||||
this.activeCur = active
|
||||
},
|
||||
@@ -329,10 +336,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'
|
||||
|
||||
Reference in New Issue
Block a user