zs 1 year ago
parent
commit
51f31b6056

+ 65 - 15
pagesHome/car/index.vue

@@ -40,13 +40,13 @@
 									<span>{{info.series}}</span>&nbsp;
 									<u-icon name="arrow-right" size="12"></u-icon>
 								</view>
-								<view class="other">
+								<!-- <view class="other">
 									<span>{{info.rank}}·</span>
 									<span>第{{info.rankNum}}名</span>&nbsp;
 									<u-icon name="arrow-right" size="12"></u-icon>
-								</view>
+								</view> -->
 							</view>
-							<view class="two_3">
+							<view class="two_3" @tap="toChat">
 								<view class="left">
 									<text>分期购车</text>
 									<text>首付{{info.first_pay}}万开回家</text>
@@ -83,21 +83,40 @@
 								<text>参数</text>
 								<view class="info">
 									<view class="list">
-										<view class="info_1">{{getDict(info.displacement,'displacement')}}</view>
+										<view class="info_1">{{info.hundred_time||'0'}}s</view>
+										<view class="info_2">百公里加速</view>
+									</view>
+									<view class="list">
+										<view class="info_1">{{info.displacement||'暂无'}}</view>
 										<view class="info_2">发动机</view>
 									</view>
 									<view class="list">
-										<view class="info_1">{{info.wheelbase}}</view>
+										<view class="info_1">{{info.wheelbase||'暂无'}}</view>
 										<view class="info_2">轴距</view>
 									</view>
 									<view class="list">
 										<view class="info_1">{{getDict(info.type,'type')}}</view>
 										<view class="info_2">变速箱</view>
 									</view>
+								</view>
+							</view>
+						</view>
+						<view class="two thr2">
+							<view class="thr_1">
+								<text>用车成本</text>
+								<view class="info">
 									<view class="list">
-										<view class="info_1">{{info.oil}}L</view>
+										<view class="info_1">{{info.oil||'0'}}L</view>
 										<view class="info_2">百公里油耗</view>
 									</view>
+									<view class="list">
+										<view class="info_1">{{info.premium||'0'}}元</view>
+										<view class="info_2">年均保险费</view>
+									</view>
+									<view class="list">
+										<view class="info_1">{{info.maintenance||'0'}}元</view>
+										<view class="info_2">年均保养费</view>
+									</view>
 								</view>
 							</view>
 						</view>
@@ -232,7 +251,6 @@
 	// 字典表
 	const emissionList = ref([]);
 	const boxTypeList = ref([]);
-	const displacementList = ref([]);
 	onLoad(async (options) => {
 		id.value = options && options.id
 		await searchConfig();
@@ -298,9 +316,6 @@
 		// 排放标准
 		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) => {
@@ -312,9 +327,6 @@
 			case 'emission':
 				list = emissionList.value;
 				break;
-			case 'displacement':
-				list = displacementList.value;
-				break;
 			default:
 				break;
 		}
@@ -346,7 +358,10 @@
 				console.log('拨打电话成功');
 			},
 			fail: function () {
-				console.log('拨打电话失败');
+				uni.showToast({
+					title: '拨打电话失败',
+					icon: 'error',
+				});
 			}
 		});
 	};
@@ -359,7 +374,7 @@
 	// 查看更多图片
 	const toMore = () => {
 		uni.navigateTo({
-			url: `/pagesHome/picture/index?id=${info.value.id || info.value._id}`
+			url: `/pagesHome/picture/index?id=${info.value.id || info.value._id}&shop=${shop.value._id}`
 		})
 	};
 	// 收藏
@@ -512,6 +527,41 @@
 					}
 				}
 
+				.thr2 {
+					.thr_1 {
+						display: flex;
+
+						.info {
+							display: flex;
+							justify-content: space-around;
+							width: 89%;
+							margin: 0 0 2vw 0;
+
+							.list {
+								font-size: var(--font14Size);
+								text-align: center;
+								width: 19vw;
+
+								.info_1 {
+									font-weight: bold;
+								}
+
+								.info_2 {
+									color: var(--f828Color);
+									margin: 1vw 0 0 0;
+								}
+							}
+						}
+
+						text {
+							width: 8vw;
+							margin: 0 2vw 0 0;
+							color: var(--f828Color);
+							font-size: var(--font14Size);
+						}
+					}
+				}
+
 				.four {
 
 					.four_1 {

+ 20 - 6
pagesHome/picture/index.vue

@@ -48,16 +48,27 @@
 	const current = ref(0);
 	const itemId = ref(''); // 栏目右边scroll-view用于滚动的id
 	const imageList = ref([{ name: '外观', url: [] }, { name: '内饰', url: [] }, { name: '空间', url: [] }]);
-
+	// 店铺
+	const shop = ref({});
 	onLoad(async (options) => {
 		id.value = options && options.id
+		const shopId = options && options.shop
 		await searchConfig();
-		await searchOther();
+		await searchOther(shopId);
 		await search();
 	})
 	// 查询其他信息
-	const searchOther = async () => {
+	const searchOther = async (id) => {
 		let res;
+		res = await $api(`shop/${id}`, 'GET', {});
+		if (res.errcode === 0) {
+			shop.value = res.data
+		} else {
+			uni.showToast({
+				title: res.errmsg || '',
+				icon: 'error',
+			});
+		}
 	};
 	// config信息
 	const searchConfig = async () => {
@@ -91,14 +102,17 @@
 		}
 	};
 	// 联系卖家
-	const toChat = (item) => {
+	const toChat = () => {
 		uni.makePhoneCall({
-			phoneNumber: item.shop || '110',
+			phoneNumber: shop.value?.tel,
 			success: function () {
 				console.log('拨打电话成功');
 			},
 			fail: function () {
-				console.log('拨打电话失败');
+				uni.showToast({
+					title: '拨打电话失败',
+					icon: 'error',
+				});
 			}
 		});
 	};

+ 4 - 1
pagesHome/rank/index.vue

@@ -200,7 +200,10 @@
 				console.log('拨打电话成功');
 			},
 			fail: function () {
-				console.log('拨打电话失败');
+				uni.showToast({
+					title: '拨打电话失败',
+					icon: 'error',
+				});
 			}
 		});
 	};

+ 5 - 2
pagesHome/search/index.vue

@@ -287,12 +287,15 @@
 	// 联系卖家
 	const toChat = (item) => {
 		uni.makePhoneCall({
-			phoneNumber: item.shop || '110',
+			phoneNumber: item.shop?.tel,
 			success: function () {
 				console.log('拨打电话成功');
 			},
 			fail: function () {
-				console.log('拨打电话失败');
+				uni.showToast({
+					title: '拨打电话失败',
+					icon: 'error',
+				});
 			}
 		});
 	};

+ 8 - 4
pagesHome/shop/index.vue

@@ -4,7 +4,8 @@
 			<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage">
 				<view class="list-scroll-view">
 					<view class="top">
-						<image class="image" :src="shop.logo&&shop.logo?.length>0?shop.logo[0].url:'https://cdn.uviewui.com/uview/album/1.jpg'" />
+						<image class="image"
+							:src="shop.logo&&shop.logo?.length>0?shop.logo[0].url:'https://cdn.uviewui.com/uview/album/1.jpg'" />
 					</view>
 					<view class="bottom">
 						<view class="one">
@@ -351,14 +352,17 @@
 		})
 	};
 	// 联系卖家
-	const toChat = (item) => {
+	const toChat = () => {
 		uni.makePhoneCall({
-			phoneNumber: item.shop || '110',
+			phoneNumber: shop.value?.tel,
 			success: function () {
 				console.log('拨打电话成功');
 			},
 			fail: function () {
-				console.log('拨打电话失败');
+				uni.showToast({
+					title: '拨打电话失败',
+					icon: 'error',
+				});
 			}
 		});
 	};

+ 4 - 1
pagesMy/collect/index.vue

@@ -199,7 +199,10 @@
 				console.log('拨打电话成功');
 			},
 			fail: function () {
-				console.log('拨打电话失败');
+				uni.showToast({
+					title: '拨打电话失败',
+					icon: 'error',
+				});
 			}
 		});
 	};

+ 42 - 48
unpackage/dist/dev/mp-weixin/pagesHome/car/index.js

@@ -28,7 +28,6 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
     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();
@@ -92,9 +91,6 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
       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;
@@ -105,9 +101,6 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         case "emission":
           list2 = emissionList.value;
           break;
-        case "displacement":
-          list2 = displacementList.value;
-          break;
       }
       if (!list2)
         return;
@@ -135,7 +128,10 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
           console.log("拨打电话成功");
         },
         fail: function() {
-          console.log("拨打电话失败");
+          common_vendor.index.showToast({
+            title: "拨打电话失败",
+            icon: "error"
+          });
         }
       });
     };
@@ -146,7 +142,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
     };
     const toMore = () => {
       common_vendor.index.navigateTo({
-        url: `/pagesHome/picture/index?id=${info.value.id || info.value._id}`
+        url: `/pagesHome/picture/index?id=${info.value.id || info.value._id}&shop=${shop.value._id}`
       });
     };
     const toCollect = () => {
@@ -177,59 +173,57 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
           name: "arrow-right",
           size: "12"
         }),
-        m: common_vendor.t(info.value.rank),
-        n: common_vendor.t(info.value.rankNum),
-        o: common_vendor.p({
-          name: "arrow-right",
-          size: "12"
-        }),
-        p: common_vendor.t(info.value.first_pay),
-        q: common_vendor.p({
+        m: common_vendor.t(info.value.first_pay),
+        n: common_vendor.p({
           name: "arrow-right",
           size: "16"
         }),
-        r: common_vendor.t(common_vendor.unref(common_vendor.hooks)(info.value.f_time).format("YYYY-MM") || "暂无日期"),
-        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({
+        o: common_vendor.o(toChat),
+        p: common_vendor.t(common_vendor.unref(common_vendor.hooks)(info.value.f_time).format("YYYY-MM") || "暂无日期"),
+        q: common_vendor.t(info.value.mileage || "暂无"),
+        r: common_vendor.t(getDict(info.value.emission, "emission")),
+        s: common_vendor.t(info.value.place || "暂无"),
+        t: common_vendor.o(toRecord),
+        v: common_vendor.p({
           name: "arrow-right",
           size: "16"
         }),
-        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({
+        w: common_vendor.t(info.value.hundred_time || "0"),
+        x: common_vendor.t(info.value.displacement || "暂无"),
+        y: common_vendor.t(info.value.wheelbase || "暂无"),
+        z: common_vendor.t(getDict(info.value.type, "type")),
+        A: common_vendor.t(info.value.oil || "0"),
+        B: common_vendor.t(info.value.premium || "0"),
+        C: common_vendor.t(info.value.maintenance || "0"),
+        D: 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",
+        E: common_vendor.t(shop.value.name || "暂无"),
+        F: common_vendor.p({
           bold: true,
           color: "#000",
           name: "arrow-right",
           size: "16"
         }),
-        F: common_vendor.o(toShop),
-        G: common_vendor.t(shop.value.num || 0),
-        H: common_vendor.o(toChat),
-        I: common_vendor.p({
+        G: common_vendor.o(toShop),
+        H: common_vendor.t(shop.value.num || 0),
+        I: common_vendor.o(toChat),
+        J: common_vendor.p({
           icon: "phone",
           text: "咨询卖家车况",
           size: "normal",
           type: "info"
         }),
-        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({
+        K: 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",
+        L: 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",
+        M: 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",
+        N: 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",
+        O: 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",
+        P: common_vendor.o(toMore),
+        Q: common_vendor.p({
           text: "查看更多图片",
           size: "normal",
           type: "info"
         }),
-        Q: common_vendor.f(list.value, (item, index, i0) => {
+        R: 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 || "暂无"),
@@ -252,20 +246,20 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
             m: common_vendor.o(($event) => toView(item), index)
           });
         }),
-        R: common_vendor.p({
+        S: common_vendor.p({
           color: "#000",
           name: "red-packet",
           size: "20"
         }),
-        S: common_vendor.o(toChat),
-        T: common_vendor.p({
+        T: common_vendor.o(toChat),
+        U: common_vendor.p({
           color: "#000",
           name: "heart",
           size: "20"
         }),
-        U: common_vendor.o(toCollect),
-        V: common_vendor.o(toChat),
-        W: common_vendor.o(toChat)
+        V: common_vendor.o(toCollect),
+        W: common_vendor.o(toChat),
+        X: common_vendor.o(toChat)
       };
     };
   }

File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesHome/car/index.wxml


+ 27 - 0
unpackage/dist/dev/mp-weixin/pagesHome/car/index.wxss

@@ -122,6 +122,33 @@
   color: var(--f828Color);
   font-size: var(--font14Size);
 }
+.content .main .bottom .thr2 .thr_1.data-v-6b665083 {
+  display: flex;
+}
+.content .main .bottom .thr2 .thr_1 .info.data-v-6b665083 {
+  display: flex;
+  justify-content: space-around;
+  width: 89%;
+  margin: 0 0 2vw 0;
+}
+.content .main .bottom .thr2 .thr_1 .info .list.data-v-6b665083 {
+  font-size: var(--font14Size);
+  text-align: center;
+  width: 19vw;
+}
+.content .main .bottom .thr2 .thr_1 .info .list .info_1.data-v-6b665083 {
+  font-weight: bold;
+}
+.content .main .bottom .thr2 .thr_1 .info .list .info_2.data-v-6b665083 {
+  color: var(--f828Color);
+  margin: 1vw 0 0 0;
+}
+.content .main .bottom .thr2 .thr_1 text.data-v-6b665083 {
+  width: 8vw;
+  margin: 0 2vw 0 0;
+  color: var(--f828Color);
+  font-size: var(--font14Size);
+}
 .content .main .bottom .four .four_1.data-v-6b665083 {
   display: flex;
   align-items: center;

+ 21 - 5
unpackage/dist/dev/mp-weixin/pagesHome/picture/index.js

@@ -23,13 +23,25 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
     const current = common_vendor.ref(0);
     const itemId = common_vendor.ref("");
     const imageList = common_vendor.ref([{ name: "外观", url: [] }, { name: "内饰", url: [] }, { name: "空间", url: [] }]);
+    const shop = common_vendor.ref({});
     common_vendor.onLoad(async (options) => {
       id.value = options && options.id;
+      const shopId = options && options.shop;
       await searchConfig();
-      await searchOther();
+      await searchOther(shopId);
       await search();
     });
-    const searchOther = async () => {
+    const searchOther = async (id2) => {
+      let res;
+      res = await $api(`shop/${id2}`, "GET", {});
+      if (res.errcode === 0) {
+        shop.value = res.data;
+      } else {
+        common_vendor.index.showToast({
+          title: res.errmsg || "",
+          icon: "error"
+        });
+      }
     };
     const searchConfig = async () => {
       config.value = common_vendor.index.getStorageSync("config");
@@ -64,14 +76,18 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         }
       }
     };
-    const toChat = (item) => {
+    const toChat = () => {
+      var _a2;
       common_vendor.index.makePhoneCall({
-        phoneNumber: item.shop || "110",
+        phoneNumber: (_a2 = shop.value) == null ? void 0 : _a2.tel,
         success: function() {
           console.log("拨打电话成功");
         },
         fail: function() {
-          console.log("拨打电话失败");
+          common_vendor.index.showToast({
+            title: "拨打电话失败",
+            icon: "error"
+          });
         }
       });
     };

+ 4 - 1
unpackage/dist/dev/mp-weixin/pagesHome/rank/index.js

@@ -146,7 +146,10 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
           console.log("拨打电话成功");
         },
         fail: function() {
-          console.log("拨打电话失败");
+          common_vendor.index.showToast({
+            title: "拨打电话失败",
+            icon: "error"
+          });
         }
       });
     };

+ 6 - 2
unpackage/dist/dev/mp-weixin/pagesHome/search/index.js

@@ -202,13 +202,17 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
       });
     };
     const toChat = (item) => {
+      var _a2;
       common_vendor.index.makePhoneCall({
-        phoneNumber: item.shop || "110",
+        phoneNumber: (_a2 = item.shop) == null ? void 0 : _a2.tel,
         success: function() {
           console.log("拨打电话成功");
         },
         fail: function() {
-          console.log("拨打电话失败");
+          common_vendor.index.showToast({
+            title: "拨打电话失败",
+            icon: "error"
+          });
         }
       });
     };

+ 7 - 3
unpackage/dist/dev/mp-weixin/pagesHome/shop/index.js

@@ -208,14 +208,18 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         return item;
       });
     };
-    const toChat = (item) => {
+    const toChat = () => {
+      var _a2;
       common_vendor.index.makePhoneCall({
-        phoneNumber: item.shop || "110",
+        phoneNumber: (_a2 = shop.value) == null ? void 0 : _a2.tel,
         success: function() {
           console.log("拨打电话成功");
         },
         fail: function() {
-          console.log("拨打电话失败");
+          common_vendor.index.showToast({
+            title: "拨打电话失败",
+            icon: "error"
+          });
         }
       });
     };

+ 4 - 1
unpackage/dist/dev/mp-weixin/pagesMy/collect/index.js

@@ -136,7 +136,10 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
           console.log("拨打电话成功");
         },
         fail: function() {
-          console.log("拨打电话失败");
+          common_vendor.index.showToast({
+            title: "拨打电话失败",
+            icon: "error"
+          });
         }
       });
     };