carCard.js 1.5 KB
"use strict";
const common_vendor = require("../common/vendor.js");
const _sfc_main = {
  __name: "carCard",
  props: {
    carInfo: {
      type: Object,
      require: true
    },
    tipContent: {
      type: String,
      default: ""
    }
  },
  emits: ["onSkip"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const bgColor = common_vendor.computed(() => {
      let index = props.carInfo.status || 99;
      let objColor = {
        0: "#D5E5FF",
        1: "#DED5FF",
        2: "#FFD5D5"
      };
      return objColor[index] || "#D5E5FF";
    });
    const fontColor = common_vendor.computed(() => {
      let index = props.carInfo.status || 99;
      let objColor = {
        0: "#3680FE",
        1: "#7F36FE",
        2: "#C81515"
      };
      return objColor[index] || "#3680FE";
    });
    const textContent = common_vendor.computed(() => {
      let index = props.carInfo.status || 99;
      let objColor = {
        0: "已提交",
        1: "等待修改",
        2: "已作废"
      };
      return objColor[index] || "";
    });
    const skip = () => {
      emit("onSkip", props.carInfo.carId);
    };
    return (_ctx, _cache) => {
      return {
        a: common_vendor.t(__props.tipContent === "" ? textContent.value : __props.tipContent),
        b: bgColor.value,
        c: fontColor.value,
        d: common_vendor.o(skip)
      };
    };
  }
};
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-dc738fdc"]]);
wx.createComponent(Component);