|
@ -87,13 +87,13 @@ |
|
|
<view class="d-search" @click="isShow=false"> |
|
|
<view class="d-search" @click="isShow=false"> |
|
|
<view class="search" @click.stop=""> |
|
|
<view class="search" @click.stop=""> |
|
|
<u-icon name="search" color="#999999" size="20"/> |
|
|
<u-icon name="search" color="#999999" size="20"/> |
|
|
<input placeholder="请输入搜索内容" :value="(list.find(v=>v.value==value)||{label:''}).label||value" auto-blur @focus="isShow=true" @blur="isShow=false" @input="$emit('input',$event.detail.value)" @confirm="$emit('search')"/> |
|
|
<input placeholder="请输入搜索内容" :value="(list.find(v=>v.value==value)||{label:''}).label||value" auto-blur @focus="isShow=true" @input="$emit('input',$event.detail.value)" @confirm="isShow=false;$emit('search')"/> |
|
|
<u-button type="primary" shape="circle" color="#10C176" text="搜索" size="mini" @click="$emit('search')"/> |
|
|
<u-button type="primary" shape="circle" v-if="list.length<=0" color="#10C176" text="搜索" size="mini" @click="$emit('search')"/> |
|
|
</view> |
|
|
</view> |
|
|
<view v-if="list.length>0" @click.stop="" class="want_search card" :class="{show:isShow}"> |
|
|
<view v-if="list.length>0" @click.stop="" class="want_search card" :class="{show:isShow}"> |
|
|
<text class="title">猜你想搜</text> |
|
|
<text class="title">猜你想搜</text> |
|
|
<view class="content"> |
|
|
<view class="content"> |
|
|
<text v-for="(v,k) in list" :class="{active:false}" :key="k" @click="$emit('input', v.value);$emit('search')">{{v.label}}</text> |
|
|
<text v-for="(v,k) in list" :class="{active:v.value==selectVal}" :key="k" @click="$emit('select', v.value==selectVal?'':v.value);">{{v.label}}</text> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="mask" :class="{show:isShow}" v-if="list.length>0"/> |
|
|
<view class="mask" :class="{show:isShow}" v-if="list.length>0"/> |
|
@ -109,7 +109,11 @@ export default { |
|
|
list:{ |
|
|
list:{ |
|
|
type:Array, |
|
|
type:Array, |
|
|
default:()=>[] |
|
|
default:()=>[] |
|
|
} |
|
|
}, |
|
|
|
|
|
selectVal:{ |
|
|
|
|
|
type:[String,Number], |
|
|
|
|
|
default:'' |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
data(){ |
|
|
data(){ |
|
|
return{ |
|
|
return{ |
|
|