This commit is contained in:
xk_guohonglei
2021-06-04 09:20:09 +08:00
parent 422843e0ac
commit 1335809f58
14 changed files with 1504 additions and 241 deletions

View File

@@ -3,9 +3,12 @@
<template>
<view class="cu-item radius shadow margin-bottom ">
<!-- <image class="pay-status" :src="baseURL+'static/img/oil-unfinished.png'" alt /> -->
<view class="cu-avatar text-sl" v-if="item.sourceType==='3'" :style="'background-image:url('+baseURL+'static/img/order-wjy.png)'"></view>
<view class="cu-avatar text-sl" v-if="item.sourceType==='4'||item.sourceType==='6'" :style="'background-image:url('+baseURL+'static/img/order-xy.png)'"></view>
<view class="cu-avatar text-sl" v-if="item.sourceType==='5'" :style="'background-image:url('+baseURL+'static/img/order-lv.png)'"></view>
<view class="cu-avatar text-sl" v-if="item.sourceType==='3'"
:style="'background-image:url('+baseURL+'static/img/order-wjy.png)'"></view>
<view class="cu-avatar text-sl" v-if="item.sourceType==='4'||item.sourceType==='6'"
:style="'background-image:url('+baseURL+'static/img/order-xy.png)'"></view>
<view class="cu-avatar text-sl" v-if="item.sourceType==='5'"
:style="'background-image:url('+baseURL+'static/img/order-lv.png)'"></view>
<view class="content">
<view class=" solid-bottom padding-bottom-sm">
<view class="flex-treble" @tap="copyId(item.orderID)">
@@ -23,7 +26,8 @@
<view class="details">
<view class="top1 text-left">
<image class="icon icon-desc " :src="baseURL+'static/img/oil-lf.png'" alt />
<text class="padding-left-xs padding-right-xs" v-if="item.vol"> {{item.vol|numberFilter}}</text>
<text class="padding-left-xs padding-right-xs" v-if="item.vol">
{{item.vol|numberFilter}}</text>
<text>
{{item.oilName}}
</text>
@@ -49,29 +53,30 @@
</view>
<view class="margin-top-sm flex justify-between" @tap="toDetails(item.orderID)">
<view class="text-gray text-df">
{{item.createDatetime.substring(0,19)}}</view>
{{item.createDatetime.substring(0,19)}}
</view>
<view>
<text class="color-000 text-lg total-money">{{item.realamount|numberFilter}}</text>
<view class="round pay-state light bg-olive bg-transparent text-center state-0" v-if="item.istate==0">
<text class="inner-istate round">{{item.istate|formatStr}}</text>
<view class="round pay-state light bg-olive bg-transparent text-center state-0" v-if="istate==0">
<text class="inner-istate round">{{istate|formatStr}}</text>
<view class="inner-border">
</view>
</view>
<view class="round pay-state light bg-orange bg-transparent text-center state-1" v-if="item.istate==1">
<text class="inner-istate round">{{item.istate|formatStr}}</text>
<view class="round pay-state light bg-orange bg-transparent text-center state-1" v-if="istate==1">
<text class="inner-istate round">{{istate|formatStr}}</text>
<view class="inner-border">
</view>
</view>
<view class="round pay-state light bg-oilve bg-transparent text-center state--1" v-if="item.istate==-1">
<text class="inner-istate round">{{item.istate|formatStr}}</text>
<view class="round pay-state light bg-oilve bg-transparent text-center state--1" v-if="istate==-1">
<text class="inner-istate round">{{istate|formatStr}}</text>
<view class="inner-border">
</view>
</view>
<view class="round pay-state light bg-gray bg-transparent text-center state--2" v-if="item.istate==-2">
<text class="inner-istate round">{{item.istate|formatStr}}</text>
<view class="round pay-state light bg-gray bg-transparent text-center state--2" v-if="istate==-2||istate==2">
<text class="inner-istate round">{{istate|formatStr}}</text>
<view class="inner-border">
</view>
@@ -88,16 +93,39 @@
</template>
<script>
export default {
name: 'oilOrders',
props: {
item: {
type: Object,
default () {}
}
},
computed: {
istate() {
let orderType = uni.getStorageSync('orderType')
if (orderType == 1) {
console.log(this.item.istate)
switch (parseInt(this.item.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.item.istate
}
}
},
data() {
return {
baseURL: this.global.baseURL
@@ -116,8 +144,9 @@
})
},
toDetails(id) {
let orderType = uni.getStorageSync('orderType')
uni.setStorageSync('orderSource', orderType == 1 ? 'mpxoil' : null)
uni.setStorageSync('orderId', id)
console.log('id', id)
uni.navigateTo({
url: '/packageOrders/pages/orderList/OrderDetail/OrderDetail'
})
@@ -140,7 +169,9 @@
return value.toFixed(2)
},
formatStr(value) {
let orderType = uni.getStorageSync('orderType')
switch (parseInt(value)) {
// 0待支付 1已支付 -1支付失败 -2退款
case 1:
return '已支付'
case -1:
@@ -149,9 +180,10 @@
return '退款'
case 0:
return '待支付'
default:
return '待支付'
case 2:
return '已取消'
}
}
}
}