zs 1 éve
szülő
commit
20f5767b11

+ 33 - 113
pagesHome/rank/index.vue

@@ -14,15 +14,17 @@
 							</image>
 						</view>
 						<view class="right">
-							<view class="name textOver">{{item.brand||'暂无'}}</view>
-							<view class="right_1">
-								<view class="money">
-									<text>{{item.money||'0'}}</text>
-									<text>万</text>
-								</view>
-								<view>
-									<u-icon color="#000" name="heart" size="20"></u-icon>
-								</view>
+							<view class="name textOver">{{item.series||'暂无'}} {{item.year||'暂无'}}款
+								{{item.style||'暂无'}}
+							</view>
+							<view class="other">
+								<text v-if="item.year">{{item.year||'暂无'}}年 | </text>
+								<text v-if="item.mileage">{{item.mileage||'暂无'}}万公里 | </text>
+								<text v-if="item.place">{{item.place||'暂无'}}</text>
+							</view>
+							<view class="money">
+								<text>{{item.total_money||'0'}}</text>
+								<text>万</text>
 							</view>
 						</view>
 					</view>
@@ -49,97 +51,7 @@
 	// 基本信息
 	const config = ref({ logoUrl: [] });
 	// 列表
-	const list = ref([
-		{
-			id: '1',
-			file: [{ url: 'https://cdn.uviewui.com/uview/album/1.jpg' }],
-			brand: '夏朗',
-			year: '2014年 ',
-			city: '丹东',
-			kilometer: '8万公里',
-			money: '7.80'
-		},
-		{
-			id: '1',
-			file: [{ url: 'https://cdn.uviewui.com/uview/album/2.jpg' }],
-			brand: '捷豹',
-			year: '2014年 ',
-			city: '丹东',
-			kilometer: '8万公里',
-			money: '7.80'
-		},
-		{
-			id: '1',
-			file: [{ url: 'https://cdn.uviewui.com/uview/album/3.jpg' }],
-			brand: '大众',
-			year: '2014年 ',
-			city: '丹东',
-			kilometer: '8万公里',
-			money: '7.80'
-		},
-		{
-			id: '1',
-			file: [{ url: 'https://cdn.uviewui.com/uview/album/4.jpg' }],
-			brand: '大众',
-			year: '2014年 ',
-			city: '丹东',
-			kilometer: '8万公里',
-			money: '7.80'
-		},
-		{
-			id: '1',
-			file: [{ url: 'https://cdn.uviewui.com/uview/album/5.jpg' }],
-			brand: '大众',
-			year: '2014年 ',
-			city: '丹东',
-			kilometer: '8万公里',
-			money: '7.80'
-		},
-		{
-			id: '1',
-			file: [{ url: 'https://cdn.uviewui.com/uview/album/6.jpg' }],
-			brand: '大众',
-			year: '2014年 ',
-			city: '丹东',
-			kilometer: '8万公里',
-			money: '7.80'
-		},
-		{
-			id: '1',
-			file: [{ url: 'https://cdn.uviewui.com/uview/album/7.jpg' }],
-			brand: '奔驰',
-			year: '2014年 ',
-			city: '丹东',
-			kilometer: '8万公里',
-			money: '7.80'
-		},
-		{
-			id: '1',
-			file: [{ url: 'https://cdn.uviewui.com/uview/album/8.jpg' }],
-			brand: '丰田',
-			year: '2014年 ',
-			city: '丹东',
-			kilometer: '8万公里',
-			money: '7.80'
-		},
-		{
-			id: '1',
-			file: [{ url: 'https://cdn.uviewui.com/uview/album/9.jpg' }],
-			brand: '大众',
-			year: '2014年 ',
-			city: '丹东',
-			kilometer: '8万公里',
-			money: '7.80'
-		},
-		{
-			id: '1',
-			file: [{ url: 'https://cdn.uviewui.com/uview/album/10.jpg' }],
-			brand: '本田',
-			year: '2014年 ',
-			city: '丹东',
-			kilometer: '8万公里',
-			money: '7.80'
-		}]);
+	const list = ref([]);
 	const total = ref(0);
 	const skip = ref(0);
 	const limit = ref(6);
@@ -157,7 +69,21 @@
 	};
 	// 查询
 	const search = async () => {
-
+		const info = {
+			skip: skip.value,
+			limit: limit.value,
+			status: '0'
+		}
+		const res = await $api('car', 'GET', info);
+		if (res.errcode === 0) {
+			list.value = list.value.concat(res.data)
+			total.value = res.total
+		} else {
+			uni.showToast({
+				title: res.errmsg || '',
+				icon: 'error',
+			});
+		}
 	};
 	const toRoute = (item) => {
 		uni.navigateTo({
@@ -266,7 +192,7 @@
 				.left {
 					.image {
 						width: 100px;
-						height: 60px;
+						height: 70px;
 						border-radius: 2px;
 					}
 				}
@@ -287,18 +213,12 @@
 						font-size: var(--font12Size);
 					}
 
-					.right_1 {
-						display: flex;
-						justify-content: space-between;
-						align-items: center;
-
-						.money {
-							color: var(--fF0Color);
-							font-size: var(--font12Size);
+					.money {
+						color: var(--fF0Color);
+						font-size: var(--font12Size);
 
-							text:first-child {
-								font-size: var(--font18Size);
-							}
+						text:first-child {
+							font-size: var(--font18Size);
 						}
 					}
 				}

+ 42 - 112
unpackage/dist/dev/mp-weixin/pagesHome/rank/index.js

@@ -2,116 +2,23 @@
 const common_vendor = require("../../common/vendor.js");
 if (!Array) {
   const _easycom_u_subsection2 = common_vendor.resolveComponent("u-subsection");
-  const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
-  (_easycom_u_subsection2 + _easycom_u_icon2)();
+  _easycom_u_subsection2();
 }
 const _easycom_u_subsection = () => "../../node-modules/uview-plus/components/u-subsection/u-subsection.js";
-const _easycom_u_icon = () => "../../node-modules/uview-plus/components/u-icon/u-icon.js";
 if (!Math) {
-  (_easycom_u_subsection + _easycom_u_icon)();
+  _easycom_u_subsection();
 }
 const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
   __name: "index",
   setup(__props) {
     var _a, _b;
-    (_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;
     (_b = common_vendor.getCurrentInstance()) == null ? void 0 : _b.appContext.config.globalProperties.$config;
     common_vendor.ref(["-2px", "355px"]);
     const tabList = common_vendor.ref(["销量榜", "保值榜", "店铺规模榜"]);
     const curNow = common_vendor.ref(0);
     const config = common_vendor.ref({ logoUrl: [] });
-    const list = common_vendor.ref([
-      {
-        id: "1",
-        file: [{ url: "https://cdn.uviewui.com/uview/album/1.jpg" }],
-        brand: "夏朗",
-        year: "2014年 ",
-        city: "丹东",
-        kilometer: "8万公里",
-        money: "7.80"
-      },
-      {
-        id: "1",
-        file: [{ url: "https://cdn.uviewui.com/uview/album/2.jpg" }],
-        brand: "捷豹",
-        year: "2014年 ",
-        city: "丹东",
-        kilometer: "8万公里",
-        money: "7.80"
-      },
-      {
-        id: "1",
-        file: [{ url: "https://cdn.uviewui.com/uview/album/3.jpg" }],
-        brand: "大众",
-        year: "2014年 ",
-        city: "丹东",
-        kilometer: "8万公里",
-        money: "7.80"
-      },
-      {
-        id: "1",
-        file: [{ url: "https://cdn.uviewui.com/uview/album/4.jpg" }],
-        brand: "大众",
-        year: "2014年 ",
-        city: "丹东",
-        kilometer: "8万公里",
-        money: "7.80"
-      },
-      {
-        id: "1",
-        file: [{ url: "https://cdn.uviewui.com/uview/album/5.jpg" }],
-        brand: "大众",
-        year: "2014年 ",
-        city: "丹东",
-        kilometer: "8万公里",
-        money: "7.80"
-      },
-      {
-        id: "1",
-        file: [{ url: "https://cdn.uviewui.com/uview/album/6.jpg" }],
-        brand: "大众",
-        year: "2014年 ",
-        city: "丹东",
-        kilometer: "8万公里",
-        money: "7.80"
-      },
-      {
-        id: "1",
-        file: [{ url: "https://cdn.uviewui.com/uview/album/7.jpg" }],
-        brand: "奔驰",
-        year: "2014年 ",
-        city: "丹东",
-        kilometer: "8万公里",
-        money: "7.80"
-      },
-      {
-        id: "1",
-        file: [{ url: "https://cdn.uviewui.com/uview/album/8.jpg" }],
-        brand: "丰田",
-        year: "2014年 ",
-        city: "丹东",
-        kilometer: "8万公里",
-        money: "7.80"
-      },
-      {
-        id: "1",
-        file: [{ url: "https://cdn.uviewui.com/uview/album/9.jpg" }],
-        brand: "大众",
-        year: "2014年 ",
-        city: "丹东",
-        kilometer: "8万公里",
-        money: "7.80"
-      },
-      {
-        id: "1",
-        file: [{ url: "https://cdn.uviewui.com/uview/album/10.jpg" }],
-        brand: "本田",
-        year: "2014年 ",
-        city: "丹东",
-        kilometer: "8万公里",
-        money: "7.80"
-      }
-    ]);
+    const list = common_vendor.ref([]);
     const total = common_vendor.ref(0);
     const skip = common_vendor.ref(0);
     const limit = common_vendor.ref(6);
@@ -126,6 +33,21 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
       config.value = common_vendor.index.getStorageSync("config");
     };
     const search = async () => {
+      const info = {
+        skip: skip.value,
+        limit: limit.value,
+        status: "0"
+      };
+      const res = await $api("car", "GET", info);
+      if (res.errcode === 0) {
+        list.value = list.value.concat(res.data);
+        total.value = res.total;
+      } else {
+        common_vendor.index.showToast({
+          title: res.errmsg || "",
+          icon: "error"
+        });
+      }
     };
     const sectionChange = (index) => {
       curNow.value = index;
@@ -158,27 +80,35 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
           current: curNow.value
         }),
         c: common_vendor.f(list.value, (item, index, i0) => {
-          return {
+          return common_vendor.e({
             a: common_vendor.t(index + 1),
             b: common_vendor.n(`rank${index + 1}`),
             c: item.file && item.file.length > 0 ? item.file[0].url : "",
-            d: common_vendor.t(item.brand || "暂无"),
-            e: common_vendor.t(item.money || "0"),
-            f: "581af8d0-1-" + i0,
-            g: index,
-            h: common_vendor.o(($event) => toView(item), index)
-          };
-        }),
-        d: common_vendor.p({
-          color: "#000",
-          name: "heart",
-          size: "20"
+            d: common_vendor.t(item.series || "暂无"),
+            e: common_vendor.t(item.year || "暂无"),
+            f: common_vendor.t(item.style || "暂无"),
+            g: item.year
+          }, item.year ? {
+            h: common_vendor.t(item.year || "暂无")
+          } : {}, {
+            i: item.mileage
+          }, item.mileage ? {
+            j: common_vendor.t(item.mileage || "暂无")
+          } : {}, {
+            k: item.place
+          }, item.place ? {
+            l: common_vendor.t(item.place || "暂无")
+          } : {}, {
+            m: common_vendor.t(item.total_money || "0"),
+            n: index,
+            o: common_vendor.o(($event) => toView(item), index)
+          });
         }),
-        e: is_bottom.value
+        d: is_bottom.value
       }, is_bottom.value ? {
-        f: common_vendor.t(config.value.bottom_title || "没有更多了!")
+        e: common_vendor.t(config.value.bottom_title || "没有更多了!")
       } : {}, {
-        g: common_vendor.o(toPage)
+        f: common_vendor.o(toPage)
       });
     };
   }

+ 1 - 2
unpackage/dist/dev/mp-weixin/pagesHome/rank/index.json

@@ -6,7 +6,6 @@
   "backgroundColorTop": "#F4F5F6",
   "backgroundColorBottom": "#F4F5F6",
   "usingComponents": {
-    "u-subsection": "../../node-modules/uview-plus/components/u-subsection/u-subsection",
-    "u-icon": "../../node-modules/uview-plus/components/u-icon/u-icon"
+    "u-subsection": "../../node-modules/uview-plus/components/u-subsection/u-subsection"
   }
 }

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesHome/rank/index.wxml


+ 3 - 8
unpackage/dist/dev/mp-weixin/pagesHome/rank/index.wxss

@@ -48,7 +48,7 @@
 }
 .content .bottom .list .left .image.data-v-581af8d0 {
   width: 100px;
-  height: 60px;
+  height: 70px;
   border-radius: 2px;
 }
 .content .bottom .list .right.data-v-581af8d0 {
@@ -65,16 +65,11 @@
   color: var(--f85Color);
   font-size: var(--font12Size);
 }
-.content .bottom .list .right .right_1.data-v-581af8d0 {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-}
-.content .bottom .list .right .right_1 .money.data-v-581af8d0 {
+.content .bottom .list .right .money.data-v-581af8d0 {
   color: var(--fF0Color);
   font-size: var(--font12Size);
 }
-.content .bottom .list .right .right_1 .money text.data-v-581af8d0:first-child {
+.content .bottom .list .right .money text.data-v-581af8d0:first-child {
   font-size: var(--font18Size);
 }
 .scroll-view.data-v-581af8d0 {