// pages/bibliographyList/index.js const app = getApp() Page({ /** * 页面的初始数据 */ data: { higherList: [], vocationalList: [], teacherList: [], higherTotal: null, vocationalTotal: null, teacherTotal: null }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { this.higherGet() this.vocationalGet() this.teacherGet() }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady() { }, /** * 生命周期函数--监听页面显示 */ onShow() { }, /** * 生命周期函数--监听页面隐藏 */ onHide() { }, /** * 生命周期函数--监听页面卸载 */ onUnload() { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom() { }, /** * 用户点击右上角分享 */ onShareAppMessage() { }, onTabsChange(event) { console.log(`Change tab, tab-panel value is ${event.detail.value}.`); }, onTabsClick(event) { console.log(`Click tab, tab-panel value is ${event.detail.value}.`); }, //高等教育 higherGet() { app.MG.resource.getItem({ path: 'jsek_biblioClassification\\jsek_bCHigherEducation', queryType: '*', paging: { start: '0', size: '999' }, coverSize: { width: 260 }, fields: { jsek_link: [], content: [], subtitle: [], fileType: [], jsek_resource: [], freeFile: [] }, SysType: 'CmsItem' }).then(res => { console.log(res.total); this.setData({ higherList: res.datas, higherTotal: res.total }) console.log(this.data.higherList, '5555'); }) }, //教师教育 vocationalGet() { app.MG.resource.getItem({ path: 'jsek_biblioClassification\\jsek_bCVocationalEducation', queryType: '*', paging: { start: '0', size: '999' }, coverSize: { width: 260 }, fields: { jsek_link: [], content: [], subtitle: [], fileType: [], jsek_resource: [], freeFile: [] }, SysType: 'CmsItem' }).then(res => { this.setData({ vocationalList: res.datas, vocationalTotal: res.total }) }) }, // 职业教育 teacherGet() { app.MG.resource.getItem({ path: 'jsek_biblioClassification\\jsek_bCTeacherEducation', queryType: '*', paging: { start: '0', size: '999' }, coverSize: { width: 260 }, fields: { jsek_link: [], content: [], subtitle: [], fileType: [], jsek_resource: [], freeFile: [] }, SysType: 'CmsItem' }).then(res => { this.setData({ teacherList: res.datas, teacherTotal: res.total }) }) } })