|
@@ -23,11 +23,12 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
|
const config = common_vendor.ref({});
|
|
|
const id = common_vendor.ref("");
|
|
|
const currentNum = common_vendor.ref(1);
|
|
|
- const files = common_vendor.ref([{ name: "上牌时间", content: "2013-10" }, { name: "表显里程", content: "8.0万公里" }, { name: "排放标准", content: "国六" }, { name: "车源地", content: "长春" }]);
|
|
|
- const parameter = common_vendor.ref([{ name: "发动机", content: "1.8L" }, { name: "轴距", content: "2700mm" }, { name: "变速箱", content: "自动" }, { name: "最大功率", content: "103kW" }]);
|
|
|
- const info = common_vendor.ref({ url: [{ url: "https://cdn.uviewui.com/uview/album/1.jpg" }, { url: "https://cdn.uviewui.com/uview/album/2.jpg" }, { url: "https://cdn.uviewui.com/uview/album/3.jpg" }, { url: "https://cdn.uviewui.com/uview/album/4.jpg" }, { url: "https://cdn.uviewui.com/uview/album/5.jpg" }], payment: "2.7", rankNum: "11", rank: "全国紧凑型SUV销售榜", type: "夏朗", name: "夏朗 2013款 1.8TSI 标配型 欧IV", money: "7.80", price: "29.06" });
|
|
|
+ const info = common_vendor.ref({});
|
|
|
const shop = common_vendor.ref({});
|
|
|
const list = common_vendor.ref([]);
|
|
|
+ const emissionList = common_vendor.ref([]);
|
|
|
+ const boxTypeList = common_vendor.ref([]);
|
|
|
+ const displacementList = common_vendor.ref([]);
|
|
|
common_vendor.onLoad(async (options) => {
|
|
|
id.value = options && options.id;
|
|
|
await searchConfig();
|
|
@@ -72,18 +73,46 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
|
status: "0",
|
|
|
shop: shop.value._id
|
|
|
};
|
|
|
- const res = await $api("car", "GET", {
|
|
|
+ const arr = await $api("car", "GET", {
|
|
|
...info2
|
|
|
});
|
|
|
- if (res.errcode === 0) {
|
|
|
- list.value = res.data;
|
|
|
- shop.value.num = res.total;
|
|
|
+ if (arr.errcode === 0) {
|
|
|
+ list.value = arr.data;
|
|
|
+ shop.value.num = arr.total;
|
|
|
} else {
|
|
|
common_vendor.index.showToast({
|
|
|
- title: res.errmsg || "",
|
|
|
+ title: arr.errmsg || "",
|
|
|
icon: "error"
|
|
|
});
|
|
|
}
|
|
|
+ let res;
|
|
|
+ res = await $api(`dictData`, "GET", { code: "boxType", is_use: "0" });
|
|
|
+ if (res.errcode === 0)
|
|
|
+ boxTypeList.value = res.data;
|
|
|
+ res = await $api(`dictData`, "GET", { code: "emission", is_use: "0" });
|
|
|
+ if (res.errcode === 0)
|
|
|
+ emissionList.value = res.data;
|
|
|
+ res = await $api(`dictData`, "GET", { code: "displacement", is_use: "0" });
|
|
|
+ if (res.errcode === 0)
|
|
|
+ displacementList.value = res.data;
|
|
|
+ };
|
|
|
+ const getDict = (data, model) => {
|
|
|
+ let list2;
|
|
|
+ switch (model) {
|
|
|
+ case "type":
|
|
|
+ list2 = boxTypeList.value;
|
|
|
+ break;
|
|
|
+ case "emission":
|
|
|
+ list2 = emissionList.value;
|
|
|
+ break;
|
|
|
+ case "displacement":
|
|
|
+ list2 = displacementList.value;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (!list2)
|
|
|
+ return;
|
|
|
+ const res = list2.find((f) => f.value == data);
|
|
|
+ return (res == null ? void 0 : res.label) || "暂无";
|
|
|
};
|
|
|
const PhoneNumber = (e) => {
|
|
|
console.log(e);
|
|
@@ -159,56 +188,48 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
|
name: "arrow-right",
|
|
|
size: "16"
|
|
|
}),
|
|
|
- r: common_vendor.f(files.value, (item, index, i0) => {
|
|
|
- return {
|
|
|
- a: common_vendor.t(item.content),
|
|
|
- b: common_vendor.t(item.name),
|
|
|
- c: index,
|
|
|
- d: common_vendor.o(($event) => _ctx.toCommon(item), index)
|
|
|
- };
|
|
|
- }),
|
|
|
- s: common_vendor.o(toRecord),
|
|
|
- t: common_vendor.p({
|
|
|
+ r: common_vendor.t(common_vendor.unref(common_vendor.hooks)(info.value.f_time).format("MM-DD") || "暂无日期"),
|
|
|
+ s: common_vendor.t(info.value.mileage || "暂无"),
|
|
|
+ t: common_vendor.t(getDict(info.value.emission, "emission")),
|
|
|
+ v: common_vendor.t(info.value.place || "暂无"),
|
|
|
+ w: common_vendor.o(toRecord),
|
|
|
+ x: common_vendor.p({
|
|
|
name: "arrow-right",
|
|
|
size: "16"
|
|
|
}),
|
|
|
- v: common_vendor.f(parameter.value, (item, index, i0) => {
|
|
|
- return {
|
|
|
- a: common_vendor.t(item.content),
|
|
|
- b: common_vendor.t(item.name),
|
|
|
- c: index,
|
|
|
- d: common_vendor.o(($event) => _ctx.toCommon(item), index)
|
|
|
- };
|
|
|
- }),
|
|
|
- w: shop.value.logo && ((_b = shop.value.logo) == null ? void 0 : _b.length) > 0 ? shop.value.logo[0].url : "https://cdn.uviewui.com/uview/album/1.jpg",
|
|
|
- x: common_vendor.t(shop.value.name || "暂无"),
|
|
|
- y: common_vendor.p({
|
|
|
+ y: common_vendor.t(getDict(info.value.displacement, "displacement")),
|
|
|
+ z: common_vendor.t(info.value.wheelbase),
|
|
|
+ A: common_vendor.t(getDict(info.value.type, "type")),
|
|
|
+ B: common_vendor.t(info.value.oil),
|
|
|
+ C: shop.value.logo && ((_b = shop.value.logo) == null ? void 0 : _b.length) > 0 ? shop.value.logo[0].url : "https://cdn.uviewui.com/uview/album/1.jpg",
|
|
|
+ D: common_vendor.t(shop.value.name || "暂无"),
|
|
|
+ E: common_vendor.p({
|
|
|
bold: true,
|
|
|
color: "#000",
|
|
|
name: "arrow-right",
|
|
|
size: "16"
|
|
|
}),
|
|
|
- z: common_vendor.o(toShop),
|
|
|
- A: common_vendor.t(shop.value.num || 0),
|
|
|
- B: common_vendor.o(toChat),
|
|
|
- C: common_vendor.p({
|
|
|
+ F: common_vendor.o(toShop),
|
|
|
+ G: common_vendor.t(shop.value.num || 0),
|
|
|
+ H: common_vendor.o(toChat),
|
|
|
+ I: common_vendor.p({
|
|
|
icon: "phone",
|
|
|
text: "咨询卖家车况",
|
|
|
size: "normal",
|
|
|
type: "info"
|
|
|
}),
|
|
|
- D: info.value.file && ((_c = info.value.file) == null ? void 0 : _c.length) > 0 ? info.value.file[0].url : "https://cdn.uviewui.com/uview/album/1.jpg",
|
|
|
- E: info.value.file && ((_d = info.value.file) == null ? void 0 : _d.length) > 1 ? info.value.file[1].url : "https://cdn.uviewui.com/uview/album/5.jpg",
|
|
|
- F: info.value.file && ((_e = info.value.file) == null ? void 0 : _e.length) > 2 ? info.value.file[2].url : "https://cdn.uviewui.com/uview/album/2.jpg",
|
|
|
- G: info.value.file && ((_f = info.value.file) == null ? void 0 : _f.length) > 3 ? info.value.file[3].url : "https://cdn.uviewui.com/uview/album/3.jpg",
|
|
|
- H: info.value.file && ((_g = info.value.file) == null ? void 0 : _g.length) > 4 ? info.value.file[4].url : "https://cdn.uviewui.com/uview/album/4.jpg",
|
|
|
- I: common_vendor.o(toMore),
|
|
|
- J: common_vendor.p({
|
|
|
+ J: info.value.file && ((_c = info.value.file) == null ? void 0 : _c.length) > 0 ? info.value.file[0].url : "https://cdn.uviewui.com/uview/album/1.jpg",
|
|
|
+ K: info.value.file && ((_d = info.value.file) == null ? void 0 : _d.length) > 1 ? info.value.file[1].url : "https://cdn.uviewui.com/uview/album/5.jpg",
|
|
|
+ L: info.value.file && ((_e = info.value.file) == null ? void 0 : _e.length) > 2 ? info.value.file[2].url : "https://cdn.uviewui.com/uview/album/2.jpg",
|
|
|
+ M: info.value.file && ((_f = info.value.file) == null ? void 0 : _f.length) > 3 ? info.value.file[3].url : "https://cdn.uviewui.com/uview/album/3.jpg",
|
|
|
+ N: info.value.file && ((_g = info.value.file) == null ? void 0 : _g.length) > 4 ? info.value.file[4].url : "https://cdn.uviewui.com/uview/album/4.jpg",
|
|
|
+ O: common_vendor.o(toMore),
|
|
|
+ P: common_vendor.p({
|
|
|
text: "查看更多图片",
|
|
|
size: "normal",
|
|
|
type: "info"
|
|
|
}),
|
|
|
- K: common_vendor.f(list.value, (item, index, i0) => {
|
|
|
+ Q: common_vendor.f(list.value, (item, index, i0) => {
|
|
|
return common_vendor.e({
|
|
|
a: item.file && item.file.length > 0 ? item.file[0].url : "",
|
|
|
b: common_vendor.t(item.series || "暂无"),
|
|
@@ -231,20 +252,20 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
|
m: common_vendor.o(($event) => toView(item), index)
|
|
|
});
|
|
|
}),
|
|
|
- L: common_vendor.p({
|
|
|
+ R: common_vendor.p({
|
|
|
color: "#000",
|
|
|
name: "red-packet",
|
|
|
size: "20"
|
|
|
}),
|
|
|
- M: common_vendor.o(toChat),
|
|
|
- N: common_vendor.p({
|
|
|
+ S: common_vendor.o(toChat),
|
|
|
+ T: common_vendor.p({
|
|
|
color: "#000",
|
|
|
name: "heart",
|
|
|
size: "20"
|
|
|
}),
|
|
|
- O: common_vendor.o(toCollect),
|
|
|
- P: common_vendor.o(toChat),
|
|
|
- Q: common_vendor.o(toChat)
|
|
|
+ U: common_vendor.o(toCollect),
|
|
|
+ V: common_vendor.o(toChat),
|
|
|
+ W: common_vendor.o(toChat)
|
|
|
};
|
|
|
};
|
|
|
}
|