const getHeight = require("../../../utils/getRheRemainingHeight"), _Http = getApp().globalData.http; Page({ /** * 页面的初始数据 */ data: { height: 0, list: [], content: { nocache: true, pageNumber: 1, pageSize: 20, pageTotal: 1, type: "应用", where: {} }, total: 0, }, /** * 生命周期函数--监听页面加载 */ onLoad(options) {}, //切换tab选项 tabChange({ detail }) { this.setData({ "content.type": detail.name }) this.getlist(true); }, onReady() { getHeight.getHeight(".head", this).then(res => { this.setData({ height: res }) }) }, async toDetails(e) { const { objectname, objectid, messageid } = e.currentTarget.dataset.item; _Http.basic({ "classname": "system.message.Message", "method": "readMessage", "content": { messageid } }, false) const res = await _Http.basic({ "classname": "saletool.common.auth", "method": "isAuth", "content": { objectid, objectname } }); if (res.msg != '成功' || res.data[0].isAuth != 1) return wx.showToast({ title: '暂无权限进入应用', icon: "none" }); switch (objectname) { case 'sat_courseware': wx.navigateTo({ url: `/pages/college/index`, }) break; case 'sat_sharematerial': wx.navigateTo({ url: `/pages/promotional/index`, }) break; case 'sat_notice': wx.navigateTo({ url: `/pages/annunciate/index`, }) break; case 'sat_submitedit': wx.navigateTo({ url: `/pages/submission/index`, }) break; case 'sat_orderclue': wx.navigateTo({ url: `/pages/threadedTree/index`, }) break; case 'sys_attachment': let item = { attachmentid: objectid, document: '营销物料' } wx.navigateTo({ url: 'pages/tabbar/smartStore/index', }) break; default: wx.showToast({ title: '当前应用暂不支持跳转', icon: "none" }) break; } /* wx.navigateTo({ url: './details?id=' + item.messageid, }) */ }, getlist(init = false) { if (init.detail != undefined) init = init.detail; let content = this.data.content if (init) content.pageNumber = 1; if (content.pageNumber > content.pageTotal) return; _Http.basic({ "classname": "system.message.Message", "method": "queryMessage", content }).then(res => { this.selectComponent('#ListBox').RefreshToComplete(); if (res.msg != '成功') return wx.showToast({ title: res.msg, icon: "none" }) this.setData({ total: res.total, list: (res.pageNumber == 1) ? res.data : this.data.list.concat(res.data), ['content.pageNumber']: res.pageNumber + 1, ['content.pageTotal']: res.pageTotal }) }) }, onShow() { this.getlist(true); this.getTabBar().init(); }, })