index.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. // pages/login/login.js
  2. const app = getApp();
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. frameStyle: { useTop: true, name: '入库管理', leftArrow: true, useBar: false },
  9. // 主体高度
  10. infoHeight: '',
  11. // 采购申请
  12. list: [{ id: '1234567', register_name: '登记人', register_phone: '登记人电话', register_date: '2022-5-16' }],
  13. // 弹框
  14. dialog: { title: '详细信息', show: false, type: '1' },
  15. // 详细信息
  16. info: { id: '1234567', register_name: '登记人', register_phone: '登记人电话', register_date: '2022-5-16', reason: '无', order: [{ name: '商品1', num: '10' }] },
  17. },
  18. back: function () {
  19. wx.navigateBack({ url: '/pages/home/index' })
  20. },
  21. // 添加入库
  22. toAdd: function () {
  23. wx.navigateTo({ url: `/pages/indepot/detail` })
  24. },
  25. // 详细信息
  26. toView: function (e) {
  27. this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
  28. },
  29. /**
  30. * 生命周期函数--监听页面加载
  31. */
  32. onLoad: function (options) {
  33. this.search();
  34. // 计算高度
  35. this.searchHeight();
  36. },
  37. search: function () {
  38. console.log("查询");
  39. },
  40. // 计算高度
  41. searchHeight: function () {
  42. let frameStyle = this.data.frameStyle;
  43. let client = app.globalData.client;
  44. // 减去状态栏
  45. let infoHeight = client.windowHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
  46. // 是否减去底部菜单
  47. if (frameStyle.useBar) infoHeight = infoHeight - 50;
  48. if (infoHeight) this.setData({ infoHeight: infoHeight })
  49. },
  50. /**
  51. * 生命周期函数--监听页面初次渲染完成
  52. */
  53. onReady: function () {
  54. },
  55. /**
  56. * 生命周期函数--监听页面显示
  57. */
  58. onShow: function () {
  59. this.search();
  60. },
  61. /**
  62. * 生命周期函数--监听页面隐藏
  63. */
  64. onHide: function () {
  65. },
  66. /**
  67. * 生命周期函数--监听页面卸载
  68. */
  69. onUnload: function () {
  70. },
  71. /**
  72. * 页面相关事件处理函数--监听用户下拉动作
  73. */
  74. onPullDownRefresh: function () {
  75. },
  76. /**
  77. * 页面上拉触底事件的处理函数
  78. */
  79. onReachBottom: function () {
  80. },
  81. /**
  82. * 用户点击右上角分享
  83. */
  84. onShareAppMessage: function () {
  85. }
  86. })