Commit 6b7fa7df authored by zhangyanni's avatar zhangyanni

分类下的文章

parent 659b8384
......@@ -1159,6 +1159,22 @@ export default new Router({
]
},
{
path:'/articleFlagList',
name:"articleFlagList",
component:articleList,
children:[
{
name:"articleFlagList",
path:"/articleFlagList",
components:{
default:resolve => require(['views/mobile/article/list.vue'], resolve),
other:resolve=>require(['views/mobile/article/articledetail.vue'],resolve)
}
}
]
},
{
path:'/articleDetail',
name:"articleDetail",
......
......@@ -7,5 +7,9 @@ export default {
getChannelListAxios(){
return api.fetchLoadingLogin("/business/content/selectContentChannelList");
},
getArticleFlagListAxios(params){
return api.fetchLoadingLogin("/business/content/selectContentListByClassifyId",params);
}
}
\ No newline at end of file
......@@ -10,94 +10,12 @@
name: "articlelist",
data() {
return {
userInfo:this.publicFun.getCookie("userInfo") ? JSON.parse(this.Base64.decode(this.publicFun.getCookie("userInfo"))) : null,
tableData: [],
currentIndex: 0,
channelList: [
{
id: 1,
name: "智能出行"
},
{
id: 2,
name: "智能驾驶"
},
{
id: 3,
name: "科学技术"
},
{
id: 1,
name: "智能出行"
},
{
id: 2,
name: "智能驾驶"
},
{
id: 3,
name: "科学技术"
},
{
id: 1,
name: "智能出行"
},
{
id: 2,
name: "智能驾驶"
},
{
id: 3,
name: "科学技术"
},
],
page:1,
pageSize:10,
totalPage:1,
allLoaded:false,
currentData:null,
isMobile:this.publicFun.getCookie('ismobile')
}
},
methods: {
handleTab(data, index) {
this.currentIndex = index;
if(index>= (this.channelList.length -1) / 2 && this.channelList.length>=5){
this.$refs.navBar.scrollLeft = this.$refs.navBar.scrollLeft + window.document.body.clientWidth - 50;
}
},
handleToDetail(data){
this.$router.push({path:"/articleDetail",query:{id:1}})
},
loadTop() {
this.page = 1;
this.$store.dispatch('applyListPageAction',{path:this.$route.path,pars:this.page});
// 加载更多数据
this.getInitFunc();
this.$refs.loadmore.onTopLoaded();
},
loadBottom() {
// 加载更多数据
this.more(); // 上拉触发的分页查询
this.$refs.loadmore.onBottomLoaded();
},
isHaveMore: function(isHaveMore) {
// 是否还有下一页,如果没有就禁止上拉刷新
this.allLoaded = true; //true是禁止上拉加载
if(isHaveMore) {
this.allLoaded = false;
}
},
more: function() {
// 分页查询
this.page = parseInt(this.page) + 1;
this.$store.dispatch('applyListPageAction',{path:this.$route.path,pars:this.page});
this.getInitFunc(1);
},
},
mounted() {
......
This diff is collapsed.
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