recorddetails.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. // pages/record/recorddetails/recorddetails.js
  2. const app = getApp()
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. id: 0,
  9. type: 0,
  10. info: '',
  11. },
  12. /**
  13. * 生命周期函数--监听页面加载
  14. */
  15. onLoad: function (options) {
  16. this.setData({id: options.id})
  17. this.setData({type: options.type})
  18. this.getinfo()
  19. },
  20. /**
  21. * 生命周期函数--监听页面初次渲染完成
  22. */
  23. onReady: function () {
  24. },
  25. /**
  26. * 生命周期函数--监听页面显示
  27. */
  28. onShow: function () {
  29. },
  30. goedit(){
  31. wx.navigateTo({
  32. url: '/pages/sorting/add/add?fenid='+this.data.id,
  33. })
  34. },
  35. getinfo(){
  36. let that = this
  37. wx.showLoading()
  38. app.api.useApi(app.globalData.baseAppUrl + "api/admin/sorting/pack/InventoryDetails", {id:that.data.id}, "get").then(function (res) {
  39. wx.hideLoading()
  40. if(res.code==200){
  41. that.setData({info: res.message.data})
  42. }
  43. }).catch(function (err) {
  44. console.log(222);
  45. })
  46. },
  47. gorecorddetailsinfo(){
  48. // let id = e.currentTarget.dataset.id
  49. wx.navigateTo({
  50. url: '/pages/record/recorddetailsinfo/recorddetailsinfo?id='+this.data.id,
  51. })
  52. },
  53. /**
  54. * 生命周期函数--监听页面隐藏
  55. */
  56. onHide: function () {
  57. },
  58. /**
  59. * 生命周期函数--监听页面卸载
  60. */
  61. onUnload: function () {
  62. },
  63. /**
  64. * 页面相关事件处理函数--监听用户下拉动作
  65. */
  66. onPullDownRefresh: function () {
  67. },
  68. /**
  69. * 页面上拉触底事件的处理函数
  70. */
  71. onReachBottom: function () {
  72. },
  73. /**
  74. * 用户点击右上角分享
  75. */
  76. onShareAppMessage: function () {
  77. }
  78. })