Commit 138bb233 authored by 沈良进's avatar 沈良进

首页及搜索页调整

parent 0e5c7dff
...@@ -460,12 +460,16 @@ export default { ...@@ -460,12 +460,16 @@ export default {
}; };
}, },
created() { created() {
this.$EventBus.$on('hotList', (hotList) => { // this.$EventBus.$on('hotList', (hotList) => {
console.log('hotList', hotList); // console.log('hotList', hotList);
this.hotList = hotList // this.hotList = hotList
}) // })
}, },
mounted() { mounted() {
var jObj = JSON.parse(window.localStorage.getItem('baseifo'));
const hotList = this.getHotList(jObj.AreaList)
console.log('hotList mounted', jObj, hotList)
this.hotList = hotList
this.getHistory() this.getHistory()
var newStartDate = new Date(); var newStartDate = new Date();
var newStartDateStr = this.formatDate( var newStartDateStr = this.formatDate(
...@@ -498,6 +502,19 @@ export default { ...@@ -498,6 +502,19 @@ export default {
}, },
computed: {}, computed: {},
methods: { methods: {
getHotList(arr) {
let hotArr = [];
arr.forEach(item => {
if (item.SubList && item.SubList.length) {
hotArr = hotArr.concat(this.getHotList(item.SubList));
} else {
if (item.IsHot === 1) {
hotArr.push(item);
}
}
});
return hotArr;
},
handleHotTagClick(item) { handleHotTagClick(item) {
this.setectHotTag = item.Id this.setectHotTag = item.Id
let val = item.Name let val = item.Name
......
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