From 49226941c423243aa3c75fc17c12cd2fd8e849d1 Mon Sep 17 00:00:00 2001 From: iuu <2167162990@qq.com> Date: Thu, 22 Aug 2024 22:30:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 5 +- images/del.png | Bin 0 -> 3066 bytes pages/index/index.js | 15 +++- pages/index/index.wxml | 3 +- pages/index/index.wxss | 2 +- pages/s-list/s-list.js | 86 +++++++++++++++++++ pages/s-list/s-list.json | 5 ++ pages/s-list/s-list.wxml | 178 +++++++++++++++++++++++++++++++++++++++ pages/s-list/s-list.wxss | 95 +++++++++++++++++++++ pages/search/index.js | 82 ++++++++++++++++++ pages/search/index.json | 5 ++ pages/search/index.wxml | 29 +++++++ pages/search/index.wxss | 127 ++++++++++++++++++++++++++++ 13 files changed, 628 insertions(+), 4 deletions(-) create mode 100644 images/del.png create mode 100644 pages/s-list/s-list.js create mode 100644 pages/s-list/s-list.json create mode 100644 pages/s-list/s-list.wxml create mode 100644 pages/s-list/s-list.wxss create mode 100644 pages/search/index.js create mode 100644 pages/search/index.json create mode 100644 pages/search/index.wxml create mode 100644 pages/search/index.wxss diff --git a/app.json b/app.json index b34770b..88d3784 100644 --- a/app.json +++ b/app.json @@ -3,7 +3,10 @@ "pages/index/index", "pages/list/list", "pages/222", - "pages/details/details" + "pages/details/details", + "pages/search/index", + "pages/s-list/s-list" + ], "window": { "navigationBarTextStyle": "black", diff --git a/images/del.png b/images/del.png new file mode 100644 index 0000000000000000000000000000000000000000..13f3947e2158d53671b1376ae1be6202cea7503d GIT binary patch literal 3066 zcmb7Gc{J2*8~%;mU_uOK=vPrDW|T~p*D|)6L1mqWEE%Fk_7PK-5wbI7r<6VWi|j=9 zy)2VL_1Z>bEt29@AMbm<^ZoUH=e&PB&wXFlbMA9r=RDVa&K+rd>4E_CFcbg)0X$C6 zbT9VoA0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}b_JZF948G_;u$Tao`Qe9dC*ND2tDRW6&~2VeOK|oj(Nvb zVEzmCITGhFH1T+sJURx?oli8XNG0tz>=ZFvIR3w?dm#~`5p~yM#jEO06LWu+V>?KZ z;%8~Hq7g)SAqPTocaB6f1BX+A>JLRVKa&{L-sdfghY=r0<4lh!=GA0;NmR>^( zHNY|UT&6NK8dAv1%shgA?~)II5+XeT#{<+UgU2p*CyI~<%a`)K*F^V}@%gw<8w`DH zTQyvjWpH^L4NIL#dE{-SgHlRKzVQk9#=Inn-P5i8g~er>jzsYO%jWO~wH%S*F5~y~5fH(}`L4SD9yC zso*|6T#-m=eWW<{`n@{y5I3()Wk3kGVBQC*FthuI8#21pXTdDP8u!mY_Sj^O zN1w5-??$RKBKLR4@a|!=rLVX@OUGwFg|+ven_TkTX0-y+8TmiBlEWlwx&jB9uVpdZ zwDMxA-oH7gFEG1S`B6q-$SX5Nsau;+0im= zA#F0q%4E{`cD-O4^-U zSdsBAm4*oBRZ4|jFN~^;W0clixsZmDVUrw1(Qt+jV&^R8Ns@#9zL+wsFe=bs!^<91Nw`a>H zbqj1l@Gm)cd8K78&uPYYj;waE-tK#D*c$4*eFLye_losxS>3uj!I1qa2f6J38Y&6s zA+s+`lT{*2%Wf$Hy$0q}05>w3+-%>=EHWtQle&*25VB{u08@F37gbPP_nbani*)4M&Wu?XBPplep3*fUV~_kb5O{Oib)cF#SX=eD#_J zc_6AIN|k(A4NZ~>=9_&z#~8VUKTEse#tuW1+M;5|S?KmrqtcT3F@6v)9xHnFASJ~> z$r|QQmOX zen^{3Y=1Ed9nPu{f1-jN(K(4WDdgtCYMPfdF#E)oIXT07()Q0NR-n*7Jol5Bg*b(hH*siE%N|g|B_yr&b5300qE>? AEdT%j literal 0 HcmV?d00001 diff --git a/pages/index/index.js b/pages/index/index.js index a87e106..366f11d 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -31,8 +31,8 @@ Page({ ] }, + // 页面跳转 jumpPage(e) { - let jumpType = e.currentTarget.dataset.jumptype; console.log(jumpType == 1); if(jumpType == 1){ @@ -40,8 +40,21 @@ Page({ url: "/pages/list/list?id=1" }) } + if(jumpType == 2){ + wx.navigateTo({ + url: "/pages/list/list?id=1" + }) + } + if(jumpType == 3){ + wx.navigateTo({ + url: "/pages/search/index" + }) + } // wx.navigateTo({ // url: this.data.category[index].url // }) }, + bindFocus(e){ + console.log(e); + } }) \ No newline at end of file diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 55452c4..54a5a6a 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -6,7 +6,8 @@ - + 请输入故障代码或关键词 + diff --git a/pages/index/index.wxss b/pages/index/index.wxss index 3514bfd..c9ebe9f 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -50,7 +50,7 @@ page { /* 搜索 start */ .search-box { - padding-top: 20px; + padding-top: 45rpx; } .search { diff --git a/pages/s-list/s-list.js b/pages/s-list/s-list.js new file mode 100644 index 0000000..1513fdf --- /dev/null +++ b/pages/s-list/s-list.js @@ -0,0 +1,86 @@ +// pages/list/list.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + searchName : "", + }, + + + jumpPage(e) { + let jumpType = e.currentTarget.dataset.jumptype; + console.log(jumpType == 2); + if (jumpType == 2) { + wx.navigateTo({ + url: "/pages/details/details?id=1" + }) + } + // wx.navigateTo({ + // url: this.data.category[index].url + // }) + }, + + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + let that = this; + console.log(options); + that.setData({searchName:options.search}) + // that.data.searchName = options.search; + // if (that.sea) + // console.log(options); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/s-list/s-list.json b/pages/s-list/s-list.json new file mode 100644 index 0000000..3632c6a --- /dev/null +++ b/pages/s-list/s-list.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "list-nav-bar": "/components/list-nav-bar/list-nav-bar" + } + } \ No newline at end of file diff --git a/pages/s-list/s-list.wxml b/pages/s-list/s-list.wxml new file mode 100644 index 0000000..c8b71f1 --- /dev/null +++ b/pages/s-list/s-list.wxml @@ -0,0 +1,178 @@ + + + + + + + + + + + + + + + {{searchName}} + + + + + + + + + + + + + 超出焊接时间 + + + + 查看详情 + + + + + + + + + 超出焊接时间 + + + + 查看详情 + + + + + + + + + 超出焊接时间 + + + + 查看详情 + + + + + + + + + 超出焊接时间 + + + + 查看详情 + + + + + + + + + 超出焊接时间 + + + + 查看详情 + + + + + + + + + 超出焊接时间 + + + + 查看详情 + + + + + + + + + 超出焊接时间 + + + + 查看详情 + + + + + + + + + 超出焊接时间 + + + + 查看详情 + + + + + + + + + 超出焊接时间 + + + + 查看详情 + + + + + + + + + 超出焊接时间 + + + + 查看详情 + + + + + + + + + 超出焊接时间 + + + + 查看详情 + + + + + \ No newline at end of file diff --git a/pages/s-list/s-list.wxss b/pages/s-list/s-list.wxss new file mode 100644 index 0000000..9fcd453 --- /dev/null +++ b/pages/s-list/s-list.wxss @@ -0,0 +1,95 @@ +page { + height: 100vh; + display: flex; + flex-direction: column; + background: #f3f2f4; + min-height: 100vh; +} + + +/* 搜索 start */ + +.search-box { + /* padding-top: 45rpx; */ + /* margin-bottom: 20rpx; */ + background: #f3f2f4; + padding-top: 45rpx; + z-index: 99; +} + +.search { + display: flex; + align-items: center; + justify-content: center; + height: 100rpx; + background: #f3f2f4; +} + +.search .search_in { + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 20rpx; + /* box-sizing: border-box; */ + height: 70rpx; + background-color: #ffffff; + border-radius: 10rpx; +} + +.search_in image { + height: 45rpx; + width: 45rpx; +} + +.search input { + width: 600rpx; +} + +/* 搜索 end */ + + + + +.container{ + margin-top: 45rpx; + margin-left: 30rpx; + margin-right: 30rpx; +} + +.card { + background-color: #ffffff; + border-radius: 10rpx; + padding: 30rpx; + margin-bottom: 20rpx; + /* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); */ +} + +.card-header { + display: flex; + align-items: center; + margin-bottom: 20rpx; +} + +.dot { + width: 16rpx; + height: 16rpx; + background-color: #3c8bf6; /* 蓝色圆点 */ + border-radius: 50%; + margin-right: 20rpx; +} + +.title { + font-size: 30rpx; + font-weight: bold; +} + +.details { + display: flex; + align-items: center; + color: #737373; /* 灰色文本 */ + font-size: 24rpx; +} +.details-icon{ + height: 20rpx; + width: 25rpx; +} \ No newline at end of file diff --git a/pages/search/index.js b/pages/search/index.js new file mode 100644 index 0000000..ec3fb9b --- /dev/null +++ b/pages/search/index.js @@ -0,0 +1,82 @@ +let App = getApp(); + +Page({ + + /** + * 页面的初始数据 + */ + data: { + recentSearch: [], + searchValue: '', + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + // 获取历史搜索 + this.getRecentSearch(); + }, + + /** + * 获取历史搜索 + */ + getRecentSearch: function () { + let recentSearch = wx.getStorageSync('recentSearch'); + this.setData({ + recentSearch + }); + }, + + /** + * 绑定输入值 + */ + getSearchContent: function (e) { + this.data.searchValue = e.detail.value; + }, + + /** + * 搜索提交 + */ + search: function () { + if (this.data.searchValue) { + // 记录最近搜索 + let recentSearch = wx.getStorageSync('recentSearch') || []; + let searchValue = this.data.searchValue.trim(); // 去掉前后的空格 + if (searchValue && !recentSearch.includes(searchValue)) { + recentSearch.unshift(searchValue); + } + // recentSearch.unshift(this.data.searchValue); + wx.setStorageSync('recentSearch', recentSearch) + // 跳转到列表页 + wx.navigateTo({ + url: '../s-list/s-list?search=' + this.data.searchValue, + }) + } + }, + + /** + * 清空最近搜索记录 + */ + clearSearch: function () { + wx.removeStorageSync('recentSearch'); + this.getRecentSearch(); + }, + + /** + * 跳转到最近搜索 + */ + goSearch: function (e) { + console.log(e.target.dataset.text); + wx.navigateTo({ + url: '../s-list/s-list?search=' + e.target.dataset.text, + }) + }, +}) \ No newline at end of file diff --git a/pages/search/index.json b/pages/search/index.json new file mode 100644 index 0000000..3632c6a --- /dev/null +++ b/pages/search/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "list-nav-bar": "/components/list-nav-bar/list-nav-bar" + } + } \ No newline at end of file diff --git a/pages/search/index.wxml b/pages/search/index.wxml new file mode 100644 index 0000000..3c7e4f5 --- /dev/null +++ b/pages/search/index.wxml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + 最近搜索 + + + + + {{recent}} + + + + \ No newline at end of file diff --git a/pages/search/index.wxss b/pages/search/index.wxss new file mode 100644 index 0000000..6f6c243 --- /dev/null +++ b/pages/search/index.wxss @@ -0,0 +1,127 @@ +page { + background: #f7f7f7; +} + + +.cont-box { + padding: 20rpx; +} + +.dis-flex { + display: flex; +} + + +.search-input-box { + height: 64rpx; +} + + +.search-input { + width: 80%; + background: #fff; + border-radius: 10rpx 0 0 10rpx; + padding-left: 10rpx; + box-sizing: border-box; + overflow: hidden; +} + + +.search-box .left { + width: 60rpx; +} + +.search-box .left icon { + padding: 18rpx; +} + +.search-box .right { + flex: 1; +} + + + + + +.search-input input { + font-size: 30rpx; + height: 64rpx; + line-height: 64rpx; +} + +.serch-button { + width: 25%; + box-sizing: border-box; +} + +.serch-button button { + color: #fff; + background: #3c8bf6; + width: 100%; + line-height: 64rpx; + height: 64rpx; + font-size: 28rpx; + border-radius: 0 10rpx 10rpx 0; +} + + + + + +.title-box { + display: flex; + justify-content: space-between; + padding: 50rpx 0 0 0; +} + +.title-box-title { + color: #777; + font-size: 28rpx; +} + +.title-box-image { + width: 30rpx; + height: 30rpx; +} + + +.sale-button-box { + display: flex; + padding: 10rpx 0; + flex-flow: wrap; + overflow: hidden; +} +/* .seconds-kill-li { + padding: 10rpx; + box-sizing: border-box; +} */ + + +.seconds-kill-li { + display: block; + padding: 10rpx; + box-sizing: border-box; + /* width: 33.3%; */ + min-width: 33.3%; + float: left; +} + + +.recent-button { + background: #fff; + /* padding:10rpx 10rpx 10rpx 10rpx; */ + padding-left: 15rpx; + padding-right: 15rpx; + color: #777; + border-radius: 50rpx; + justify-content: center; + text-align: center; + font-size: 26rpx; + border: 1rpx solid #eee; + overflow: hidden!important; + white-space: nowrap!important; + text-overflow: ellipsis!important; + height: 60rpx; + line-height: 60rpx; + +} \ No newline at end of file