Commit c041a84fa0b47236b8454bbdc3b5e2508d1a0cc4

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

搜索框修改

pages/goods/search/search.js
... ... @@ -492,5 +492,11 @@ Page({
492 492 hiddenClear: true,
493 493 openSearchModal: true,
494 494 });
495   - }
  495 + },
  496 +
  497 + inputFocus() {
  498 + this.setData({
  499 + openSearchModal: true,
  500 + });
  501 + },
496 502 });
497 503 \ No newline at end of file
... ...
pages/goods/search/search.wxml
... ... @@ -6,7 +6,7 @@
6 6 <form bindsubmit="submitSearch">
7 7 <view class="pdh20 pdv10 flex ai_c jc_sb">
8 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 10 <text class="iconfont icon-guan" hidden="{{hiddenClear}}" catchtap="clearInput"></text>
11 11 </view>
12 12 <button class="btn" formType="submit" hover-class="none">搜索</button>
... ... @@ -44,7 +44,6 @@
44 44  
45 45  
46 46 <block wx:if="{{!openSearchModal}}">
47   -
48 47  
49 48 <view class="nav flex">
50 49 <navigator bindtap="changeTab" class="nav-item f1" data-href="sort" data-ad="{{adname}}">综合
... ...
pages/goods/search/search.wxss
... ... @@ -3,6 +3,13 @@
3 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 13 .nav-item {
7 14 /* float: left;
8 15 width: 30%;
... ...