百川更新

This commit is contained in:
2023-09-20 16:04:55 +08:00
parent d7d1fc5ae5
commit eade32dca7
8 changed files with 104 additions and 43 deletions

View File

@@ -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({

View File

@@ -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'