import { getDataSet } from "@/utils/util";

Page({
  /**
   * 页面的初始数据
   */
  data: {
    params: { curr_page: 1, page_count: 20, state: "1", process_id: "" },
    list: [
      {
        order_no: "XSDD2025112500000043",
        custom_name: "客户5",
        custom_address: "",
        custom_phone: null,
        custom_order_no: "",
        goods_name: "浴室柜",
        info_process_id: 163,
        produce_info_id: 62,
        process_code: "ld",
        state: 1,
        end_user_address: null,
        end_user_name: null,
        end_user_phone: null,
      },
    ],
    count: 1,
  },
  tabChange(e: any) {
    const state = getDataSet(e).key;
    this.data.params.state = state;
    this.page();
  },
  page(curr: number = 1) {
    this.data.params.curr_page = curr;
    this.setData({ params: this.data.params });
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    // console.log(options);
    wx.setNavigationBarTitle({
      title: decodeURIComponent(options.title || ""),
    });
    this.data.params.process_id = `${options.process_id || ""}`;
    this.page();
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {},

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {},

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {},

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {},

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {},

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {},

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {},
});

