import { wxNavigateTo } from "@utils/promise-wx-api"; import commonBehavior from "@mixins/common"; import listBehavior from "@mixins/list"; const app = getApp(); Component({ behaviors: [commonBehavior, listBehavior], properties: { listParams: { type: Object, value: { gridId: "", }, // 表决中voting 已转项目turned 已关闭closed }, listUrl: { type: String, value: "", // 表决中voting 已转项目turned 已关闭closed }, status: { type: String, value: "", // 表决中voting 已转项目turned 已关闭closed }, listIsMock: { type: Boolean, value: false, }, }, data: { iniLoaded: false, refresherIsTriggered: false, }, lifetimes: { attached() { this.init(); }, }, pageLifetimes: { async show() { await this.refreshData(); }, }, methods: { async init() { await app.doAfterLogin(); await this.getApiData(); this.setData({ iniLoaded: true, }); }, // 刷新 async refreshData() { if (this.data.iniLoaded) { // 如果第一页,静默刷新 const { list } = this.data; if (list.page == 2) { list.page = 1; list.isNone = false; this.setData({ list }); await this.getApiData(); } } }, // 加载更多 getMore() { this.getApiData(); }, async getApiData() { await this.getList(); }, // 查看详情 handleTapItem(e) { const { currentTarget: { dataset: { id }, }, } = e; wxNavigateTo("/subpages/group/pages/issue/auditting/info/index", { issueApplicationId: id, }); }, }, });