Commit 5a2006ed authored by zhanglw's avatar zhanglw

搜索跳转

parent b0895a4d
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
<div class="search-btn"> <div class="search-btn">
<el-input v-model="query.keyword" clearable placeholder="请输入关键字" style="width: 600px" /> <el-input v-model="query.keyword" clearable placeholder="请输入关键字" style="width: 600px" />
<el-select v-model="query.productType" placeholder="全部产品" style="width: 160px"> <el-select v-model="query.productType" placeholder="全部产品" style="width: 160px">
<el-option v-for="item in [{value:undefined,label:'全部产品'}, ...dict.product_type]" :key="item.value" :label="item.label" :value="item.value" /> <el-option v-for="item in [{value:'',label:'全部产品'}, ...dict.product_type]" :key="item.value" :label="item.label" :value="item.value" />
</el-select> </el-select>
<el-select v-model="query.area" placeholder="区域" style="width: 100px"> <el-select v-model="query.area" placeholder="区域" style="width: 100px">
<el-option v-for="item in [{value:undefined,label:'全地区'}, ...dict.area_province]" :key="item.value" :label="item.label" :value="item.value" /> <el-option v-for="item in [{value:'',label:'全地区'}, ...dict.area_province]" :key="item.value" :label="item.label" :value="item.value" />
</el-select> </el-select>
<el-button icon="el-icon-search" class="btn" @click="search">搜索</el-button> <el-button icon="el-icon-search" class="btn" @click="search">搜索</el-button>
</div> </div>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</el-col> </el-col>
<el-col :span="3"> <el-col :span="3">
<el-select v-model="query.productType" placeholder="全部产品"> <el-select v-model="query.productType" placeholder="全部产品">
<el-option v-for="item in [{value:undefined,label:'全部产品'}, ...dict.product_type]" :key="item.value" :label="item.label" :value="item.value" /> <el-option v-for="item in [{value:'',label:'全部产品'}, ...dict.product_type]" :key="item.value" :label="item.label" :value="item.value" />
</el-select> </el-select>
</el-col> </el-col>
<el-col :span="3"> <el-col :span="3">
...@@ -40,9 +40,9 @@ ...@@ -40,9 +40,9 @@
</el-row> </el-row>
<el-row style="padding-top: 10px"> <el-row style="padding-top: 10px">
<el-col :span="2"> <el-col :span="2">
<div class="search-item" :class="query.type===undefined?'active':''"> <div class="search-item" :class="query.type===''?'active':''">
<span class="touch label" @click="setQuertType()">默认排序</span> <span class="touch label" @click="setQuertType()">默认排序</span>
<span v-if="query.type===undefined"> <span v-if="query.type===''">
<i v-if="query.sort" class="el-icon-sort-up touch" /> <i v-if="query.sort" class="el-icon-sort-up touch" />
<i v-else class="el-icon-sort-down touch" /> <i v-else class="el-icon-sort-down touch" />
</span> </span>
...@@ -204,8 +204,9 @@ export default { ...@@ -204,8 +204,9 @@ export default {
imgSrcStart: process.env.VUE_APP_BASE_API, imgSrcStart: process.env.VUE_APP_BASE_API,
query: { query: {
keyword: '', keyword: '',
area: undefined, productType: '',
type: undefined, area: '',
type: '',
sort: false sort: false
}, },
page: 1, page: 1,
...@@ -352,7 +353,7 @@ export default { ...@@ -352,7 +353,7 @@ export default {
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
console.log(this.$route.params) this.query = Object.assign(this.query, this.$route.params)
HttpReq.webClientApi.homePageGetSearch({ HttpReq.webClientApi.homePageGetSearch({
preview: false preview: false
}).then((res) => { }).then((res) => {
...@@ -362,7 +363,7 @@ export default { ...@@ -362,7 +363,7 @@ export default {
}, },
methods: { methods: {
onDictReady(dict) { onDictReady(dict) {
this.areaOpts = [{ value: undefined, label: '全部' }, ...dict.area_province] this.areaOpts = [{ value: '', label: '全部' }, ...dict.area_province]
}, },
search() { search() {
Object.keys(this.query).length !== 0 && Object.keys(this.query).forEach(item => { Object.keys(this.query).length !== 0 && Object.keys(this.query).forEach(item => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment