index.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // pages/tabber/home/index.js
  2. const api = require('../../../utils/api');
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. menuList: [
  9. {
  10. url: '/pages/image/home/ruhexiadan.png',
  11. text: '如何下单'
  12. },
  13. {
  14. url: '/pages/image/home/changjianwenti.png',
  15. text: '常见问题'
  16. }
  17. ,
  18. {
  19. url: '/pages/image/home/xidifanwei.png',
  20. text: '洗涤范围'
  21. },
  22. {
  23. url: '/pages/image/home/fenxianghaoyou.png',
  24. text: '分享好友'
  25. }
  26. ],
  27. current: 3,
  28. btnInfo: {},
  29. },
  30. /**
  31. * 生命周期函数--监听页面加载
  32. */
  33. onLoad: function (options) {
  34. // api.getBanner().then(res=>{
  35. // console.log(res);
  36. // })
  37. var info = wx.getMenuButtonBoundingClientRect()
  38. console.log(info);
  39. this.setData({
  40. btnInfo: info
  41. })
  42. setTimeout(()=>{
  43. this.listenerLogin()
  44. },1000)
  45. },
  46. onReady: function () {
  47. this.toast = this.selectComponent("#toast");
  48. },
  49. listenerLogin: function () {
  50. this.toast.showToast('领取成功');
  51. },
  52. })