forked from nsjcy/frontEnd/nsjcy

Mr Ke
2020-05-27 0ec802e93557b2b1422ddbd68aafa994fa68f455
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
//index.js
//获取应用实例
const app = getApp()
 
Page({
  data: {
    zxzx: app.globalData.imgUrl +'/image/zxzx.png',
    zzzx: app.globalData.imgUrl +'/image/zzzx.png',
    dacx: app.globalData.imgUrl +'/image/dacx.png',
    msaj: app.globalData.imgUrl +'/image/msaj.png',
    itemIcon: app.globalData.imgUrl +'/image/ceshi.jpg',
    icon: app.globalData.imgUrl +'/image/fzl.svg',
    user: app.globalData.imgUrl +'/image/user.svg',
    dataSet: [],
    dataType:[],
    content: '------加载中------',
    size: 10,
    hasMoreData: true,
  },
  //事件处理函数
 
  tapName: function() {
    wx.navigateTo({
      url: '../logs/logs',
    })
  },
  folder: function (event) {
    var title = event.currentTarget.dataset['title'];
    wx.navigateTo({
      url: '../guidelist/guidelist?title=' + title,
    })
  },
  guideInfo: function(event) {
    var id = event.currentTarget.dataset['id'];
    wx.navigateTo({
      url: '../guideInfo/guideInfo?id=' + id,
    })
  },
  //在线咨询
  artificial: function() {
    wx.navigateTo({
      url: '../artificial/artificial',
    })
  },
  //自助咨询
  artificial1: function () {
    wx.navigateTo({
      url: '../artificial1/artificial1',
    })
  },
 
  onLoad: function() {
    this.showList();
  },
 
  showList: function() {
    var that = this;
    wx.request({
      url: app.globalData.url + '/api/article/publicMsgQuery?page=1&size=' + that.data.size + '&flag=' + '办事指南',
      success: function(res) {
        console.log(res)
        if (res.data.code == 0) {
          that.setData({
            dataType: res.data.data.units
          })
          if (res.data.data.result.totalElements < that.data.size) {
            that.setData({
              dataSet: res.data.data.result.content,
              hasMoreData: false,
              content: '------我是有底线的------'
            })
          } else {
            that.setData({
              dataSet: res.data.data.result.content,
              hasMoreData: true,
              content: '------加载更多------',
              size: that.data.size + 10
            })
          }
        } else {
          wx.showModal({
            title: '提示',
            content: "请求失败!"
          })
        }
 
      }
    })
  },
 
  link: function(event) {
    // 跳转详情页面
    var id = event.currentTarget.dataset['id'];
    var flag = '办事指南详情';
    wx.navigateTo({
      url: '../publicMsgDetails/publicMsgDetails?id=' + id + '&flag=' + flag,
    })
  },
  suo: function (e) {
    wx.navigateTo({
      url: '../search/search',
    })
  },
 
})