星油云站
This commit is contained in:
511
packageOrders/pages/orderList/OrderDetail/OrderDetail.vue
Normal file
511
packageOrders/pages/orderList/OrderDetail/OrderDetail.vue
Normal file
@@ -0,0 +1,511 @@
|
||||
<template>
|
||||
<view class="page-content my-bg">
|
||||
<cu-custom class="main-totextbar bg-main-oil" :isBack="true" bgColor="bg-main-oil">
|
||||
<block slot="backText">返回</block>
|
||||
<block slot="content">订单详情</block>
|
||||
</cu-custom>
|
||||
<view class="padding margin">
|
||||
</view>
|
||||
<view class="text-center margin-top icon-container">
|
||||
<view class="cu-avatar xl round text-sl headImg"></view>
|
||||
<!-- <view class="cu-avatar xl round text-sl" v-if="orderItem.sourceType===3" :style="'background-image:url('+baseURL+'static/img/order-wjy.png)'"></view>
|
||||
<view class="cu-avatar xl round text-sl" v-else-if="orderItem.sourceType===4||orderItem.sourceType===6" :style="'background-image:url('+baseURL+'static/img/order-xy.png)'"></view>
|
||||
<view class="cu-avatar xl round text-sl" v-else-if="orderItem.sourceType===5" :style="'background-image:url('+baseURL+'static/img/order-lv.png)'"></view>
|
||||
<view class="cu-avatar xl round text-sl" v-else :style="'background-image:url('+baseURL+'static/img/order-xy.png)'"></view> -->
|
||||
</view>
|
||||
<view class="radius margin margin-top bg-white padding-top padding">
|
||||
<!-- sourceType 万金油3 老吕5 星油4/6 -->
|
||||
<!-- <image size="20" v-if="orderItem.sourceType===4||orderItem.sourceType===6" :src="baseURL+'static/img/order-xy.png'"></image>
|
||||
<image size="20" v-else-if="orderItem.sourceType===3" :src="baseURL+'static/img/order-wjy.png'"></image>
|
||||
<image size="20" v-else-if="orderItem.sourceType===5" :src="baseURL+'static/img/order-lv.png'"></image> -->
|
||||
<view class="margin padding">
|
||||
<view class="text-lg text-center orderText" style="font-weight:700;margin-top: 10rpx;" >{{orderItem.orderStatus|formatZyStr}}</view>
|
||||
<view class="text-lg text-center" v-if="orderSource=='zy'">{{orderItem.orderStatus|formatZyStr}}</view>
|
||||
<view class="text-lg text-center" v-else>{{istate|formatStr}}</view>
|
||||
<view class="number text-xl text-center oil-main-color">¥{{displayMoney|numberFormat}}</view>
|
||||
</view>
|
||||
<view class="margin-bottom-sm" @tap="copyId(orderItem.customerId,'司机编号')">
|
||||
司机编号
|
||||
<text class="fr">{{orderItem.customerId}}<text :class="orderItem.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>{{orderItem.customerName|nameFilter}}</text> <text class="padding-left-sm">{{orderItem.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">{{orderItem.oilsBar}}号枪{{orderItem.oilName||orderItem.oilsCode}}</text>
|
||||
</view>
|
||||
<!-- <view class="margin-bottom-sm">
|
||||
加油总金额
|
||||
<text
|
||||
class="fr">¥{{orderItem.amount?orderItem.amount:(orderItem.xoilDiscountAmount+orderItem.realamount)|numberFormat}}</text>
|
||||
</view> -->
|
||||
<view class="margin-bottom-sm">
|
||||
油机单价
|
||||
<text class="fr">¥{{orderItem.sitePrice|| orderItem.price | UnitPriceFormat}} / {{orderItem.oilProductType=='GAS'?'L':'L'}}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm">
|
||||
{{ orderItem.oilProductType=='GAS'?'加气升数':'加油升数' }}
|
||||
<text class="fr">{{orderItem.volume|numberFormats}} {{orderItem.oilProductType=='GAS'?'L':'L'}}</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>
|
||||
<view class="margin-bottom-sm" v-else>
|
||||
星卡优惠
|
||||
<text class="fr">¥ {{(orderItem.amount-orderItem.realamount)|numberFormat}}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm">
|
||||
优惠券
|
||||
<text class="fr">{{orderItem.coupon|couponFormat}}</text>
|
||||
</view> -->
|
||||
<!-- <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="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.address}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="radius bg-white margin margin-bottom-0 padding">
|
||||
<view class="margin-bottom-sm" @tap="copyId(orderItem.orderSerialNumber,'订单号')">
|
||||
订单号
|
||||
<text class=" fr">{{orderItem.orderSerialNumber}}<text class="flex-sub padding-left-sm text-right cuIcon-copy text-lg text-red">
|
||||
</text></text>
|
||||
|
||||
</view>
|
||||
<view class="margin-bottom-sm">
|
||||
{{orderItem.suppleMark==0 ? '订单创建时间' : '补单订单创建时间'}}
|
||||
<text class="fr">{{orderItem.orderTime||` ${orderItem.createTime}`}} </text>
|
||||
</view>
|
||||
<!-- <view class="margin-bottom-sm">
|
||||
扣款时间
|
||||
<text class="fr">{{orderItem.paydatetime}}</text>
|
||||
</view> -->
|
||||
<!-- <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">
|
||||
支付时间
|
||||
<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="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 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 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: 100%;max-height:100%;display: block;object-fit: cove;" mode=""></image>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import cloudSiteApi from '@/api/cloud-site.js'
|
||||
import oilFnanceApi from '@/api/oil-finance.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
orderStatue:'下单成功',
|
||||
show:false,
|
||||
// orderId:'',
|
||||
showUrl:'',
|
||||
plateNumberImages:'',
|
||||
refuellerImages:'',
|
||||
orderId: uni.getStorageSync('orderId'),
|
||||
formQr: uni.getStorageSync('formQr') ? true : false,
|
||||
tempOrderInfo: uni.getStorageSync('tempOrderInfo'),
|
||||
orderSource: uni.getStorageSync('orderSource'),
|
||||
orderType: uni.getStorageSync('orderType'),
|
||||
orderItem: {},
|
||||
baseURL: this.global.baseURL,
|
||||
zeyiType:0,
|
||||
}
|
||||
},
|
||||
onUnload() {
|
||||
uni.setStorageSync('orderSource', null)
|
||||
this.clearStatus()
|
||||
},
|
||||
filters:{
|
||||
company(e){
|
||||
if(e) return e=='GAS'?'L':'L';
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
displayMoney(){
|
||||
if(this.orderSource=='mpxoil'){
|
||||
console.log('mpxoil')
|
||||
return this.orderItem.sitePriceAmount
|
||||
|
||||
}else{
|
||||
console.log('zeyi')
|
||||
// return this.orderItem.price*this.orderItem.vol
|
||||
console.log('这里是则一++++')
|
||||
|
||||
return this.orderItem.sitePriceAmount
|
||||
}
|
||||
},
|
||||
istate() {
|
||||
let orderType = uni.getStorageSync('orderType')
|
||||
if (orderType == 1) {
|
||||
console.log(this.orderItem.OrderStatus)
|
||||
switch (parseInt(this.orderItem.OrderStatus)) {
|
||||
// 网页版 0:待支付, 1:已支付 ,-1:支付失败 ,-2:退款,
|
||||
//小程序 0:待支付, 1:已支付 ,-1:支付失败 ,2:已取消,3:已退款
|
||||
case 1:
|
||||
return 1
|
||||
case -1:
|
||||
return -1
|
||||
case 2:
|
||||
return 2
|
||||
case 0:
|
||||
return 0
|
||||
case 3:
|
||||
return -2
|
||||
}
|
||||
} else {
|
||||
return this.orderItem.OrderStatus
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// if (this.orderType == 1) {
|
||||
// // 小程序订单
|
||||
// this.getMPorder()
|
||||
// return false
|
||||
// }
|
||||
|
||||
console.log(this.tempOrderInfo)
|
||||
if (this.orderSource === 'zy') {
|
||||
// 则一
|
||||
// let obj = {
|
||||
// addres : this.tempOrderInfo.address ,
|
||||
// oilsBar : this.tempOrderInfo.bar ,
|
||||
// plateNumber :this.tempOrderInfo.carNo ,
|
||||
// // coupon: 0
|
||||
// createTime : this.tempOrderInfo.createDatetime,
|
||||
// orderStatus : this.tempOrderInfo.istate,
|
||||
// oilName : this.tempOrderInfo.oilName,
|
||||
// siteName : this.tempOrderInfo.oilSiteName,
|
||||
// Id : this.tempOrderInfo.orderID,
|
||||
// // orderStatus: 1,
|
||||
// payRealAmount : this.tempOrderInfo.realamount,
|
||||
// customerName : this.tempOrderInfo.userName,
|
||||
// volume :this.tempOrderInfo.vol,
|
||||
// xoilDiscountAmount : this.tempOrderInfo.xoilDiscountAmount
|
||||
// }
|
||||
this.getZyPorder()
|
||||
// this.orderItem = obj
|
||||
} else if (this.orderSource === 'mpxoil') {
|
||||
// 则一
|
||||
this.getMPorder()
|
||||
} else if (this.formQr && !this.tempOrderInfo.payOrderId) {
|
||||
if (this.orderType == 0) {
|
||||
// 一般订单的网页订单
|
||||
this.orderItem = {
|
||||
...this.tempOrderInfo,
|
||||
orderID: this.tempOrderInfo.payOrderId,
|
||||
amount: this.tempOrderInfo.standardAmount,
|
||||
realamount: this.tempOrderInfo.oilAmount,
|
||||
userName: this.tempOrderInfo.driverId,
|
||||
carNo: this.tempOrderInfo.plateNumber,
|
||||
createDatetime: this.tempOrderInfo.createTime,
|
||||
paydatetime: this.tempOrderInfo.payTime,
|
||||
bar: this.tempOrderInfo.oilGun,
|
||||
vol: this.tempOrderInfo.volume,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// G7
|
||||
let _that = this
|
||||
_that.zeyiType = 1
|
||||
this.getOrderDetail()
|
||||
}
|
||||
},
|
||||
onHide() {
|
||||
this.clearStatus()
|
||||
},
|
||||
methods: {
|
||||
close(){
|
||||
console.log('关闭')
|
||||
},
|
||||
showImg(type){
|
||||
if(type === 'car'){
|
||||
console.log('1111111',type,this.plateNumberImages,this.showUrl)
|
||||
this.showUrl =this.plateNumberImages
|
||||
}else{
|
||||
console.log('2222222',type,this.plateNumberImages,this.showUrl)
|
||||
this.showUrl =this.refuellerImages
|
||||
}
|
||||
this.show = true
|
||||
},
|
||||
getMPorder() {
|
||||
console.log('这里是星油')
|
||||
oilFnanceApi.getOrderInfo({
|
||||
id: this.orderId
|
||||
}).then(res => {
|
||||
// 小程序点动感详情
|
||||
console.log('这里是星油',res)
|
||||
if (res.code === 20000) {
|
||||
this.orderItem = res.data
|
||||
this.plateNumberImages = res.data.plateNumberImages
|
||||
this.refuellerImages = res.data.refuellerImages
|
||||
console.log(this.orderItem)
|
||||
}
|
||||
})
|
||||
},
|
||||
getZyPorder(){
|
||||
console.log('这里是则一')
|
||||
console.log(this.tempOrderInfo.orderId)
|
||||
oilFnanceApi.getOrderInfo({
|
||||
id:this.tempOrderInfo.orderId
|
||||
}).then(res => {
|
||||
console.log('这里是则一',res)
|
||||
// 小程序点动感详情
|
||||
if (res.code === 20000) {
|
||||
this.orderItem = res.data
|
||||
console.log(this.orderItem)
|
||||
}
|
||||
})
|
||||
},
|
||||
clearStatus() {
|
||||
uni.removeStorageSync('formQr')
|
||||
},
|
||||
scanQr() {
|
||||
var scanUrl = '/pages/station-info/scan-camera/scan-camera'
|
||||
uni.navigateTo({
|
||||
url: scanUrl,
|
||||
fail: (err) => {
|
||||
// console.log(err)
|
||||
},
|
||||
success: (res) => {
|
||||
// console.log('chengg', res)
|
||||
}
|
||||
})
|
||||
},
|
||||
backHome() {
|
||||
uni.navigateBack({
|
||||
delta: 2
|
||||
})
|
||||
},
|
||||
copyId(id, name) {
|
||||
if (id) {
|
||||
uni.setClipboardData({
|
||||
data: id,
|
||||
success: () => {
|
||||
uni.showToast({
|
||||
title: name + '已复制',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
getOrderDetail() {
|
||||
console.log('这里是g7')
|
||||
oilFnanceApi.getOrderInfo({id:this.orderId}).then(res => {
|
||||
// G7
|
||||
console.log('这里是g7',res)
|
||||
console.log(res.data)
|
||||
if (res.code === 20000) {
|
||||
this.orderItem = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
UnitPriceFormat(value){
|
||||
console.log('++++++++++++++++++++',value)
|
||||
if(value){
|
||||
return value
|
||||
} else{
|
||||
return '--'
|
||||
}
|
||||
},
|
||||
nameFilter(value) {
|
||||
if (value) {
|
||||
var arr = value.split('')
|
||||
arr[1] = "*"
|
||||
return arr.join('')
|
||||
}
|
||||
},
|
||||
plateFilter(value) {
|
||||
if (value) {
|
||||
const numBegin = value.substring(0, 2);
|
||||
const numEnd = value.substring(5);
|
||||
return numBegin + '***' + numEnd;
|
||||
}else{
|
||||
return '暂无'
|
||||
}
|
||||
},
|
||||
formatZyStr(value) {
|
||||
switch (parseInt(value)) {
|
||||
case 1:
|
||||
return '订单已支付'
|
||||
case -1:
|
||||
return '订单支付失败'
|
||||
case 2:
|
||||
return '订单已取消'
|
||||
case 3:
|
||||
return '订单已退款'
|
||||
default:
|
||||
return '订单待支付'
|
||||
}
|
||||
},
|
||||
formatStr(value) {
|
||||
switch (parseInt(value)) {
|
||||
case 1:
|
||||
return '订单已支付'
|
||||
case -1:
|
||||
return '订单支付失败'
|
||||
case -2:
|
||||
return '订单已退款'
|
||||
case 4:
|
||||
return '订单支付失败'
|
||||
case 0:
|
||||
return '订单待支付'
|
||||
case 2:
|
||||
return '订单已取消'
|
||||
|
||||
}
|
||||
},
|
||||
couponFormat(value) {
|
||||
if (value) {
|
||||
return value
|
||||
} else {
|
||||
return '未使用'
|
||||
}
|
||||
},
|
||||
numberFormats(value) {
|
||||
if (value) {
|
||||
console.log(value)
|
||||
// let _thast = this.zeyiType
|
||||
// console.log(_thast)
|
||||
// if( _that.zeyiType == 1){
|
||||
// return value
|
||||
// }
|
||||
let number = (Math.round(value * 100) / 100).toFixed(2)
|
||||
return number
|
||||
} else {
|
||||
return '0.00'
|
||||
}
|
||||
},
|
||||
numberFormat(value) {
|
||||
if (value) {
|
||||
console.log(value)
|
||||
// let _thast = this.zeyiType
|
||||
// console.log(_thast)
|
||||
// if( _that.zeyiType == 1){
|
||||
// return value
|
||||
// }
|
||||
// let number = Number(value.toString().match(/^\d+(?:\.\d{0,2})?/))
|
||||
let number = Number(value).toFixed(2)
|
||||
return number
|
||||
} else {
|
||||
return '0.00'
|
||||
}
|
||||
},
|
||||
invoiceStateFormat(value) {
|
||||
switch (parseInt(value)) {
|
||||
case 1:
|
||||
return '已申请'
|
||||
case 2:
|
||||
return '已开票'
|
||||
case -1:
|
||||
return '开票失败'
|
||||
case 0:
|
||||
return '未开票'
|
||||
default:
|
||||
return ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/* 去付款弹窗 */
|
||||
.popup-container p.title {
|
||||
padding: 16px 10px;
|
||||
}
|
||||
|
||||
text.fr {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.icon-container {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.icon-container .text-sl {
|
||||
position: absolute;
|
||||
margin-left: -64rpx;
|
||||
margin-top: -64rpx;
|
||||
z-index: 2;
|
||||
}
|
||||
.headImg{
|
||||
background-image: url(../../../../packageQr/static/img/new_logo.png);
|
||||
background-size: cover;
|
||||
background-color: #fff;
|
||||
}
|
||||
.orderText{
|
||||
font-weight: 700;
|
||||
margin-bottom: 10rpx;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user