|
@@ -36,18 +36,18 @@
|
|
|
<view class="list">
|
|
|
<view class="list-title">产品</view>
|
|
|
<view class="list-main">
|
|
|
- <view v-for="(item,index) in hotSearchList" :key="index" @click="keywordsClick(item.keyword)" :class="item.type == '1' ? 'list-active' : ''">
|
|
|
- {{item.keyword}}
|
|
|
- <text class="iconfont icon-resou" v-if="item.type === '1'"></text>
|
|
|
+ <view v-for="(item,index) in productHotSearch" :key="index" @click="keywordsClick(item.name)" :class="item.isHot == '1' ? 'list-active' : ''">
|
|
|
+ {{item.name}}
|
|
|
+ <text class="iconfont icon-resou" v-if="item.isHot === '1'"></text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="list">
|
|
|
<view class="list-title">仪器</view>
|
|
|
<view class="list-main">
|
|
|
- <view v-for="(item,index) in hotSearchList" :key="index" @click="keywordsClick(item.keyword)" :class="item.type == '1' ? 'list-active' : ''">
|
|
|
- {{item.keyword}}
|
|
|
- <text class="iconfont icon-resou" v-if="item.type === '1'"></text>
|
|
|
+ <view v-for="(item,index) in instrumentHotSearch" :key="index" @click="keywordsClick(item.name)" :class="item.isHot == '1' ? 'list-active' : ''">
|
|
|
+ {{item.name}}
|
|
|
+ <text class="iconfont icon-resou" v-if="item.isHot === '1'"></text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -179,16 +179,8 @@
|
|
|
isShowClose:false, //是否显示清空输入框图标
|
|
|
isSearchHistory:false,//是都显示搜索历史
|
|
|
serachRecordList:[],//历史搜索记录
|
|
|
- hotSearchList:[
|
|
|
- {keyword:'玻尿酸',type:'1',name:''},
|
|
|
- {keyword:'械字号',type:'1',name:''},
|
|
|
- {keyword:'导入液含税',type:'1',name:''},
|
|
|
- {keyword:'热门仪器',type:'1',name:''},
|
|
|
- {keyword:'除皱',type:'1',name:''},
|
|
|
- {keyword:'微整形 ',type:'0',name:''},
|
|
|
- {keyword:'纹绣',type:'0',name:''},
|
|
|
- {keyword:'美白嫩肤',type:'0',name:''}
|
|
|
- ],
|
|
|
+ instrumentHotSearch:[],
|
|
|
+ productHotSearch:[],
|
|
|
isShowWrapper:false,
|
|
|
isModallayer:false,
|
|
|
isFocus:false,
|
|
@@ -215,7 +207,6 @@
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
console.log(option)
|
|
|
-
|
|
|
this.$api.getStorage().then((resolve) =>{
|
|
|
this.userID = resolve.userID ? resolve.userID : 0;
|
|
|
this.shopId = resolve.shopID ? resolve.shopID : 0;
|
|
@@ -241,6 +232,16 @@
|
|
|
...mapState(['hasLogin','userInfo','identity'])
|
|
|
},
|
|
|
methods:{
|
|
|
+ GetHomeHotSearchTerms(){//金刚区分类
|
|
|
+ this.CommonService.GetHomeHotSearchTerms({}).then(response =>{
|
|
|
+ let data = response.data
|
|
|
+ console.log(data)
|
|
|
+ this.instrumentHotSearch = data.instrumentHotSearch
|
|
|
+ this.productHotSearch = data.productHotSearch
|
|
|
+ }).catch(error =>{
|
|
|
+ this.$util.msg(error.msg,2000)
|
|
|
+ })
|
|
|
+ },
|
|
|
initGetSerachRecord(){//查询搜索历史记录
|
|
|
this.ProductService.GetProductSearchHistory({userId:this.userID}).then(response =>{
|
|
|
if(response.code == 0){
|
|
@@ -441,6 +442,7 @@
|
|
|
},
|
|
|
onShow() {
|
|
|
this.setScrollHeight();
|
|
|
+ this.GetHomeHotSearchTerms()
|
|
|
}
|
|
|
}
|
|
|
</script>
|