代码提交

This commit is contained in:
黄少君
2023-11-14 17:21:03 +08:00
parent d0b337c596
commit dcab74274f
567 changed files with 22414 additions and 7375 deletions

View File

@ -1,83 +1,83 @@
<template>
<layout>
<uv-sticky
bgColor="#fff"
customNavHeight="0"
bgColor="#fff"
customNavHeight="0"
>
<uv-navbar
:fixed="false"
title="售后订单"
@leftClick="$onClickLeft"
:fixed="false"
title="售后订单"
@leftClick="goBack"
/>
<uv-tabs
:scrollable="false"
:list="navList"
@click="click"
lineColor="#f56c6c"
>
></uv-tabs>
:scrollable="false"
:list="navList"
@click="click"
lineColor="#f56c6c"
></uv-tabs>
</uv-sticky>
<view class="orderList">
<order
:data="item"
v-for="(item, index) in orderListData"
:key="actionType + '_' + index"
@refresh="handleRefresh"
<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 { navigateTo, back } from '@/utils/router'
import { onLoad } from '@dcloudio/uni-app'
import { useMainStore } from '@/store/store'
import { storeAfterSalesList } from '@/api/order'
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 orderListData = ref([])
const {type, refresh, dataList, loadend, loading, listEmpty} = usePage(storeAfterSalesList)
const handleOrderList = async () => {
let res = await storeAfterSalesList({
type: actionType.value
})
orderListData.value = res
}
const {goBack, getParams} = useRouter();
const actionType = ref(0)
const navList = ref([
{ name: "全部", value: -1, },
{ name: "售后中", value: 1, },
{ name: "已完成", value: 2, },
{name: "全部", value: -1,},
{name: "售后中", value: 1,},
{name: "已完成", value: 2,},
])
const click = (data) => {
actionType.value = data.value
handleOrderList()
console.log("--> % click % data:\n", data)
type.value = data.value
refresh()
}
onLoad(({ type }) => {
if (type < 0 || !type) {
actionType.value = -1
onLoad((options) => {
const params = getParams(options)
if (params.type < 0 || !params.type) {
type.value = -1
} else {
actionType.value = type
type.value = params.type
}
handleOrderList()
console.log("--> % onLoad % type:\n", type)
refresh()
})
</script>
<style lang="less">
<style lang="scss">
.orderList {
padding: 20rpx 0;
}