zs 1 рік тому
батько
коміт
ab177f8c3c

+ 14 - 16
pages/select/index.vue

@@ -157,27 +157,25 @@
 		})
 	};
 	const toCommon = (item, type) => {
-		console.log(item);
 		if (type == '0') {
-			uni.navigateTo({
-				url: `/pagesHome/brand/index?type=${item.type}`,
-			})
-		} else {
-			if (type == '0') {
+			if (item.type == '4') {
+				uni.navigateTo({
+					url: `/pagesHome/brand/index?type=${item.type}`,
+				})
+			} else {
 				uni.navigateTo({
 					url: `/pagesHome/search/index?brand=${item.name}`,
 				})
+			}
+		} else {
+			if (item.type == '3') {
+				uni.navigateTo({
+					url: `/pagesHome/search/index?type=${item.type}`,
+				})
 			} else {
-				if (item.type == '3') {
-					uni.navigateTo({
-						url: `/pagesHome/search/index?type=${item.type}`,
-					})
-				} else {
-					uni.navigateTo({
-						url: `/pagesHome/search/index?money=${item.title}`,
-					})
-				}
-
+				uni.navigateTo({
+					url: `/pagesHome/search/index?money=${item.title}`,
+				})
 			}
 		}
 	};

+ 14 - 6
pagesHome/brand/index.vue

@@ -40,11 +40,13 @@
 	const config = ref({ logoUrl: [] });
 	const indexList = ref([]);
 	const itemArr = ref([]);
+	const type = ref('0');
 	// const list = ref([{ name: '奥迪', url: [], type: '0' }, { name: '本田', url: [], type: '0' }, { name: '别克', url: [], type: '0' },
 	// { name: '奥迪', url: [], type: '0' }, { name: '大众', url: [], type: '0' }, { name: '长城', url: [], type: '0' },
 	// { name: '福特', url: [], type: '0' }, { name: '丰田', url: [], type: '0' }, { name: '长安', url: [], type: '0' },
 	// { name: '日产', url: [], type: '0' }]);
-	onLoad(async () => {
+	onLoad(async (options) => {
+		type.value = options && options.type
 		await searchConfig();
 		await search();
 	})
@@ -66,11 +68,17 @@
 		}
 	};
 	const toCommon = (item) => {
-		uni.$emit('toRoute', item)
-		// 4. 返回上一页面
-		uni.navigateBack({
-			delta: 1 // 返回的页面数
-		})
+		if (type.value == '4') {
+			uni.navigateTo({
+				url: `/pagesHome/search/index?brand=${item.name}`
+			})
+		} else {
+			uni.$emit('toRoute', item)
+			// 4. 返回上一页面
+			uni.navigateBack({
+				delta: 1 // 返回的页面数
+			})
+		}
 	};
 </script>
 <style lang="scss" scoped>

+ 14 - 15
unpackage/dist/dev/mp-weixin/pages/select/index.js

@@ -94,26 +94,25 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
       });
     };
     const toCommon = (item, type) => {
-      console.log(item);
       if (type == "0") {
-        common_vendor.index.navigateTo({
-          url: `/pagesHome/brand/index?type=${item.type}`
-        });
-      } else {
-        if (type == "0") {
+        if (item.type == "4") {
+          common_vendor.index.navigateTo({
+            url: `/pagesHome/brand/index?type=${item.type}`
+          });
+        } else {
           common_vendor.index.navigateTo({
             url: `/pagesHome/search/index?brand=${item.name}`
           });
+        }
+      } else {
+        if (item.type == "3") {
+          common_vendor.index.navigateTo({
+            url: `/pagesHome/search/index?type=${item.type}`
+          });
         } else {
-          if (item.type == "3") {
-            common_vendor.index.navigateTo({
-              url: `/pagesHome/search/index?type=${item.type}`
-            });
-          } else {
-            common_vendor.index.navigateTo({
-              url: `/pagesHome/search/index?money=${item.title}`
-            });
-          }
+          common_vendor.index.navigateTo({
+            url: `/pagesHome/search/index?money=${item.title}`
+          });
         }
       }
     };

+ 14 - 6
unpackage/dist/dev/mp-weixin/pagesHome/brand/index.js

@@ -20,7 +20,9 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
     const config = common_vendor.ref({ logoUrl: [] });
     const indexList = common_vendor.ref([]);
     const itemArr = common_vendor.ref([]);
-    common_vendor.onLoad(async () => {
+    const type = common_vendor.ref("0");
+    common_vendor.onLoad(async (options) => {
+      type.value = options && options.type;
       await searchConfig();
       await search();
     });
@@ -40,11 +42,17 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
       }
     };
     const toCommon = (item) => {
-      common_vendor.index.$emit("toRoute", item);
-      common_vendor.index.navigateBack({
-        delta: 1
-        // 返回的页面数
-      });
+      if (type.value == "4") {
+        common_vendor.index.navigateTo({
+          url: `/pagesHome/search/index?brand=${item.name}`
+        });
+      } else {
+        common_vendor.index.$emit("toRoute", item);
+        common_vendor.index.navigateBack({
+          delta: 1
+          // 返回的页面数
+        });
+      }
     };
     return (_ctx, _cache) => {
       return {