zs 1 年間 前
コミット
4e1ba948b2

+ 1 - 1
pages/home/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="content">
 		<view class="top">
-			<u-search shape="square" :show-action="false" placeholder="品牌/车系" @change="toChange"></u-search>
+			<u-search shape="square" :show-action="false" placeholder="品牌/车系" @focus="toChange"></u-search>
 		</view>
 		<view class="bottom">
 			<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage">

+ 1 - 1
pages/select/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="content">
 		<view class="top">
-			<u-search shape="square" :show-action="false" placeholder="品牌/车系" @change="toChange"></u-search>
+			<u-search shape="square" :show-action="false" placeholder="品牌/车系" @focus="toChange"></u-search>
 		</view>
 		<view class="bottom">
 			<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage">

+ 1 - 1
pagesHome/search/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="content">
 		<view class="top">
-			<u-search shape="square" :show-action="false" placeholder="请输入车辆的名称或品牌" @change="toChange"></u-search>
+			<u-search shape="square" :show-action="false" placeholder="请输入车辆的名称或品牌" @focus="toChange"></u-search>
 			<view class="search">
 				<view class="list" v-for="(item, index) in searchList" :key="index" @tap="toSearch(item)">
 					<view :class="[item.is_open==false?'title_1':'title_2']">{{item.title}}</view>

+ 58 - 70
pagesHome/type/index.vue

@@ -1,94 +1,82 @@
 <template>
 	<view class="content">
-		<image class="logo" :src="config?.logo[0]?.url||'/static/logo.png'"></image>
+		<view class="one">
+			<u-search shape="square" v-model="value" :show-action="true" action-text="取消" placeholder="想买什么车"
+				@change="toChange" @custom="toCustom"></u-search>
+		</view>
+		<view class="two">
+			<view class="list" v-for="(item, index) in list" :key="index" @tap="toView(item)">
+				<view class="left">
+					<image v-if="item.file" class="image" :src="item.file&&item.file.length>0?item.file[0].url:''">
+					</image>
+					<u-icon v-else size="14px" name="search"></u-icon>
+				</view>
+				<view class="right">
+					{{item.name}}
+				</view>
+			</view>
+		</view>
 	</view>
 </template>
 
 <script setup lang="ts">
 	import { getCurrentInstance, ref } from 'vue';
-	//该依赖已内置不需要单独安装
-	import { onLoad } from "@dcloudio/uni-app";
 	// 请求接口
 	const $api = getCurrentInstance()?.appContext.config.globalProperties.$api;
-	const $app = getCurrentInstance()?.appContext.config.globalProperties.$app;
-	const $config = getCurrentInstance()?.appContext.config.globalProperties.$config;
-	// 基本信息
-	const config = ref({ logo: [] });
-	onLoad(async () => {
-		await searchConfig();
-		await search();
-	})
-	// config信息
-	const searchConfig = async () => {
-		let res = await $api(`config`, 'GET', {});
-		if (res.errcode == 0) {
-			config.value = res.data
-			uni.setStorage({
-				key: 'config',
-				data: res.data,
-			})
-		}
-	};
+
+	const value = ref('');
+	const list = ref([]);
 	// 查询
 	const search = async () => {
-		uni.getStorage({
-			key: 'openid',
-			success: function (res) {
-				uni.reLaunch({
-					url: `/pages/home/index`
-				})
-			},
-			fail: function (err) {
-				uni.login({
-					success: async function (res) {
-						if (res.code) {
-							uni.reLaunch({
-								url: `/pages/home/index`
-							})
-							// const aee = await $app('/wechat/api/login/app', 'GET', {
-							// 	js_code: res.code,
-							// 	config: $config.wx_projectkey
-							// })
-							// if (aee.errcode == '0') {
-							// 	uni.setStorage({
-							// 		key: "openid",
-							// 		data: aee.data.openid
-							// 	})
-							// 	uni.reLaunch({
-							// 		url: `/pages/home/index`
-							// 	})
-							// } else {
-							// 	uni.showToast({
-							// 		title: aee.errmsg,
-							// 		icon: 'none'
-							// 	})
-							// }
-						} else {
-							uni.showToast({
-								title: res.errMsg,
-								icon: 'none'
-							})
-						}
-					}
-				});
-			}
+	};
+	// 搜索
+	const toChange = async () => {
+	};
+	// 取消
+	const toCustom = async () => {
+		value.value = ''
+	};
+	// 查看详情
+	const toView = (item) => {
+		console.log(item);
+		uni.navigateTo({
+			url: `/pagesHome/search/index?type=${item.type || ''}`
 		})
 	};
+	
 </script>
 <style lang="scss" scoped>
 	.content {
 		display: flex;
 		flex-direction: column;
-		align-items: center;
-		justify-content: center;
 		width: 100vw;
 		height: 100vh;
 
-		.logo {
-			width: 50vw;
-			height: 50vw;
-			border-radius: 90px;
-			box-shadow: 0 0 5px #f1f1f1;
+		.one {
+			padding: 2vw;
+		}
+
+		.two {
+			.list {
+				display: flex;
+				align-items: center;
+				margin: 1vw 0 0 0;
+				padding: 1vw;
+				border-bottom: 1px solid var(--f9Color);
+			}
+
+			.left {
+				.image {
+					width: 40px;
+					height: 40px;
+					border-radius: 40px;
+				}
+			}
+
+			.right {
+				margin: 0 0 0 2vw;
+				font-size: var(--font14Size);
+			}
 		}
 	}
 </style>

+ 1 - 1
pagesMy/car/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="content">
 		<view class="top">
-			<u-search shape="square" :show-action="false" placeholder="品牌/车系" @change="toChange"></u-search>
+			<u-search shape="square" :show-action="false" placeholder="品牌/车系" @focus="toChange"></u-search>
 		</view>
 		<view class="bottom">
 			<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage">

+ 1 - 1
pagesMy/collect/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="content">
 		<view class="top">
-			<u-search shape="square" :show-action="false" placeholder="品牌/车系" @change="toChange"></u-search>
+			<u-search shape="square" :show-action="false" placeholder="品牌/车系" @focus="toChange"></u-search>
 		</view>
 		<view class="bottom">
 			<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage">

ファイルの差分が大きいため隠しています
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/home/index.wxml


ファイルの差分が大きいため隠しています
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/select/index.wxml


ファイルの差分が大きいため隠しています
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesHome/search/index.wxml


+ 49 - 44
unpackage/dist/dev/mp-weixin/pagesHome/type/index.js

@@ -1,57 +1,62 @@
 "use strict";
 const common_vendor = require("../../common/vendor.js");
+if (!Array) {
+  const _easycom_u_search2 = common_vendor.resolveComponent("u-search");
+  const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
+  (_easycom_u_search2 + _easycom_u_icon2)();
+}
+const _easycom_u_search = () => "../../node-modules/uview-plus/components/u-search/u-search.js";
+const _easycom_u_icon = () => "../../node-modules/uview-plus/components/u-icon/u-icon.js";
+if (!Math) {
+  (_easycom_u_search + _easycom_u_icon)();
+}
 const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
   __name: "index",
   setup(__props) {
-    var _a, _b, _c;
-    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.$app;
-    (_c = common_vendor.getCurrentInstance()) == null ? void 0 : _c.appContext.config.globalProperties.$config;
-    const config = common_vendor.ref({ logo: [] });
-    common_vendor.onLoad(async () => {
-      await searchConfig();
-      await search();
-    });
-    const searchConfig = async () => {
-      let res = await $api(`config`, "GET", {});
-      if (res.errcode == 0) {
-        config.value = res.data;
-        common_vendor.index.setStorage({
-          key: "config",
-          data: res.data
-        });
-      }
+    var _a;
+    (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
+    const value = common_vendor.ref("");
+    const list = common_vendor.ref([]);
+    const toChange = async () => {
     };
-    const search = async () => {
-      common_vendor.index.getStorage({
-        key: "openid",
-        success: function(res) {
-          common_vendor.index.reLaunch({
-            url: `/pages/home/index`
-          });
-        },
-        fail: function(err) {
-          common_vendor.index.login({
-            success: async function(res) {
-              if (res.code) {
-                common_vendor.index.reLaunch({
-                  url: `/pages/home/index`
-                });
-              } else {
-                common_vendor.index.showToast({
-                  title: res.errMsg,
-                  icon: "none"
-                });
-              }
-            }
-          });
-        }
+    const toCustom = async () => {
+      value.value = "";
+    };
+    const toView = (item) => {
+      console.log(item);
+      common_vendor.index.navigateTo({
+        url: `/pagesHome/search/index?type=${item.type || ""}`
       });
     };
     return (_ctx, _cache) => {
-      var _a2, _b2;
       return {
-        a: ((_b2 = (_a2 = config.value) == null ? void 0 : _a2.logo[0]) == null ? void 0 : _b2.url) || "/static/logo.png"
+        a: common_vendor.o(toChange),
+        b: common_vendor.o(toCustom),
+        c: common_vendor.o(($event) => value.value = $event),
+        d: common_vendor.p({
+          shape: "square",
+          ["show-action"]: true,
+          ["action-text"]: "取消",
+          placeholder: "想买什么车",
+          modelValue: value.value
+        }),
+        e: common_vendor.f(list.value, (item, index, i0) => {
+          return common_vendor.e({
+            a: item.file
+          }, item.file ? {
+            b: item.file && item.file.length > 0 ? item.file[0].url : ""
+          } : {
+            c: "2f32406a-1-" + i0,
+            d: common_vendor.p({
+              size: "14px",
+              name: "search"
+            })
+          }, {
+            e: common_vendor.t(item.name),
+            f: index,
+            g: common_vendor.o(($event) => toView(item), index)
+          });
+        })
       };
     };
   }

+ 4 - 1
unpackage/dist/dev/mp-weixin/pagesHome/type/index.json

@@ -4,5 +4,8 @@
   "backgroundColor": "#F8F8F8",
   "backgroundColorTop": "#F4F5F6",
   "backgroundColorBottom": "#F4F5F6",
-  "usingComponents": {}
+  "usingComponents": {
+    "u-search": "../../node-modules/uview-plus/components/u-search/u-search",
+    "u-icon": "../../node-modules/uview-plus/components/u-icon/u-icon"
+  }
 }

ファイルの差分が大きいため隠しています
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesHome/type/index.wxml


+ 18 - 7
unpackage/dist/dev/mp-weixin/pagesHome/type/index.wxss

@@ -7,14 +7,25 @@
 .content.data-v-2f32406a {
   display: flex;
   flex-direction: column;
-  align-items: center;
-  justify-content: center;
   width: 100vw;
   height: 100vh;
 }
-.content .logo.data-v-2f32406a {
-  width: 50vw;
-  height: 50vw;
-  border-radius: 90px;
-  box-shadow: 0 0 5px #f1f1f1;
+.content .one.data-v-2f32406a {
+  padding: 2vw;
+}
+.content .two .list.data-v-2f32406a {
+  display: flex;
+  align-items: center;
+  margin: 1vw 0 0 0;
+  padding: 1vw;
+  border-bottom: 1px solid var(--f9Color);
+}
+.content .two .left .image.data-v-2f32406a {
+  width: 40px;
+  height: 40px;
+  border-radius: 40px;
+}
+.content .two .right.data-v-2f32406a {
+  margin: 0 0 0 2vw;
+  font-size: var(--font14Size);
 }

ファイルの差分が大きいため隠しています
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesMy/car/index.wxml


ファイルの差分が大きいため隠しています
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesMy/collect/index.wxml