Browse Source

search

featrue/v4.5
xpz2018 4 years ago
parent
commit
c5bb12f327
3 changed files with 10 additions and 20 deletions
  1. 2
      components/free-input/index.js
  2. 26
      components/free-input/index.wxml
  3. 2
      pages/mall/search-list/index.wxml

2
components/free-input/index.js

@ -64,7 +64,7 @@ Component({
// send、search、next、go、done // send、search、next、go、done
confirmType:{ confirmType:{
type:String, type:String,
value:'done'
value:'search'
}, },
// 提示词 // 提示词
placeholder:{ placeholder:{

26
components/free-input/index.wxml

@ -1,34 +1,24 @@
<view class='box' style="position:{{position}};background:{{bgColor}};"> <view class='box' style="position:{{position}};background:{{bgColor}};">
<view class="{{inputStyle == 0?'inputStyle':'inputStyles'}} {{inputStyle == 1 &&disabled?'disabled':''}}" style="border-radius:{{radius}};background:{{inputBg}};">
<view class="{{inputStyle == 0?'inputStyle':'inputStyles'}} {{inputStyle == 1 &&disabled?'disabled':''}}"
style="border-radius:{{radius}};background:{{inputBg}};">
<!-- 前置图标 --> <!-- 前置图标 -->
<view style="margin: 2px 0 0 0.8em;" wx:if="{{prefixIcon}}"> <view style="margin: 2px 0 0 0.8em;" wx:if="{{prefixIcon}}">
<!-- <text class="cuIcon-search text-gray" style="font-size:16px;padding-top: 8rpx;"></text> --> <!-- <text class="cuIcon-search text-gray" style="font-size:16px;padding-top: 8rpx;"></text> -->
<image src="/assets/image/icon-search.png" style="height: 30rpx;width: 30rpx;margin-top: 20rpx;"></image> <image src="/assets/image/icon-search.png" style="height: 30rpx;width: 30rpx;margin-top: 20rpx;"></image>
</view> </view>
<input type="{{type}}"
style="color:{{color}}"
placeholder-style="color:{{color}}"
confirm-type="{{confirmType}}"
placeholder="{{placeholder}}"
value="{{value}}"
bindinput="getInput"
bindfocus="getFocus"
bindblur="getBlur"
bindconfirm="getConfirm"
password="{{password}}"
disabled="{{disabled}}"
focus="{{ focus }}"
class="input"/>
<input type="{{type}}" style="color:{{color}}" placeholder-style="color:{{color}}" confirm-type="{{confirmType}}"
placeholder="{{placeholder}}" value="{{value}}" bindinput="getInput" bindfocus="getFocus" bindblur="getBlur"
bindconfirm="getConfirm" password="{{password}}" disabled="{{disabled}}" focus="{{ focus }}" class="input" />
<!-- 删除 --> <!-- 删除 -->
<view class="deleStyle" wx:if="{{value && close}}" bindtap="close"> <view class="deleStyle" wx:if="{{value && close}}" bindtap="close">
<text class="cuIcon-close text-gray" style="font-size:16px;"></text> <text class="cuIcon-close text-gray" style="font-size:16px;"></text>
</view> </view>
<!-- 后置图标 --> <!-- 后置图标 -->
<view style="padding: 0 20rpx;" wx:if="{{suffixIcon}}" >
<view style="padding: 0 20rpx;" wx:if="{{suffixIcon}}">
<!-- <slot name='suffix' ></slot> --> <!-- <slot name='suffix' ></slot> -->
</view>
</view>
</view> </view>
<view class="extreaBtn" wx:if='{{extreaWord}}' style="color:{{extreaColor}}" bindtap="extreaBtn"> <view class="extreaBtn" wx:if='{{extreaWord}}' style="color:{{extreaColor}}" bindtap="extreaBtn">
<text>{{extreaWord}}</text> <text>{{extreaWord}}</text>
</view> </view>
</view>
</view>

2
pages/mall/search-list/index.wxml

@ -3,7 +3,7 @@
</cu-custom> </cu-custom>
<view class="bg-white"> <view class="bg-white">
<free-input value="{{form.searchKey}}" placeholder="请输入关键字" extreaWord="搜索" bind:focus="onFocusChange" bind:blur="onBlurChange" focus="{{focus}}" close="{{true}}" bind:extrea="onSearchList"></free-input>
<free-input value="{{form.searchKey}}" placeholder="请输入关键字" extreaWord="搜索" focus="{{focus}}" close="{{true}}" bind:focus="onFocusChange" bind:blur="onBlurChange" bind:confirm="onSearchList" bind:extrea="onSearchList"></free-input>
</view> </view>
<view class="bg-white" style="height:90rpx;border-bottom:2rpx solid #f3f3f3" wx:if="{{!focus || searchList.length == 0}}"> <view class="bg-white" style="height:90rpx;border-bottom:2rpx solid #f3f3f3" wx:if="{{!focus || searchList.length == 0}}">
<wux-tabi tab-data="{{tabList}}" tab-index="{{tabIndex}}" disable="{{requesting || loading}}" scroll="{{false}}" bind:change="onTabChange"/> <wux-tabi tab-data="{{tabList}}" tab-index="{{tabIndex}}" disable="{{requesting || loading}}" scroll="{{false}}" bind:change="onTabChange"/>

Loading…
Cancel
Save