riku
2026-01-22 f14ea940fb32105de8b592992e3f53c62f31d84d
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
// pages/learn/learn.js
import ListPage from '../../../base/ListPage'
import bFetch from '../behaviors/bFetch'
import bOpenFile from '../behaviors/bOpenFile'
import $f from "../../../service/baserequest";
 
ListPage({
  behaviors: [bFetch, bOpenFile],
  /**
   * 页面的初始数据
   */
  data: {
    icon1: $f.baseIconUrl + 'res/learn_2.png',
    icon2: $f.baseIconUrl + 'res/learn_1.png',
 
    currentTab: 0,
    tabList: [{
        "name": "VOCs排放"
      },
      {
        "name": "台账"
      },
      {
        "name": "治理设施设备"
      },
      {
        "name": "在线监测设备"
      }
    ],
    banners: [
      {
        pic: '',
        url: '',
        fileType: ''
      },
    ],
    
  },
  
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.getResources({})
  },
 
  loadComplete() {
    this.getBanner()
  },
 
  getBanner() {
    let banners = []
    const results = this.data.results
    const max = results.length > 5 ? 5 : results.length
    for (let i = 0; i < max; i++) {
      const d = this.data.results[i]
      banners.push({
        pic: d.lrPicurl,
        url: d.lrBodyurl,
        fileType: d.lrResourcefiletype,
      })
    }
    this.setData({
      banners
    })
  },
 
  goto: function (e) {
    var url = ""
    var index = e.currentTarget.dataset.index
    switch (index) {
      case '0':
        url = '/pages/mLearn/learfile/learnfile'
        break;
      case '1':
        url = "/pages/mLearn/learncase/learncase"
        break;
    }
    if (url != "") {
      wx.navigateTo({
        url: url,
      })
    }
  }
})