// pages/aboutUs/index.js const app = getApp() // import drawQrcode from './js/weapp.qrcode' Page({ /** * 页面的初始数据 */ data: { aboutText: null, swiperList: null, current: 1,//轮播图参数 autoplay: true, //轮播图参数 duration: '500',//轮播图参数 interval: 5000,//轮播图参数 navigation: { type: 'dots' },//轮播图参数 bannerList: [], //轮播图列表 navBarHeight: '', barHeight: '', types: '', }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { const systInfo = wx.getSystemInfoSync(); const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息 const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度 this.setData({ navBarHeight: navBarHeight, barHeight: systInfo.statusBarHeight, types: options.types }) console.log(this.data.types); // this.getBanner() this.getAboutText() }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady() { }, /** * 生命周期函数--监听页面显示 */ onShow() { }, /** * 生命周期函数--监听页面隐藏 */ onHide() { }, /** * 生命周期函数--监听页面卸载 */ onUnload() { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom() { }, /** * 用户点击右上角分享 */ onShareAppMessage() { }, //轮播图 getBanner() { app.MG.resource.getItem({ path: 'jsek_banner\\jsek_aboutUsBanner', paging: { start: 0, size: 9 }, fields: { jsek_link: [] } }).then(res => { this.setData({ bannerList: res.datas[0].icon, swiperList: res.datas[0].icon }) console.log(this.data.bannerList, 789); }) }, //文字 jsek_aboutUs 关于我们 //jsek_contactUs 联系我们 getAboutText() { app.MG.resource.getItem({ path: this.data.types, fields: { content: [] }, coverSize: { width: 750 }, }).then(res => { console.log(res); this.setData({ aboutText: res.datas[0].content }) }) }, goBack() { wx.navigateBack() } })