OrderHeader.js 1.06 KB
import { ORDER_LIST } from "~/constants/mine.js";
Component({
  properties: {
    padding_bottom: {
      type: Number,
      value: 0,
    },
    // tab: {
    //   type: Array,
    //   value: [],
    // },
    tabIndex: {
      type: Number,
      value: 0,
    },
    keyword: {
      type: String,
      value: "",
    },
  },

  data: {
    tab: Object.freeze(ORDER_LIST.map((item) => item.text)),
  },

  methods: {
    navbarReady(e) {
      wx.p.wxApi.getViewInfo(".tab", (res) => {
        console.log("🚀 ~ navbarReady ~ res:", e)
        this.setData({
          padding_bottom: e.detail.height,
          margin_top: e.detail.height + res.height,
        });
      });
    },

    back() {
      this.triggerEvent("back");
    },

    changeTab(e) {
      this.triggerEvent("changeTab", e.detail);
    },

    search(e) {
      this.triggerEvent("search", e.detail);
    },

    clear() {
      this.triggerEvent("clear");
    },

    input(e) {
      this.triggerEvent("input", e.detail);
    },

    blur(e) {
      this.triggerEvent("blur", e.detail);
    },
  },
});