123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- const app=getApp(),utils=require("../../../utils/http");
- let page=1;
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- webUrl:"",
- // clientype: app.globalData.clientype,
- inforList:[],
- datashow:false,
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- this.setData({
- clientype: app.globalData.clientype,
- webUrl:app.globalData.webUrl+'applet.html#/information?token='+app.globalData.token + '&client_type=' + app.globalData.clientype,
- })
- wx.showLoading({
- title: '加载中...',
- })
- this.inforfun();
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- },
- inforfun(){
- const that=this;
- page=1;
- utils.$post({
- url: app.globalData.webUrl + 'api/user_msg/list',
- header: {
- 'Authorization': 'bearer ' + app.globalData.token
- },
- data: {
- page: 1,
- limit:15
- },
- success: function (res) {
- wx.hideLoading();
- if (res.data.code == '0') {
- that.setData({
- inforList: res.data.data,
- datashow:true
- })
- }
- }
- })
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
- app.globalData.unreadNum=0;
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
- wx.showLoading({
- title: '加载中...',
- })
- this.inforfun();
- wx.stopPullDownRefresh()
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
- const that=this;
- page=page*1+1;
- wx.showLoading({
- title: '加载中...',
- })
- utils.$post({
- url: app.globalData.webUrl + 'api/user_msg/list',
- header: {
- 'Authorization': 'bearer ' + app.globalData.token
- },
- data: {
- page:page,
- limit:15
- },
- success: function (res) {
- wx.hideLoading();
- let inforList=that.data.inforList;
- if (res.data.code == '0') {
- inforList=inforList.concat(res.data.data);
- that.setData({
- inforList:inforList
- })
- }
- }
- })
- },
- /**
- * 用户点击右上角分享
- */
- // onShareAppMessage: function () {
- // }
- })
|