recorddetails.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. openpreview(e){
  31. wx.previewImage({
  32. current: e.currentTarget.dataset.url, // 当前显示图片的http链接
  33. urls: e.currentTarget.dataset.urls || [] // 需要预览的图片http链接列表
  34. })
  35. },
  36. goedit(){
  37. wx.navigateTo({
  38. url: '/pages/sorting/add/add?fenid='+this.data.id,
  39. })
  40. },
  41. getinfo(){
  42. let that = this
  43. wx.showLoading()
  44. app.api.useApi(app.globalData.baseAppUrl + "api/admin/sorting/pack/InventoryDetails", {id:that.data.id}, "get").then(function (res) {
  45. wx.hideLoading()
  46. if(res.code==200){
  47. that.setData({info: res.message.data})
  48. }
  49. }).catch(function (err) {
  50. console.log(222);
  51. })
  52. },
  53. gorecorddetailsinfo(){
  54. // let id = e.currentTarget.dataset.id
  55. wx.navigateTo({
  56. url: '/pages/record/recorddetailsinfo/recorddetailsinfo?id='+this.data.id,
  57. })
  58. },
  59. /**
  60. * 生命周期函数--监听页面隐藏
  61. */
  62. onHide: function () {
  63. },
  64. /**
  65. * 生命周期函数--监听页面卸载
  66. */
  67. onUnload: function () {
  68. },
  69. /**
  70. * 页面相关事件处理函数--监听用户下拉动作
  71. */
  72. onPullDownRefresh: function () {
  73. },
  74. /**
  75. * 页面上拉触底事件的处理函数
  76. */
  77. onReachBottom: function () {
  78. },
  79. /**
  80. * 用户点击右上角分享
  81. */
  82. onShareAppMessage: function () {
  83. }
  84. })