85 lines
1.7 KiB
Vue
85 lines
1.7 KiB
Vue
<template>
|
|
<layout>
|
|
<uv-sticky
|
|
bgColor="#fff"
|
|
customNavHeight="0"
|
|
>
|
|
<uv-navbar
|
|
:fixed="false"
|
|
title="售后订单"
|
|
@leftClick="goBack"
|
|
/>
|
|
<uv-tabs
|
|
:scrollable="false"
|
|
:list="navList"
|
|
@click="click"
|
|
lineColor="#f56c6c"
|
|
></uv-tabs>
|
|
</uv-sticky>
|
|
<view
|
|
class="orderList"
|
|
v-if="!listEmpty"
|
|
>
|
|
<refund-order
|
|
:data="item"
|
|
v-for="(item) in dataList"
|
|
:key="`${type}_${item.id}`"
|
|
@refresh="handleRefresh"
|
|
/>
|
|
</view>
|
|
<Empty
|
|
v-else
|
|
:iconSrc="emptyIcon"
|
|
></Empty>
|
|
<!-- 加载中 -->
|
|
<ListLoadLoading v-if="loading" />
|
|
<!-- 加载完毕-->
|
|
<ListLoadOver v-if="loadend" />
|
|
</layout>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { ref } from 'vue'
|
|
import { onLoad } from '@dcloudio/uni-app'
|
|
import { orderList, storeAfterSalesList } from '@/api/order'
|
|
import { useRouter } from "@/hooks/useRouter";
|
|
import emptyIcon from "@/static/icon/empty/订单.png"
|
|
import Empty from "@/components/Empty/index.vue"
|
|
import { usePage } from "@/hooks";
|
|
|
|
const {type, refresh, dataList, loadend, loading, listEmpty} = usePage(storeAfterSalesList)
|
|
|
|
const {goBack, getParams} = useRouter();
|
|
|
|
|
|
const navList = ref([
|
|
{name: "全部", value: -1,},
|
|
{name: "售后中", value: 1,},
|
|
{name: "已完成", value: 2,},
|
|
])
|
|
|
|
|
|
const click = (data) => {
|
|
type.value = data.value
|
|
refresh()
|
|
}
|
|
|
|
onLoad((options) => {
|
|
const params = getParams(options)
|
|
if (params.type < 0 || !params.type) {
|
|
type.value = -1
|
|
} else {
|
|
type.value = params.type
|
|
}
|
|
refresh()
|
|
})
|
|
|
|
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.orderList {
|
|
padding: 20rpx 0;
|
|
}
|
|
</style>
|