calculator.ts 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. // mHome/pages/calculator/calculator.ts
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. /// 底部安全区域
  8. safeBottom: getApp().globalData.safeBottom,
  9. /// 窗口高度
  10. windowHeight: getApp().globalData.windowHeight,
  11. /// 形状
  12. shapes: [{id: 1, name: '圆形'},
  13. {id: 2, name: '公主方'},
  14. {id: 3, name: '祖母绿'},
  15. {id: 4, name: '垫形'},
  16. {id: 5, name: '阿斯切'},
  17. {id: 6, name: '心形'},
  18. {id: 7, name: '梨形'},
  19. {id: 8, name: '雷迪恩'},
  20. {id: 9, name: '椭圆'},
  21. {id: 10, name: '马眼'}],
  22. /// 选中形状
  23. shape: '圆形',
  24. /// 颜色
  25. colors: [{id: 1, name: 'D'},
  26. {id: 2, name: 'E'},
  27. {id: 3, name: 'F'},
  28. {id: 4, name: 'G'},
  29. {id: 5, name: 'H'},
  30. {id: 6, name: 'I'},
  31. {id: 7, name: 'J'},
  32. {id: 8, name: 'K'},
  33. {id: 9, name: 'L'},
  34. {id: 10, name: 'M-N'}],
  35. /// 选中形状
  36. color: '',
  37. /// 净度
  38. neatness: [{id: 1, name: 'FL/IF'},
  39. {id: 2, name: 'VVS1'},
  40. {id: 3, name: 'VVS2'},
  41. {id: 4, name: 'VS1'},
  42. {id: 5, name: 'VS2'},
  43. {id: 6, name: 'Sl1'},
  44. {id: 7, name: 'Sl2'},
  45. {id: 8, name: 'Sl3'},
  46. {id: 9, name: 'l1'},
  47. {id: 10, name: 'l2'}],
  48. /// 选中净度
  49. neatnes: '',
  50. /// 重量
  51. weight: 0.0,
  52. /// 价格
  53. price: 0.0,
  54. /// 汇率
  55. erate: 0.0,
  56. /// 折扣
  57. discount: 0.0,
  58. /// 美元
  59. doller: 0.0,
  60. /// 人民币
  61. rmb: 0.0
  62. },
  63. /**
  64. * 生命周期函数--监听页面加载
  65. */
  66. onLoad() {
  67. },
  68. /**
  69. * 生命周期函数--监听页面初次渲染完成
  70. */
  71. onReady() {
  72. console.log(this.data.windowHeight)
  73. },
  74. /**
  75. * 生命周期函数--监听页面显示
  76. */
  77. onShow() {
  78. },
  79. /**
  80. * 生命周期函数--监听页面隐藏
  81. */
  82. onHide() {
  83. },
  84. /**
  85. * 生命周期函数--监听页面卸载
  86. */
  87. onUnload() {
  88. },
  89. /**
  90. * 页面相关事件处理函数--监听用户下拉动作
  91. */
  92. onPullDownRefresh() {
  93. },
  94. /**
  95. * 页面上拉触底事件的处理函数
  96. */
  97. onReachBottom() {
  98. },
  99. /**
  100. * 用户点击右上角分享
  101. */
  102. onShareAppMessage() {
  103. }
  104. })