Commit 5582ce4c authored by 沈良进's avatar 沈良进

搜索页优化

parent 6de34457
......@@ -164,6 +164,7 @@ module.exports = function( /* ctx */ ) {
'QBadge',
'QParallax',
'QField',
'QTree',
],
directives: [
......
......@@ -2,12 +2,12 @@ import Vue from 'vue'
import axios from 'axios'
import md5 from 'js-md5'
// import {eventBus} from './eventBus'
import VueCoreVideoPlayer from 'vue-core-video-players'
// import VueCoreVideoPlayer from 'vue-core-video-players'
import 'viewerjs/dist/viewer.css'
import VueViewer from 'v-viewer'
// import VueCoreVideoPlayer from 'vue-core-video-player'
Vue.prototype.$EventBus = new Vue()
Vue.use(VueCoreVideoPlayer)
// Vue.use(VueCoreVideoPlayer)
Vue.use(VueViewer)
//域名管理对象
Vue.prototype.domainManager = function () {
......
......@@ -318,11 +318,11 @@ color: #EE4454;
</q-toolbar>
<div class="header-box flex">
<q-tabs align="center" shrink>
<q-btn flat class="address-btn">
<q-btn flat class="address-btn" @mouseenter="mouseenterAddress" @mouseleave="mouseeleaveAddress">
<span slot="default" class="flex item-center">
<i class="iconfont icondingweixiao q-icon notranslate" style="font-size: 14px; margin-right: 8px"></i>選擇目的地
</span>
<q-menu>
<q-menu ref="address" @mouseenter="addressMenuEnter" @mouseleave="addressMenuLeave">
<div class="address-box flex">
<div class="menu-box">
<div
......@@ -343,7 +343,7 @@ color: #EE4454;
</div>
</div>
<div class="city-box">
<div v-for="item in selectedArea" :key="item">
<div v-for="item in selectedArea" :key="item.Id">
<div class="city" >
<img class="city-img" v-if="item.ImageList.length" :src="item.ImageList[0]" />
<div class="city-name-box flex flex-center"><div class="city-name">{{item.Name}}</div></div>
......@@ -362,8 +362,8 @@ color: #EE4454;
</q-menu>
</q-btn>
<q-separator style="height: 16px;margin: auto 0" vertical/>
<q-btn class="all-type" flat label="全部分類">
<q-menu>
<q-btn class="all-type" flat label="全部分類" @mouseenter="typeHoverAll(true)" @mouseleave="typeHoverAll(false)">
<q-menu ref="menu0" @mouseenter="menuFocus = 2" @mouseleave="menuLeaveAll">
<div class="all-menu">
<div class="flex">
<div class="category-item font-16" :key="i" v-for="(x, i) in dataList.CategoryList">{{x.CategoryName}}</div>
......@@ -389,8 +389,8 @@ color: #EE4454;
</q-menu>
</q-btn>
<template v-for="(x, i) in dataList.CategoryList">
<q-btn :key="i" :label="x.CategoryName" flat :content-style="{ hover: '#ff0000' }">
<q-menu :key="i">
<q-btn :key="i" :label="x.CategoryName" flat :content-style="{ hover: '#ff0000' }" @mouseenter="typeHover(i,true)" @mouseleave="typeHover(i,false)">
<q-menu ref="menu" :key="i" @mouseenter="menuFocus = 2" @mouseleave="menuLeave(i)">
<q-list>
<div :key="item.Id" v-for="item in x.SubList">
<q-item v-if="item.SubList.length" clickable>
......@@ -437,6 +437,7 @@ export default {
},
data() {
return {
menuFocus: 0,
selectCategory: undefined,
categoryList: [],
subTitle: "",
......@@ -477,6 +478,84 @@ export default {
this.getCategoryList();
},
methods: {
mouseenterAddress() {
this.menuFocusAll = 0
this.menuFocus = 0
this.addressFocus = 1
this.$refs.address.show()
},
mouseeleaveAddress() {
setTimeout(() => {
if(!this.addressFocus) {
this.$refs.address.hide()
}
}, 50)
},
addressMenuEnter() {
this.addressFocus = 2
},
addressMenuLeave() {
this.addressFocus = 0
setTimeout(() => {
if(!this.addressFocus) {
this.$refs.address.hide()
}
}, 50)
},
typeHoverAll(bool) {
if(bool) {
this.addressFocus = 0
this.menuFocus = 0
this.menuFocusAll = 1
if(this.currentMenu !== undefined) {
this.$refs.menu[this.currentMenu].hide()
}
this.$refs.menu0.show()
} else {
this.menuFocusAll = 0
setTimeout(() => {
if(!this.menuFocusAll) {
this.$refs.menu0.hide()
}
}, 50)
}
this.currentMenu = undefined
},
typeHover(index, bool) {
if(bool) {
this.addressFocus = 0
this.menuFocusAll = 0
this.menuFocus = 1
if(this.currentMenu !== undefined && index !== this.currentMenu) {
this.$refs.menu[this.currentMenu].hide()
}
this.$refs.menu[index].show()
} else {
this.menuFocus = 0
setTimeout(() => {
if(!this.menuFocus) {
this.$refs.menu[index].hide()
}
}, 50)
}
this.currentMenu = index
},
menuLeaveAll() {
this.menuFocus = 0
setTimeout(() => {
if(!this.menuFocus) {
this.$refs.menu0.hide()
}
}, 50)
},
menuLeave(i) {
this.menuFocus = 0
setTimeout(() => {
if(!this.menuFocus) {
this.$refs.menu[i].hide()
}
}, 50)
},
changeAreas(item) {
this.selectedArea = item.SubList;
this.selectedAreaId = item.Id;
......@@ -514,7 +593,6 @@ export default {
Id: ''
});
this.$EventBus.$emit('hotList', hotArr)
console.log('emit', this.$EventBus.$emit, hotArr)
this.selectedArea = hotArr
this.areas = this.areas.concat(this.baseData.AreaList);
},
......
This diff is collapsed.
This diff is collapsed.
......@@ -839,7 +839,7 @@
</div>
</template>
<template v-else>
<kkday :qMsg="qMsg"></kkday>
<kkday :qMsg="qMsg" @change="handlerSearchChange"></kkday>
</template>
<div v-if="DataList.length==0 && ShowType!=2" class="blank-block">
<i class="iconfont iconchazhao"></i>
......@@ -1229,6 +1229,11 @@
}
},
methods: {
handlerSearchChange(value) {
console.log('handlerSearchChange', value)
this.qMsg = value
this.goSearchHandler();
},
//清除所有条件
clearAll(){
let msg={
......@@ -1382,7 +1387,7 @@
}
}
this.apipost(
"b2b_get_GetB2BTravelPageList", msg,
"b2c_get_GetB2CMergeProductPageList", msg,
res => {
this.$q.loading.hide()
if (res.data.resultCode == 1) {
......
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