|
@@ -1,17 +1,17 @@
|
|
|
<template>
|
|
|
<view class="search">
|
|
|
<view class="search-item">
|
|
|
- <u-search v-model="search_text" :clearabled="true" @custom="handlerSearchBtn" @search="handlerSearchBtn" />
|
|
|
+ <u-search v-model="search_text" :clearabled="true" @custom="handlerSearchBtn" @search="handlerSearchBtn" :actionStyle="{ color:'#215EBE' }" />
|
|
|
<!-- <button class="search-btn" @click="handlerSearchBtn">搜索</button> -->
|
|
|
</view>
|
|
|
|
|
|
<!-- 搜索历史 -->
|
|
|
<view class="history" v-show="search_list.length != 0">
|
|
|
<view class="history-top">
|
|
|
- <hotCom>搜索历史</hotCom>
|
|
|
+ <view class='title'>搜索历史</view>
|
|
|
<view class="history-right" @click="handlerAllSearchRecord">
|
|
|
<u-icon name="trash" />
|
|
|
- <text>删除记录</text>
|
|
|
+ <!-- <text>删除记录</text> -->
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="label">
|
|
@@ -21,7 +21,11 @@
|
|
|
:text="item.name"
|
|
|
plain
|
|
|
closable
|
|
|
+ borderColor='#F5F6F8'
|
|
|
:show="close2"
|
|
|
+ color='#0C1223'
|
|
|
+ bgColor='#F5F6F8'
|
|
|
+ :closable='false'
|
|
|
@close="handlerCloseSearchItem(item, index)"
|
|
|
@click="handlerSelctHistItem(item)"
|
|
|
/>
|
|
@@ -30,14 +34,20 @@
|
|
|
<!-- 热门搜索 -->
|
|
|
<view class="history">
|
|
|
<view class="history-top">
|
|
|
- <text class="hotCom">热门搜索</text>
|
|
|
+ <view class='title'>热门搜索</view>
|
|
|
</view>
|
|
|
<view class="label">
|
|
|
<u-tag
|
|
|
v-for="(item, index) in popular_search_list"
|
|
|
:text="item.name"
|
|
|
:key="index"
|
|
|
+ borderColor='#F5F6F8'
|
|
|
+ :show="close2"
|
|
|
+ :color=" index == 0 ? '#EB1010' : (index == 1 ? '#FF5219' : (index == 2 ? '#FDA50C' : '#0C1223') ) "
|
|
|
+ bgColor='#F5F6F8'
|
|
|
+ :closable='false'
|
|
|
class="label-item"
|
|
|
+ v-if='index < 8'
|
|
|
@click="$Router.push(`/pagesHome/marketer/index?id=${item.id}`)"
|
|
|
/>
|
|
|
</view>
|
|
@@ -53,12 +63,13 @@
|
|
|
@click="$Router.push(`/pagesHome/marketer/index?id=${item.id}`)"
|
|
|
>
|
|
|
<view class="item-left">
|
|
|
- <image class="img" :src="item.logo"></image>
|
|
|
+ <image class="img" :src="item.logo" mode="aspectFill"></image>
|
|
|
</view>
|
|
|
<view class="item-right">
|
|
|
<view class="item-title">{{ item.name }}</view>
|
|
|
<view class="item-score">
|
|
|
- <u-rate count="5" :value="item.score" readonly />
|
|
|
+ <u-rate count="5" size='20' :value="item.score" active-color='#FFA033' readonly />
|
|
|
+ <span class="rate-text" v-if='item.score'>( {{ item.score.toFixed(1) }} )</span>
|
|
|
</view>
|
|
|
<view class="item-address"> {{ item.address }} </view>
|
|
|
</view>
|
|
@@ -97,6 +108,15 @@ export default {
|
|
|
computed: {
|
|
|
...mapGetters(['location']),
|
|
|
},
|
|
|
+ watch:{
|
|
|
+ // 搜索历史 > 8 删除最后一项
|
|
|
+ search_list(newValue){
|
|
|
+ if(newValue.length > 8){
|
|
|
+ this.search_list.splice(newValue.length - 1, 1);
|
|
|
+ uni.setStorageSync('searchItem', this.search_list);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
onShow() {
|
|
|
this.search_text = ''
|
|
|
if (uni.getStorageSync('searchItem')) {
|
|
@@ -177,25 +197,23 @@ export default {
|
|
|
|
|
|
/* 搜索历史样式 */
|
|
|
.history {
|
|
|
- padding: 30rpx;
|
|
|
- margin-bottom: 10rpx;
|
|
|
+ padding: 20rpx 30rpx;
|
|
|
|
|
|
.history-top {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
margin-bottom: 20rpx;
|
|
|
-
|
|
|
+ .title{
|
|
|
+ color:#0C1223;
|
|
|
+ font-size: 30rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
.history-right {
|
|
|
margin-top: 15rpx;
|
|
|
display: flex;
|
|
|
font-size: 12px;
|
|
|
}
|
|
|
-
|
|
|
- hotCom {
|
|
|
- font-size: 15px;
|
|
|
- font-weight: bold;
|
|
|
- color: #404045;
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -230,16 +248,25 @@ export default {
|
|
|
.item-right {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
- justify-content: space-between;
|
|
|
+ justify-content: space-around;
|
|
|
|
|
|
.item-title {
|
|
|
- color: #000;
|
|
|
+ color: #0C1223;
|
|
|
font-weight: bold;
|
|
|
- font-size: 32rpx;
|
|
|
+ font-size: 28rpx;
|
|
|
+ }
|
|
|
+ .item-score{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ .rate-text{
|
|
|
+ color: #9FA0A6;
|
|
|
+ font-size: 24rpx;
|
|
|
+ margin-left: 10rpx;
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
.item-address {
|
|
|
- color: #a1a1a1;
|
|
|
+ color: #999999;
|
|
|
+ font-size: 24rpx;
|
|
|
}
|
|
|
}
|
|
|
}
|