From 92c33f360e726fb6b9a99670dc2388411c82696c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=94=A1=E5=86=9B=E4=BB=81?= <3115324624@qq.com> Date: Wed, 4 Dec 2024 10:49:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=92=8C=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuan ma/mp-shop/pages/search/search.js | 21 ++++++++++++++++++++- yuan ma/mp-shop/pages/search/search.wxml | 2 +- yuan ma/mp-shop/pages/search/search.wxss | 22 +++++++++++----------- 3 files changed, 32 insertions(+), 13 deletions(-) diff --git a/yuan ma/mp-shop/pages/search/search.js b/yuan ma/mp-shop/pages/search/search.js index 9f040fd..8263f11 100644 --- a/yuan ma/mp-shop/pages/search/search.js +++ b/yuan ma/mp-shop/pages/search/search.js @@ -12,6 +12,19 @@ Page({ }, /** * 生命周期函数--监听页面加载2 + *.list-keywords { + *margin: 10px; + *padding: 10px; + *background: #fff; + *} + *.list-keywords .item{ + *display: inline-block; + *padding: 5px 10px; + *background: #f1f1f1; + *margin: 5px; + *font-size: 12px; + *color: #666; + *} */ onLoad(options) { getHotSearch().then(res =>{//获取热点搜索函数 @@ -61,4 +74,10 @@ Page({ } }) } -}) \ No newline at end of file +}) /** + * 展示搜索数据,在goods页面展示4 + * 1. 在搜索页面通过网络请求获取数据,传递到goods页面显示5 + * 2. 在搜索页面将搜索的关键字传递到goods页面,在goods页面做网络请求6 + */ + + // 实现搜索7 \ No newline at end of file diff --git a/yuan ma/mp-shop/pages/search/search.wxml b/yuan ma/mp-shop/pages/search/search.wxml index ed1a9c3..aa69fe2 100644 --- a/yuan ma/mp-shop/pages/search/search.wxml +++ b/yuan ma/mp-shop/pages/search/search.wxml @@ -1,6 +1,6 @@ - 搜索 + 搜索//搜索提示 {{ item.content }} diff --git a/yuan ma/mp-shop/pages/search/search.wxss b/yuan ma/mp-shop/pages/search/search.wxss index 7e21917..baf9e30 100644 --- a/yuan ma/mp-shop/pages/search/search.wxss +++ b/yuan ma/mp-shop/pages/search/search.wxss @@ -1,13 +1,13 @@ -.list-keywords { - margin: 10px; - padding: 10px; - background: #fff; +.list-keywords {//搜索框设置 + margin: 10px;//外边距 + padding: 10px;//内边距 + background: #fff;//背景色 } .list-keywords .item{ - display: inline-block; - padding: 5px 10px; - background: #f1f1f1; - margin: 5px; - font-size: 12px; - color: #666; -} \ No newline at end of file + display: inline-block;//样式 + padding: 5px 10px;//内边距 + background: #f1f1f1;//背景 + margin: 5px;//外边距 + font-size: 12px;//字号 + color: #666;//颜色 +}