|
@@ -16,7 +16,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
|
__name: "index",
|
|
|
setup(__props) {
|
|
|
var _a;
|
|
|
- (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
|
|
|
+ const $api = (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
|
|
|
common_vendor.computed(() => {
|
|
|
return common_vendor.index.getStorageSync("openid");
|
|
|
});
|
|
@@ -26,111 +26,64 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
|
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 shop = common_vendor.ref({ name: "淘车车长春店", num: "109" });
|
|
|
- const list = common_vendor.ref([
|
|
|
- {
|
|
|
- id: "1",
|
|
|
- file: [{ url: "https://cdn.uviewui.com/uview/album/1.jpg" }],
|
|
|
- name: "夏朗 2013款 1.8TSI 标配型 欧IV",
|
|
|
- year: "2014年 ",
|
|
|
- city: "丹东",
|
|
|
- kilometer: "8万公里",
|
|
|
- money: "7.80"
|
|
|
- },
|
|
|
- {
|
|
|
- id: "1",
|
|
|
- file: [{ url: "https://cdn.uviewui.com/uview/album/2.jpg" }],
|
|
|
- name: "捷豹XEL 2020款 2.0T 200PS S进取优雅版",
|
|
|
- year: "2014年 ",
|
|
|
- city: "丹东",
|
|
|
- kilometer: "8万公里",
|
|
|
- money: "7.80"
|
|
|
- },
|
|
|
- {
|
|
|
- id: "1",
|
|
|
- file: [{ url: "https://cdn.uviewui.com/uview/album/3.jpg" }],
|
|
|
- name: "夏朗 2013款 1.8TSI 标配型 欧IV",
|
|
|
- year: "2014年 ",
|
|
|
- city: "丹东",
|
|
|
- kilometer: "8万公里",
|
|
|
- money: "7.80"
|
|
|
- },
|
|
|
- {
|
|
|
- id: "1",
|
|
|
- file: [{ url: "https://cdn.uviewui.com/uview/album/4.jpg" }],
|
|
|
- name: "夏朗 2013款 1.8TSI 标配型 欧IV",
|
|
|
- year: "2014年 ",
|
|
|
- city: "丹东",
|
|
|
- kilometer: "8万公里",
|
|
|
- money: "7.80"
|
|
|
- },
|
|
|
- {
|
|
|
- id: "1",
|
|
|
- file: [{ url: "https://cdn.uviewui.com/uview/album/5.jpg" }],
|
|
|
- name: "夏朗 2013款 1.8TSI 标配型 欧IV",
|
|
|
- year: "2014年 ",
|
|
|
- city: "丹东",
|
|
|
- kilometer: "8万公里",
|
|
|
- money: "7.80"
|
|
|
- },
|
|
|
- {
|
|
|
- id: "1",
|
|
|
- file: [{ url: "https://cdn.uviewui.com/uview/album/6.jpg" }],
|
|
|
- name: "夏朗 2013款 1.8TSI 标配型 欧IV",
|
|
|
- year: "2014年 ",
|
|
|
- city: "丹东",
|
|
|
- kilometer: "8万公里",
|
|
|
- money: "7.80"
|
|
|
- },
|
|
|
- {
|
|
|
- id: "1",
|
|
|
- file: [{ url: "https://cdn.uviewui.com/uview/album/7.jpg" }],
|
|
|
- name: "夏朗 2013款 1.8TSI 标配型 欧IV",
|
|
|
- year: "2014年 ",
|
|
|
- city: "丹东",
|
|
|
- kilometer: "8万公里",
|
|
|
- money: "7.80"
|
|
|
- },
|
|
|
- {
|
|
|
- id: "1",
|
|
|
- file: [{ url: "https://cdn.uviewui.com/uview/album/8.jpg" }],
|
|
|
- name: "夏朗 2013款 1.8TSI 标配型 欧IV",
|
|
|
- year: "2014年 ",
|
|
|
- city: "丹东",
|
|
|
- kilometer: "8万公里",
|
|
|
- money: "7.80"
|
|
|
- },
|
|
|
- {
|
|
|
- id: "1",
|
|
|
- file: [{ url: "https://cdn.uviewui.com/uview/album/9.jpg" }],
|
|
|
- name: "夏朗 2013款 1.8TSI 标配型 欧IV",
|
|
|
- year: "2014年 ",
|
|
|
- city: "丹东",
|
|
|
- kilometer: "8万公里",
|
|
|
- money: "7.80"
|
|
|
- },
|
|
|
- {
|
|
|
- id: "1",
|
|
|
- file: [{ url: "https://cdn.uviewui.com/uview/album/10.jpg" }],
|
|
|
- name: "夏朗 2013款 1.8TSI 标配型 欧IV",
|
|
|
- year: "2014年 ",
|
|
|
- city: "丹东",
|
|
|
- kilometer: "8万公里",
|
|
|
- money: "7.80"
|
|
|
- }
|
|
|
- ]);
|
|
|
+ const shop = common_vendor.ref({});
|
|
|
+ const list = common_vendor.ref([]);
|
|
|
common_vendor.onLoad(async (options) => {
|
|
|
id.value = options && options.id;
|
|
|
await searchConfig();
|
|
|
- await searchOther();
|
|
|
await search();
|
|
|
});
|
|
|
const searchConfig = async () => {
|
|
|
config.value = common_vendor.index.getStorageSync("config");
|
|
|
};
|
|
|
- const searchOther = async () => {
|
|
|
- };
|
|
|
const search = async () => {
|
|
|
+ var _a2;
|
|
|
+ if (id.value) {
|
|
|
+ const res = await $api(`car/${id.value}`, "GET", {});
|
|
|
+ if (res.errcode === 0) {
|
|
|
+ info.value = res.data;
|
|
|
+ await searchShop((_a2 = res.data) == null ? void 0 : _a2.shop);
|
|
|
+ await searchOther();
|
|
|
+ } else {
|
|
|
+ common_vendor.index.showToast({
|
|
|
+ title: res.errmsg || "",
|
|
|
+ icon: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ const searchShop = async (e) => {
|
|
|
+ if (!e)
|
|
|
+ return;
|
|
|
+ const res = await $api(`shop/${e}`, "GET", {});
|
|
|
+ if (res.errcode === 0) {
|
|
|
+ shop.value = res.data;
|
|
|
+ } else {
|
|
|
+ common_vendor.index.showToast({
|
|
|
+ title: res.errmsg || "",
|
|
|
+ icon: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ };
|
|
|
+ const searchOther = async () => {
|
|
|
+ const info2 = {
|
|
|
+ skip: 0,
|
|
|
+ limit: 20,
|
|
|
+ status: "0",
|
|
|
+ shop: shop.value._id
|
|
|
+ };
|
|
|
+ const res = await $api("car", "GET", {
|
|
|
+ ...info2
|
|
|
+ });
|
|
|
+ if (res.errcode === 0) {
|
|
|
+ list.value = res.data;
|
|
|
+ shop.value.num = res.total;
|
|
|
+ } else {
|
|
|
+ common_vendor.index.showToast({
|
|
|
+ title: res.errmsg || "",
|
|
|
+ icon: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
};
|
|
|
const PhoneNumber = (e) => {
|
|
|
console.log(e);
|
|
@@ -170,39 +123,42 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
|
console.log("收藏");
|
|
|
};
|
|
|
return (_ctx, _cache) => {
|
|
|
+ var _a2, _b, _c, _d, _e, _f, _g;
|
|
|
return {
|
|
|
a: common_vendor.t(currentNum.value + 1),
|
|
|
- b: common_vendor.t(info.value.url.length),
|
|
|
+ b: common_vendor.t((_a2 = info.value.file) == null ? void 0 : _a2.length),
|
|
|
c: common_vendor.o((e) => currentNum.value = e.current),
|
|
|
d: common_vendor.p({
|
|
|
- list: info.value.url,
|
|
|
+ list: info.value.file,
|
|
|
height: "300px",
|
|
|
keyName: "url",
|
|
|
autoplay: false,
|
|
|
indicatorStyle: "right: 20px",
|
|
|
radius: "0"
|
|
|
}),
|
|
|
- e: common_vendor.t(info.value.money || "0"),
|
|
|
+ e: common_vendor.t(info.value.real_pay || "0"),
|
|
|
f: common_vendor.t(info.value.price || "0"),
|
|
|
g: common_vendor.o(PhoneNumber),
|
|
|
- h: common_vendor.t(info.value.name || "暂无名称"),
|
|
|
- i: common_vendor.t(info.value.type),
|
|
|
- j: common_vendor.p({
|
|
|
+ h: common_vendor.t(info.value.series || "暂无"),
|
|
|
+ i: common_vendor.t(info.value.year || "暂无"),
|
|
|
+ j: common_vendor.t(info.value.style || "暂无"),
|
|
|
+ k: common_vendor.t(info.value.series),
|
|
|
+ l: common_vendor.p({
|
|
|
name: "arrow-right",
|
|
|
size: "12"
|
|
|
}),
|
|
|
- k: common_vendor.t(info.value.rank),
|
|
|
- l: common_vendor.t(info.value.rankNum),
|
|
|
- m: common_vendor.p({
|
|
|
+ m: common_vendor.t(info.value.rank),
|
|
|
+ n: common_vendor.t(info.value.rankNum),
|
|
|
+ o: common_vendor.p({
|
|
|
name: "arrow-right",
|
|
|
size: "12"
|
|
|
}),
|
|
|
- n: common_vendor.t(info.value.payment),
|
|
|
- o: common_vendor.p({
|
|
|
+ p: common_vendor.t(info.value.first_pay),
|
|
|
+ q: common_vendor.p({
|
|
|
name: "arrow-right",
|
|
|
size: "16"
|
|
|
}),
|
|
|
- p: common_vendor.f(files.value, (item, index, i0) => {
|
|
|
+ r: common_vendor.f(files.value, (item, index, i0) => {
|
|
|
return {
|
|
|
a: common_vendor.t(item.content),
|
|
|
b: common_vendor.t(item.name),
|
|
@@ -210,12 +166,12 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
|
d: common_vendor.o(($event) => _ctx.toCommon(item), index)
|
|
|
};
|
|
|
}),
|
|
|
- q: common_vendor.o(toRecord),
|
|
|
- r: common_vendor.p({
|
|
|
+ s: common_vendor.o(toRecord),
|
|
|
+ t: common_vendor.p({
|
|
|
name: "arrow-right",
|
|
|
size: "16"
|
|
|
}),
|
|
|
- s: common_vendor.f(parameter.value, (item, index, i0) => {
|
|
|
+ v: common_vendor.f(parameter.value, (item, index, i0) => {
|
|
|
return {
|
|
|
a: common_vendor.t(item.content),
|
|
|
b: common_vendor.t(item.name),
|
|
@@ -223,69 +179,71 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
|
d: common_vendor.o(($event) => _ctx.toCommon(item), index)
|
|
|
};
|
|
|
}),
|
|
|
- t: shop.value.file && shop.value.file.length > 0 ? shop.value.file[0].url : "https://cdn.uviewui.com/uview/album/1.jpg",
|
|
|
- v: common_vendor.t(shop.value.name || "暂无"),
|
|
|
- w: common_vendor.p({
|
|
|
+ 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({
|
|
|
bold: true,
|
|
|
color: "#000",
|
|
|
name: "arrow-right",
|
|
|
size: "16"
|
|
|
}),
|
|
|
- x: common_vendor.o(toShop),
|
|
|
- y: common_vendor.t(shop.value.num || 0),
|
|
|
- z: common_vendor.o(toChat),
|
|
|
- A: common_vendor.p({
|
|
|
+ z: common_vendor.o(toShop),
|
|
|
+ A: common_vendor.t(shop.value.num || 0),
|
|
|
+ B: common_vendor.o(toChat),
|
|
|
+ C: common_vendor.p({
|
|
|
icon: "phone",
|
|
|
text: "咨询卖家车况",
|
|
|
size: "normal",
|
|
|
type: "info"
|
|
|
}),
|
|
|
- B: info.value.file && info.value.file.length > 0 ? info.value.file[0].url : "https://cdn.uviewui.com/uview/album/1.jpg",
|
|
|
- C: info.value.file && info.value.file.length > 1 ? info.value.file[1].url : "https://cdn.uviewui.com/uview/album/5.jpg",
|
|
|
- D: info.value.file && info.value.file.length > 2 ? info.value.file[2].url : "https://cdn.uviewui.com/uview/album/2.jpg",
|
|
|
- E: info.value.file && info.value.file.length > 3 ? info.value.file[3].url : "https://cdn.uviewui.com/uview/album/3.jpg",
|
|
|
- F: info.value.file && info.value.file.length > 4 ? info.value.file[4].url : "https://cdn.uviewui.com/uview/album/4.jpg",
|
|
|
- G: common_vendor.o(toMore),
|
|
|
- H: common_vendor.p({
|
|
|
+ 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({
|
|
|
text: "查看更多图片",
|
|
|
size: "normal",
|
|
|
type: "info"
|
|
|
}),
|
|
|
- I: common_vendor.f(list.value, (item, index, i0) => {
|
|
|
+ K: 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.name || "暂无"),
|
|
|
- c: item.year
|
|
|
+ b: common_vendor.t(item.series || "暂无"),
|
|
|
+ c: common_vendor.t(item.year || "暂无"),
|
|
|
+ d: common_vendor.t(item.style || "暂无"),
|
|
|
+ e: item.year
|
|
|
}, item.year ? {
|
|
|
- d: common_vendor.t(item.year || "暂无")
|
|
|
+ f: common_vendor.t(item.year || "暂无")
|
|
|
} : {}, {
|
|
|
- e: item.kilometer
|
|
|
- }, item.kilometer ? {
|
|
|
- f: common_vendor.t(item.kilometer || "暂无")
|
|
|
+ g: item.mileage
|
|
|
+ }, item.mileage ? {
|
|
|
+ h: common_vendor.t(item.mileage || "暂无")
|
|
|
} : {}, {
|
|
|
- g: item.city
|
|
|
- }, item.city ? {
|
|
|
- h: common_vendor.t(item.city || "暂无")
|
|
|
+ i: item.place
|
|
|
+ }, item.place ? {
|
|
|
+ j: common_vendor.t(item.place || "暂无")
|
|
|
} : {}, {
|
|
|
- i: common_vendor.t(item.money || "0"),
|
|
|
- j: index,
|
|
|
- k: common_vendor.o(($event) => toView(item), index)
|
|
|
+ k: common_vendor.t(item.total_money || "0"),
|
|
|
+ l: index,
|
|
|
+ m: common_vendor.o(($event) => toView(item), index)
|
|
|
});
|
|
|
}),
|
|
|
- J: common_vendor.p({
|
|
|
+ L: common_vendor.p({
|
|
|
color: "#000",
|
|
|
name: "red-packet",
|
|
|
size: "20"
|
|
|
}),
|
|
|
- K: common_vendor.o(toChat),
|
|
|
- L: common_vendor.p({
|
|
|
+ M: common_vendor.o(toChat),
|
|
|
+ N: common_vendor.p({
|
|
|
color: "#000",
|
|
|
name: "heart",
|
|
|
size: "20"
|
|
|
}),
|
|
|
- M: common_vendor.o(toCollect),
|
|
|
- N: common_vendor.o(toChat),
|
|
|
- O: common_vendor.o(toChat)
|
|
|
+ O: common_vendor.o(toCollect),
|
|
|
+ P: common_vendor.o(toChat),
|
|
|
+ Q: common_vendor.o(toChat)
|
|
|
};
|
|
|
};
|
|
|
}
|