|
|
|
@ -53,7 +53,7 @@ |
|
|
|
<router-link :to="{path: '/bundle/pages/resource_details/resource_details', query: {id: item.id, type}}"> |
|
|
|
<view class="flex col-top"> |
|
|
|
<view class="info flex-1"> |
|
|
|
<view class="title lg line-2 m-b-20">{{ item.title }}</view> |
|
|
|
<view class="title lg line-2 m-b-20" style="-webkit-line-clamp:1">{{ item.title }}</view> |
|
|
|
<view class="lighter line-2"> |
|
|
|
<view>{{ item.intro }}</view> |
|
|
|
</view> |
|
|
|
@ -117,11 +117,15 @@ |
|
|
|
categoryList: [], |
|
|
|
newsList: [], |
|
|
|
type: -1, |
|
|
|
cate_type:0, |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
|
async onShow() { |
|
|
|
console.log(111) |
|
|
|
this.categoryList = [], |
|
|
|
this.type = 0; |
|
|
|
this.cate_type = 0; |
|
|
|
uni.setNavigationBarTitle({ |
|
|
|
title: '资料库' |
|
|
|
}); |
|
|
|
@ -144,14 +148,27 @@ |
|
|
|
// 使用get方法获取index和cate的值 |
|
|
|
let p_index = params['index']; |
|
|
|
let p_cate = params['cate']; |
|
|
|
let cate_type = params['cate_type']; |
|
|
|
|
|
|
|
if(p_index !=undefined && p_index!=""){ |
|
|
|
this.current = parseInt(p_index) |
|
|
|
this.currentNav = parseInt(p_index) |
|
|
|
} |
|
|
|
|
|
|
|
if(p_cate !=undefined && p_cate!=""){ |
|
|
|
this.cid = parseInt(p_cate) |
|
|
|
} |
|
|
|
|
|
|
|
if(cate_type !=undefined && cate_type!=""){ |
|
|
|
this.cate_type = parseInt(cate_type) |
|
|
|
this.active = 0 |
|
|
|
if(this.cate_type == 1){ |
|
|
|
uni.setNavigationBarTitle({ |
|
|
|
title: '全国案例' |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -167,7 +184,7 @@ |
|
|
|
}); |
|
|
|
console.log(11111) |
|
|
|
// 选择城市后是否刷新 |
|
|
|
await this.downCallback(); |
|
|
|
// await this.downCallback(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
@ -188,13 +205,12 @@ |
|
|
|
}, |
|
|
|
upCallback(page) { |
|
|
|
const { type, active, categoryList } = this |
|
|
|
console.log(categoryList,11222) |
|
|
|
console.log(categoryList[active-1],22333) |
|
|
|
getResourceList({ |
|
|
|
type: this.type, |
|
|
|
cid: this.active ? categoryList[active-1].id : '', |
|
|
|
page_size:page.size, |
|
|
|
page_no:page.num |
|
|
|
page_no:page.num, |
|
|
|
cate_type: this.cate_type, |
|
|
|
}).then(({ |
|
|
|
data |
|
|
|
}) => { |
|
|
|
@ -210,6 +226,8 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
async getCategoryListFun() { |
|
|
|
this.categoryList = []; |
|
|
|
console.log("当前分类",this.categoryList) |
|
|
|
let { |
|
|
|
cityInfo, |
|
|
|
isLogin |
|
|
|
@ -218,16 +236,21 @@ |
|
|
|
code, |
|
|
|
data |
|
|
|
} = await getResourceCategoryList({ |
|
|
|
type: this.type |
|
|
|
cate_type: this.cate_type, |
|
|
|
}) |
|
|
|
|
|
|
|
if (code == 1) { |
|
|
|
this.categoryList = data |
|
|
|
} |
|
|
|
let item = {id:0,name:"全国"} |
|
|
|
if(cityInfo.id !=null && cityInfo.id!=undefined && cityInfo.id>0){ |
|
|
|
item = {id:"city_"+cityInfo.id,name:"本地"} |
|
|
|
let item = {} |
|
|
|
|
|
|
|
if(this.cate_type == 0){ |
|
|
|
let item = {id:0,name:"全国"} |
|
|
|
if(cityInfo.id !=null && cityInfo.id!=undefined && cityInfo.id>0){ |
|
|
|
item = {id:"city_"+cityInfo.id,name:"本地"} |
|
|
|
} |
|
|
|
this.categoryList.push(item) |
|
|
|
} |
|
|
|
this.categoryList.push(item) |
|
|
|
|
|
|
|
if(isLogin){ |
|
|
|
item = {id:"my_buy",name:"我的购买"} |
|
|
|
@ -236,6 +259,14 @@ |
|
|
|
item = {id:"my_download",name:"我的下载"} |
|
|
|
this.categoryList.push(item) |
|
|
|
} |
|
|
|
this.$nextTick(() => { |
|
|
|
// 在DOM更新之后使用Vue.set来更新数组 |
|
|
|
this.categoryList.forEach((item, index) => { |
|
|
|
this.$set(this.categoryList, index, item); |
|
|
|
}); |
|
|
|
}); |
|
|
|
console.log("后续值",this.categoryList) |
|
|
|
console.log("后续值2",this.cid) |
|
|
|
this.categoryList.forEach((item, index) => { |
|
|
|
if(this.cid>0 && item.id == this.cid){ |
|
|
|
this.active = index+1 |
|
|
|
|