chore: establish V1.1 recovery baseline
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* 我的举报页
|
||||
* 展示用户提交的举报记录列表
|
||||
*/
|
||||
const api = require('../../utils/api');
|
||||
|
||||
Page({
|
||||
data: {
|
||||
reports: [],
|
||||
loading: true,
|
||||
empty: false
|
||||
},
|
||||
|
||||
onLoad() {},
|
||||
|
||||
onShow() {
|
||||
this.loadReports();
|
||||
},
|
||||
|
||||
async loadReports() {
|
||||
this.setData({ loading: true });
|
||||
try {
|
||||
const token = wx.getStorageSync('accessToken');
|
||||
const res = await api.get('/risk/reports/my', {}, {
|
||||
Authorization: `Bearer ${token}`
|
||||
});
|
||||
this.setData({
|
||||
reports: res || [],
|
||||
empty: !(res && res.length > 0),
|
||||
loading: false
|
||||
});
|
||||
} catch (err) {
|
||||
this.setData({ loading: false });
|
||||
}
|
||||
},
|
||||
|
||||
onRefresh() {
|
||||
this.loadReports();
|
||||
},
|
||||
|
||||
getStatusTag(status) {
|
||||
const map = {
|
||||
pending: { text: '待处理', type: 'warning' },
|
||||
processing: { text: '处理中', type: 'warning' },
|
||||
resolved: { text: '已处理', type: 'success' },
|
||||
rejected: { text: '未受理', type: 'info' },
|
||||
dismissed: { text: '已驳回', type: 'default' }
|
||||
};
|
||||
return map[status] || { text: status, type: 'default' };
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user