index.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. // pages/payment/index.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: [
  13. { order_num: 'Ygj4757945hdFueu', receive_user_name: '胡英俊', mech_name: '翻斗幼儿园-小豆班', status_name: '待财务确认', status: '3', user_name: '采购人员', user_phone: '12345678901', money: '3344', receive_user_phone: '98765432109', receive_address: '翻斗大街翻斗花园2号楼1001室', },
  14. { order_num: 'Hgj4757945hdFueu', receive_user_name: '胡图图', mech_name: '翻斗幼儿园-小豆班', status_name: '待财务确认', status: '3', user_name: '采购人员', user_phone: '12345678901', money: '3344', receive_user_phone: '98765432109', receive_address: '翻斗大街翻斗花园2号楼1001室', order: [{ name: '小洋人', num: '123', money: '3000' }, { name: '娃哈哈', num: '123', money: '344' }] },
  15. ],
  16. },
  17. back: function () {
  18. wx.navigateBack({ url: '/pages/home/index' })
  19. },
  20. // 详细信息
  21. toView: function (e) {
  22. let item = e.currentTarget.dataset.item;
  23. this.setData({ info: item })
  24. this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
  25. },
  26. // 财务确认订单
  27. toSign: function (e) {
  28. wx.showModal({
  29. title: '订单确认',
  30. content: '您是否确认订单?',
  31. confirmText: '同意',
  32. success: (res) => {
  33. if (res.confirm) wx.showToast({ title: `已成功同意订单`, icon: 'success', duration: 2000 })
  34. else if (res.cancel) { }
  35. }
  36. })
  37. },
  38. /**
  39. * 生命周期函数--监听页面加载
  40. */
  41. onLoad: function (options) {
  42. // 计算高度
  43. this.searchHeight();
  44. },
  45. // 计算高度
  46. searchHeight: function () {
  47. let frameStyle = this.data.frameStyle;
  48. let client = app.globalData.client;
  49. // 减去状态栏
  50. let infoHeight = client.windowHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
  51. // 是否减去底部菜单
  52. if (frameStyle.useBar) infoHeight = infoHeight - 50;
  53. if (infoHeight) this.setData({ infoHeight: infoHeight })
  54. },
  55. /**
  56. * 生命周期函数--监听页面初次渲染完成
  57. */
  58. onReady: function () {
  59. },
  60. /**
  61. * 生命周期函数--监听页面显示
  62. */
  63. onShow: function () {
  64. },
  65. /**
  66. * 生命周期函数--监听页面隐藏
  67. */
  68. onHide: function () {
  69. },
  70. /**
  71. * 生命周期函数--监听页面卸载
  72. */
  73. onUnload: function () {
  74. },
  75. /**
  76. * 页面相关事件处理函数--监听用户下拉动作
  77. */
  78. onPullDownRefresh: function () {
  79. },
  80. /**
  81. * 页面上拉触底事件的处理函数
  82. */
  83. onReachBottom: function () {
  84. },
  85. /**
  86. * 用户点击右上角分享
  87. */
  88. onShareAppMessage: function () {
  89. }
  90. })