|
@@ -12,22 +12,23 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
+ <!-- card -->
|
|
<view class="tab-card">
|
|
<view class="tab-card">
|
|
- <view :class="['card-item',tab.class]" v-for="(tab,index) in tabCards" :key="index" :style="'width:' + 100/tabCards.length +'%'">
|
|
|
|
- <view class="title">{{tab.title}}</view>
|
|
|
|
- <view class="sub-title">{{tab.sub_tit}}</view>
|
|
|
|
- <view class="card-bot">
|
|
|
|
- <view class="look-ico" @click="linkPage(tab)">去查看</view>
|
|
|
|
- <image class="section-ico" :src="tab.ico" mode="aspectFill" />
|
|
|
|
- </view>
|
|
|
|
|
|
+ <view
|
|
|
|
+ class="card-item"
|
|
|
|
+ v-for="(tab,index) in tabCards"
|
|
|
|
+ :key="index"
|
|
|
|
+ @click="linkPage(tab)"
|
|
|
|
+ >
|
|
|
|
+ <image :src="tab.icon" mode="aspectFill" class="card-ico"/>
|
|
|
|
+ <view class="title">{{tab.tab}}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
<!-- 分类 -->
|
|
<!-- 分类 -->
|
|
<view class="type-wrap">
|
|
<view class="type-wrap">
|
|
<view class="flex first-type-box">
|
|
<view class="flex first-type-box">
|
|
- <view class="item" v-for="(item,index) in topFirstList" :key="item.classify_name" @click="handleClickTopFirst(item,index)">
|
|
|
|
- <image :src="selectTopFirstId==item.classify_name?item.select_icon_url:item.icon_url" mode="aspectFill"/>
|
|
|
|
|
|
+ <view :class="['item',{ act: selectTopFirstId==item.classify_name }]" v-for="(item,index) in topFirstList" :key="item.classify_name" @click="handleClickTopFirst(item,index)">
|
|
<view>{{item.classify_name}}</view>
|
|
<view>{{item.classify_name}}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -86,6 +87,7 @@
|
|
const moment=require('@/utils/moment-with-locales.min')
|
|
const moment=require('@/utils/moment-with-locales.min')
|
|
moment.locale('zh-cn');
|
|
moment.locale('zh-cn');
|
|
import {apiReportIndexPageAuthList,apiReportIndexPageList} from '@/api/report'
|
|
import {apiReportIndexPageAuthList,apiReportIndexPageList} from '@/api/report'
|
|
|
|
+import { apiHomeTab } from '@/api/user.js';
|
|
export default {
|
|
export default {
|
|
filters: {
|
|
filters: {
|
|
getListTime(e){
|
|
getListTime(e){
|
|
@@ -115,28 +117,18 @@ export default {
|
|
pageSize:20,
|
|
pageSize:20,
|
|
finished:false,
|
|
finished:false,
|
|
|
|
|
|
- sectionTabs: [
|
|
|
|
- {
|
|
|
|
- title:'研报',
|
|
|
|
- sub_tit: '查看全部报告分类',
|
|
|
|
- ico: require('@/static/classify.png'),
|
|
|
|
- class: 'section-report',
|
|
|
|
- url: '/pages-report/classify'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title:'已购',
|
|
|
|
- sub_tit: '查看我的研报资产',
|
|
|
|
- ico: require('@/static/buy.png'),
|
|
|
|
- class: 'section-buy',
|
|
|
|
- url: '/pages/buy/buy'
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
|
|
+ tabPathMap: new Map([
|
|
|
|
+ ['report','/pages-report/classify'],
|
|
|
|
+ ['chart','/pages/chart/chart'],
|
|
|
|
+ ['buy','/pages/buy/buy'],
|
|
|
|
+ ]),
|
|
tabCards: []
|
|
tabCards: []
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad(){
|
|
onLoad(){
|
|
this.initNavBar()
|
|
this.initNavBar()
|
|
this.getTopAuthList()
|
|
this.getTopAuthList()
|
|
|
|
+ this.getTopTab();
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
uni.getSystemInfo({
|
|
uni.getSystemInfo({
|
|
@@ -185,9 +177,16 @@ export default {
|
|
this.authData.contactInfo=res.data.contact_info
|
|
this.authData.contactInfo=res.data.contact_info
|
|
this.topFirstList=res.data.permission_list.slice(0,4)
|
|
this.topFirstList=res.data.permission_list.slice(0,4)
|
|
this.handleClickTopFirst(this.topFirstList[0],0)
|
|
this.handleClickTopFirst(this.topFirstList[0],0)
|
|
- this.tabCards = res.data.check_flag ? this.sectionTabs : this.sectionTabs.slice(0,1)
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+ /* 顶部tab */
|
|
|
|
+ async getTopTab() {
|
|
|
|
+ const { code,data } = await apiHomeTab()
|
|
|
|
+
|
|
|
|
+ if(code !== 200) return
|
|
|
|
+ this.tabCards = data;
|
|
|
|
+ },
|
|
|
|
|
|
//点击顶部一级分类
|
|
//点击顶部一级分类
|
|
handleClickTopFirst(item,index){
|
|
handleClickTopFirst(item,index){
|
|
@@ -262,8 +261,15 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
//跳转
|
|
//跳转
|
|
- linkPage({url}) {
|
|
|
|
- uni.navigateTo({ url })
|
|
|
|
|
|
+ linkPage({mark}) {
|
|
|
|
+ const url = this.tabPathMap.get(mark);
|
|
|
|
+ uni.navigateTo({ url,
|
|
|
|
+ fail () {
|
|
|
|
+ uni.switchTab({
|
|
|
|
+ url,
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
|
|
|
|
// 跳转分类
|
|
// 跳转分类
|
|
@@ -399,8 +405,13 @@ movable-area{
|
|
.first-type-box{
|
|
.first-type-box{
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|
|
.item{
|
|
.item{
|
|
|
|
+ min-width: 120rpx;
|
|
flex-shrink: 0;
|
|
flex-shrink: 0;
|
|
text-align: center;
|
|
text-align: center;
|
|
|
|
+ padding: 16rpx 0;
|
|
|
|
+ text-align: center;
|
|
|
|
+ background-color: #F5F5F5;
|
|
|
|
+ border-radius: 8rpx;
|
|
font-size: $global-font-size-sm;
|
|
font-size: $global-font-size-sm;
|
|
image{
|
|
image{
|
|
width: 100rpx;
|
|
width: 100rpx;
|
|
@@ -409,6 +420,10 @@ movable-area{
|
|
margin: 0 auto 15rpx auto;
|
|
margin: 0 auto 15rpx auto;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ .act {
|
|
|
|
+ background: #FDF8F2;
|
|
|
|
+ color: #E3B377;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
.sub-type-box{
|
|
.sub-type-box{
|
|
margin-top: 40rpx;
|
|
margin-top: 40rpx;
|
|
@@ -527,54 +542,17 @@ movable-area{
|
|
|
|
|
|
.tab-card {
|
|
.tab-card {
|
|
display: flex;
|
|
display: flex;
|
|
- padding: 40rpx 34rpx 30rpx;
|
|
|
|
|
|
+ padding: 40rpx 34rpx 20rpx;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: space-between;
|
|
.card-item {
|
|
.card-item {
|
|
- height: 207rpx;
|
|
|
|
- border-radius: 16rpx;
|
|
|
|
- padding: 20rpx;
|
|
|
|
- .title {
|
|
|
|
- font-size: 34rpx;
|
|
|
|
- font-weight: 600;
|
|
|
|
- }
|
|
|
|
- .sub-title {
|
|
|
|
- margin: 10rpx 0 16rpx;
|
|
|
|
- color: #666;
|
|
|
|
|
|
+ .card-ico {
|
|
|
|
+ width: 100rpx;
|
|
|
|
+ height: 100rpx;
|
|
|
|
+ display: block;
|
|
}
|
|
}
|
|
- .card-bot {
|
|
|
|
- display: flex;
|
|
|
|
- .look-ico {
|
|
|
|
- width: 180rpx;
|
|
|
|
- height: 50rpx;
|
|
|
|
- line-height: 50rpx;
|
|
|
|
- border-radius: 50rpx;
|
|
|
|
- text-align: center;
|
|
|
|
- margin-right: 50rpx;
|
|
|
|
- }
|
|
|
|
- .section-ico {
|
|
|
|
- width: 45rpx;
|
|
|
|
- height: 45rpx;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- &.section-report {
|
|
|
|
- background-color: #FFF7EB;
|
|
|
|
- .title {
|
|
|
|
- color: #E3B377;
|
|
|
|
- }
|
|
|
|
- .look-ico {
|
|
|
|
- background-color: #E3B377;
|
|
|
|
- color: #fff;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- &.section-buy {
|
|
|
|
- background-color: #ECF1FD;
|
|
|
|
- margin-left: 20rpx;
|
|
|
|
- .title {
|
|
|
|
- color: #333;
|
|
|
|
- }
|
|
|
|
- .look-ico {
|
|
|
|
- background-color: #DEE9FB;
|
|
|
|
- color: #487EFC;
|
|
|
|
- }
|
|
|
|
|
|
+ .title {
|
|
|
|
+ text-align: center;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|