You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
1.4 KiB
82 lines
1.4 KiB
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,
|
|
});
|
|
}
|
|
},
|
|
},
|
|
});
|
|
|