// pages/mainPage/mainPage.js import ProApi from '../../net/api/projectApi'; const screenInfo = wx.getWindowInfo(); const statusBarHeight = screenInfo.statusBarHeight; // 状态栏高度 Page({ /** * 页面的初始数据 */ data: { statusBarHeight: statusBarHeight, recommendList: [{ id: '1', content: '生成真实系统 | 可下载安装包' }, { id: '2', content: '提供材料撰写 | 提供一键导出' }, { id: '2', content: '不下证书就退款 | 免费补正也退款' }, { id: '2', content: '全托管包下证 | 也可自行申报' } ], docCount: 0, cerCount: 0, recommendDesc: '' }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { this.getMainProCount() }, getMainProCount() { ProApi.doGetMainProCount() .then(res => { this.setData({ recommendDesc: `AI喵著网累计辅助编写资料 ${res.data[0]} 万套,通过平台代办下发证书 ${res.data[1]} 万件` }) }) .catch(err => { console.log(err) }) }, openLogin() { wx.navigateTo({ url: '/pages/login/login', }) } })