import { getSaleData, getIncomeList } from '~/api/sale' Page({ data: { currentIndex: 1, categoryList: [{ id: 1, title: '全部' }, { id: 2, title: '7日' }, { id: 3, title: '月' }, { id: 4, title: '季' }, { id: 5, title: '半年' }], allIncome: {}, orderList: [] }, async onShow() { let allIncome = await getSaleData() let data = await getIncomeList({pageSize:1000,type:this.data.currentIndex}) console.log(allIncome,data); this.setData({ allIncome, orderList:data.list }) }, setClass({ currentTarget }) { this.setData({ currentIndex: currentTarget.dataset.index, }); // this.resetData(); }, })