1.3.2
This commit is contained in:
@@ -8,9 +8,14 @@
|
||||
|
||||
</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" v-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-if="orderItem.sourceType===5" :style="'background-image:url('+baseURL+'static/img/order-lv.png)'"></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 -->
|
||||
@@ -18,36 +23,46 @@
|
||||
<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">{{orderItem.istate|formatStr}}</view>
|
||||
<view class="number text-xl text-center oil-main-color">¥{{orderItem.realamount|numberFormat}}</view>
|
||||
<view class="text-lg text-center" v-if="orderSource=='zy'">{{orderItem.istate|formatZyStr}}</view>
|
||||
<view class="text-lg text-center" v-else>{{istate|formatStr}}</view>
|
||||
<view class="number text-xl text-center oil-main-color">¥{{orderItem.realamount|numberFormat}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="margin-bottom-sm" @tap="copyId(orderItem.userName,'加油司机')">
|
||||
加油司机
|
||||
<text class="fr">{{orderItem.userName}}<text class="flex-sub padding-left-sm text-right cuIcon-copy text-lg text-red">
|
||||
<text class="fr">{{orderItem.userName}}<text
|
||||
class="flex-sub padding-left-sm text-right cuIcon-copy text-lg text-red">
|
||||
</text></text>
|
||||
</view>
|
||||
|
||||
<view class="margin-bottom-sm" @tap="copyId(orderItem.carNo,'司机车牌')">
|
||||
司机车牌
|
||||
<text class="fr">{{orderItem.carNo}}<text class="flex-sub padding-left-sm text-right cuIcon-copy text-lg text-red">
|
||||
<text class="fr">{{orderItem.carNo}}<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.bar}}号枪{{orderItem.oilName}}</text>
|
||||
<text class="fr">{{orderItem.bar}}号枪{{orderItem.oilName||orderItem.oilCode}}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm">
|
||||
加油总金额
|
||||
<text class="fr">¥ {{orderItem.amount|numberFormat}}</text>
|
||||
<text
|
||||
class="fr">¥{{orderItem.amount?orderItem.amount:(orderItem.xoilDiscountAmount+orderItem.realamount)|numberFormat}}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm">
|
||||
加油升数
|
||||
<text class="fr">{{orderItem.vol|numberFormat}} 升</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm">
|
||||
<view class="margin-bottom-sm" v-if="orderItem.xoilDiscountAmount">
|
||||
星卡优惠
|
||||
<text class="fr">¥ {{orderItem.amount-orderItem.realamount|numberFormat}}</text>
|
||||
<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">
|
||||
优惠券
|
||||
@@ -78,7 +93,8 @@
|
||||
<view class="radius bg-white margin margin-bottom-0 padding">
|
||||
<view class="margin-bottom-sm" @tap="copyId(orderItem.orderID,'订单号')">
|
||||
订单号
|
||||
<text class=" fr">{{orderItem.orderID}}<text class="flex-sub padding-left-sm text-right cuIcon-copy text-lg text-red">
|
||||
<text class=" fr">{{orderItem.orderID}}<text
|
||||
class="flex-sub padding-left-sm text-right cuIcon-copy text-lg text-red">
|
||||
</text></text>
|
||||
|
||||
</view>
|
||||
@@ -123,35 +139,89 @@
|
||||
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
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.formQr && !this.tempOrderInfo.payOrderId) {
|
||||
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,
|
||||
onUnload() {
|
||||
uni.setStorageSync('orderSource', null)
|
||||
this.clearStatus()
|
||||
},
|
||||
computed: {
|
||||
istate() {
|
||||
let orderType = uni.getStorageSync('orderType')
|
||||
if (orderType == 1) {
|
||||
console.log(this.orderItem.istate)
|
||||
switch (parseInt(this.orderItem.istate)) {
|
||||
// 网页版 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.istate
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// if (this.orderType == 1) {
|
||||
// // 小程序订单
|
||||
// this.getMPorder()
|
||||
// return false
|
||||
// }
|
||||
if (this.orderSource === 'zy') {
|
||||
// 则一
|
||||
this.orderItem = this.tempOrderInfo
|
||||
} 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
|
||||
this.getOrderDetail()
|
||||
}
|
||||
},
|
||||
onHide() {
|
||||
this.clearStatus()
|
||||
},
|
||||
onUnload() {
|
||||
this.clearStatus()
|
||||
},
|
||||
|
||||
methods: {
|
||||
getMPorder() {
|
||||
cloudSiteApi.getNewItemSiteOrderInfo({
|
||||
id: this.orderId
|
||||
}).then(res => {
|
||||
// 小程序点动感详情
|
||||
if (res.code === 20000) {
|
||||
this.orderItem = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
clearStatus() {
|
||||
uni.removeStorageSync('formQr')
|
||||
},
|
||||
@@ -160,10 +230,10 @@
|
||||
uni.navigateTo({
|
||||
url: scanUrl,
|
||||
fail: (err) => {
|
||||
console.log(err)
|
||||
// console.log(err)
|
||||
},
|
||||
success: (res) => {
|
||||
console.log('chengg', res)
|
||||
// console.log('chengg', res)
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -185,6 +255,7 @@
|
||||
},
|
||||
getOrderDetail() {
|
||||
cloudSiteApi.getSiteOrderById(this.orderId).then(res => {
|
||||
// G7
|
||||
if (res.code === 20000) {
|
||||
this.orderItem = res.data
|
||||
}
|
||||
@@ -192,20 +263,35 @@
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
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 3:
|
||||
return '订单已支付'
|
||||
case -2:
|
||||
return '订单已退款'
|
||||
case 4:
|
||||
return '订单支付失败'
|
||||
case 0:
|
||||
return '订单待支付'
|
||||
default:
|
||||
return '订单待支付'
|
||||
case 2:
|
||||
return '订单已取消'
|
||||
|
||||
}
|
||||
},
|
||||
couponFormat(value) {
|
||||
@@ -218,6 +304,8 @@
|
||||
numberFormat(value) {
|
||||
if (value) {
|
||||
return value.toFixed(2)
|
||||
} else {
|
||||
return '0.00'
|
||||
}
|
||||
},
|
||||
invoiceStateFormat(value) {
|
||||
|
||||
Reference in New Issue
Block a user