index.js 2.4 KB

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