carCard.js 1.4 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: ""
    }
  },
  setup(__props) {
    const props = __props;
    const bgColor = common_vendor.computed(() => {
      var _a;
      let index = ((_a = props.carInfo) == null ? void 0 : _a.policyStatus) || 0;
      let objColor = {
        "进行中": "#D5E5FF",
        "已完成": "#dbf1e1",
        "已作废": "#FFD5D5"
      };
      return objColor[index] || "#D5E5FF";
    });
    const fontColor = common_vendor.computed(() => {
      var _a;
      let index = ((_a = props.carInfo) == null ? void 0 : _a.policyStatus) || 0;
      let objColor = {
        "进行中": "#3680FE",
        "已完成": "#19be6b",
        "已作废": "#C81515"
      };
      return objColor[index] || "#3680FE";
    });
    return (_ctx, _cache) => {
      var _a;
      return {
        a: common_vendor.t(((_a = __props.carInfo) == null ? void 0 : _a.policyStatus) ?? __props.tipContent),
        b: bgColor.value,
        c: fontColor.value,
        d: common_vendor.o((...args) => _ctx.skip && _ctx.skip(...args))
      };
    };
  }
};
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-dc738fdc"]]);
wx.createComponent(Component);