details.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // pages/details/details.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. date: "",
  8. show: "ture",
  9. },
  10. /**
  11. * 生命周期函数--监听页面加载
  12. */
  13. onLoad(options) {},
  14. serverd: function () {
  15. const year = new Date().getFullYear();
  16. const month = new Date().getMonth() + 1;
  17. const day = new Date().getDate();
  18. const hour = new Date().getHours();
  19. const minute = new Date().getMinutes();
  20. const second = new Date().getSeconds();
  21. // const show1 = true
  22. // console.log(year);
  23. // console.log(this.show)
  24. this.setData({
  25. date: `${year+'-'+month+'-'+day+' '+hour+':'+minute+':'+second}`,
  26. show:!true
  27. });
  28. },
  29. /**
  30. * 生命周期函数--监听页面初次渲染完成
  31. */
  32. onReady() {},
  33. /**
  34. * 生命周期函数--监听页面显示
  35. */
  36. onShow() {},
  37. /**
  38. * 生命周期函数--监听页面隐藏
  39. */
  40. onHide() {},
  41. /**
  42. * 生命周期函数--监听页面卸载
  43. */
  44. onUnload() {},
  45. /**
  46. * 页面相关事件处理函数--监听用户下拉动作
  47. */
  48. onPullDownRefresh() {},
  49. /**
  50. * 页面上拉触底事件的处理函数
  51. */
  52. onReachBottom() {},
  53. /**
  54. * 用户点击右上角分享
  55. */
  56. onShareAppMessage() {},
  57. });