diff --git a/src/app.json b/src/app.json index 9c340df8..1415b86c 100644 --- a/src/app.json +++ b/src/app.json @@ -31,7 +31,8 @@ "example/navbar/navbar", "example/tabbar/tabbar", - "example/searchbar/searchbar" + "example/searchbar/searchbar", + "example/searchbartop/searchbartop" ], "window": { "navigationBarTextStyle": "black", diff --git a/src/example/index.js b/src/example/index.js index aee218e7..fed0b050 100644 --- a/src/example/index.js +++ b/src/example/index.js @@ -29,7 +29,7 @@ Page({ id: 'search', name: '搜索相关', open: false, - pages: ['searchbar'] + pages: ['searchbar','searchbartop'] } ] }, diff --git a/src/example/searchbar/searchbar.wxml b/src/example/searchbar/searchbar.wxml index da15a052..c9573099 100644 --- a/src/example/searchbar/searchbar.wxml +++ b/src/example/searchbar/searchbar.wxml @@ -18,29 +18,51 @@ 搜索 - + - - - - 实时搜索文本 - - - - - 实时搜索文本 - - - - - 实时搜索文本 + - - - 实时搜索文本 + - + + + + + 实时搜索文本 + + + + + 实时搜索文本 + + + + + 实时搜索文本 + + + + + 实时搜索文本 + + + \ No newline at end of file diff --git a/src/example/searchbar/searchbar.wxss b/src/example/searchbar/searchbar.wxss index 4083ba64..e4d590f9 100644 --- a/src/example/searchbar/searchbar.wxss +++ b/src/example/searchbar/searchbar.wxss @@ -1,10 +1,30 @@ -.searchbar-result{ +.searchbar-result { margin-top: 0; font-size: 14px; } -.searchbar-result:before{ + +.searchbar-result:before { display: none; } -.weui-cell{ + +.weui-cell { padding: 12px 15px 12px 35px; +} + +.weui-search-panel { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: #fff; + z-index: 9999; +} + +.weui-search-panel .weui-search-bar__cancel-btn { + font-size: 16px; +} + +.weui-search-panel .searchbar-result { + margin-top: 0; } \ No newline at end of file diff --git a/src/example/searchbartop/searchbartop.js b/src/example/searchbartop/searchbartop.js new file mode 100644 index 00000000..ae6a4276 --- /dev/null +++ b/src/example/searchbartop/searchbartop.js @@ -0,0 +1,27 @@ +Page({ + data: { + inputShowed: false, + inputVal: "" + }, + showInput: function () { + this.setData({ + inputShowed: true + }); + }, + hideInput: function () { + this.setData({ + inputVal: "", + inputShowed: false + }); + }, + clearInput: function () { + this.setData({ + inputVal: "" + }); + }, + inputTyping: function (e) { + this.setData({ + inputVal: e.detail.value + }); + } +}); \ No newline at end of file diff --git a/src/example/searchbartop/searchbartop.wxml b/src/example/searchbartop/searchbartop.wxml new file mode 100644 index 00000000..d8ea81c4 --- /dev/null +++ b/src/example/searchbartop/searchbartop.wxml @@ -0,0 +1,68 @@ + + + SearchBarTop + 搜索栏点击置顶 + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/example/searchbartop/searchbartop.wxss b/src/example/searchbartop/searchbartop.wxss new file mode 100644 index 00000000..e4d590f9 --- /dev/null +++ b/src/example/searchbartop/searchbartop.wxss @@ -0,0 +1,30 @@ +.searchbar-result { + margin-top: 0; + font-size: 14px; +} + +.searchbar-result:before { + display: none; +} + +.weui-cell { + padding: 12px 15px 12px 35px; +} + +.weui-search-panel { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: #fff; + z-index: 9999; +} + +.weui-search-panel .weui-search-bar__cancel-btn { + font-size: 16px; +} + +.weui-search-panel .searchbar-result { + margin-top: 0; +} \ No newline at end of file