| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 | const getHeight = require("../../utils/getRheRemainingHeight");const _Http = getApp().globalData.http;Page({    /**     * 页面的初始数据     */    data: {        scrollHeight: 0,        list: [],        "content": {            "pageNumber": 1,            "pageSize": 20,            "pageTotal": 1,            "where": {                "condition": ""            }        }    },    /**     * 生命周期函数--监听页面加载     */    onLoad(options) {        this.getList()    },    getList(init = false) {        if (init.detail != undefined) init = init.detail;        if (init) this.setData({            ['content.pageNumber']: 1        })        if (this.data.content.pageNumber > this.data.content.pageTotal) return;        _Http.basic({            "classname": "saletool.notice.notice",            "method": "queryNoticeList",            content: this.data.content        }).then(res => {            console.log("通告列表", res)            this.selectComponent('#ListBox').RefreshToComplete();            if (res.msg != '成功') return wx.showToast({                title: res.data,                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            })        })    },    /* 查看详情 */    toDetails(e) {        const {            item        } = e.currentTarget.dataset;        wx.navigateTo({            url: './details?item=' + JSON.stringify(item)        })    },    /**     * 生命周期函数--监听页面初次渲染完成     */    onReady() {        getHeight.getHeight('.top', this).then(res => {            this.setData({                scrollHeight: res            })        })    },    /**     * 生命周期函数--监听页面显示     */    onShow() {    },    /**     * 生命周期函数--监听页面隐藏     */    onHide() {    },    /**     * 生命周期函数--监听页面卸载     */    onUnload() {    },    /**     * 页面相关事件处理函数--监听用户下拉动作     */    onPullDownRefresh() {    },    /**     * 页面上拉触底事件的处理函数     */    onReachBottom() {    },    /**     * 用户点击右上角分享     */    onShareAppMessage() {    }})
 |