This commit is contained in:
xiaozhiyong
2023-11-27 14:46:36 +08:00
parent 858948fbe4
commit 0554adda71
8 changed files with 546 additions and 573 deletions

View File

@@ -4,8 +4,10 @@
<block slot="content">中石化紫云路</block>
<block slot="backText">返回</block>
</cu-custom> -->
<view class="bg-img fixed-top flex align-end margin-bottom-lg " :style="'background-image: url('+otherImgURL+'bg.png '+');width: 750upx;height: 326rpx;background-size:cover'">
<image @tap="goBack" :src="imgURL+'site-back.png'" width="20upx" mode="widthFix" class="position-ab site-back">
<view class="bg-img fixed-top flex align-end margin-bottom-lg "
:style="'background-image: url('+otherImgURL+'bg.png '+');width: 750upx;height: 326rpx;background-size:cover'">
<image @tap="goBack" :src="imgURL+'site-back.png'" width="20upx" mode="widthFix"
class="position-ab site-back">
</image>
<view class="cu-list menu margin padding-sm radius my-shadow bg-white yu-card-xuan">
<view class="cu-item ">
@@ -24,14 +26,16 @@
<view class="oil-main-color">
<my-icon iconName="sy-der-icon.png" class="padding-right-xs text-sm"></my-icon>
<text v-if="!location">暂无信息</text>
<text v-else >{{siteInfo.juli|distanceFilter}}</text>
<text v-else>{{siteInfo.juli|distanceFilter}}</text>
</view>
</view>
</view>
</view>
</view>
<view class="bg-img placeholder-hidden flex align-end margin-bottom-lg " :style="'background-image: url('+imgURL+'site-bg.png '+');width: 750upx;height: 326rpx;background-size:cover'">
<image @tap="goBack" :src="imgURL+'site-back.png'" width="20upx" mode="widthFix" class="position-ab site-back">
<view class="bg-img placeholder-hidden flex align-end margin-bottom-lg "
:style="'background-image: url('+imgURL+'site-bg.png '+');width: 750upx;height: 326rpx;background-size:cover'">
<image @tap="goBack" :src="imgURL+'site-back.png'" width="20upx" mode="widthFix"
class="position-ab site-back">
</image>
<view class="flex-sub">
<view class="cu-list menu margin padding-sm radius my-shadow bg-white yu-card-xuan">
@@ -51,7 +55,7 @@
<view class="oil-main-color">
<my-icon iconName="sy-der-icon.png" class="padding-right-xs text-sm"></my-icon>
<text v-if="!location">暂无信息</text>
<text v-else >{{siteInfo.juli|distanceFilter}}</text>
<text v-else>{{siteInfo.juli|distanceFilter}}</text>
</view>
</view>
</view>
@@ -63,7 +67,7 @@
</view>
<!-- 价格 -->
<price-tab @onChangeChannelCode="getChannelCode" @onChangePayQr="onChangePayQr" @onChangePay="onChangePay"
:channel-list="siteInfo.oilSiteChannelDetailsVos" :siteInfo="siteInfo"></price-tab>
:channel-list="siteInfo.oilSiteChannelDetailsVos" :siteInfo="siteInfo"></price-tab>
<!-- 客户评价 -->
@@ -90,7 +94,8 @@
<text class=" text-black "> {{itm.oilsCode}} {{itm.volume}}L 节省 <text class="text-red">
{{itm.discountAmount}}</text></text>
</view>
<view class="cu-item no-border" v-if="siteInfo.oilSiteOrderInfoVos && !siteInfo.oilSiteOrderInfoVos.length">
<view class="cu-item no-border"
v-if="siteInfo.oilSiteOrderInfoVos && !siteInfo.oilSiteOrderInfoVos.length">
暂无
</view>
@@ -108,11 +113,11 @@
</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">
<button class="cu-btn block bg-main-oil lg" @tap="makePay">
<image class="site-icon margin-right-sm" :src="imgURL+'site-yz.png'" mode="widthFix">
</image>
一键支付
</button>
</button>
</view>
</view>
</view>
@@ -125,10 +130,10 @@
<view class="">
<image src="../../../static/img/errIcon.png" mode="" style="width:100rpx;height: 100rpx;"></image>
</view>
<view class="cu-bar box-panding text-centerS" >
<text class="headShow"> 支付提醒 </text>
<view class="cu-bar box-panding text-centerS">
<text class="headShow"> 支付提醒 </text>
</view>
<view class="cu-bar box-panding" >
<view class="cu-bar box-panding">
<text class="showtext">当前油站距离您较远请与加油员确认您选择的油站是否正确</text>
</view>
<view class="checklocation_box_button">
@@ -153,15 +158,15 @@
},
data() {
return {
location:null,
showtitle:false,
location: null,
showtitle: false,
radio: 'B',
mainURL: this.global.mainURL,
imgURL: this.global.imgURL,
otherImgURL:this.global.otherImgURL,
otherImgURL: this.global.otherImgURL,
active: 0,
ColorList: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
siteInfo: { },
siteInfo: {},
activeCur: '',
activePay: null,
qrcodePay: null,
@@ -171,59 +176,68 @@
}
},
onHide() {
this.innerAudioContext && this.innerAudioContext.stop()
if (this.innerAudioContext) {
this.innerAudioContext.stop()
}
},
onUnload() {
this.innerAudioContext && this.innerAudioContext.stop()
},
if (this.innerAudioContext) {
this.innerAudioContext.stop()
this.innerAudioContext.destroy()
}
},
onLoad(option) {
this.location = uni.getStorageSync('location')
// console.log('option',option)
// let userInfo = uni.getStorageSync('user')
// if(!userInfo && option.q) {
// uni.redirectTo({
// url: `/BagAuth/pages/login/login?scanningParams=${option.q}`
// })
// return
// }
if(option.q) {
let originLink = decodeURIComponent(option.q)
let target = this.obtainUrlPathParameterTarget(originLink)
console.log('target',target)
if(target.siteId) {
this.siteId = target.siteId
this.getSiteInfo(target.siteId)
}
return
if (option.q) {
try {
let originLink = decodeURIComponent(option.q)
let target = this.obtainUrlPathParameterTarget(originLink)
let authorization = uni.getStorageSync('Authorization')
if (authorization && target.siteId) {
uni.showModal({
content: '该二维码非最新版,请提示油站工作人员更新',
success: res => {
if(res.confirm) {
this.siteId = target.siteId
this.gotoPay()
}
if(res.cancel) {
this.backTohome()
}
}
})
}
} catch (e) {}
return
}
if(!option.item){
let siteInfos = uni.getStorageSync('siteInfo')
var oilItem = JSON.parse(decodeURIComponent(siteInfos))
}else{
var oilItem = JSON.parse(decodeURIComponent(option.item));
}
console.log(oilItem,'oilItemoilItemoilItem')
uni.setStorageSync('oilItem',oilItem)
this.getSiteInfo(oilItem)
this.location = uni.getStorageSync('location')
if (!option.item) {
let siteInfos = uni.getStorageSync('siteInfo')
var oilItem = JSON.parse(decodeURIComponent(siteInfos))
} else {
var oilItem = JSON.parse(decodeURIComponent(option.item));
}
// console.log(oilItem, 'oilItemoilItemoilItem')
uni.setStorageSync('oilItem', oilItem)
this.getSiteInfo(oilItem)
this.siteId = oilItem.siteId
if(oilItem.listTag == '万金油'){
if (oilItem.listTag == '万金油') {
this.audioUrl = 'https://publicxingyou.oss-cn-hangzhou.aliyuncs.com/mp-oil/wanjinyou.mp3'
}else if(oilItem.listTag == '星油'){
} else if (oilItem.listTag == '星油') {
this.audioUrl = 'https://publicxingyou.oss-cn-hangzhou.aliyuncs.com/mp-oil/xingyouyunzhan.mp3'
}else if(oilItem.listTag == '壳牌'){
} else if (oilItem.listTag == '壳牌') {
this.audioUrl = 'https://publicxingyou.oss-cn-hangzhou.aliyuncs.com/mp-oil/qiaopainew.mp3'
}else if(oilItem.listTag == '上汽联名卡'){
} else if (oilItem.listTag == '上汽联名卡') {
this.audioUrl = 'https://publicxingyou.oss-cn-hangzhou.aliyuncs.com/mp-oil/shangqi.mp3'
}
this.ContextAudio(this.audioUrl);
this.ContextAudio(this.audioUrl);
},
methods: {
methods: {
obtainUrlPathParameterTarget(url) {
let target = {}
if(url.includes('?')) {
if (url.includes('?')) {
let paramsText = url.split("?")[1]
let paramsArr = paramsText.split("&")
paramsArr.forEach(item => {
@@ -233,28 +247,30 @@
return target
},
// 生成音频文件
ContextAudio(url){
ContextAudio(url) {
this.innerAudioContext = uni.createInnerAudioContext();
this.innerAudioContext.autoplay = true;
this.innerAudioContext.src = url;
this.innerAudioContext.onPlay(() => {
console.log('开始播放');
console.log('开始播放');
});
this.innerAudioContext.onError((res) => {
console.log(res);
console.log(res);
});
},
backTohome(){
this.innerAudioContext && this.innerAudioContext.stop()
backTohome() {
// this.innerAudioContext && this.innerAudioContext.stop()
uni.switchTab({
url:'../../../pages/tabbar/home/home'
url: '../../../pages/tabbar/home/home'
})
},
hidendialog(){
this.showtitle =false
hidendialog() {
this.showtitle = false
},
gotoPay(){
this.innerAudioContext && this.innerAudioContext.stop()
gotoPay() {
// this.innerAudioContext && this.innerAudioContext.stop()
// console.log('this.activeCur',this.activeCur)
// return
uni.navigateTo({
url: `/BagStation/pages/makeOrder/makeOrder?siteId=${this.siteId}&activeCur=${this.activeCur}`
})
@@ -264,7 +280,7 @@
this.secondChannelCode = sec
},
siteQrPay() {
this.innerAudioContext && this.innerAudioContext.stop()
// this.innerAudioContext && this.innerAudioContext.stop()
uni.navigateTo({
url: `/BagStation/pages/stationDetail/stieQr?siteId=${this.siteId}&activeChannelCode=${this.activeChannelCode}&secondChannelCode=${this.secondChannelCode}`
})
@@ -276,20 +292,20 @@
clientBelong: "ZHONGPIN"
}
let user = uni.getStorageSync('user');
if (user) {
if (user) {
oilSiteApi.getSiteDetails(data2).then(res => {
if (res.code == 20000) {
this.siteInfo = Object.assign(item,res.data);
this.siteInfo = Object.assign(item, res.data);
}
})
})
} else {
this.siteInfo = item;
}
},
makePay() {
let user = uni.getStorageSync('user');
if(!user){
if (!user) {
uni.showModal({
title: '请您登录',
content: "登录佰川加油才可以加油 |˛˙꒳​˙)♡",
@@ -304,10 +320,10 @@
});
return
}
if(this.siteInfo.juli > 1000 ){
if (this.siteInfo.juli > 1000) {
this.showtitle = true
}else{
this.innerAudioContext && this.innerAudioContext.stop()
} else {
// this.innerAudioContext && this.innerAudioContext.stop()
uni.navigateTo({
url: `/BagStation/pages/makeOrder/makeOrder?siteId=${this.siteId}&activeCur=${this.activeCur}`
})
@@ -335,7 +351,7 @@
},
goBack() {
// this.innerAudioContext.stop()
// this.innerAudioContext.stop()
uni.switchTab({
url: '/pages/tabbar/home/home'
@@ -486,69 +502,83 @@
.yu-card-xuan .action {
white-space: nowrap;
}.close-icon{
position: absolute;
right: 2%;
top: 2%;
}
.dialog-box{
position: relative;
}
.text-centerS{
display: flex;
justify-content: center;
align-items: center;
text-align: center;
}
.red_btn{
color: #FFFFFF;
background-color: #1890FF ;
}
.box-paddings{
padding:40rpx 0;
}
.headShow{
font-size: 36rpx;
font-weight: 600;
}
.showtext{
line-height: 2;
font-size: 30rpx;
margin-bottom: 30rpx;
padding: 0 10%;
word-spacing: 10px;
letter-spacing: 3px;
text-align: left;
}
.checklocation_box_button{
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 5%;
}
.btn-box{
width: 45%;
flex: 0 0 auto;
text-align: center;
padding: 3%;
border-radius: 20rpx;
font-size: 28rpx;
box-sizing: border-box;
border: 2rpx solid #bfbfbf;
}
.box-panding{
padding:10 0;
}
.checklocation{
}
.close-icon {
position: absolute;
right: 2%;
top: 2%;
}
.dialog-box {
position: relative;
}
.text-centerS {
display: flex;
justify-content: center;
align-items: center;
text-align: center;
}
.red_btn {
color: #FFFFFF;
background-color: #1890FF;
}
.box-paddings {
padding: 40rpx 0;
}
.headShow {
font-size: 36rpx;
font-weight: 600;
}
.showtext {
line-height: 2;
font-size: 30rpx;
margin-bottom: 30rpx;
padding: 0 10%;
word-spacing: 10px;
letter-spacing: 3px;
text-align: left;
}
.checklocation_box_button {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 5%;
}
.btn-box {
width: 45%;
flex: 0 0 auto;
text-align: center;
padding: 3%;
border-radius: 20rpx;
font-size: 28rpx;
box-sizing: border-box;
border: 2rpx solid #bfbfbf;
}
.box-panding {
padding: 10 0;
}
.checklocation {
position: fixed;
top: 50%;
left: 20%;
right: 20%;
z-index: 999;
}
.checklocation_box{
.checklocation_box {
background-color: #FFFFFF;
}
.content {
min-height: 100%;
position: relative;