Files
xl-mobile/src/pages/walletLog/index.vue

110 lines
3.7 KiB
Vue
Raw Normal View History

2025-04-21 15:19:28 +08:00
<script setup>
import XNav from "../../components/XNav.vue";
import filer from "../../static/icons/filer-balck.png";
import {reactive, ref} from "vue";
import XFilter from "../../components/XFilter.vue";
import XRadioGroup from "../../components/XRadioGroup.vue";
import XFilterItem from "../../components/XFilterItem.vue";
import XRadio from "../../components/XRadio.vue";
import XDateTime from "../../components/XDateTime.vue";
import dayjs from "dayjs";
import XTag from "../../components/XTag.vue";
import useTableQuery from "../../hooks/useTableQuery.js";
import Api from "../../api/index.js";
const showFilter = ref(false);
const sumPo = reactive({
type: 0,
datetime: dayjs().format('YYYY-MM'),
});
const vo = reactive({
page: '',
rows: [],
total: 0,
});
const {loading, pagination, initFetchData} = useTableQuery({
2025-05-21 15:45:10 +08:00
api: Api.system.getUserMoneyLog,
2025-04-21 15:19:28 +08:00
parameter: sumPo,
callback: (data) => {
2025-05-21 15:45:10 +08:00
Object.assign(vo, data);
2025-04-21 15:19:28 +08:00
}
});
2025-07-22 18:38:39 +08:00
const init = () => {
sumPo.type = 0;
sumPo.datetime = dayjs().format('YYYY-MM');
}
2025-04-21 15:19:28 +08:00
</script>
2025-03-25 16:35:39 +08:00
<template>
<!--变动记录-->
2025-04-21 15:19:28 +08:00
<x-nav></x-nav>
<x-filter
2025-07-22 18:38:39 +08:00
@init="init"
2025-05-21 15:45:10 +08:00
@success="initFetchData"
2025-04-21 15:19:28 +08:00
v-model:model="sumPo"
v-model:visible="showFilter">
<x-filter-item label="账单类型">
<x-radio-group v-model:model-value="sumPo.type">
<view class="!grid grid-cols-3 gap-[24rpx]">
<x-radio :value="0">全部</x-radio>
<x-radio :value="1">收入</x-radio>
<x-radio :value="2">支出</x-radio>
</view>
</x-radio-group>
</x-filter-item>
<x-filter-item label="时间选择">
<x-radio-group v-model:model-value="sumPo.type">
<view class="!grid grid-cols-3 gap-[24rpx]">
<x-date-time v-model:model-value="sumPo.datetime" fields="month"></x-date-time>
</view>
</x-radio-group>
</x-filter-item>
</x-filter>
<view class="py-[28rpx] !flex justify-evenly bg-[#fff] h-[100rpx]">
<view class="top-filter top-filter-cur text-[var(--primary-color)]">{{
['全部', '收入', '支出'][sumPo.type]
}}
</view>
<view class="w-[4rpx] bg-[#E5E6EB]"></view>
<view class="top-filter top-filter-cur text-[var(--primary-color)]">{{ sumPo.datetime }}</view>
<view class="w-[4rpx] bg-[#E5E6EB]"></view>
<view class="top-filter" @click="showFilter=true">
<image class="!w-[22rpx] !h-[22rpx]" :src="filer"></image>
筛选
</view>
</view>
<scroll-view
@refresherpulling="initFetchData()"
2025-07-22 18:38:39 +08:00
@scrolltolower="pagination.page++"
2025-04-21 15:19:28 +08:00
scroll-y
class="h-[calc(100vh-200rpx)]">
2025-05-21 15:45:10 +08:00
<view class="p-[20rpx]" v-for="item in vo.rows" :key="item.id">
2025-04-21 15:19:28 +08:00
<view class="p-[20rpx] rounded-[12rpx] bg-[#fff] !flex justify-between items-center">
<view class="!flex flex-col gap-[24rpx]">
<view class="!flex items-center gap-[16rpx]">
2025-05-21 15:45:10 +08:00
<view>{{ item.purpose_name }}</view>
<x-tag :type="Number(item.money) > 0 ? 'success' : 'info'">{{ item.purpose_type }}</x-tag>
</view>
<view class="text-[#86909C] test-24r">{{
dayjs(item.createtime).format('YYYY-MM-DD HH:mm:ss')
}}
2025-04-21 15:19:28 +08:00
</view>
</view>
<view class="test-36r font-bold HarmonyOS">
2025-05-21 15:45:10 +08:00
{{ item.money }}
2025-04-21 15:19:28 +08:00
</view>
</view>
</view>
<tui-loadmore v-if="loading" text="加载中..."></tui-loadmore>
</scroll-view>
2025-03-25 16:35:39 +08:00
</template>
<style scoped>
</style>