carCard.js
1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
"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);