|
|
@@ -1,5 +1,8 @@
|
|
|
<template>
|
|
|
- <app-pull-refresh v-model:error="error" v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="onRefresh">
|
|
|
+ <app-pull-refresh ref="pullRefreshRef" v-model:error="error" v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="onRefresh">
|
|
|
+ <DropdownMenu>
|
|
|
+ <DropdownItem v-model="type" :options="options" @change="onChange"></DropdownItem>
|
|
|
+ </DropdownMenu>
|
|
|
<app-list :columns="columns" :data-list="dataList" v-if="dataList.length" @click="onClick">
|
|
|
<!-- 日期 -->
|
|
|
<template #profitmonth="{ value }">
|
|
|
@@ -16,7 +19,7 @@ import { formatDate } from '@/filters'
|
|
|
import { useQueryTHJPromotionIncome } from '@/business/order'
|
|
|
import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
|
|
|
import AppList from '@mobile/components/base/list/index.vue'
|
|
|
-import { Empty } from 'vant'
|
|
|
+import { Empty, DropdownItem, DropdownMenu } from 'vant'
|
|
|
import { useNavigation } from '@/hooks/navigation'
|
|
|
|
|
|
const { router } = useNavigation()
|
|
|
@@ -24,6 +27,11 @@ const { pageIndex, pageCount, getTHJPromotionIncome } = useQueryTHJPromotionInco
|
|
|
const dataList = shallowRef<Model.THJPromotionIncomeRsp[]>([])
|
|
|
const error = shallowRef(false)
|
|
|
|
|
|
+const options = [ { text: '全部', value: 0 }, { text: '已支付', value: 1 }, { text: '未支付', value: 2 }]
|
|
|
+const type = shallowRef(0)
|
|
|
+/// 下拉刷新
|
|
|
+const pullRefreshRef = shallowRef()
|
|
|
+
|
|
|
const columns: Model.TableColumn[] = [
|
|
|
{ prop: 'profitmonth', label: '时间' },
|
|
|
{ prop: 'sumamount', label: '金额' },
|
|
|
@@ -35,7 +43,7 @@ const onClick = (item: Model.THJPromotionIncomeRsp) => {
|
|
|
|
|
|
const onRefresh = (finish: () => void) => {
|
|
|
/// 查询数据
|
|
|
- getTHJPromotionIncome(0).then((res) => {
|
|
|
+ getTHJPromotionIncome(type.value).then((res) => {
|
|
|
if (pageIndex.value === 1) {
|
|
|
dataList.value = []
|
|
|
}
|
|
|
@@ -46,6 +54,11 @@ const onRefresh = (finish: () => void) => {
|
|
|
finish()
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+const onChange = () => {
|
|
|
+ /// 查询
|
|
|
+ pullRefreshRef.value?.refresh()
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|