提交法律援助和财税援助,调整我的页面

This commit is contained in:
2024-11-29 15:36:18 +08:00
parent 520f44a25f
commit 3ad21ea708
15 changed files with 219 additions and 50 deletions

View File

@@ -1,5 +1,5 @@
import { getAidList } from "../../service/system";
import { alertInfo, alertSuccess } from "../../utils/index";
import { alertInfo, alertSuccess, loadingFunc } from "../../utils/index";
import request from '../../utils/request'
const { OK } = request;
@@ -32,7 +32,9 @@ Component({
},
lifetimes: {
attached() {
this.init()
loadingFunc(async () => {
await this.init();
})
}
},
/**
@@ -42,16 +44,14 @@ Component({
async init() {
const { type, page, size } = this.data;
const { code, message, data = [], total } = await getAidList(page, size, type);
console.log('data', data)
if (code !== OK) {
alertInfo(message)
return
}
this.setData({
list: data,
total
}, () => {
console.log("this.data", this.data)
total,
totalPage: Math.ceil(total / size)
})
},
onRefresh() {
@@ -69,10 +69,21 @@ Component({
url: `/pages/aid/detail/index?id=${id}&type=${type}`,
})
},
consult() {
consult(e) {
const { id = "" } = e.currentTarget.dataset;
const { type } = this.data;
wx.navigateTo({
url: `/pages/aid/consult/index?id=${this.data.type}`,
url: `/pages/aid/consult/index?id=${id}&type=${type}`,
})
}
},
async onChangePage(e) {
const page = e.detail.currentIndex;
const that = this;
this.setData({
page
}, () => {
that.init();
})
},
}
})