소스 검색

Merge branch 'master' into yx_1.0

bding 1 년 전
부모
커밋
89dcccba97
5개의 변경된 파일657개의 추가작업 그리고 212개의 파일을 삭제
  1. 22 0
      src/api/hzyb/report.js
  2. 497 202
      src/views/hzyb/chart/Detail.vue
  3. 33 4
      src/views/hzyb/chart/component/chartBox.vue
  4. 52 3
      src/views/hzyb/report/ChapterDetail.vue
  5. 53 3
      src/views/hzyb/report/Detail.vue

+ 22 - 0
src/api/hzyb/report.js

@@ -52,4 +52,26 @@ export const apiRddpShareImg=params=>{
  */
 export const apiReportPPtImgs=params=>{
     return get('/report/ppt_img',params)
+}
+
+/**
+ * banner埋点
+ * @param  "banner_url": "wwwwwwww",
+ * @param   "first_source": 1, //一级来源 1小程序移动 2小程序pc 3研报官网
+ * @param   "second_source": 1 //二级来源 1首页 2研报详情页
+ * @returns 
+ */
+export const apiPublicBannerMark = params=>{
+    return post('/public/banner/mark',params)
+}
+
+/**
+ * banner图列表
+ * @param  "banner_url": "wwwwwwww",
+ * @param   "first_source": 1, //一级来源 1小程序移动 2小程序pc 3研报官网
+ * @param   "second_source": 1 //二级来源 1首页 2研报详情页
+ * @returns 
+ */
+export const apiPublicBannerList = params=>{
+    return get('/public/banner/list',params)
 }

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 497 - 202
src/views/hzyb/chart/Detail.vue


+ 33 - 4
src/views/hzyb/chart/component/chartBox.vue

@@ -104,20 +104,27 @@ const chartDefaultOpts={
 }
 
 const props = defineProps({
-  options: Object
+  options: Object,
+	chartInfo: Object
 })
 import {ref,onMounted,watch,toRefs } from 'vue'
 import Highcharts from 'highcharts/highstock';
+import HighchartsMore from 'highcharts/highcharts-more';
 import HighchartszhCN  from '../../utils/highcahrts-zh_CN.js'
 HighchartszhCN(Highcharts)
+HighchartsMore(Highcharts);
 let chartIns=ref(null)// 图表实例
 onMounted(() => {
-	let obj={...chartDefaultOpts,...props.options}
+	let themeOptions = setThemeOptions();
+
+	console.log(themeOptions)
+
+	let obj={...chartDefaultOpts,...themeOptions,...props.options}
 	console.log(obj);
 	
 	//stock不支持线形图只支持时间图 某些用chart
 	let is_linear = props.options.series 
-			? props.options.series.every(_ => _.type === 'scatter') || props.options.series.some(_ => _.chartType === 'linear')
+			? props.options.series.some(_ => _.chartType === 'linear')
 			: false ;
 	chartIns.value = is_linear ? Highcharts.chart("chart-box",obj) : Highcharts.stockChart("chart-box",obj);
 })
@@ -134,12 +141,34 @@ const clickChartTopLabel=index=>{
 	}
 }
 
+    //主题色一些外层公用配置  目前只有绘图区和legend和colors
+const setThemeOptions = () => {
+	
+	if(!props.chartInfo.ChartThemeStyle) return {}
+
+	let chartTheme = JSON.parse(props.chartInfo.ChartThemeStyle)		
+	return {
+		legend: {
+			...chartDefaultOpts.legend,
+			...chartTheme.legendOptions
+		},
+		chart: {
+			...chartDefaultOpts.chart,
+			...chartTheme.drawOption
+		},
+		colors: chartTheme.colorsOptions
+	}
+}
+
 watch(
 	()=>props.options,
 	(nval)=>{
 		console.log('重绘');
+
+		let themeOptions = setThemeOptions();
+
 		let obj={}
-		obj={...chartDefaultOpts,...props.options}
+		obj={...chartDefaultOpts,...themeOptions,...props.options}
 		console.log(obj);
 		// update: function (options, redraw, oneToOne, animation)
 		// chartIns.value.update(obj,true)

+ 52 - 3
src/views/hzyb/report/ChapterDetail.vue

@@ -1,5 +1,12 @@
 <template>
 <van-pull-refresh v-model="loading" disabled style="min-height:100vh">
+  <div class="content-swipe" v-if="bannerDataList.length > 0">
+        <van-swipe class="my-swipe" :autoplay="4000" :show-indicators="false">
+            <van-swipe-item v-for="item in bannerDataList" :key="item.id" @click="bannerSwiperHandler(item)">
+                <img :src="item.image_url_mobile" />
+            </van-swipe-item>
+        </van-swipe>
+  </div>
   <div class="chapter-detail-page" v-if="info" :style="{paddingBottom:$store.state.hzyb.audioData.url&&'80px'}">
     <div :class="['main-box',!info.auth_ok&&'main-box-noauth']">
       <!-- <div class="title">【第{{info.report_chapter_item.stage}}期 | {{info.report_chapter_item.classify_name_first}}  | {{info.report_chapter_item.type_name}}】{{info.report_chapter_item.title}}</div> -->
@@ -146,13 +153,13 @@ import 'moment/dist/locale/zh-cn'
 moment.locale('zh-cn')
 import {addTokenToIframe} from '../utils/common'
 
-import {apiChapterDetail,apiChapterTickerValue,apiRddpShareImg,apiReportPPtImgs} from '@/api/hzyb/report'
+import {apiChapterDetail,apiChapterTickerValue,apiRddpShareImg,apiReportPPtImgs,apiPublicBannerMark,apiPublicBannerList} from '@/api/hzyb/report'
 import {apiApplyPermission,apiUserInfo,apiSetCollect,apiCancelCollect} from '@/api/hzyb/user'
-import {Popup,Image as VanImage,PullRefresh,Col, Row,Dialog,Toast} from 'vant'
+import {Popup,Image as VanImage,PullRefresh,Col, Row,Dialog,Toast,Swipe, SwipeItem} from 'vant'
 import AudioBox from './components/AudioBox.vue'
 import SharePoster from '../components/SharePoster.vue'
-import _ from 'lodash';
 import LeaveMessage from '../components/leaveMessage/index.vue'
+import _ from 'lodash';
 import collectIcon from '@/assets/hzyb/collect-icon.png'
 import collectIcons from '@/assets/hzyb/collect-icon-s.png'
 import reportCancel from './components/reportCancel.vue'
@@ -163,6 +170,8 @@ export default {
     [PullRefresh.name]:PullRefresh,
     [Col.name]:Col,
     [Row.name]:Row,
+    [Swipe.name]:Swipe,
+    [SwipeItem.name]:SwipeItem,
     [PullRefresh.name]:PullRefresh,
     [Dialog.name]:Dialog,
     AudioBox,
@@ -222,6 +231,7 @@ export default {
       collectIcons,
 
       isReportPublishCancel:false,//报告取消发布
+      bannerDataList:[]
     };
   },
   beforeCreate(){
@@ -234,6 +244,7 @@ export default {
     this.chapterId=this.$route.query.chapterId
     this.fromPage=this.$route.query.fromPage||''
     this.getDetail()
+    this.getBannerList()
   },
   mounted(){
         $(document).on('click', '.rich-content img',function(event) {
@@ -254,6 +265,26 @@ export default {
     window.removeEventListener('scroll',this.loadMoreHandle)
   },
   methods: {
+    // banner 获取列表
+    async getBannerList(){
+      const res = await apiPublicBannerList()
+          if(res.code ==200){
+            this.bannerDataList = res.data
+          }
+    },
+     // banner 点击事件
+    async bannerSwiperHandler(item){
+         const res = await apiPublicBannerMark({
+             first_source: 1, //一级来源 1小程序移动 2小程序pc 3研报官网
+             second_source: 2, //二级来源 1首页 2研报详情页
+             id:item.id
+         })
+         if(res.code===200){
+           wx.miniProgram.navigateTo({
+             url:"/pages-report/disseminatePage/disseminatePage?imgHb="+item.jump_url_mobile
+           })
+         }
+    },
     //背景音频播放报告音频
     handlePlayAudioBG(){
       wx.miniProgram.navigateTo({
@@ -928,4 +959,22 @@ export default {
   }
 
 }
+.content-swipe {
+    width: 100%;
+    padding: 30px 34px 0 34px;
+    .my-swipe {
+    width: 100%;
+    .van-swipe-item {
+     width: 100%;
+     height: auto;
+     overflow: hidden;
+    }
+    img {
+      object-fit: contain;
+      width: 100%;
+      height: 100%;
+    }
+  }
+}
+
 </style>

+ 53 - 3
src/views/hzyb/report/Detail.vue

@@ -1,5 +1,12 @@
 <template>
 <van-pull-refresh v-model="loading" disabled style="min-height:100vh">
+    <div class="content-swipe" v-if="bannerDataList.length > 0">
+        <van-swipe class="my-swipe" :autoplay="4000" :show-indicators="false">
+            <van-swipe-item v-for="item in bannerDataList" :key="item.id" @click="bannerSwiperHandler(item)">
+                <img :src="item.image_url_mobile" />
+            </van-swipe-item>
+        </van-swipe>
+    </div>
     <div class="report-detail-page" @click="closeAttention" v-if="info" :style="{paddingBottom:$store.state.hzyb.audioData.url&&'80px'}">
         <!-- 晨报、周报章节 -->
         <div class="chapter-list-wrap" v-if="['晨报','周报'].includes(info.report_info.classify_name_first)">
@@ -175,9 +182,9 @@ import 'moment/dist/locale/zh-cn'
 moment.locale('zh-cn')
 import {addTokenToIframe} from '../utils/common'
 
-import {apiReportDetail,apiRddpShareImg,apiReportPPtImgs} from '@/api/hzyb/report'
+import {apiReportDetail,apiRddpShareImg,apiReportPPtImgs,apiPublicBannerMark,apiPublicBannerList} from '@/api/hzyb/report'
 import {apiApplyPermission,apiUserInfo,apiSetCollect,apiCancelCollect} from '@/api/hzyb/user'
-import {Popup,Image as VanImage,PullRefresh,Dialog, Toast} from 'vant'
+import {Popup,Image as VanImage,PullRefresh,Dialog, Toast,Swipe, SwipeItem} from 'vant'
 import AudioBox from './components/AudioBox.vue'
 import SharePoster from '../components/SharePoster.vue'
 import _ from 'lodash';
@@ -191,6 +198,8 @@ export default {
         [Popup.name]:Popup,
         [VanImage.name]:VanImage,
         [PullRefresh.name]:PullRefresh,
+        [Swipe.name]:Swipe,
+        [SwipeItem.name]:SwipeItem,
         [Dialog.name]:Dialog,
         AudioBox,
         SharePoster,
@@ -244,6 +253,7 @@ export default {
 
             showAttention:false,//是否显示配置播放清单提示
             isReportPublishCancel:false,//报告取消发布
+            bannerDataList:[]
         }
     },
     beforeCreate(){
@@ -257,7 +267,8 @@ export default {
         this.fromPage = this.$route.query.fromPage || ''
         this.getDetail()
         this.getUserInfo()
-
+        this.getBannerList()
+        console.log(11111111);
     },
     mounted(){
         $(document).on('click', '.rich-content img',function(event) {
@@ -278,6 +289,27 @@ export default {
         window.removeEventListener('scroll',this.loadMoreHandle)
     },
     methods: {
+        // banner 获取列表
+        async getBannerList(){
+            console.log(112233333);
+            const res = await apiPublicBannerList()
+            if(res.code ===200){
+                this.bannerDataList = res.data
+            }
+        },
+        // banner 点击事件
+       async bannerSwiperHandler(item){
+            const res = await apiPublicBannerMark({
+                first_source: 1, //一级来源 1小程序移动 2小程序pc 3研报官网
+                second_source: 2, //二级来源 1首页 2研报详情页
+                id:item.id
+            })
+            if(res.code===200){
+              wx.miniProgram.navigateTo({
+                url:"/pages-report/disseminatePage/disseminatePage?imgHb="+item.jump_url_mobile
+              })
+            }
+        },
         // 点击开始播放周报的列表中的音频
         handlePlayWeekAudio(e){
             const arr=[]
@@ -1064,4 +1096,22 @@ export default {
         }
     }
 }
+.content-swipe {
+    width: 100%;
+    padding: 30px 34px 0 34px;
+    .my-swipe {
+    width: 100%;
+    .van-swipe-item {
+     width: 100%;
+     height: auto;
+     overflow: hidden;
+    }
+    img {
+      object-fit: contain;
+      width: 100%;
+      height: 100%;
+    }
+  }
+}
+
 </style>

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.