student.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. // pages/student/student.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. height: 0,
  8. animation: {},
  9. left: 750,
  10. shareImg: 'https://app.schoolwisdoms.com/static/app/student/imgs/share-bill.png'
  11. },
  12. closeCamera:function(){
  13. this.animation = wx.createAnimation({
  14. timingFunction: 'linear',
  15. duration: 400
  16. })
  17. const left = 750
  18. this.animation.translateX(left).step()
  19. this.setData({
  20. animation:this.animation.export()
  21. })
  22. },
  23. showCamaer:function(){
  24. this.animation = wx.createAnimation({
  25. timingFunction: 'linear',
  26. duration: 100
  27. })
  28. const left = 0
  29. this.animation.translateX(left).step()
  30. this.setData({
  31. animation:this.animation.export(),
  32. left
  33. })
  34. },
  35. scanCode:function(e){
  36. console.log(JSON.stringify(e))
  37. },
  38. /**
  39. * 生命周期函数--监听页面加载
  40. */
  41. onLoad: function (options) {
  42. wx.getSystemInfo({
  43. success: (result) => {
  44. this.setData({
  45. height: result.windowHeight
  46. })
  47. },
  48. })
  49. },
  50. /**
  51. * 生命周期函数--监听页面初次渲染完成
  52. */
  53. onReady: function () {
  54. },
  55. /**
  56. * 生命周期函数--监听页面显示
  57. */
  58. onShow: function () {
  59. },
  60. /**
  61. * 生命周期函数--监听页面隐藏
  62. */
  63. onHide: function () {
  64. },
  65. /**
  66. * 生命周期函数--监听页面卸载
  67. */
  68. onUnload: function () {
  69. },
  70. /**
  71. * 页面相关事件处理函数--监听用户下拉动作
  72. */
  73. onPullDownRefresh: function () {
  74. },
  75. /**
  76. * 页面上拉触底事件的处理函数
  77. */
  78. onReachBottom: function () {
  79. },
  80. /**
  81. * 用户点击右上角分享
  82. */
  83. onShareAppMessage: function () {
  84. }
  85. })