Commit c041a84fa0b47236b8454bbdc3b5e2508d1a0cc4

Authored by 后端研发-苏泰源
1 parent a3a6db2c

搜索框修改

pages/goods/search/search.js
@@ -492,5 +492,11 @@ Page({ @@ -492,5 +492,11 @@ Page({
492 hiddenClear: true, 492 hiddenClear: true,
493 openSearchModal: true, 493 openSearchModal: true,
494 }); 494 });
495 - } 495 + },
  496 +
  497 + inputFocus() {
  498 + this.setData({
  499 + openSearchModal: true,
  500 + });
  501 + },
496 }); 502 });
497 \ No newline at end of file 503 \ No newline at end of file
pages/goods/search/search.wxml
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 <form bindsubmit="submitSearch"> 6 <form bindsubmit="submitSearch">
7 <view class="pdh20 pdv10 flex ai_c jc_sb"> 7 <view class="pdh20 pdv10 flex ai_c jc_sb">
8 <view class="input-box"> 8 <view class="input-box">
9 - <input autoFocus class="input-search" name="word" placeholder="搜索商品" bindconfirm="submitSearch" bindinput="getInput" value="{{keyword}}"/> 9 + <input autoFocus class="input-search" name="word" placeholder="搜索商品" bindconfirm="submitSearch" bindinput="getInput" bindfocus="inputFocus" value="{{keyword}}"/>
10 <text class="iconfont icon-guan" hidden="{{hiddenClear}}" catchtap="clearInput"></text> 10 <text class="iconfont icon-guan" hidden="{{hiddenClear}}" catchtap="clearInput"></text>
11 </view> 11 </view>
12 <button class="btn" formType="submit" hover-class="none">搜索</button> 12 <button class="btn" formType="submit" hover-class="none">搜索</button>
@@ -44,7 +44,6 @@ @@ -44,7 +44,6 @@
44 44
45 45
46 <block wx:if="{{!openSearchModal}}"> 46 <block wx:if="{{!openSearchModal}}">
47 -  
48 47
49 <view class="nav flex"> 48 <view class="nav flex">
50 <navigator bindtap="changeTab" class="nav-item f1" data-href="sort" data-ad="{{adname}}">综合 49 <navigator bindtap="changeTab" class="nav-item f1" data-href="sort" data-ad="{{adname}}">综合
pages/goods/search/search.wxss
@@ -3,6 +3,13 @@ @@ -3,6 +3,13 @@
3 overflow: visible; 3 overflow: visible;
4 } 4 }
5 5
  6 +.nav {
  7 + position: sticky;
  8 + top: 90rpx;
  9 + background-color: white;
  10 + z-index: 999;
  11 +}
  12 +
6 .nav-item { 13 .nav-item {
7 /* float: left; 14 /* float: left;
8 width: 30%; 15 width: 30%;