瀏覽代碼

Merge branch 'yb6.0'

Karsa 2 年之前
父節點
當前提交
3d00791e65
共有 14 個文件被更改,包括 204 次插入84 次删除
  1. 7 0
      api/user.js
  2. 6 6
      custom-tab-bar/index.wxml
  3. 1 1
      mixin/index.js
  4. 1 1
      pages-applyPermission/applyPermission.vue
  5. 13 18
      pages.json
  6. 1 0
      pages/pc.vue
  7. 58 0
      pages/pricedriven/pricedriven.vue
  8. 91 26
      pages/report/report.vue
  9. 二進制
      static/buy.png
  10. 二進制
      static/classify.png
  11. 二進制
      static/tabbar/price-s.png
  12. 二進制
      static/tabbar/price.png
  13. 25 31
      utils/config.js
  14. 1 1
      utils/request.js

+ 7 - 0
api/user.js

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

+ 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/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:''
         }
     },

+ 13 - 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
 			}
 		},
@@ -52,6 +53,12 @@
 			"style":{
 				"navigationBarTitleText": ""
 			}
+		},
+		{
+			"path": "pages/pricedriven/pricedriven",
+			"style":{
+				"navigationBarTitleText":"价格驱动"
+			}
 		}
 	],
 	"subPackages":[
@@ -248,21 +255,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",
@@ -270,12 +271,6 @@
 				"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": "问答",

+ 1 - 0
pages/pc.vue

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

+ 58 - 0
pages/pricedriven/pricedriven.vue

@@ -0,0 +1,58 @@
+<template>
+    <web-view :src="webviewLink" @message="handleGetMessage"/></web-view>
+</template>
+
+<script>
+import {h5BaseUrl} from '@/utils/config'
+import {apiGetSceneToParams} from '@/api/common'
+export default {
+    data () {
+        return {
+            url:'',
+				webviewLink:'',
+            msgObj:{}
+        }
+    },
+    onLoad(options) {
+        this.init(options)
+        
+    },
+	 onShow() {
+		this.webviewLink = `${this.url}&timestamp=${new Date().getTime()}#wechat_redirect`;
+	 },
+    onShareAppMessage() {
+        return {
+            title:this.msgObj.title,
+            path:`/pages/pricedriven/pricedriven?default_classify_first=${this.msgObj.default_classify_first}&default_classify_sub=${this.msgObj.default_classify_sub}`
+        }
+    },
+    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 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}`
+        },
+
+        handleGetMessage(e){
+            const data=e.detail.data[e.detail.data.length-1]
+            console.log('h5传来的数据',data);
+            this.msgObj=data
+        }
+    }
+    
+}
+</script>

+ 91 - 26
pages/report/report.vue

@@ -2,36 +2,35 @@
   <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>
+	
+	<!-- card -->
+	<view class="tab-card">
+		<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 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 :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>
-        <!-- <view class="item" @click="goClassify">
-          <image src="@/static/report-menu.png" mode="aspectFill"/>
-          <view>查看更多</view>
-        </view> -->
       </view>
       <view class="flex sub-type-box">
         <view 
@@ -88,6 +87,7 @@
 const moment=require('@/utils/moment-with-locales.min')
 moment.locale('zh-cn');
 import {apiReportIndexPageAuthList,apiReportIndexPageList} from '@/api/report'
+import { apiHomeTab } from '@/api/user.js';
 export default {
   filters: {
     getListTime(e){
@@ -115,12 +115,20 @@ export default {
       dateArr:[],
       page:1,
       pageSize:20,
-      finished:false
+      finished:false,
+	  
+		tabPathMap: new Map([
+			['report','/pages-report/classify'],
+			['chart','/pages/chart/chart'],
+			['buy','/pages/buy/buy'],
+		]),
+		tabCards: []
     }
   },
   onLoad(){ 
     this.initNavBar()
     this.getTopAuthList()
+	 this.getTopTab();
   },
   onShow() {
     uni.getSystemInfo({
@@ -167,10 +175,18 @@ 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)
       }
     },
+	 
+	/* 顶部tab */
+	 async getTopTab() {
+		const { code,data } = await apiHomeTab()
+		
+		if(code !== 200) return
+		this.tabCards = data;
+	 },
 
     //点击顶部一级分类
     handleClickTopFirst(item,index){
@@ -244,6 +260,18 @@ export default {
       }
     },
 
+	//跳转
+	linkPage({mark}) {
+		const url = this.tabPathMap.get(mark);
+		uni.navigateTo({ url,
+			fail () {
+			   uni.switchTab({
+				  url,
+			   })
+		   } 
+		})
+	},
+	
     // 跳转分类
     goClassify(){
       uni.navigateTo({ url: '/pages-report/classify' })
@@ -260,7 +288,7 @@ export default {
         url: '/pages/user/user',
         fail () {
           uni.switchTab({
-            url:'/pages/user/user'
+            url:'/pages/user/user',
           })
         }
       })
@@ -308,10 +336,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,13 +400,18 @@ movable-area{
     height:78rpx;
     border-radius: 50%;
     overflow: hidden;
-    margin-right: 15rpx;
+    margin-right: 30rpx;
   }
   .first-type-box{
     justify-content: space-between;
     .item{
+		 min-width: 120rpx;
       flex-shrink: 0;
       text-align: center;
+		padding: 16rpx 0;
+		text-align: center;
+		background-color: #F5F5F5;
+		border-radius: 8rpx;
       font-size: $global-font-size-sm;
       image{
         width: 100rpx;
@@ -378,6 +420,10 @@ movable-area{
         margin: 0 auto 15rpx auto;
       }
     }
+	 .act {
+		background: #FDF8F2;
+		color: #E3B377;
+	 }
   }
   .sub-type-box{
     margin-top: 40rpx;
@@ -494,4 +540,23 @@ movable-area{
   z-index: 50;
 }
 
+.tab-card {
+	display: flex;
+	padding:  40rpx 34rpx 20rpx;
+	align-items: center;
+	// justify-content: space-between;
+	.card-item {
+		margin-right: 40rpx;
+		&:last-child { margin-right: 0; }
+		.card-ico {
+			width: 100rpx;
+			height: 100rpx;
+			display: block;
+		}
+		.title {
+			text-align: center;
+		}
+	}
+}
+
 </style>

二進制
static/buy.png


二進制
static/classify.png


二進制
static/tabbar/price-s.png


二進制
static/tabbar/price.png


+ 25 - 31
utils/config.js

@@ -8,6 +8,7 @@ let pcBaseUrl=''//pc页面根路径
 if(env.envVersion==='develop'){//开发
     baseApiUrl='http://8.136.199.33:8612/api'
     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,45 +39,38 @@ 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: "activity",
-        pagePath: "pages/activity/activity",
-        text: "活动",
-        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: 'pricedriven',
+		pagePath: "pages/pricedriven/pricedriven",
+		text: "价格驱动",
+		iconPath: "../static/tabbar/price.png",
+		selectedIconPath: "../static/tabbar/price-s.png"
+	},
+    // {
+    //     key: "chart",
+    //     pagePath: "pages/chart/chart",
+    //     text: "图库",
+    //     iconPath: "../static/tabbar/chart.png",
+    //     selectedIconPath: "../static/tabbar/chart-s.png",
+    // },
     {
         key: "question",
         pagePath: "pages/question/question",
         text: "问答",
         iconPath: "../static/tabbar/question.png",
-        selectedIconPath: "../static/tabbar/question-s.png"
-    }
+        selectedIconPath: "../static/tabbar/question-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,
 			header:{
 				Authorization:store.state.user.token,
-				version:'yb5.0'
+				version:'yb8.0'
 			},
 			success(e) {
 				// 接口404