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

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

Loading…
Cancel
Save