scaner.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // pages/scaner/scaner.ts
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. width: 300,
  8. height: 300,
  9. renderWidth: 300,
  10. renderHeight: 300,
  11. },
  12. /**
  13. * 生命周期函数--监听页面加载
  14. */
  15. onLoad() {
  16. const info = wx.getSystemInfoSync();
  17. const width = info.windowWidth;
  18. const height = info.windowHeight;
  19. const dpi = info.pixelRatio;
  20. this.setData({
  21. width, height,
  22. renderWidth: width * dpi,
  23. renderHeight: height * dpi
  24. });
  25. },
  26. /**
  27. * 生命周期函数--监听页面初次渲染完成
  28. */
  29. onReady() {
  30. },
  31. /**
  32. * 生命周期函数--监听页面显示
  33. */
  34. onShow() {
  35. },
  36. /**
  37. * 生命周期函数--监听页面隐藏
  38. */
  39. onHide() {
  40. },
  41. /**
  42. * 生命周期函数--监听页面卸载
  43. */
  44. onUnload() {
  45. },
  46. /**
  47. * 页面相关事件处理函数--监听用户下拉动作
  48. */
  49. onPullDownRefresh() {
  50. },
  51. /**
  52. * 页面上拉触底事件的处理函数
  53. */
  54. onReachBottom() {
  55. },
  56. /**
  57. * 用户点击右上角分享
  58. */
  59. onShareAppMessage() {
  60. }
  61. })