index.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // pages/home/index.ts
  2. const app = getApp<IAppOption>();
  3. import { compareVersion } from "../../utils/util";
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. pageBGIMG: "",
  10. btnBGIMG: "",
  11. },
  12. lvru() {
  13. wx.navigateTo({
  14. url: "/pages/home/index"
  15. })
  16. },
  17. inited(res: any) {
  18. const { BGIMG, btnBGIMG } = res?.spreadPage;
  19. this.setData({
  20. pageBGIMG: BGIMG + "?" + Date.now(),
  21. btnBGIMG: btnBGIMG + "?" + Date.now()
  22. })
  23. },
  24. /**
  25. * 生命周期函数--监听页面加载
  26. */
  27. onLoad() {
  28. app.getPageInfo({
  29. success: (res: any) => {
  30. const configPage = res || {};
  31. this.inited(configPage);
  32. }
  33. })
  34. },
  35. /**
  36. * 生命周期函数--监听页面初次渲染完成
  37. */
  38. onReady() { },
  39. /**
  40. * 生命周期函数--监听页面显示
  41. */
  42. onShow() { },
  43. /**
  44. * 生命周期函数--监听页面隐藏
  45. */
  46. onHide() { },
  47. /**
  48. * 生命周期函数--监听页面卸载
  49. */
  50. onUnload() { },
  51. /**
  52. * 页面相关事件处理函数--监听用户下拉动作
  53. */
  54. onPullDownRefresh() { },
  55. /**
  56. * 页面上拉触底事件的处理函数
  57. */
  58. onReachBottom() { },
  59. /**
  60. * 用户点击右上角分享
  61. */
  62. onShareAppMessage() { }
  63. })
  64. export { }