index.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. // pages/project/index.js
  2. import http from '../../utils/http'
  3. import util from '../../utils/util'
  4. var app = getApp()
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. id: -1,
  11. userInfo: {},
  12. device_rent_menus: [{
  13. img: 'http://t18.9026.com/mini/create-order.png',
  14. title: '创建订单',
  15. desc: '创建外部设备租赁订单'
  16. }, {
  17. img: 'http://t18.9026.com/mini/rent-check.png',
  18. title: '租赁审核',
  19. desc: '设备租赁订单审核'
  20. }, {
  21. img: 'http://t18.9026.com/mini/error-handle.png',
  22. title: '异常处理',
  23. desc: '订单流程变更审核处理'
  24. }, {
  25. img: 'http://t18.9026.com/mini/all-order.png',
  26. title: '所有订单',
  27. desc: '查看全部设备租赁订单'
  28. },]
  29. },
  30. /**
  31. * 生命周期函数--监听页面加载
  32. */
  33. onLoad: function (options) {
  34. var id = options.id ? options.id : 1
  35. this.setData({
  36. id: id,
  37. userInfo: app.globalData.userInfo
  38. })
  39. this.getProject()
  40. },
  41. getProject() {
  42. var that = this
  43. http({
  44. url: 'projects/detail',
  45. data: {
  46. id: this.data.id
  47. },
  48. success: function(res) {
  49. if(res.code == 0) {
  50. that.setData({
  51. project: res.data
  52. })
  53. wx.setNavigationBarTitle({
  54. title: res.data.name,
  55. })
  56. }
  57. }
  58. })
  59. },
  60. /**
  61. * 生命周期函数--监听页面初次渲染完成
  62. */
  63. onReady: function () {
  64. },
  65. /**
  66. * 生命周期函数--监听页面显示
  67. */
  68. onShow: function () {
  69. },
  70. /**
  71. * 生命周期函数--监听页面隐藏
  72. */
  73. onHide: function () {
  74. },
  75. /**
  76. * 生命周期函数--监听页面卸载
  77. */
  78. onUnload: function () {
  79. },
  80. /**
  81. * 页面相关事件处理函数--监听用户下拉动作
  82. */
  83. onPullDownRefresh: function () {
  84. },
  85. /**
  86. * 页面上拉触底事件的处理函数
  87. */
  88. onReachBottom: function () {
  89. },
  90. /**
  91. * 用户点击右上角分享
  92. */
  93. onShareAppMessage: function () {
  94. }
  95. })