index.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. // pages/order/invoicingRecord/index.js
  2. const util = require('../../../utils/util.js');
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. invoiceRecord: [],
  9. uidList: [], //uid集合
  10. },
  11. onLoad(options) {
  12. console.log(options);
  13. let arr = JSON.parse(options.detail)
  14. this.setData({
  15. uidList: arr
  16. })
  17. this.getRecord()
  18. },
  19. //获取开票记录
  20. getRecord() {
  21. let that = this
  22. let data = []
  23. let arr = that.data.uidList
  24. // console.log(arr);
  25. arr.forEach(el => {
  26. data.push(el.uid)
  27. })
  28. // console.log(data);
  29. util.ajax({
  30. func: "articleInvoice/getArticleInvoiceList",
  31. data,
  32. load: false
  33. }, ({
  34. data,
  35. code
  36. }) => {
  37. if (code == 0) {
  38. data.forEach((e) => {
  39. console.log(e.crtTime);
  40. e.crtTime = util.formatUnixtimestamp((e.crtTime), 'MM月dd日 hh:mm', false)
  41. })
  42. // console.log(data,JSON.parse(data[4].orderPassword));
  43. that.setData({
  44. invoiceRecord: data
  45. })
  46. }
  47. })
  48. },
  49. //待开票 已拒绝 开票中
  50. invoDetail(e) {
  51. // console.log(e);
  52. let id = e.currentTarget.dataset.id
  53. let status = e.currentTarget.dataset.status
  54. // let detail = JSON.stringify({
  55. // id,
  56. // status
  57. // })
  58. // console.log(detail);
  59. wx.navigateTo({
  60. url: '/pages/order/invoicingDetail/index?id=' + id + '&status=' + status,
  61. })
  62. },
  63. /**
  64. * 生命周期函数--监听页面初次渲染完成
  65. */
  66. onReady() {
  67. },
  68. /**
  69. * 生命周期函数--监听页面显示
  70. */
  71. onShow() {
  72. this.getRecord()
  73. },
  74. /**
  75. * 生命周期函数--监听页面隐藏
  76. */
  77. onHide() {
  78. // this.getRecord()
  79. },
  80. /**
  81. * 生命周期函数--监听页面卸载
  82. */
  83. onUnload: function () {
  84. wx.redirectTo({
  85. url: '/pages/order/invoicing/index',
  86. })
  87. },
  88. /**
  89. * 页面相关事件处理函数--监听用户下拉动作
  90. */
  91. onPullDownRefresh() {
  92. },
  93. /**
  94. * 页面上拉触底事件的处理函数
  95. */
  96. onReachBottom() {
  97. },
  98. /**
  99. * 用户点击右上角分享
  100. */
  101. onShareAppMessage() {
  102. }
  103. })