|
|
|
@ -1,9 +1,36 @@ |
|
|
|
<template> |
|
|
|
<view class="news-list"> |
|
|
|
<view class="mainnav flex"> |
|
|
|
<view class="mainnav--item" :class="{'active': current === 1}" @click="changeNav(1)"> |
|
|
|
<text>资料库</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="mainnav--item" :class="{'active': current === 3}" @click="changeNav(3)"> |
|
|
|
<text>机构</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="mainnav--item" :class="{'active': current === 4}" @click="changeNav(4)"> |
|
|
|
<text>专家</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
<mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" |
|
|
|
:up="upOption"> |
|
|
|
<!-- 检测机构 --> |
|
|
|
<organ :active="currentNav" v-show="currentNav===3"></organ> |
|
|
|
<!-- 专家服务 --> |
|
|
|
<team :active="currentNav" v-show="currentNav===4"></team> |
|
|
|
|
|
|
|
<view class="contain"> |
|
|
|
<view class="contain" :active="currentNav" v-show="currentNav===1"> |
|
|
|
<view > |
|
|
|
<router-link |
|
|
|
:to="{path: '/bundle_b/pages/resource_search/resource_search'}"> |
|
|
|
<u-search disabled |
|
|
|
placeholder="请输入搜索内容" height="64" focus |
|
|
|
></u-search> |
|
|
|
</router-link> |
|
|
|
</view> |
|
|
|
<view > |
|
|
|
<!-- 城市 --> |
|
|
|
<router-link class="m-l-16 flex row-center city" to="/bundle_b/pages/city/city"> |
|
|
|
<text class="m-r-6">{{ cityInfo.name || '选择' }}</text> |
|
|
|
@ -11,6 +38,7 @@ |
|
|
|
<!-- <image class="icon-md m-l-30" src="/static/images/icon_news.png"> |
|
|
|
</image> --> |
|
|
|
</router-link> |
|
|
|
</view> |
|
|
|
<view class="banner"> |
|
|
|
<ad-swipers :pid="30" height="340rpx"> |
|
|
|
</ad-swipers> |
|
|
|
@ -55,6 +83,9 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import Organ from "../../components/components/organ.vue" |
|
|
|
import Team from "../../components/components/team.vue" |
|
|
|
|
|
|
|
import { |
|
|
|
mapGetters, |
|
|
|
mapActions |
|
|
|
@ -65,9 +96,15 @@ |
|
|
|
} from '@/api/store'; |
|
|
|
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins"; |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
Organ, |
|
|
|
Team |
|
|
|
}, |
|
|
|
mixins: [MescrollMixin], |
|
|
|
data() { |
|
|
|
return { |
|
|
|
current:1, |
|
|
|
currentNav:1, |
|
|
|
active: 0, |
|
|
|
upOption: { |
|
|
|
auto: false, |
|
|
|
@ -76,6 +113,7 @@ |
|
|
|
tip: "暂无数据", |
|
|
|
} |
|
|
|
}, |
|
|
|
cid:0, |
|
|
|
categoryList: [], |
|
|
|
newsList: [], |
|
|
|
type: -1, |
|
|
|
@ -87,11 +125,42 @@ |
|
|
|
uni.setNavigationBarTitle({ |
|
|
|
title: '资料库' |
|
|
|
}); |
|
|
|
this.cid = 0 |
|
|
|
this.current = 1 |
|
|
|
this.currentNav = 1 |
|
|
|
|
|
|
|
let queryString = uni.getStorageSync("params") |
|
|
|
uni.removeStorageSync("params") |
|
|
|
console.log("获取的参数:",queryString) |
|
|
|
if(queryString){ |
|
|
|
// 使用URLSearchParams类解析查询参数 |
|
|
|
const regex =/([^=&]+)=([^&]*)/g; |
|
|
|
let match, params = {}; |
|
|
|
|
|
|
|
while (match = regex.exec(queryString)) { |
|
|
|
params[match[1]] = match[2]; |
|
|
|
} |
|
|
|
|
|
|
|
// 使用get方法获取index和cate的值 |
|
|
|
let p_index = params['index']; |
|
|
|
let p_cate = params['cate']; |
|
|
|
|
|
|
|
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) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 选择城市后是否刷新 |
|
|
|
await this.downCallback(); |
|
|
|
}, |
|
|
|
|
|
|
|
async onLoad(options) { |
|
|
|
async onLoad() { |
|
|
|
|
|
|
|
this.type = 0; |
|
|
|
uni.setNavigationBarTitle({ |
|
|
|
title: '资料库' |
|
|
|
@ -103,6 +172,11 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
changeNav(index){ |
|
|
|
this.current = index |
|
|
|
this.currentNav = index |
|
|
|
console.log("此时数据:",this.currentNav) |
|
|
|
}, |
|
|
|
changeActive(e) { |
|
|
|
this.active = e; |
|
|
|
this.newsList = [] // 先置空列表,显示加载进度 |
|
|
|
@ -154,6 +228,7 @@ |
|
|
|
item = {id:"city_"+cityInfo.id,name:"本地"} |
|
|
|
} |
|
|
|
this.categoryList.push(item) |
|
|
|
|
|
|
|
if(isLogin){ |
|
|
|
item = {id:"my_buy",name:"我的购买"} |
|
|
|
this.categoryList.push(item) |
|
|
|
@ -161,6 +236,11 @@ |
|
|
|
item = {id:"my_download",name:"我的下载"} |
|
|
|
this.categoryList.push(item) |
|
|
|
} |
|
|
|
this.categoryList.forEach((item, index) => { |
|
|
|
if(this.cid>0 && item.id == this.cid){ |
|
|
|
this.active = index+1 |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
@ -170,7 +250,34 @@ |
|
|
|
}; |
|
|
|
</script> |
|
|
|
<style lang="scss"> |
|
|
|
|
|
|
|
.news-list { |
|
|
|
.mainnav { |
|
|
|
padding: 16rpx 150rpx; |
|
|
|
background-color: $-color-white; |
|
|
|
&--item { |
|
|
|
width: 150rpx; |
|
|
|
font-size: 32rpx; |
|
|
|
font-weight: 500; |
|
|
|
text-align: center; |
|
|
|
color: #BBBBBB; |
|
|
|
transition: all .2s linear; |
|
|
|
|
|
|
|
.new { |
|
|
|
width: 10rpx; |
|
|
|
height: 10rpx; |
|
|
|
border-radius: 50%; |
|
|
|
display: inline-block; |
|
|
|
margin-bottom: 24rpx; |
|
|
|
background-color: $-color-primary; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.active { |
|
|
|
color: #000000; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.main { |
|
|
|
.article-list { |
|
|
|
padding-top: 20rpx; |
|
|
|
@ -189,7 +296,7 @@ |
|
|
|
padding: 0; |
|
|
|
} |
|
|
|
.index-bg { |
|
|
|
background-image: url('../../static/images/index_bg.png'); |
|
|
|
background-image: url('https://cdn.ahbcqz.com/uploads/images/202307051615359ddc37211.png'); |
|
|
|
background-size: 100% auto; |
|
|
|
background-repeat: no-repeat; |
|
|
|
} |
|
|
|
@ -242,7 +349,7 @@ |
|
|
|
|
|
|
|
.city { |
|
|
|
position: absolute; |
|
|
|
top: 20rpx; |
|
|
|
top: 100rpx; |
|
|
|
z-index: 999; |
|
|
|
color: #fff; |
|
|
|
padding: 10rpx 15rpx; |
|
|
|
|