made.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. // pages/customized/made/made.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. dataPositionObj:{
  8. top:'156rpx',
  9. left:'286rpx'
  10. },
  11. propSize:{
  12. top:'8cm',
  13. right:'8cm',
  14. bottom: '8cm',
  15. left:'8cm',
  16. }
  17. },
  18. /**
  19. * 生命周期函数--监听页面加载
  20. */
  21. onLoad: function (options) {
  22. console.log('页面加载完成')
  23. wx.getSystemInfo({
  24. success: function (res) {
  25. let rpx = res.windowWidth / 750;
  26. console.log(res.windowWidth)
  27. const ctx = wx.createCanvasContext('madeContent');
  28. ctx.drawImage('/images/customized/cup_black_big.png', 0, 0, 750 * rpx, 588 * rpx)
  29. ctx.draw()
  30. },
  31. })
  32. },
  33. /**
  34. * 生命周期函数--监听页面初次渲染完成
  35. */
  36. onReady: function () {
  37. // console.log('页面开始准备中')
  38. const ctx = wx.createCanvasContext('madeBox');
  39. // Canvas.SetLeft(ctx, '10rpx');
  40. },
  41. /**
  42. * 生命周期函数--监听页面显示
  43. */
  44. onShow: function () {
  45. },
  46. /**
  47. * 生命周期函数--监听页面隐藏
  48. */
  49. onHide: function () {
  50. },
  51. /**
  52. * 生命周期函数--监听页面卸载
  53. */
  54. onUnload: function () {
  55. },
  56. /**
  57. * 页面相关事件处理函数--监听用户下拉动作
  58. */
  59. onPullDownRefresh: function () {
  60. },
  61. /**
  62. * 页面上拉触底事件的处理函数
  63. */
  64. onReachBottom: function () {
  65. },
  66. /**
  67. * 用户点击右上角分享
  68. */
  69. onShareAppMessage: function () {
  70. }
  71. })