// pages/order/invoicingRecord/index.js const util = require('../../../utils/util.js'); Page({ /** * 页面的初始数据 */ data: { invoiceRecord: [], uidList: [], //uid集合 }, onLoad(options) { console.log(options); let arr = JSON.parse(options.detail) this.setData({ uidList: arr }) this.getRecord() }, //获取开票记录 getRecord() { let that = this let data = [] let arr = that.data.uidList // console.log(arr); arr.forEach(el => { data.push(el.uid) }) // console.log(data); util.ajax({ func: "articleInvoice/getArticleInvoiceList", data, load: false }, ({ data, code }) => { if (code == 0) { data.forEach((e) => { console.log(e.crtTime); e.crtTime = util.formatUnixtimestamp((e.crtTime), 'MM月dd日 hh:mm', false) }) // console.log(data,JSON.parse(data[4].orderPassword)); that.setData({ invoiceRecord: data }) } }) }, //待开票 已拒绝 开票中 invoDetail(e) { // console.log(e); let id = e.currentTarget.dataset.id let status = e.currentTarget.dataset.status // let detail = JSON.stringify({ // id, // status // }) // console.log(detail); wx.navigateTo({ url: '/pages/order/invoicingDetail/index?id=' + id + '&status=' + status, }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady() { }, /** * 生命周期函数--监听页面显示 */ onShow() { this.getRecord() }, /** * 生命周期函数--监听页面隐藏 */ onHide() { // this.getRecord() }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { wx.redirectTo({ url: '/pages/order/invoicing/index', }) }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom() { }, /** * 用户点击右上角分享 */ onShareAppMessage() { } })