Commit b0895a4d authored by zhanglw's avatar zhanglw

搜索跳转

parent 396d2fc5
...@@ -458,8 +458,8 @@ export const HttpReq = { ...@@ -458,8 +458,8 @@ export const HttpReq = {
method: 'get' method: 'get'
}) })
}, },
// 产品-查询列表 // 产品-硬件查询列表
productGetList: function(params) { productGetHardwareList: function(params) {
return request({ return request({
url: '/api/bsw/bigScreen/highQualityProducts/productList?' + qs.stringify(params, { indices: false }), url: '/api/bsw/bigScreen/highQualityProducts/productList?' + qs.stringify(params, { indices: false }),
method: 'get' method: 'get'
......
...@@ -47,6 +47,7 @@ export const constantRouterMap = [ ...@@ -47,6 +47,7 @@ export const constantRouterMap = [
{ {
path: '/product', path: '/product',
meta: { title: '优质产品', noCache: true }, meta: { title: '优质产品', noCache: true },
name: 'product',
component: (resolve) => { component: (resolve) => {
return require(['@/views/homepage/product/index'], resolve) return require(['@/views/homepage/product/index'], resolve)
}, },
......
...@@ -16,7 +16,7 @@ module.exports = { ...@@ -16,7 +16,7 @@ module.exports = {
*/ */
tokenCookieExpires: 1, tokenCookieExpires: 1,
/** /**
* @description 记住密码状态下的密码在Cookie中存储的天数,默认1天s * @description 记住密码状态下的密码在Cookie中存储的天数,默认1天
*/ */
passCookieExpires: 1, passCookieExpires: 1,
/** /**
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<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:undefined,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">搜索</el-button> <el-button icon="el-icon-search" class="btn" @click="search">搜索</el-button>
</div> </div>
<div class="search-keyword"> <div class="search-keyword">
<span v-for="(item, index) in keywords" :key="index" class="label" @click="keywordClick(item, 'keyword')">{{ item.name }}</span> <span v-for="(item, index) in keywords" :key="index" class="label" @click="keywordClick(item, 'keyword')">{{ item.name }}</span>
...@@ -34,7 +34,11 @@ export default { ...@@ -34,7 +34,11 @@ export default {
dicts: ['product_type', 'area_province'], dicts: ['product_type', 'area_province'],
data() { data() {
return { return {
query: {}, query: {
keyword: '',
productType: '',
area: ''
},
keywords: ['曲线记录仪', '液位控制器', '双金属温度计', '位移传感器'], keywords: ['曲线记录仪', '液位控制器', '双金属温度计', '位移传感器'],
brands: ['高领传感', '施克', '蓝之宇', '高领传感', '施克', '蓝之宇'], brands: ['高领传感', '施克', '蓝之宇', '高领传感', '施克', '蓝之宇'],
suppliers: ['上海成渝智能科技发展有限公司', '山东盛茂科技有限公司', '山东天润科技有限公司'] suppliers: ['上海成渝智能科技发展有限公司', '山东盛茂科技有限公司', '山东天润科技有限公司']
...@@ -52,9 +56,17 @@ export default { ...@@ -52,9 +56,17 @@ export default {
}) })
}, },
methods: { methods: {
search() {
this.$router.push({
name: 'product',
params: this.query
})
},
keywordClick(item, type) { keywordClick(item, type) {
if (item.url) { if (item.url) {
this.$router.push({ path: item.url }) this.$router.push({ path: item.url })
} else {
this.query.keyword = item.name
} }
} }
} }
......
...@@ -25,12 +25,12 @@ ...@@ -25,12 +25,12 @@
</el-select> </el-select>
</el-col> </el-col>
<el-col :span="3"> <el-col :span="3">
<el-button icon="el-icon-search" class="btn">搜索</el-button> <el-button icon="el-icon-search" class="btn" @click="search">搜索</el-button>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<div class="search-keyword"> <div class="search-keyword">
<span v-for="(item, index) in keywords" :key="index" class="label" @click="keywordClick(item, 'keyword')">{{ item }}</span> <span v-for="(item, index) in keywords" :key="index" class="label" @click="keywordClick(item, 'keyword')">{{ item.name }}</span>
</div> </div>
<el-row style="padding-top: 16px"> <el-row style="padding-top: 16px">
<el-col :span="2"><div class="area-title">地区选择</div></el-col> <el-col :span="2"><div class="area-title">地区选择</div></el-col>
...@@ -191,6 +191,7 @@ import breadcrumb from '../components/breadcrumb' ...@@ -191,6 +191,7 @@ import breadcrumb from '../components/breadcrumb'
import homeFooter from '../components/homeFooter' import homeFooter from '../components/homeFooter'
import inquiryView from '../components/inquiryView' import inquiryView from '../components/inquiryView'
import floatBtn from '../components/floatBtn' import floatBtn from '../components/floatBtn'
import { HttpReq } from '@/api/common'
export default { export default {
components: { titleMenus, userLogin, languageSetting, breadcrumb, homeFooter, inquiryView, floatBtn }, components: { titleMenus, userLogin, languageSetting, breadcrumb, homeFooter, inquiryView, floatBtn },
...@@ -207,8 +208,10 @@ export default { ...@@ -207,8 +208,10 @@ export default {
type: undefined, type: undefined,
sort: false sort: false
}, },
page: 1,
pageSize: 8,
areaOpts: [], areaOpts: [],
keywords: ['曲线记录仪', '液位控制器', '双金属温度计', '位移传感器'], keywords: [],
hardwareList: [ hardwareList: [
{ {
isGood: true, isGood: true,
...@@ -349,15 +352,33 @@ export default { ...@@ -349,15 +352,33 @@ export default {
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
console.log(this.$route.params)
HttpReq.webClientApi.homePageGetSearch({
preview: false
}).then((res) => {
this.keywords = res.data.keywords
})
}) })
}, },
methods: { methods: {
onDictReady(dict) { onDictReady(dict) {
this.areaOpts = [{ value: undefined, label: '全部' }, ...dict.area_province] this.areaOpts = [{ value: undefined, label: '全部' }, ...dict.area_province]
}, },
search() {
Object.keys(this.query).length !== 0 && Object.keys(this.query).forEach(item => {
if (this.query[item] === null || this.query[item] === '') this.query[item] = undefined
})
HttpReq.backstageApi.productGetHardwareList({
page: this.page - 1,
pageSize: this.pageSize,
...this.query
}).then((res) => {
this.hardwareList = res.data.data
})
},
keywordClick(item, type) { keywordClick(item, type) {
this.query.keyword = item this.query.keyword = item.name
this.search()
}, },
setQuertType(type) { setQuertType(type) {
if (type === this.query.type) { if (type === this.query.type) {
......
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