|
@@ -4,10 +4,10 @@
|
|
<view style='background:#fff;display:flex;' class="cu-bar search">
|
|
<view style='background:#fff;display:flex;' class="cu-bar search">
|
|
<view style='flex:6;' class="search-form round" >
|
|
<view style='flex:6;' class="search-form round" >
|
|
<text style='color: #ccc;text-indent:6px;' class="cuIcon-search"></text>
|
|
<text style='color: #ccc;text-indent:6px;' class="cuIcon-search"></text>
|
|
- <input type="text" v-model="searchKeyWord" placeholder="请输入货名或标题" confirm-type="search"></input>
|
|
|
|
|
|
+ <input type="text" v-model="searchKeyWord" @input='search' placeholder="请输入货名或标题" confirm-type="search"></input>
|
|
|
|
|
|
</view>
|
|
</view>
|
|
- <view @click='doSearch' style="width:4%;flex:1;">搜索</view>
|
|
|
|
|
|
+ <view @click='doSearch()' style="width:4%;flex:1;">搜索</view>
|
|
<text @click='emptysearch' v-if='searchKeyWord.length>0' class='tip_text cuIcon-roundclosefill'></text>
|
|
<text @click='emptysearch' v-if='searchKeyWord.length>0' class='tip_text cuIcon-roundclosefill'></text>
|
|
</view>
|
|
</view>
|
|
<!-- mSearch组件 如果使用原样式,删除组件元素-->
|
|
<!-- mSearch组件 如果使用原样式,删除组件元素-->
|
|
@@ -177,12 +177,21 @@
|
|
this.loadHotKeyword();
|
|
this.loadHotKeyword();
|
|
|
|
|
|
},
|
|
},
|
|
|
|
+ search(e){
|
|
|
|
+ if(e.detail.value.length==0){
|
|
|
|
+ this.isShowKeywordList=false
|
|
|
|
+ this.loadOldKeyword()
|
|
|
|
+ this.loadHotKeyword()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
blur(){
|
|
blur(){
|
|
uni.hideKeyboard()
|
|
uni.hideKeyboard()
|
|
},
|
|
},
|
|
doSearch(keyword){
|
|
doSearch(keyword){
|
|
|
|
+ console.log(keyword)
|
|
if(keyword){
|
|
if(keyword){
|
|
- this.searchKeyWord=keyword
|
|
|
|
|
|
+ this.searchKeyWord=keyword.searchContent
|
|
|
|
+
|
|
}
|
|
}
|
|
if(this.searchKeyWord.length>0){
|
|
if(this.searchKeyWord.length>0){
|
|
this.isShowKeywordList=true
|
|
this.isShowKeywordList=true
|
|
@@ -222,6 +231,9 @@
|
|
},
|
|
},
|
|
emptysearch(){
|
|
emptysearch(){
|
|
this.searchKeyWord=''
|
|
this.searchKeyWord=''
|
|
|
|
+ this.isShowKeywordList=false
|
|
|
|
+ this.loadOldKeyword()
|
|
|
|
+ this.loadHotKeyword()
|
|
},
|
|
},
|
|
loadHotKeyword(){
|
|
loadHotKeyword(){
|
|
this.$api.doRequest('get', '/searchRecordsInfo/selectRecommendedSearchRecordsInfo',{pageSize:this.pageSize,
|
|
this.$api.doRequest('get', '/searchRecordsInfo/selectRecommendedSearchRecordsInfo',{pageSize:this.pageSize,
|
|
@@ -356,74 +368,74 @@
|
|
hotToggle() {
|
|
hotToggle() {
|
|
this.forbid = this.forbid ? '' : '_forbid';
|
|
this.forbid = this.forbid ? '' : '_forbid';
|
|
},
|
|
},
|
|
- //执行搜索
|
|
|
|
- doSearch(e) {
|
|
|
|
- if(e.detail){
|
|
|
|
- if(e.detail.value.length>0){
|
|
|
|
- this.content='取消'
|
|
|
|
- this.isShowKeywordList=true
|
|
|
|
- this.$api.doRequest('post', '/searchRecordsInfo/api/addInfo',{commonId:this.userInfo.id,searchContent:e.detail.value}).then(res => {
|
|
|
|
- })
|
|
|
|
- .catch(res => {
|
|
|
|
|
|
+ // //执行搜索
|
|
|
|
+ // doSearch(e) {
|
|
|
|
+ // if(e.detail){
|
|
|
|
+ // if(e.detail.value.length>0){
|
|
|
|
+ // this.content='取消'
|
|
|
|
+ // this.isShowKeywordList=true
|
|
|
|
+ // this.$api.doRequest('post', '/searchRecordsInfo/api/addInfo',{commonId:this.userInfo.id,searchContent:e.detail.value}).then(res => {
|
|
|
|
+ // })
|
|
|
|
+ // .catch(res => {
|
|
|
|
|
|
- });
|
|
|
|
- }else{
|
|
|
|
- this.content='搜索'
|
|
|
|
- this.isShowKeywordList=false
|
|
|
|
- this.loadOldKeyword()
|
|
|
|
- this.loadHotKeyword()
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else if(e){
|
|
|
|
- if(e.length>0){
|
|
|
|
- this.isShowKeywordList=true
|
|
|
|
- this.content='取消'
|
|
|
|
- this.searchKeyWord = e
|
|
|
|
- this.$api.doRequest('post', '/searchRecordsInfo/api/addInfo',{commonId:this.userInfo.id,searchContent:e}).then(res => {
|
|
|
|
- })
|
|
|
|
- .catch(res => {
|
|
|
|
|
|
+ // });
|
|
|
|
+ // }else{
|
|
|
|
+ // this.content='搜索'
|
|
|
|
+ // this.isShowKeywordList=false
|
|
|
|
+ // this.loadOldKeyword()
|
|
|
|
+ // this.loadHotKeyword()
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // else if(e){
|
|
|
|
+ // if(e.length>0){
|
|
|
|
+ // this.isShowKeywordList=true
|
|
|
|
+ // this.content='取消'
|
|
|
|
+ // this.searchKeyWord = e
|
|
|
|
+ // this.$api.doRequest('post', '/searchRecordsInfo/api/addInfo',{commonId:this.userInfo.id,searchContent:e}).then(res => {
|
|
|
|
+ // })
|
|
|
|
+ // .catch(res => {
|
|
|
|
|
|
- })
|
|
|
|
- }else{
|
|
|
|
- this.content='搜索'
|
|
|
|
- this.isShowKeywordList=false
|
|
|
|
- this.loadOldKeyword()
|
|
|
|
- this.loadHotKeyword()
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- uni.showLoading({
|
|
|
|
- title: '正在加载',
|
|
|
|
- mask:true
|
|
|
|
- })
|
|
|
|
- var param1=''
|
|
|
|
- if (this.TabCur == 0) {
|
|
|
|
- param1 = '/procurementPlanInfo/selectProcurementPlanInfo'
|
|
|
|
- } else {
|
|
|
|
- param1 = '/salePlanInfo/selectSalePlanInfo'
|
|
|
|
- }
|
|
|
|
- this.$api.doRequest('get', param1,{pageSize:this.pageSize,
|
|
|
|
- currentPage:this.currentPage,searchKeyWord:this.searchKeyWord}).then(res => {
|
|
|
|
- uni.hideLoading()
|
|
|
|
- this.keywordList=res.data.data.records
|
|
|
|
- })
|
|
|
|
- .catch(res => {
|
|
|
|
- uni.hideLoading()
|
|
|
|
- uni.showToast({
|
|
|
|
- title: res.errmsg,
|
|
|
|
- icon:'none',
|
|
|
|
- duration: 2000
|
|
|
|
- })
|
|
|
|
- });
|
|
|
|
- // console.log(key)
|
|
|
|
- // console.log(this.keyword)
|
|
|
|
- // key = key ? key : this.keyword ? this.keyword : this.defaultKeyword;
|
|
|
|
- // this.keyword = key;
|
|
|
|
- // this.saveKeyword(key); //保存为历史
|
|
|
|
- // var TabCur = this.TabCur
|
|
|
|
- // uni.navigateTo({
|
|
|
|
- // url: `/pageA/product/querylist?keywords=${key}&TabCur=${TabCur}`
|
|
|
|
- // })
|
|
|
|
- },
|
|
|
|
|
|
+ // })
|
|
|
|
+ // }else{
|
|
|
|
+ // this.content='搜索'
|
|
|
|
+ // this.isShowKeywordList=false
|
|
|
|
+ // this.loadOldKeyword()
|
|
|
|
+ // this.loadHotKeyword()
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // uni.showLoading({
|
|
|
|
+ // title: '正在加载',
|
|
|
|
+ // mask:true
|
|
|
|
+ // })
|
|
|
|
+ // var param1=''
|
|
|
|
+ // if (this.TabCur == 0) {
|
|
|
|
+ // param1 = '/procurementPlanInfo/selectProcurementPlanInfo'
|
|
|
|
+ // } else {
|
|
|
|
+ // param1 = '/salePlanInfo/selectSalePlanInfo'
|
|
|
|
+ // }
|
|
|
|
+ // this.$api.doRequest('get', param1,{pageSize:this.pageSize,
|
|
|
|
+ // currentPage:this.currentPage,searchKeyWord:this.searchKeyWord}).then(res => {
|
|
|
|
+ // uni.hideLoading()
|
|
|
|
+ // this.keywordList=res.data.data.records
|
|
|
|
+ // })
|
|
|
|
+ // .catch(res => {
|
|
|
|
+ // uni.hideLoading()
|
|
|
|
+ // uni.showToast({
|
|
|
|
+ // title: res.errmsg,
|
|
|
|
+ // icon:'none',
|
|
|
|
+ // duration: 2000
|
|
|
|
+ // })
|
|
|
|
+ // });
|
|
|
|
+ // // console.log(key)
|
|
|
|
+ // // console.log(this.keyword)
|
|
|
|
+ // // key = key ? key : this.keyword ? this.keyword : this.defaultKeyword;
|
|
|
|
+ // // this.keyword = key;
|
|
|
|
+ // // this.saveKeyword(key); //保存为历史
|
|
|
|
+ // // var TabCur = this.TabCur
|
|
|
|
+ // // uni.navigateTo({
|
|
|
|
+ // // url: `/pageA/product/querylist?keywords=${key}&TabCur=${TabCur}`
|
|
|
|
+ // // })
|
|
|
|
+ // },
|
|
tabcarchange(status){
|
|
tabcarchange(status){
|
|
this.TabCur=status
|
|
this.TabCur=status
|
|
var param1 = ''
|
|
var param1 = ''
|