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
50
51
52
"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;
let objColor = {
"进行中": "#D5E5FF",
"已完成": "#dbf1e1",
"已作废": "#FFD5D5"
};
return objColor[index] || "#D5E5FF";
});
const fontColor = common_vendor.computed(() => {
let index = props.carInfo.status;
let objColor = {
"进行中": "#3680FE",
"已完成": "#19be6b",
"已作废": "#C81515"
};
return objColor[index] || "#3680FE";
});
const skip = () => {
emit("onSkip", props.carInfo.carId);
};
return (_ctx, _cache) => {
var _a;
return {
a: common_vendor.t(((_a = __props.carInfo) == null ? void 0 : _a.status) || __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);