|
@@ -1,7 +1,9 @@
|
|
|
<script setup>
|
|
|
import chartBox from './component/chartBox.vue'
|
|
|
+import noAuth from './component/noAuth.vue'
|
|
|
+import sharePoster from '../components/SharePoster.vue'
|
|
|
import { Popup, Toast,Picker } from 'vant';
|
|
|
-import {ref,onMounted, reactive, watch} from 'vue'
|
|
|
+import {ref,onMounted, reactive, watch,computed} from 'vue'
|
|
|
import {useRoute, useRouter,onBeforeRouteUpdate} from 'vue-router'
|
|
|
import moment from 'moment'
|
|
|
import Highcharts from 'highcharts/highstock';
|
|
@@ -156,6 +158,8 @@ const chartItemStyleArr = ref([
|
|
|
{ label: '散点图', key: 5 ,value: 'scatter'}
|
|
|
])//组合图配置时可选类型
|
|
|
|
|
|
+let noauth=ref(false)
|
|
|
+let noAuthData=ref(null)
|
|
|
// 如果type:init 则是初始化获取数据
|
|
|
const getChartInfo=async (type)=>{
|
|
|
// resData.value=null
|
|
@@ -195,6 +199,24 @@ const getChartInfo=async (type)=>{
|
|
|
|
|
|
setSeasonOpt(res.data.EdbInfoList[0])
|
|
|
}
|
|
|
+
|
|
|
+ // 向小程序发送分享数据
|
|
|
+ let postData = {
|
|
|
+ params:{
|
|
|
+ chartInfoId:ChartInfoId,
|
|
|
+ searchVal:decodeURIComponent(route.query.searchVal)||'',
|
|
|
+ MyChartId:route.query.MyChartId||'',
|
|
|
+ MyChartClassifyId:route.query.MyChartClassifyId||'',
|
|
|
+ },
|
|
|
+ title: res.data.ChartInfo.ChartName,
|
|
|
+ shareImg:res.data.ChartInfo.ChartImage
|
|
|
+ };
|
|
|
+ wx.miniProgram.postMessage({ data: postData });
|
|
|
+
|
|
|
+
|
|
|
+ }else if(res.code==403){
|
|
|
+ noauth.value=true
|
|
|
+ noAuthData.value=res.data
|
|
|
}
|
|
|
}
|
|
|
getChartInfo('init')
|
|
@@ -702,7 +724,7 @@ const handleGoSearch=()=>{
|
|
|
}
|
|
|
|
|
|
// 获取当前图表
|
|
|
-let searchVal=route.query.searchVal
|
|
|
+let searchVal=decodeURIComponent(route.query.searchVal)
|
|
|
let searchListData=ref([])//搜索的数据
|
|
|
const getSearchListData=async ()=>{
|
|
|
const res=await apiChartList({Keywords:searchVal,Page:1,Limit:10000,Authorization:route.query.token})
|
|
@@ -914,10 +936,31 @@ const pageTouchmove=(e)=>{
|
|
|
|
|
|
event.preventDefault();//阻止页面移动
|
|
|
}
|
|
|
+
|
|
|
+// 生成海报所需跳转到小程序页面参数
|
|
|
+const code_scene=computed(()=>{
|
|
|
+ let obj= {
|
|
|
+ chartInfoId:ChartInfoId,
|
|
|
+ searchVal:decodeURIComponent(route.query.searchVal)||'',
|
|
|
+ MyChartId:route.query.MyChartId||'',
|
|
|
+ MyChartClassifyId:route.query.MyChartClassifyId||'',
|
|
|
+ from:'share'
|
|
|
+ }
|
|
|
+ return JSON.stringify(obj)
|
|
|
+})
|
|
|
+// 生成海报图片所需要的数据
|
|
|
+const posterParams=computed(()=>{
|
|
|
+ return {
|
|
|
+ chart_name:resData.value.ChartInfo.ChartName,
|
|
|
+ chart_image:resData.value.ChartInfo.ChartImage
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
- <div class="chart-detail" v-if="!loading">
|
|
|
+ <div class="chart-detail" v-if="!loading&&!noauth">
|
|
|
<div class="chart-title">{{resData.ChartInfo.ChartName}}</div>
|
|
|
<div class="top-box">
|
|
|
<div class="flex calendar-box" style="float:left" @click="handleShowDate">
|
|
@@ -927,6 +970,14 @@ const pageTouchmove=(e)=>{
|
|
|
<span class="date">{{endDate||'结束日期'}}</span>
|
|
|
</div>
|
|
|
<img class="icon" src="../../../assets/hzyb/chart/search.png" alt="" @click="handleGoSearch">
|
|
|
+ <share-poster
|
|
|
+ :shareData="{
|
|
|
+ type:'chart_detail',
|
|
|
+ code_scene:code_scene,
|
|
|
+ code_page:'pages-chart/chartDetail',
|
|
|
+ data:posterParams
|
|
|
+ }"
|
|
|
+ ></share-poster>
|
|
|
<img class="icon" src="../../../assets/hzyb/chart/save.png" alt="" @click="handleSaveChart" v-if="canSave">
|
|
|
<img class="icon" src="../../../assets/hzyb/chart/refresh.png" alt="" @click="handleRefreshChart">
|
|
|
</div>
|
|
@@ -934,13 +985,14 @@ const pageTouchmove=(e)=>{
|
|
|
<chartBox :options='chartData' v-if="!loading"></chartBox>
|
|
|
|
|
|
<div class="flex source-box">
|
|
|
- <span>来源:弘则研究</span>
|
|
|
- <div class="season-change-box" v-if="resData&&resData.ChartInfo.ChartType===2">
|
|
|
+ <div :style="{flex:resData&&resData.ChartInfo.ChartType===2?1:2}"><span v-if="resData&&resData.ChartInfo.ChartType!==2">来源:{{resData&&resData.ChartInfo.ChartSource}}</span></div>
|
|
|
+ <div class="season-change-box" style="flex:1" v-if="resData&&resData.ChartInfo.ChartType===2">
|
|
|
<span :class="calendarType==='农历'&&'active'" @click="calendarTypeChange('农历')">农历</span>
|
|
|
<span :class="calendarType==='公历'&&'active'" @click="calendarTypeChange('公历')">公历</span>
|
|
|
</div>
|
|
|
- <span style="color:#E3B377" @click="showLimit=true">上下限设置</span>
|
|
|
+ <span style="color:#E3B377;flex:1;text-align:right" @click="showLimit=true">上下限设置</span>
|
|
|
</div>
|
|
|
+ <div class="source-box" style="margin-top:5px" v-if="resData&&resData.ChartInfo.ChartType===2">来源:{{resData&&resData.ChartInfo.ChartSource}}</div>
|
|
|
|
|
|
<!-- 日期类型 -->
|
|
|
<div class="date-type-box" v-if="resData&&sameOptionType.includes(resData.ChartInfo.ChartType)">
|
|
@@ -973,6 +1025,7 @@ const pageTouchmove=(e)=>{
|
|
|
|
|
|
<!-- 上一张下一张图切换 -->
|
|
|
<div
|
|
|
+ v-if="$route.query.from!='share'"
|
|
|
class="change-page-wrap"
|
|
|
:style="{left:pageBoxPosition.left+'px',top:pageBoxPosition.top+'px'}"
|
|
|
@touchmove.stop="pageTouchmove"
|
|
@@ -1030,8 +1083,8 @@ const pageTouchmove=(e)=>{
|
|
|
</div>
|
|
|
</Popup>
|
|
|
</div>
|
|
|
-
|
|
|
-
|
|
|
+ <!-- 无权限 -->
|
|
|
+ <noAuth v-if="noauth" :data="noAuthData"></noAuth>
|
|
|
|
|
|
</template>
|
|
|
|
|
@@ -1073,7 +1126,7 @@ const pageTouchmove=(e)=>{
|
|
|
float: right;
|
|
|
width: 40px;
|
|
|
height: 40px;
|
|
|
- margin-left: 50px;
|
|
|
+ margin-left: 30px;
|
|
|
}
|
|
|
}
|
|
|
.select-date-box-head{
|