浏览代码

价格驱动

Karsa 2 年之前
父节点
当前提交
f7fcda5a8f
共有 8 个文件被更改,包括 78 次插入98 次删除
  1. 7 0
      api/user.js
  2. 1 1
      mixin/index.js
  3. 0 6
      pages.json
  4. 1 0
      pages/pc.vue
  5. 1 1
      pages/pricedriven/pricedriven.vue
  6. 52 74
      pages/report/report.vue
  7. 15 15
      utils/config.js
  8. 1 1
      utils/request.js

+ 7 - 0
api/user.js

@@ -9,6 +9,13 @@ export const apiWechatLogin=params=>{
 	return httpGet('/wechat/login',params)
 	return httpGet('/wechat/login',params)
 }
 }
 
 
+/**
+ * 顶部tab
+ */
+export const apiHomeTab = () => {
+	return httpGet('/user/get_top_tab')
+}
+
 /**
 /**
  * 获取用户tabbar权限
  * 获取用户tabbar权限
  */
  */

+ 1 - 1
mixin/index.js

@@ -5,7 +5,7 @@ moment.locale('zh-cn');
 import {globalImgUrls} from "../utils/config"
 import {globalImgUrls} from "../utils/config"
 import store from '@/store'
 import store from '@/store'
 
 
-const tabbarPathList=['pages/activity/activity','pages/pricedriven/pricedriven','pages/chart/chart','pages/report/report','pages/question/question']
+const tabbarPathList=['pages/activity/activity','pages/pricedriven/pricedriven','pages/report/report','pages/question/question']
 
 
 module.exports = {
 module.exports = {
   watch: {
   watch: {

+ 0 - 6
pages.json

@@ -274,12 +274,6 @@
 				"text": "问答",
 				"text": "问答",
 				"iconPath": "./static/tabbar/question.png",
 				"iconPath": "./static/tabbar/question.png",
 				"selectedIconPath": "./static/tabbar/question-s.png"
 				"selectedIconPath": "./static/tabbar/question-s.png"
-			},
-			{
-				"pagePath": "pages/chart/chart",
-				"text": "图库",
-				"iconPath": "./static/tabbar/chart.png",
-				"selectedIconPath": "./static/tabbar/chart-s.png"
 			}
 			}
 		]
 		]
 	},
 	},

+ 1 - 0
pages/pc.vue

@@ -8,6 +8,7 @@
 import {pcBaseUrl} from '../utils/config'
 import {pcBaseUrl} from '../utils/config'
 const mapObj=new Map([
 const mapObj=new Map([
     ['pages/activity/activity','/activity/list'],
     ['pages/activity/activity','/activity/list'],
+	 ['pages/pricedriven/pricedriven','/pricedriven'],
     ['pages-activity/detail','/activity/detail'],
     ['pages-activity/detail','/activity/detail'],
     ['pages/report/report','/report/index'],
     ['pages/report/report','/report/index'],
     ['pages-report/classify','/report/classify'],
     ['pages-report/classify','/report/classify'],

+ 1 - 1
pages/pricedriven/pricedriven.vue

@@ -19,7 +19,7 @@ export default {
     onShareAppMessage() {
     onShareAppMessage() {
         return {
         return {
             title:this.msgObj.title,
             title:this.msgObj.title,
-            path:`/pages/pricedriven/pricedriven?reportId=${this.msgObj.reportId}`
+            path:`/pages/pricedriven/pricedriven?default_classify_first=${this.msgObj.default_classify_first}&default_classify_sub=${this.msgObj.default_classify_sub}`
         }
         }
     },
     },
     methods: {
     methods: {

+ 52 - 74
pages/report/report.vue

@@ -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;
 		}
 		}
 	}
 	}
 }
 }

+ 15 - 15
utils/config.js

@@ -50,27 +50,27 @@ const defaultTabBarListConfig=[
 		iconPath: "../static/tabbar/price.png",
 		iconPath: "../static/tabbar/price.png",
 		selectedIconPath: "../static/tabbar/price-s.png"
 		selectedIconPath: "../static/tabbar/price-s.png"
 	},
 	},
-    {
-        key: "activity",
-        pagePath: "pages/activity/activity",
-        text: "活动",
-        iconPath: "../static/tabbar/activity.png",
-        selectedIconPath: "../static/tabbar/activity-s.png",
-    },
+    // {
+    //     key: "chart",
+    //     pagePath: "pages/chart/chart",
+    //     text: "图库",
+    //     iconPath: "../static/tabbar/chart.png",
+    //     selectedIconPath: "../static/tabbar/chart-s.png",
+    // },
     {
     {
         key: "question",
         key: "question",
         pagePath: "pages/question/question",
         pagePath: "pages/question/question",
         text: "问答",
         text: "问答",
         iconPath: "../static/tabbar/question.png",
         iconPath: "../static/tabbar/question.png",
-        selectedIconPath: "../static/tabbar/question-s.png"
+        selectedIconPath: "../static/tabbar/question-s.png",
     },
     },
-    {
-        key: "chart",
-        pagePath: "pages/chart/chart",
-        text: "图库",
-        iconPath: "../static/tabbar/chart.png",
-        selectedIconPath: "../static/tabbar/chart-s.png",
-    }
+	 {
+	     key: "activity",
+	     pagePath: "pages/activity/activity",
+	     text: "活动",
+	     iconPath: "../static/tabbar/activity.png",
+	     selectedIconPath: "../static/tabbar/activity-s.png",
+	 },
 ]
 ]
 
 
 
 

+ 1 - 1
utils/request.js

@@ -95,7 +95,7 @@ const http=(url,params,method)=>{
 			method:method,
 			method:method,
 			header:{
 			header:{
 				Authorization:store.state.user.token,
 				Authorization:store.state.user.token,
-				version:'yb6.0'
+				version:'yb8.0'
 			},
 			},
 			success(e) {
 			success(e) {
 				// 接口404
 				// 接口404