zs 1 سال پیش
والد
کامیت
94d32cab36

+ 28 - 97
pagesHome/search/index.vue

@@ -59,15 +59,16 @@
 								</image>
 							</view>
 							<view class="right">
-								<view class="name textOver">{{item.name||'暂无'}}</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.kilometer">{{item.kilometer||'暂无'}} | </text>
-									<text v-if="item.city">{{item.city||'暂无'}}</text>
+									<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="right_1">
 									<view class="money">
-										<text>{{item.money||'0'}}</text>
+										<text>{{item.total_money||'0'}}</text>
 										<text>万</text>
 									</view>
 									<view>
@@ -96,6 +97,8 @@
 	const $config = getCurrentInstance()?.appContext.config.globalProperties.$config;
 	// 基本信息
 	const config = ref({ logoUrl: [] });
+	// 查询
+	const searchInfo = ref({});
 	const type = ref('0');
 	const is_show = ref(false);
 	//查询
@@ -109,97 +112,7 @@
 	const moneyInfo = ref({});
 	const moreList = ref([]);
 	// 列表
-	const list = 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 list = ref([]);
 	const total = ref(0);
 	const skip = ref(0);
 	const limit = ref(6);
@@ -263,7 +176,24 @@
 	};
 	// 查询
 	const search = async () => {
-
+		const info = {
+			skip: skip.value,
+			limit: limit.value,
+			status: '0'
+		}
+		const res = await $api('car', 'GET', {
+			...info,
+			...searchInfo.value
+		});
+		if (res.errcode === 0) {
+			list.value = list.value.concat(res.data)
+			total.value = res.total
+		} else {
+			uni.showToast({
+				title: res.errmsg || '',
+				icon: 'error',
+			});
+		}
 	};
 	// 查询
 	const toSearch = (value) => {
@@ -522,6 +452,7 @@
 						display: flex;
 						flex-direction: column;
 						justify-content: space-between;
+						margin: 0 0 0 2vw;
 						width: 100%;
 
 						.name {

+ 36 - 106
unpackage/dist/dev/mp-weixin/pagesHome/search/index.js

@@ -14,9 +14,10 @@ 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;
     const config = common_vendor.ref({ logoUrl: [] });
+    const searchInfo = common_vendor.ref({});
     const type = common_vendor.ref("0");
     const is_show = common_vendor.ref(false);
     const searchList = common_vendor.ref([{ title: "默认排序", type: "0", is_open: false }, { title: "品牌", type: "1", is_open: false }, { title: "价格", type: "2", is_open: false }, { title: "更多筛选", type: "3", is_open: false }]);
@@ -25,98 +26,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
     const brandInfo = common_vendor.ref({});
     const moneyInfo = common_vendor.ref({});
     const moreList = common_vendor.ref([]);
-    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 list = common_vendor.ref([]);
     const total = common_vendor.ref(0);
     const skip = common_vendor.ref(0);
     const limit = common_vendor.ref(6);
@@ -176,6 +86,24 @@ 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,
+        ...searchInfo.value
+      });
+      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 toSearch = (value) => {
       searchList.value = searchList.value.map((item, index) => {
@@ -399,23 +327,25 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         w: 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: common_vendor.o(($event) => toChat(item), index),
-            k: index,
-            l: common_vendor.o(($event) => toView(item), index)
+            k: common_vendor.t(item.total_money || "0"),
+            l: common_vendor.o(($event) => toChat(item), index),
+            m: index,
+            n: common_vendor.o(($event) => toView(item), index)
           });
         }),
         x: is_bottom.value

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesHome/search/index.wxml


+ 1 - 0
unpackage/dist/dev/mp-weixin/pagesHome/search/index.wxss

@@ -114,6 +114,7 @@
   display: flex;
   flex-direction: column;
   justify-content: space-between;
+  margin: 0 0 0 2vw;
   width: 100%;
 }
 .content .bottom .one .list .right .name.data-v-2519f642 {