星油云站更新

This commit is contained in:
caoliancun
2022-03-02 16:22:09 +08:00
parent d5eea27607
commit bb229d2eb3
71 changed files with 6188 additions and 904 deletions

View File

@@ -5,13 +5,13 @@
<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" v-if="orderItem.sourceType===3" :style="'background-image:url('+baseURL+'static/img/order-wjy.png)'"></view>
<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 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 -->
@@ -19,20 +19,20 @@
<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" v-if="orderSource=='zy'">{{orderItem.istate|formatZyStr}}</view>
<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 class="number text-xl text-center oil-main-color">{{displayMoney|numberFormat}}</view>
</view>
<view class="margin-bottom-sm" @tap="copyId(orderItem.driverID,'司机编号')">
<view class="margin-bottom-sm" @tap="copyId(orderItem.customerId,'司机编号')">
司机编号
<text class="fr">{{orderItem.driverID}}<text :class="orderItem.driverID?'cuIcon-copy':''" class="flex-sub padding-left-sm text-right text-lg text-red">
<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.userName|nameFilter}}</text> <text class="padding-left-sm">{{orderItem.carNo|plateFilter}}
<text>{{orderItem.customerName|nameFilter}}</text> <text class="padding-left-sm">{{orderItem.plateNumber|plateFilter}}
</text>
</view>
@@ -46,7 +46,7 @@
<view class="margin-bottom-sm">
油枪油号
<text class="fr">{{orderItem.bar}}号枪{{orderItem.oilName||orderItem.oilCode}}</text>
<text class="fr">{{orderItem.oilsBar}}号枪{{orderItem.oilName||orderItem.oilsCode}}</text>
</view>
<!-- <view class="margin-bottom-sm">
加油总金额
@@ -55,11 +55,11 @@
</view> -->
<view class="margin-bottom-sm">
油机单价
<text class="fr">{{orderItem.sitePrice||orderItem.price}} / </text>
<text class="fr">{{orderItem.sitePrice|| orderItem.price | UnitPriceFormat}} / {{orderItem.oilProductType=='GAS'?'KG':'L'}}</text>
</view>
<view class="margin-bottom-sm">
加油升数
<text class="fr">{{orderItem.vol|numberFormat}} </text>
{{ orderItem.oilProductType=='GAS'?'加气重量':'加油升数' }}
<text class="fr">{{orderItem.volume|numberFormats}} {{orderItem.oilProductType=='GAS'?'KG':'L'}}</text>
</view>
<view class="margin-bottom-sm" v-if="orderSource=='mpxoil'">
油机总价
@@ -90,7 +90,7 @@
<view class="basis-sm">
加油站名称
</view>
<view class="basis-lg text-right text-cut">{{orderItem.oilSiteName}}</view>
<view class="basis-lg text-right text-cut">{{orderItem.siteName}}</view>
</view>
<view class="flex padding-bottom-sm">
@@ -101,34 +101,45 @@
</view>
</view>
<view class="radius bg-white margin margin-bottom-0 padding">
<view class="margin-bottom-sm" @tap="copyId(orderItem.orderID,'订单号')">
<view class="margin-bottom-sm" @tap="copyId(orderItem.orderSerialNumber,'订单号')">
订单号
<text class=" fr">{{orderItem.orderID}}<text class="flex-sub padding-left-sm text-right cuIcon-copy text-lg text-red">
<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">
下单时间
<text class="fr">{{orderItem.createDatetime}}</text>
<text class="fr">{{orderItem.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> -->
<!-- <view class="margin-bottom-sm" v-if="orderItem.paydatetime">
支付时间
<text class="fr">{{orderItem.paydatetime}}</text>
</view>-->
</view>
<view class="padding">
<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-0 padding-bottom-xl">
<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>
@@ -137,41 +148,63 @@
返回首页</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
baseURL: this.global.baseURL,
zeyiType:0,
}
},
onUnload() {
uni.setStorageSync('orderSource', null)
this.clearStatus()
},
filters:{
company(e){
if(e) return e=='GAS'?'KG':'L';
},
},
computed: {
displayMoney(){
if(this.orderSource=='mpxoil'){
return this.orderItem.sitePrice*this.orderItem.vol
console.log('mpxoil')
return this.orderItem.sitePriceAmount
}else{
console.log('zeyi')
// return this.orderItem.price*this.orderItem.vol
return this.orderItem.realamount
console.log('这里是则一++++')
return this.orderItem.sitePriceAmount
}
},
istate() {
let orderType = uni.getStorageSync('orderType')
if (orderType == 1) {
console.log(this.orderItem.istate)
switch (parseInt(this.orderItem.istate)) {
console.log(this.orderItem.OrderStatus)
switch (parseInt(this.orderItem.OrderStatus)) {
// 网页版 0待支付 1已支付 -1支付失败 -2退款
//小程序 0待支付 1已支付 -1支付失败 2已取消3已退款
case 1:
@@ -186,7 +219,7 @@
return -2
}
} else {
return this.orderItem.istate
return this.orderItem.OrderStatus
}
}
},
@@ -196,9 +229,28 @@
// this.getMPorder()
// return false
// }
console.log(this.tempOrderInfo)
if (this.orderSource === 'zy') {
// 则一
this.orderItem = this.tempOrderInfo
// 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()
@@ -218,24 +270,56 @@
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() {
cloudSiteApi.getNewItemSiteOrderInfo({
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)
}
})
},
@@ -274,8 +358,11 @@
},
getOrderDetail() {
cloudSiteApi.getSiteOrderById(this.orderId).then(res => {
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
}
@@ -283,6 +370,14 @@
}
},
filters: {
UnitPriceFormat(value){
console.log('++++++++++++++++++++',value)
if(value){
return value
} else{
return '--'
}
},
nameFilter(value) {
if (value) {
var arr = value.split('')
@@ -337,9 +432,30 @@
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) {
return value.toFixed(2)
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})?/))
return number
} else {
return '0.00'
}
@@ -381,4 +497,14 @@
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>