123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- // 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() {
- }
- })
|