// pages/tabber/home/index.js const api = require('../../../utils/api'); Page({ /** * 页面的初始数据 */ data: { menuList: [ { url: '/pages/image/home/ruhexiadan.png', text: '如何下单' }, { url: '/pages/image/home/changjianwenti.png', text: '常见问题' } , { url: '/pages/image/home/xidifanwei.png', text: '洗涤范围' }, { url: '/pages/image/home/fenxianghaoyou.png', text: '分享好友' } ], current: 3, btnInfo: {}, }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { // api.getBanner().then(res=>{ // console.log(res); // }) var info = wx.getMenuButtonBoundingClientRect() console.log(info); this.setData({ btnInfo: info }) setTimeout(()=>{ this.listenerLogin() },1000) }, onReady: function () { this.toast = this.selectComponent("#toast"); }, listenerLogin: function () { this.toast.showToast('领取成功'); }, })