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

@ -21,18 +21,21 @@
<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"
class="round large cu-btn bg-main-oil" @tap="singleCheck(orderId)">手动刷新</button>
</view> </view>
</view> </view>
<view class="margin-bottom-sm" @tap="copyId(orderInfos.customerId,'司机编号')"> <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 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></text>
</view> </view>
<view class="margin-bottom-sm"> <view class="margin-bottom-sm">
加油司机 加油司机
<view class="fr"> <view class="fr">
<text>{{ orderInfos.customerName ? orderInfos.customerName : '丰油用户' }}</text> <text class="padding-left-sm">{{orderInfos.plateNumber|plateFilter}} <text>{{ orderInfos.customerName ? orderInfos.customerName : '丰油用户' }}</text> <text
class="padding-left-sm">{{orderInfos.plateNumber|plateFilter}}
</text> </text>
</view> </view>
@ -95,7 +98,8 @@
<view class="radius bg-white margin margin-bottom-0 padding"> <view class="radius bg-white margin margin-bottom-0 padding">
<view class="margin-bottom-sm" @tap="copyId(orderInfos.orderSerialNumber,'订单号')"> <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 class=" fr">{{orderInfos.orderSerialNumber}}<text
class="flex-sub padding-left-sm text-right cuIcon-copy text-lg text-red">
</text></text> </text></text>
</view> </view>
<view class="margin-bottom-sm"> <view class="margin-bottom-sm">
@ -134,15 +138,18 @@
<!-- <button v-show="formQr" @tap="scanQr" class="bg-main-oil margin-bottom"> <!-- <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"
@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 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>
@ -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) { filters: {
numberFormat(value) {
if (value != 'xxx.x') { if (value != 'xxx.x') {
console.log('old:',value) console.log('old:', value)
let realAmount =value.toFixed(2) let realAmount = value.toFixed(2)
console.log('new:',realAmount) console.log('new:', realAmount)
return realAmount return realAmount
} else { } else {
return value return value
} }
}, },
UnitPriceFormat(value){ UnitPriceFormat(value) {
console.log('++++++++++++++++++++',value) console.log('++++++++++++++++++++', value)
if(value){ if (value) {
return value return value
} else{ } 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{
.boxsings_main_top {
position: relative; position: relative;
margin-top: 90rpx; margin-top: 90rpx;
} }
.showIcons{
.showIcons {
background-color: #fff; background-color: #fff;
background-size: cover; background-size: cover;
position: absolute; position: absolute;

Loading…
Cancel
Save