|
@@ -0,0 +1,100 @@
|
|
|
+const _Http = getApp().globalData.http,
|
|
|
+ getHeight = require("../../utils/getRheRemainingHeight");
|
|
|
+
|
|
|
+Page({
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 页面的初始数据
|
|
|
+ */
|
|
|
+ data: {
|
|
|
+ listHeight: null,
|
|
|
+ list: [],
|
|
|
+ "content": {
|
|
|
+ pageNumber: 1,
|
|
|
+ pageTotal: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ "where": {
|
|
|
+ "condition": ""
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 生命周期函数--监听页面加载
|
|
|
+ */
|
|
|
+ onLoad(options) {
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ getList(init = false) {
|
|
|
+ //init 用于初始化分页
|
|
|
+ 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({
|
|
|
+ "id": 20220906154403,
|
|
|
+ "version": 1,
|
|
|
+ content: this.data.content
|
|
|
+ }).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ this.selectComponent('#ListBox').RefreshToComplete();
|
|
|
+ this.setData({
|
|
|
+ 'content.pageNumber': res.pageNumber + 1,
|
|
|
+ 'content.pageTotal': res.pageTotal,
|
|
|
+ list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 生命周期函数--监听页面初次渲染完成
|
|
|
+ */
|
|
|
+ onReady() {
|
|
|
+ getHeight.getHeight('#placeholder', this).then(res => this.setData({
|
|
|
+ listHeight: res
|
|
|
+ }));
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 生命周期函数--监听页面显示
|
|
|
+ */
|
|
|
+ onShow() {
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 生命周期函数--监听页面隐藏
|
|
|
+ */
|
|
|
+ onHide() {
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 生命周期函数--监听页面卸载
|
|
|
+ */
|
|
|
+ onUnload() {
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 页面相关事件处理函数--监听用户下拉动作
|
|
|
+ */
|
|
|
+ onPullDownRefresh() {
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 页面上拉触底事件的处理函数
|
|
|
+ */
|
|
|
+ onReachBottom() {
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 用户点击右上角分享
|
|
|
+ */
|
|
|
+ onShareAppMessage() {
|
|
|
+
|
|
|
+ }
|
|
|
+})
|