import { wxNavigateTo } from "@utils/promise-wx-api"; import nextTick from "@npm/dai-mp/tools/nextTick.js"; import commonBehavior from "@mixins/common"; import listBehavior from "@mixins/list"; const app = getApp(); Component({ behaviors: [commonBehavior, listBehavior], properties: { listParams: { type: Object, value: { gridId: "", }, }, listUrl: { type: String, value: "", }, status: { type: String, value: "", // 我的话题mine 已转议题toissue 已转项目toproject }, listIsMock: { type: Boolean, value: false, }, gid:{ type: String, value: "", } }, data: { iniLoaded: false, refresherIsTriggered: false, }, lifetimes: { ready() { this.init(); }, }, pageLifetimes: { show() { if (this.data.iniLoaded) { // 如果第一页,静默刷新 const { list } = this.data; if (list.page == 2) { list.page = 1; list.isNone = false; this.setData({ list }); this.getApiData(); } } }, }, methods: { async init() { const { iniLoaded } = this.data; const $loading = this.selectComponent("#loading"); if (!iniLoaded) { $loading.show(); } await this.getApiData(); this.setData({ iniLoaded: true, }); $loading.hide(); }, // 刷新 async refresh() { this.setData({ refresherIsTriggered: true, }); this.resetList(); await this.getApiData(); this.setData({ refresherIsTriggered: false, }); }, // 加载更多 getMore() { this.getApiData(); }, async getApiData() { await app.doAfterLogin(); await this.getList(); }, // 查看详情 handleTapItem(e) { const { currentTarget: { dataset: { topicid, gid }, }, } = e; wxNavigateTo("/subpages/group/pages/topic/auditting/topicDetail", { tid: topicid, gid: gid, leader: 'leader' }); }, }, });