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 0000000..13f3947
Binary files /dev/null and b/images/del.png differ
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