Browse Source

首页调整布局
价格驱动页面

Karsa 2 years ago
parent
commit
85cf5e14b0

+ 6 - 6
custom-tab-bar/index.wxml

@@ -1,6 +1,6 @@
-<view class="tab-bar">
-  <view wx:for="{{list}}" wx:key="index" class="tab-bar-item" data-path="{{item.pagePath}}" data-text="{{item.text}}" bindtap="switchTab">
-    <image class="icon" src="{{selected === item.pagePath ? item.selectedIconPath : item.iconPath}}"></image>
-    <view class="text" style="color: {{selected === item.pagePath ? selectedColor : color}}">{{item.text}}</view>
-  </view>
-</view>
+<cover-view class="tab-bar">
+  <cover-view wx:for="{{list}}" wx:key="index" class="tab-bar-item" data-path="{{item.pagePath}}" data-text="{{item.text}}" bindtap="switchTab">
+    <cover-image class="icon" src="{{selected === item.pagePath ? item.selectedIconPath : item.iconPath}}"></cover-image>
+    <cover-view class="text" style="color: {{selected === item.pagePath ? selectedColor : color}}">{{item.text}}</cover-view>
+  </cover-view>
+</cover-view>

+ 1 - 1
mixin/index.js

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

+ 1 - 1
pages-applyPermission/applyPermission.vue

@@ -78,7 +78,7 @@ export default {
                 tel: '',
                 permission: '',
             },
-            source:"",//来源 1-我的 2-活动 3-图库 4-研报 5-问答
+            source:"",//来源 1-我的 2-活动 3-图库 4-研报 5-问答 6价格驱动
             from_page:''
         }
     },

+ 19 - 18
pages.json

@@ -4,6 +4,7 @@
 			"path": "pages/report/report",
 			"style": {
 				"navigationBarTitleText": "FICC研报",
+				"navigationStyle": "custom",
 				"enablePullDownRefresh": true
 			}
 		},
@@ -17,7 +18,7 @@
 		{
 			"path": "pages/chart/chart",
 			"style": {
-				"navigationBarTitleText": "ETA图库",
+				"navigationBarTitleText": "图库",
 				"enablePullDownRefresh": true
 			}
 		},
@@ -51,6 +52,12 @@
 			"style":{
 				"navigationBarTitleText": ""
 			}
+		},
+		{
+			"path": "pages/pricedriven/pricedriven",
+			"style":{
+				"navigationBarTitleText":"价格驱动"
+			}
 		}
 	],
 	"subPackages":[
@@ -246,21 +253,15 @@
 		"list": [
 			{
 				"pagePath": "pages/report/report",
-				"text": "报告",
+				"text": "首页",
 				"iconPath": "./static/tabbar/report.png",
 				"selectedIconPath": "./static/tabbar/report-s.png"
 			},
 			{
-				"pagePath": "pages/buy/buy",
-				"text": "已购",
-				"iconPath": "./static/tabbar/buy.png",
-				"selectedIconPath": "./static/tabbar/buy-s.png"
-			},
-			{
-				"pagePath": "pages/chart/chart",
-				"text": "图库",
-				"iconPath": "./static/tabbar/chart.png",
-				"selectedIconPath": "./static/tabbar/chart-s.png"
+				"pagePath": "pages/pricedriven/pricedriven",
+				"text": "价格驱动",
+				"iconPath": "./static/tabbar/price.png",
+				"selectedIconPath": "./static/tabbar/price-s.png"
 			},
 			{
 				"pagePath": "pages/activity/activity",
@@ -268,17 +269,17 @@
 				"iconPath": "./static/tabbar/activity.png",
 				"selectedIconPath": "./static/tabbar/activity-s.png"
 			},
-			/* {
-				"pagePath": "pages/user/user",
-				"text": "我的",
-				"iconPath": "./static/tabbar/user.png",
-				"selectedIconPath": "./static/tabbar/user-s.png"
-			}, */
 			{
 				"pagePath": "pages/question/question",
 				"text": "问答",
 				"iconPath": "./static/tabbar/question.png",
 				"selectedIconPath": "./static/tabbar/question-s.png"
+			},
+			{
+				"pagePath": "pages/chart/chart",
+				"text": "图库",
+				"iconPath": "./static/tabbar/chart.png",
+				"selectedIconPath": "./static/tabbar/chart-s.png"
 			}
 		]
 	},

+ 55 - 0
pages/pricedriven/pricedriven.vue

@@ -0,0 +1,55 @@
+<template>
+    <web-view :src="url" @message="handleGetMessage"/></web-view>
+</template>
+
+<script>
+import {h5BaseUrl} from '@/utils/config'
+import {apiGetSceneToParams} from '@/api/common'
+export default {
+    data () {
+        return {
+            url:'',
+            msgObj:{}
+        }
+    },
+    onLoad(options) {
+        this.init(options)
+        
+    },
+    onShareAppMessage() {
+        return {
+            title:this.msgObj.title,
+            path:`/pages/pricedriven/pricedriven?reportId=${this.msgObj.reportId}`
+        }
+    },
+    methods: {
+        async init(options){
+            console.log('options',options);
+            if(options.scene){
+                const res=await apiGetSceneToParams({scene_key:options.scene})
+                if(res.code==200){
+                    console.log(res);
+                    const obj=JSON.parse(res.data)
+                    console.log(obj);
+                    options.default_classify_first=obj.default_classify_first
+						  options.default_classify_sub = obj.default_classify_sub
+                    console.log(options);
+                }
+            }
+
+            let default_classify_first=options.default_classify_first || ''
+				let default_classify_sub=options.default_classify_sub || ''
+            const timestamp=new Date().getTime()
+            const token=this.$store.state.user.token
+            this.url=`${h5BaseUrl}/hzyb/pricedriven/detail?default_classify_first=${default_classify_first}&default_classify_sub=${default_classify_sub}&token=${token}&timestamp=${timestamp}#wechat_redirect`
+        },
+
+        handleGetMessage(e){
+            const data=e.detail.data[e.detail.data.length-1]
+            console.log('h5传来的数据',data);
+            this.msgObj=data
+        }
+    }
+    
+}
+</script>

+ 109 - 24
pages/report/report.vue

@@ -2,36 +2,34 @@
   <view class="report-page">
     <view class="top-sticky" style="background: #fff">
     <!-- 导航 -->
-    <!-- <view class="nav-bar-wrap" :style="{height:navBarStyle.height,paddingTop:navBarStyle.paddingTop,paddingBottom:navBarStyle.paddingBottom}">
+    <view class="nav-bar-wrap" :style="{height:navBarStyle.height,paddingTop:navBarStyle.paddingTop,paddingBottom:navBarStyle.paddingBottom}">
       <view class="content">
+		  <view class="avatar" @click="goUser">
+			<image style="width:100%;height:100%;border-radius: 50%" :src="userInfo.head_img_url" mode="aspectFill"/>
+		  </view>
         <van-icon custom-class="search-icon" name="search" size="24px" @click="goSearch" />
         <view class="text">FICC研报</view>
       </view>
-    </view> -->
+    </view>
+	
+	<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>
+	</view>
+	
     <!-- 分类 -->
     <view class="type-wrap">
-      <view style="display:flex;align-items: center;margin-bottom: 20rpx;">
-        <view class="avatar" @click="goUser">
-          <image style="width:100%;height:100%" :src="userInfo.head_img_url" mode="aspectFill"/>
-        </view>
-        <view style="flex:1" @click="goSearch">
-          <van-search
-                shape="round"
-                disabled
-                placeholder="请输入报告标题或关键字"
-            />
-        </view>
-        
-      </view>
       <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>{{item.classify_name}}</view>
         </view>
-        <!-- <view class="item" @click="goClassify">
-          <image src="@/static/report-menu.png" mode="aspectFill"/>
-          <view>查看更多</view>
-        </view> -->
       </view>
       <view class="flex sub-type-box">
         <view 
@@ -115,7 +113,25 @@ export default {
       dateArr:[],
       page:1,
       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'
+		  },
+		],
+		tabCards: []
     }
   },
   onLoad(){ 
@@ -167,8 +183,9 @@ export default {
       if(res.code===200){
         this.authData.isBuy=res.data.check_flag
         this.authData.contactInfo=res.data.contact_info
-        this.topFirstList=res.data.permission_list
+        this.topFirstList=res.data.permission_list.slice(0,4)
         this.handleClickTopFirst(this.topFirstList[0],0)
+		  this.tabCards = res.data.check_flag ? this.sectionTabs : this.sectionTabs.slice(0,1)
       }
     },
 
@@ -244,6 +261,11 @@ export default {
       }
     },
 
+	//跳转
+	linkPage({url}) {
+		uni.navigateTo({ url })
+	},
+	
     // 跳转分类
     goClassify(){
       uni.navigateTo({ url: '/pages-report/classify' })
@@ -260,7 +282,7 @@ export default {
         url: '/pages/user/user',
         fail () {
           uni.switchTab({
-            url:'/pages/user/user'
+            url:'/pages/user/user',
           })
         }
       })
@@ -308,10 +330,19 @@ export default {
     height: 100%;
     .search-icon{
       position: absolute;
-      left: 34rpx;
+      left: 134rpx;
       top: 50%;
       transform: translateY(-50%);
     }
+	.avatar {
+		width: 60rpx;
+		height: 60rpx;
+		border-radius: 50%;
+		position: absolute;
+		left: 34rpx;
+		top: 50%;
+		transform: translateY(-50%);
+	}
   }
   
 }
@@ -363,7 +394,7 @@ movable-area{
     height:78rpx;
     border-radius: 50%;
     overflow: hidden;
-    margin-right: 15rpx;
+    margin-right: 30rpx;
   }
   .first-type-box{
     justify-content: space-between;
@@ -494,4 +525,58 @@ movable-area{
   z-index: 50;
 }
 
+.tab-card {
+	display: flex;
+	padding:  40rpx 34rpx 30rpx;
+	.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-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;
+			}
+		}
+	}
+}
+
 </style>

BIN
static/buy.png


BIN
static/classify.png


BIN
static/tabbar/price-s.png


BIN
static/tabbar/price.png


+ 17 - 23
utils/config.js

@@ -7,7 +7,8 @@ let h5BaseUrl=''// h5页面根路径
 let pcBaseUrl=''//pc页面根路径
 if(env.envVersion==='develop'){//开发
     baseApiUrl='http://8.136.199.33:8612/api'
-    h5BaseUrl='http://xcxh5test.hzinsights.com/xcx_h5'
+    // h5BaseUrl='http://xcxh5test.hzinsights.com/xcx_h5'
+	 h5BaseUrl='http://192.168.77.17:3000/xcx_h5'
     pcBaseUrl='https://ybpctest.hzinsights.com'
 }else if(env.envVersion==='trial'){//体验版
     baseApiUrl='http://8.136.199.33:8612/api'
@@ -38,24 +39,17 @@ const defaultTabBarListConfig=[
     {
         key: "report",
         pagePath: "pages/report/report",
-        text: "报告",
+        text: "首页",
         iconPath: "../static/tabbar/report.png",
         selectedIconPath: "../static/tabbar/report-s.png",
     },
-    {
-        key: "buy",
-        pagePath: "pages/buy/buy",
-        text: "已购",
-        iconPath: "../static/tabbar/buy.png",
-        selectedIconPath: "../static/tabbar/buy-s.png",
-    },
-    {
-        key: "chart",
-        pagePath: "pages/chart/chart",
-        text: "ETA图库",
-        iconPath: "../static/tabbar/chart.png",
-        selectedIconPath: "../static/tabbar/chart-s.png",
-    },
+	{
+		key: 'pricedriven',
+		pagePath: "pages/pricedriven/pricedriven",
+		text: "价格驱动",
+		iconPath: "../static/tabbar/price.png",
+		selectedIconPath: "../static/tabbar/price-s.png"
+	},
     {
         key: "activity",
         pagePath: "pages/activity/activity",
@@ -63,19 +57,19 @@ const defaultTabBarListConfig=[
         iconPath: "../static/tabbar/activity.png",
         selectedIconPath: "../static/tabbar/activity-s.png",
     },
-   /*  {
-        key: "user",
-        pagePath: "pages/user/user",
-        text: "我的",
-        iconPath: "../static/tabbar/user.png",
-        selectedIconPath: "../static/tabbar/user-s.png",
-    }, */
     {
         key: "question",
         pagePath: "pages/question/question",
         text: "问答",
         iconPath: "../static/tabbar/question.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",
     }
 ]
 

+ 1 - 1
utils/request.js

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