import { inputSync, nextTick, doAfterLogin, getComponent, } from "@utils/tools"; import { wxRequestPost, wxRedirectTo, wxNavigateTo, } from "@utils/promise-wx-api"; import words from "@config/words"; const app = getApp(); Component({ properties: { id: { type: String, value: "", }, }, data: { iniLoaded: false, inavalid: false, }, methods: { async onLoad() { this.init(); }, async init() { await this.getApiData(); this.setData({ iniLoaded: true, }); }, async getApiData() { this.getInfo(); }, // 阅读全部 async getInfo() { const { id } = this.data; const { data: { data: { code }, }, msg, } = await wxRequestPost( "resi/mine/mymessage/readallmsg", { id, }, { // isMock: true, // isQuiet: false, } ); wx.hideLoading(); if (msg === "success" && code === 0) { const { customerId, gridId, url, params } = data; app.globalData.customerId = customerId; app.globalData.gridId = gridId; await app.loginbywxcode(); await app.enterGridData(); wxRedirectTo(url, params); } else { this.setData({ inavalid: true, }); } }, }, });