pull/6/head
xiaozhiyong 2 years ago
parent ea5b71c1ae
commit 7be8276544
  1. 349
      pages/stationDetail/OrderStatus.vue

@ -9,59 +9,62 @@
<image src="../../static/img/new_logo.png" class='showimgs' mode=""></image> <image src="../../static/img/new_logo.png" class='showimgs' mode=""></image>
</view> </view>
</view> </view>
<view class="radius margin bg-white padding-top padding " style="padding-top: 125rpx;"> <view class="radius margin bg-white padding-top padding " style="padding-top: 125rpx;">
<view class=""> <view class="">
<view class="payStatue_text"> <view class="payStatue_text">
<text>{{PayTitle}}</text> <text>{{PayTitle}}</text>
</view> </view>
<view class="number text-xl text-center oil-main-color">{{displayMoney|numberFormat}}</view> <view class="number text-xl text-center oil-main-color">{{displayMoney|numberFormat}}</view>
</view> </view>
<view class="payStatue"> <view class="payStatue">
<view class="payStatue_p" v-if="payState == 0"> <view class="payStatue_p" v-if="payState == 0">
<text>请勿离开当前页面,等待支付完成</text> <text>请勿离开当前页面,等待支付完成</text>
</view> </view>
<view class="payStatue_p" v-if="payState == 2"> <view class="payStatue_p" v-if="payState == 2">
<button style="width: 500upx;margin-bottom: 40upx;" v-if="payState == 2" class="round large cu-btn bg-main-oil" @tap="singleCheck(orderId)">手动刷新</button> <button style="width: 500upx;margin-bottom: 40upx;" v-if="payState == 2"
</view> class="round large cu-btn bg-main-oil" @tap="singleCheck(orderId)">手动刷新</button>
</view> </view>
<view class="margin-bottom-sm" @tap="copyId(orderInfos.customerId,'司机编号')"> </view>
司机编号 <view class="margin-bottom-sm" @tap="copyId(orderInfos.customerId,'司机编号')">
<text class="fr">{{orderInfos.customerId}}<text :class="orderInfos.customerId?'cuIcon-copy':''" class="flex-sub padding-left-sm text-right text-lg text-red"> 司机编号
</text></text> <text class="fr">{{orderInfos.customerId}}<text :class="orderInfos.customerId?'cuIcon-copy':''"
</view> class="flex-sub padding-left-sm text-right text-lg text-red">
<view class="margin-bottom-sm"> </text></text>
加油司机 </view>
<view class="fr"> <view class="margin-bottom-sm">
<text>{{ orderInfos.customerName ? orderInfos.customerName : '丰油用户' }}</text> <text class="padding-left-sm">{{orderInfos.plateNumber|plateFilter}} 加油司机
</text> <view class="fr">
</view> <text>{{ orderInfos.customerName ? orderInfos.customerName : '丰油用户' }}</text> <text
class="padding-left-sm">{{orderInfos.plateNumber|plateFilter}}
</text>
</view>
</view> </view>
<!-- <view class="margin-bottom-sm" @tap="copyId(orderItem.carNo,'司机车牌')"> <!-- <view class="margin-bottom-sm" @tap="copyId(orderItem.carNo,'司机车牌')">
司机车牌 司机车牌
<text class="fr">{{orderItem.carNo?orderItem.carNo:'暂无'}}<text :class="orderItem.carNo?'cuIcon-copy':''" class="flex-sub padding-left-sm text-right text-lg text-red"> <text class="fr">{{orderItem.carNo?orderItem.carNo:'暂无'}}<text :class="orderItem.carNo?'cuIcon-copy':''" class="flex-sub padding-left-sm text-right text-lg text-red">
</text></text> </text></text>
</view> --> </view> -->
<view class="margin-bottom-sm"> <view class="margin-bottom-sm">
油枪油号 油枪油号
<text class="fr">{{orderInfos.oilsBar}}号枪{{orderInfos.oilName||orderInfos.oilsCode}}</text> <text class="fr">{{orderInfos.oilsBar}}号枪{{orderInfos.oilName||orderInfos.oilsCode}}</text>
</view> </view>
<view class="margin-bottom-sm"> <view class="margin-bottom-sm">
油机单价 油机单价
<text class="fr">{{orderInfos.sitePrice||orderInfos.price |UnitPriceFormat}} / </text> <text class="fr">{{orderInfos.sitePrice||orderInfos.price |UnitPriceFormat}} / </text>
</view> </view>
<view class="margin-bottom-sm"> <view class="margin-bottom-sm">
加油升数 加油升数
<text class="fr">{{orderInfos.volume|numberFormat}} </text> <text class="fr">{{orderInfos.volume|numberFormat}} </text>
</view> </view>
<view class="margin-bottom-sm" v-if="orderSource=='mpxoil'"> <view class="margin-bottom-sm" v-if="orderSource=='mpxoil'">
油机总价 油机总价
<text class="fr">{{displayMoney|numberFormat}}</text> <text class="fr">{{displayMoney|numberFormat}}</text>
</view> </view>
<!-- <view class="margin-bottom-sm" v-if="orderItem.xoilDiscountAmount"> <!-- <view class="margin-bottom-sm" v-if="orderItem.xoilDiscountAmount">
星卡优惠 星卡优惠
<text class="fr">¥ {{(orderItem.xoilDiscountAmount)|numberFormat}}</text> <text class="fr">¥ {{(orderItem.xoilDiscountAmount)|numberFormat}}</text>
</view> </view>
@ -73,80 +76,84 @@
优惠券 优惠券
<text class="fr">{{orderItem.coupon|couponFormat}}</text> <text class="fr">{{orderItem.coupon|couponFormat}}</text>
</view> --> </view> -->
<!-- <view class="margin-bottom-sm"> <!-- <view class="margin-bottom-sm">
实扣款 实扣款
<text class="fr oil-main-color">¥ {{orderItem.realamount|numberFormat}}</text> <text class="fr oil-main-color">¥ {{orderItem.realamount|numberFormat}}</text>
</view> --> </view> -->
</view>
<view class="radius bg-white margin padding ">
<view class="flex padding-bottom-sm">
<view class="basis-sm">
加油站名称
</view> </view>
<view class="radius bg-white margin padding "> <view class="basis-lg text-right text-cut">{{orderItem.siteName}}</view>
<view class="flex padding-bottom-sm"> </view>
<view class="basis-sm"> <view class="flex padding-bottom-sm">
加油站名称 <view class="basis-xs">
</view> 地址
<view class="basis-lg text-right text-cut">{{orderItem.siteName}}</view>
</view>
<view class="flex padding-bottom-sm">
<view class="basis-xs">
地址
</view>
<view class="basis-xl text-right text-cut">{{orderItem.siteAddress}}</view>
</view>
</view> </view>
<view class="radius bg-white margin margin-bottom-0 padding"> <view class="basis-xl text-right text-cut">{{orderItem.siteAddress}}</view>
<view class="margin-bottom-sm" @tap="copyId(orderInfos.orderSerialNumber,'订单号')"> </view>
订单号 </view>
<text class=" fr">{{orderInfos.orderSerialNumber}}<text class="flex-sub padding-left-sm text-right cuIcon-copy text-lg text-red"> <view class="radius bg-white margin margin-bottom-0 padding">
</text></text> <view class="margin-bottom-sm" @tap="copyId(orderInfos.orderSerialNumber,'订单号')">
</view> 订单号
<view class="margin-bottom-sm"> <text class=" fr">{{orderInfos.orderSerialNumber}}<text
下单时间 class="flex-sub padding-left-sm text-right cuIcon-copy text-lg text-red">
<text class="fr">{{orderInfos.createTime}}</text> </text></text>
</view> </view>
<!-- <view class="margin-bottom-sm"> <view class="margin-bottom-sm">
下单时间
<text class="fr">{{orderInfos.createTime}}</text>
</view>
<!-- <view class="margin-bottom-sm">
扣款时间 扣款时间
<text class="fr">{{orderItem.paydatetime}}</text> <text class="fr">{{orderItem.paydatetime}}</text>
</view> --> </view> -->
<!-- <view class="padding-bottom-sm"> <!-- <view class="padding-bottom-sm">
开票状态 开票状态
<text class="fr" v-if="formQr">未开票</text> <text class="fr" v-if="formQr">未开票</text>
<text class="fr" v-else>{{orderItem.invoiceState|invoiceStateFormat}}</text> <text class="fr" v-else>{{orderItem.invoiceState|invoiceStateFormat}}</text>
</view> --> </view> -->
<!-- <view class="margin-bottom-sm" v-if="orderItem.paydatetime"> <!-- <view class="margin-bottom-sm" v-if="orderItem.paydatetime">
支付时间 支付时间
<text class="fr">{{orderItem.paydatetime}}</text> <text class="fr">{{orderItem.paydatetime}}</text>
</view>--> </view>-->
</view>
<view class="radius bg-white margin margin-bottom-0 padding" v-if='orderItem.plateNumberImages'>
<view class="flex padding-bottom-sm">
<view class="basis-sm">
车辆照片
</view> </view>
<view class="radius bg-white margin margin-bottom-0 padding" v-if='orderItem.plateNumberImages'> <view class="basis-lg text-right text-cut" @tap="showImg('car')">点击查看</view>
<view class="flex padding-bottom-sm"> </view>
<view class="basis-sm"> <view class="flex padding-bottom-sm">
车辆照片 <view class="basis-xs">
</view> 油站照片
<view class="basis-lg text-right text-cut" @tap="showImg('car')">点击查看</view>
</view>
<view class="flex padding-bottom-sm">
<view class="basis-xs">
油站照片
</view>
<view class="basis-xl text-right text-cut" @tap="showImg('oli')">点击查看</view>
</view>
</view> </view>
<view class="padding-lg padding-top-40 padding-bottom-xl"> <view class="basis-xl text-right text-cut" @tap="showImg('oli')">点击查看</view>
<!-- <button v-show="formQr" @tap="scanQr" class="bg-main-oil margin-bottom"> </view>
</view>
<view class="padding-lg padding-top-40 padding-bottom-xl">
<!-- <button v-show="formQr" @tap="scanQr" class="bg-main-oil margin-bottom">
<text class="cuIcon-scan padding-right-xs"></text> <text class="cuIcon-scan padding-right-xs"></text>
继续加油</button> --> 继续加油</button> -->
<button v-if="payState == 1" class="round large cu-btn bg-main-oil btn-oils" @tap="toDetails(orderId)">前往订单</button> <button v-if="payState == 1" class="round large cu-btn bg-main-oil btn-oils"
<button v-if="payState == 2" class="round large cu-btn bg-main-oil btn-oils" @tap="getScanning()">重新扫码下单</button> @tap="toDetails(orderId)">前往订单</button>
<button v-if="payState != 0" class="round large cu-btn bg-main-oil btn-oils" @tap="gotoHome()">返回首页</button> <button v-if="payState == 2" class="round large cu-btn bg-main-oil btn-oils"
<!-- <button class="bg-red light margin-bottom" @tap="backHome"> @tap="getScanning()">重新扫码下单</button>
<button v-if="payState != 0" class="round large cu-btn bg-main-oil btn-oils"
@tap="gotoHome()">返回首页</button>
<!-- <button class="bg-red light margin-bottom" @tap="backHome">
<text class="cuIcon-home padding-right-xs"></text> <text class="cuIcon-home padding-right-xs"></text>
返回首页</button> --> 返回首页</button> -->
</view> </view>
<u-popup v-model="show" mode="center" @close="close" > <u-popup v-model="show" mode="center" @close="close">
<view style="width: 100%;height: 100%;"> <view style="width: 100%;height: 100%;">
<image :src="showUrl" style=" max-width: 80%;max-height: 80%;" mode=""></image> <image :src="showUrl" style=" max-width: 80%;max-height: 80%;" mode=""></image>
</view> </view>
</u-popup> </u-popup>
<!-- <view class="margin-sm bg-white padding-lg"> <!-- <view class="margin-sm bg-white padding-lg">
<view class="padding-top margin-bottom"></view> <view class="padding-top margin-bottom"></view>
<view class="text-xsl text-center"> <view class="text-xsl text-center">
@ -201,99 +208,98 @@
<script> <script>
import oilFinanceApi from '@/api/oil-finance.js' import oilFinanceApi from '@/api/oil-finance.js'
export default{ export default {
data(){ data() {
return{ return {
orderItem:uni.getStorageSync('SiteInfo'), orderItem: uni.getStorageSync('SiteInfo'),
insertResult:{}, insertResult: {},
orderId:'', orderId: '',
timerF:'', timerF: '',
checkTime:40, checkTime: 40,
payState:0, payState: 0,
PayTitle:'正在支付中', PayTitle: '正在支付中',
orderInfos:{} orderInfos: {}
}
},
filters:{numberFormat(value) {
if (value != 'xxx.x') {
console.log('old:',value)
let realAmount =value.toFixed(2)
console.log('new:',realAmount)
return realAmount
} else {
return value
} }
}, },
UnitPriceFormat(value){ filters: {
console.log('++++++++++++++++++++',value) numberFormat(value) {
if(value){ if (value != 'xxx.x') {
console.log('old:', value)
let realAmount = value.toFixed(2)
console.log('new:', realAmount)
return realAmount
} else {
return value return value
} else{ }
},
UnitPriceFormat(value) {
console.log('++++++++++++++++++++', value)
if (value) {
return value
} else {
return '--' return '--'
} }
}, },
}, },
onLoad(option) { onLoad(option) {
console.log(option) console.log(option)
let insertResult= JSON.parse(option.item) let insertResult = JSON.parse(option.item)
this.insertResult = insertResult this.insertResult = insertResult
console.log(this.insertResult) console.log(this.insertResult)
this.orderId =insertResult.orderId this.orderId = insertResult.orderId
let orderId=insertResult.orderId let orderId = insertResult.orderId
console.log(this.orderId) console.log(this.orderId)
this.checkSf(orderId)// this.checkSf(orderId) //
this.timerF = setInterval((res)=>{ this.timerF = setInterval((res) => {
this.checkSf(orderId) this.checkSf(orderId)
},5000) }, 5000)
}, },
methods:{ methods: {
getScanning(){ // getScanning() { //
uni.redirectTo({ uni.redirectTo({
url: '/pages/stationDetail/stationDetail', url: '/pages/stationDetail/stationDetail',
fail: (err) => { fail: (err) => {}
}
}) })
}, },
gotoHome(){ // gotoHome() { //
uni.reLaunch({ uni.reLaunch({
url: '/pages/index/index', url: '/pages/index/index',
fail: (err) => { fail: (err) => {}
}
}) })
}, },
singleCheck(ids){ //check singleCheck(ids) { //check
let _that = this let _that = this
oilFinanceApi.checkOrderState(ids).then( (res)=>{ oilFinanceApi.checkOrderState(ids).then((res) => {
console.log(res) console.log(res)
if(res.code == 20000){ if (res.code == 20000) {
_that.displayMoney =res.data.payRealAmount _that.displayMoney = res.data.payRealAmount
_that.orderInfos = res.data _that.orderInfos = res.data
console.log(_that.orderInfos) console.log(_that.orderInfos)
_that.payState = res.data.orderStatus _that.payState = res.data.orderStatus
if(res.data.orderStatus == 0){ if (res.data.orderStatus == 0) {
_that.PayTitle = '正在支付中....' _that.PayTitle = '正在支付中....'
} }
if(res.data.orderStatus == 1){ if (res.data.orderStatus == 1) {
_that.PayTitle = '支付成功' _that.PayTitle = '支付成功'
if(_that.payState != 0 || res.data.orderStatus==1){ if (_that.payState != 0 || res.data.orderStatus == 1) {
console.log('测试手动刷新是否进入清除计时器') console.log('测试手动刷新是否进入清除计时器')
clearInterval(_that.timerF) clearInterval(_that.timerF)
} }
} }
if(res.data.orderStatus == 2){ if (res.data.orderStatus == 2) {
if(!res.data.cancelRemak){ if (!res.data.cancelRemak) {
_that.PayTitle = '支付已取消' _that.PayTitle = '支付已取消'
}else{ } else {
_that.PayTitle = res.data.cancelRemak _that.PayTitle = res.data.cancelRemak
} }
if(_that.payState != 0 || res.data.orderStatus==2){ if (_that.payState != 0 || res.data.orderStatus == 2) {
console.log('测试手动刷新是否进入清除计时器') console.log('测试手动刷新是否进入清除计时器')
clearInterval(_that.timerF) clearInterval(_that.timerF)
} }
} }
} }
} ) })
}, },
toDetails(id) { toDetails(id) {
uni.setStorageSync('orderId', id) uni.setStorageSync('orderId', id)
@ -303,20 +309,20 @@
}) })
}, },
checkSf(id){// check checkSf(id) { // check
let _that = this, let _that = this,
time = _that.checkTime, time = _that.checkTime,
ids = id ids = id
if(time<=0){ if (time <= 0) {
uni.showToast({ uni.showToast({
title:'支付已取消' title: '支付已取消'
}) })
_that.payState = 0 _that.payState = 0
_that.PayTitle= '三分钟自动取消....' _that.PayTitle = '三分钟自动取消....'
clearInterval(_that.timerF) clearInterval(_that.timerF)
// uni.navigateBack({}) // uni.navigateBack({})
}else{ } else {
time -- time--
_that.singleCheck(ids) _that.singleCheck(ids)
// oilFinanceApi.checkOrderState(ids).then( (res)=>{ // oilFinanceApi.checkOrderState(ids).then( (res)=>{
// console.log(res) // console.log(res)
@ -369,9 +375,10 @@
</script> </script>
<style scoped> <style scoped>
page{ page {
background-color: #efefef; background-color: #efefef;
} }
.page-content { .page-content {
background-color: #f1f2f7; background-color: #f1f2f7;
min-height: 100%; min-height: 100%;
@ -429,7 +436,8 @@
display: block; display: block;
border-radius: 0 0 0 100upx; border-radius: 0 0 0 100upx;
} }
.payStatue_text{
.payStatue_text {
font-size: 36rpx; font-size: 36rpx;
color: #737373; color: #737373;
font-weight: bold; font-weight: bold;
@ -437,7 +445,8 @@
text-align: center; text-align: center;
margin-top: 6rpx; margin-top: 6rpx;
} }
.payStatue_p{
.payStatue_p {
font-size: 26rpx; font-size: 26rpx;
color: #888888; color: #888888;
font-weight: bold; font-weight: bold;
@ -445,7 +454,8 @@
margin-bottom: 30rpx; margin-bottom: 30rpx;
margin-top: 20rpx; margin-top: 20rpx;
} }
.btn-oils{
.btn-oils {
width: 100%; width: 100%;
border-radius: 14rpx; border-radius: 14rpx;
margin-top: 30rpx; margin-top: 30rpx;
@ -453,15 +463,18 @@
/* padding: 14rpx; */ /* padding: 14rpx; */
height: 80rpx; height: 80rpx;
} }
.showimgs{
.showimgs {
width: 130rpx; width: 130rpx;
height: 130rpx; height: 130rpx;
} }
.boxsings_main_top{
position: relative; .boxsings_main_top {
margin-top: 90rpx; position: relative;
margin-top: 90rpx;
} }
.showIcons{
.showIcons {
background-color: #fff; background-color: #fff;
background-size: cover; background-size: cover;
position: absolute; position: absolute;

Loading…
Cancel
Save