|
|
|
<template>
|
|
|
|
<view class="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>
|
|
|
|
<scroll-view scroll-x class="bg-white nav">
|
|
|
|
<view class="flex text-center">
|
|
|
|
<view class="cu-item flex-sub" :class="index==TabCur?'text-orange cur':''" v-for="(item,index) in tabList" :key="index"
|
|
|
|
@tap="tabSelect" :data-id="index">{{item}}</view>
|
|
|
|
</view>
|
|
|
|
</scroll-view>
|
|
|
|
<view class="margin">
|
|
|
|
<OrderItem class="cu-list menu-avatar comment" v-for="(item,index) in tabList" :key="index" v-show="index==TabCur"
|
|
|
|
:item="order" />
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import cloudSiteApi from '@/api/cloud-site.js'
|
|
|
|
import OrderItem from '@/components/order-item'
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
OrderItem
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
tabList: [
|
|
|
|
'全部', '待支付', '已支付', '退款'
|
|
|
|
],
|
|
|
|
TabCur: 0,
|
|
|
|
pageNumber: 1,
|
|
|
|
istate: 3,
|
|
|
|
scrollLeft: 0,
|
|
|
|
order: {
|
|
|
|
istate: 0,
|
|
|
|
vol: 3,
|
|
|
|
oilName: '0#',
|
|
|
|
orderID: '15979997825872',
|
|
|
|
oilCode: '12396989',
|
|
|
|
oilSiteName: '疯疯疯加油站',
|
|
|
|
carNo: '皖A12354',
|
|
|
|
sourceType: 3,
|
|
|
|
realamount: 4.66,
|
|
|
|
credateDatetime: '2020-10-12 12:30:10'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
this.calcIstate(this.TabCur)
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
tabSelect(e) {
|
|
|
|
this.TabCur = e.currentTarget.dataset.id;
|
|
|
|
this.calcIstate(this.TabCur)
|
|
|
|
this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60
|
|
|
|
},
|
|
|
|
calcIstate(id) {
|
|
|
|
|
|
|
|
switch (id) {
|
|
|
|
case 0:
|
|
|
|
this.istate = 3
|
|
|
|
this.loadList()
|
|
|
|
break
|
|
|
|
case 1:
|
|
|
|
this.istate = 0
|
|
|
|
this.loadList()
|
|
|
|
break
|
|
|
|
case 2:
|
|
|
|
this.istate = 1
|
|
|
|
this.loadList()
|
|
|
|
break
|
|
|
|
case 3:
|
|
|
|
this.istate = 2
|
|
|
|
this.loadList()
|
|
|
|
break
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
loadList() {
|
|
|
|
const data2 = {
|
|
|
|
istate: this.istate, //类型:Number 必有字段 备注:订单状态 0待支付 1支付成功 -3 查所有
|
|
|
|
pageIndex: this.pageNumber //类型:Number 必有字段 备注:查询第几页,默认一页10条
|
|
|
|
}
|
|
|
|
cloudSiteApi.getSiteOrder(data2).then(res => {
|
|
|
|
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.content {
|
|
|
|
min-height: 100%;
|
|
|
|
}
|
|
|
|
</style>
|