import { defineComponent, reactive, onMounted, computed } from 'vue' import { Cell, Grid, GridItem, Progress, Icon, List } from 'vant' import OEmpty from '@/components/o-empty' import styles from './index.module.less' import OSticky from '@/components/o-sticky' import OHeader from '@/components/o-header' import request from '@/helpers/request' import dayjs from 'dayjs' import { moneyFormat } from '@/helpers/utils' import { postMessage } from '@/helpers/native-message' export default defineComponent({ name: 'practice-rewards', setup() { const state = reactive({ list: [] as any, listState: { dataShow: true, // 判断是否有数据 loading: false, finished: false }, statistics: { totalTrainingSalary: 0, waitSalary: 0 } }) const getStatistics = async () => { try { const { data } = await request.post('/api-school/schoolWeekSalaryRecord/trainingStatistics') console.log(data) state.statistics = { totalTrainingSalary: data.totalTrainingSalary || 0, waitSalary: data.waitSalary || 0 } } catch { // } } const getList = async () => { try { const res = await request.post('/api-school/schoolWeekSalaryRecord/trainingList', { data: {} }) const result = res.data || [] // 处理重复请求数据 if (state.list.length > 0 && result.current === 1) { return } state.list = res.data || [] state.listState.dataShow = state.list.length > 0 } catch { state.listState.dataShow = false } } onMounted(() => { getStatistics() getList() }) return () => (