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

首页及搜索页调整

parent 0e5c7dff
......@@ -460,12 +460,16 @@ export default {
};
},
created() {
this.$EventBus.$on('hotList', (hotList) => {
console.log('hotList', hotList);
this.hotList = hotList
})
// this.$EventBus.$on('hotList', (hotList) => {
// console.log('hotList', hotList);
// this.hotList = hotList
// })
},
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()
var newStartDate = new Date();
var newStartDateStr = this.formatDate(
......@@ -498,6 +502,19 @@ export default {
},
computed: {},
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) {
this.setectHotTag = item.Id
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