carCard.js
1.5 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
53
54
55
56
57
58
59
60
"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);