index.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. device_use_menus: [{
  30. img: 'http://t18.9026.com/mini/use-apply.png',
  31. title: '调用申请',
  32. desc: '机电负责人调用设备'
  33. }, {
  34. img: 'http://t18.9026.com/mini/rent-check.png',
  35. title: '调用审核',
  36. desc: '设备调用订单审核'
  37. }, {
  38. img: 'http://t18.9026.com/mini/error-handle.png',
  39. title: '异常处理',
  40. desc: '订单流程变更审核处理'
  41. }, {
  42. img: 'http://t18.9026.com/mini/all-order.png',
  43. title: '所有订单',
  44. desc: '查看全部设备调用订单'
  45. }],
  46. device_depot_menus: [{
  47. img: 'http://t18.9026.com/mini/all-order.png',
  48. title: '所有设备',
  49. desc: '查看仓库所有设备'
  50. }, {
  51. img: 'http://t18.9026.com/mini/rent-check.png',
  52. title: '维修上报',
  53. desc: '设备维修上报'
  54. }]
  55. },
  56. /**
  57. * 生命周期函数--监听页面加载
  58. */
  59. onLoad: function (options) {
  60. var id = options.id ? options.id : 1
  61. this.setData({
  62. id: id,
  63. userInfo: app.globalData.userInfo
  64. })
  65. },
  66. navigate: function(e) {
  67. wx.navigateTo({
  68. url: e.currentTarget.dataset.url,
  69. })
  70. },
  71. getProject() {
  72. var that = this
  73. http({
  74. url: 'projects/detail',
  75. data: {
  76. id: this.data.id
  77. },
  78. success: function(res) {
  79. if(res.code == 0) {
  80. that.setData({
  81. project: res.data
  82. })
  83. wx.setNavigationBarTitle({
  84. title: res.data.name,
  85. })
  86. }
  87. }
  88. })
  89. },
  90. /**
  91. * 生命周期函数--监听页面初次渲染完成
  92. */
  93. onReady: function () {
  94. },
  95. /**
  96. * 生命周期函数--监听页面显示
  97. */
  98. onShow: function () {
  99. this.getProject()
  100. },
  101. /**
  102. * 生命周期函数--监听页面隐藏
  103. */
  104. onHide: function () {
  105. },
  106. /**
  107. * 生命周期函数--监听页面卸载
  108. */
  109. onUnload: function () {
  110. },
  111. /**
  112. * 页面相关事件处理函数--监听用户下拉动作
  113. */
  114. onPullDownRefresh: function () {
  115. },
  116. /**
  117. * 页面上拉触底事件的处理函数
  118. */
  119. onReachBottom: function () {
  120. },
  121. /**
  122. * 用户点击右上角分享
  123. */
  124. onShareAppMessage: function () {
  125. }
  126. })