oil-station/pos-uni/pagesHome/orderList/orderList.vue
DESKTOP-369JRHT\12997 e8ab427cdc no message
2024-05-28 08:40:17 +08:00

227 lines
4.3 KiB
Vue

<template>
<view class="content">
<view class="container">
<headers :titles="titles"><u-icon name="arrow-left" color="#fff" size="22"></u-icon></headers>
<view class="tablist">
<view class="tabbox" v-for="(item,index) in tablist" :key="index" @click="getindex(index)">
<view class="">{{item}}</view>
<view class="gang" v-if="tabindex == index"></view>
</view>
</view>
<view class="box_" v-for="item,index in orderList" :key="index">
<view class="b-bx">
<!-- <view class="title_">京博加油站</view> -->
<view class="zt-size" v-if="item.orderStatus == 'paid'">已支付</view>
<view class="zt-size" v-if="item.orderStatus == 'refund'">已退款</view>
<view class="zt-size" v-if="item.orderStatus == 'unpaid'">未支付</view>
</view>
<view class="centne">
<view class="touxiang"></view>
<view class="right-centne">
<view class="h_">订单号:{{item.orderNo}}</view>
<view class="h_">油号:{{item.oilName}}</view>
<view class="h_">升数:{{item.shengshu}}L</view>
<view class="h_">下单时间:{{item.payTime}}</view>
<view class="b-bx">
<view class="">应付:¥{{item.goodsMoney}}</view>
<view class="">优惠:¥0.00</view>
</view>
</view>
</view>
<view class="end-box">实付:¥{{item.payMoney}}</view>
</view>
<view style="width: 100%; height: 20px; "></view>
</view>
</view>
</template>
<script>
import request from "../../utils/request";
import headers from '../../components/header/headers.vue'
export default {
data() {
return {
titles: "订单列表",
tabindex: 0,
tablist: [
"全部",
"已完成",
"已退款",
"支付失败",
],
orderList: [],
form: {
page: 1,
pageSize: 10,
status: ''
}
}
},
onShow() {
// this.actList = ["1", "1", "1", "1", "1", ]
// this.status = "nomore" 底部刷新结束
this.getPageListByPos();
},
onPullDownRefresh() {
console.log("刷新");
uni.stopPullDownRefresh()
},
onReachBottom() {
// this.show = true
setTimeout(() => {
console.log("加载执行");
}, 2000)
},
components: {
headers
},
methods: {
getindex(index) {
this.orderList = []
this.tabindex = index
if (index == 0) {
this.form.status = ''
} else if (index == 1) {
this.form.status = 'paid'
} else if (index == 2) {
this.form.status = 'refund'
} else if (index == 3) {
this.form.status = 'unpaid'
}
this.getPageListByPos()
},
goback() {
uni.navigateBack()
},
getPageListByPos() {
request({
url: 'business/allOrderInfo/getPageListByPos',
method: 'get',
params: this.form
}).then((res) => {
if (res.code == 200) {
this.orderList = res.data.records;
} else {
uni.showToast({
title: res.data,
icon: "none"
})
}
})
},
}
}
</script>
<style scoped lang="scss">
.content {
background: #f8f8f8;
// background: linear-gradient(180deg, #B2D2FC 0%, #B2D2FC 14%, rgba(255, 255, 255, 0.84) 24%, rgba(255, 255, 255, 0.84) 100%);
height: 100vh;
}
.container {
width: 100%;
background: #f8f8f8;
box-sizing: border-box;
padding-top: 88px;
}
.img-box {
image {
width: 100%;
height: 100%;
}
}
.tablist {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
}
.tabbox {
width: 25%;
height: 40px;
text-align: center;
box-sizing: border-box;
padding-top: 15px;
}
.gang {
width: 36px;
height: 2px;
background: #0864E9;
margin: 5px auto;
}
.box_ {
width: 95%;
border-radius: 8px;
background: #fff;
box-sizing: border-box;
padding: 15px;
margin: 15px auto;
}
.b-bx {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
}
.title_ {
font-weight: bold;
font-size: 16px;
color: #333333;
}
.zt-size {
font-weight: bold;
font-size: 16px;
color: #FD504E;
}
.centne {
display: flex;
}
.touxiang {
width: 60px;
height: 60px;
border-radius: 50%;
background: #D9D9D9;
margin-right: 15px;
}
.right-centne {
width: 70%;
font-size: 14px;
}
.h_ {
margin-bottom: 5px;
}
.end-box {
width: 100%;
text-align: right;
font-weight: bold;
font-size: 16px;
color: #0864E9;
}
</style>