ChapterDetail.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460
  1. <script setup>
  2. import {ref,onMounted} from 'vue'
  3. import {apiChapterDetail,apiChapterTickerValue} from '@/api/report'
  4. import {apiApplyPermission} from '@/api/user'
  5. import {apiGetWechatQRCode} from '@/api/common'
  6. import { ElMessageBox } from 'element-plus'
  7. import moment from 'moment';
  8. import AudioBox from './components/AudioBox.vue'
  9. import { useRoute, useRouter } from 'vue-router';
  10. const route=useRoute()
  11. const router=useRouter()
  12. let chapterId=ref(route.query.chapterId||'') //章节id
  13. let frompage=ref(route.query.frompage||'')//如果来自报告详情页 则展示底部章节列表
  14. //获取晨报中指标数据
  15. let tickerInfo=ref(null)
  16. let tickerHead=ref([])
  17. const getTickerValue=async ()=>{
  18. const res=await apiChapterTickerValue({report_chapter_id:Number(this.chapterId)})
  19. if(res.code===200){
  20. if(!res.data||!res.data.list) return
  21. tickerInfo.value=res.data
  22. if(res.data.ticker_title.report_chapter_type_id===17){
  23. tickerHead.value=[
  24. {
  25. label:res.data.ticker_title.ticker_title,
  26. key:'base_column_name'
  27. },
  28. {
  29. label:'公布日期',
  30. key:'date'
  31. },
  32. {
  33. label:'最新值',
  34. key:'ticker_value'
  35. },
  36. {
  37. label:'上期值',
  38. key:'last_value'
  39. }
  40. ]
  41. }else{
  42. tickerHead.value=[
  43. {
  44. label:res.data.ticker_title.ticker_title,
  45. key:'base_column_name'
  46. },
  47. {
  48. label:res.data.list[0].date,
  49. key:'ticker_value'
  50. },
  51. {
  52. label:'当日涨跌',
  53. key:'dd_value'
  54. },
  55. {
  56. label:'一周涨跌',
  57. key:'ww_value'
  58. },
  59. {
  60. label:'一月涨跌',
  61. key:'mm_value'
  62. }
  63. ]
  64. }
  65. }
  66. }
  67. // 获取章节报告详情
  68. let info=ref(null)
  69. let audioData=ref(null)
  70. const getChapterReportDetail=async ()=>{
  71. const res=await apiChapterDetail({
  72. report_chapter_id:Number(chapterId.value)
  73. })
  74. if(res.code===200){
  75. info.value=res.data
  76. audioData.value={
  77. auth_ok:res.data.auth_ok,
  78. video_name:res.data.report_chapter_item.video_name,
  79. video_size:res.data.report_chapter_item.video_size,
  80. video_play_seconds:res.data.report_chapter_item.video_play_seconds,
  81. video_url:res.data.report_chapter_item.video_url,
  82. reportId:res.data.report_chapter_item.report_chapter_id+res.data.report_chapter_item.report_id
  83. }
  84. document.title=res.data.report_chapter_item.classify_name_first
  85. if(res.data.auth_ok&&res.data.report_chapter_item.classify_name_first==='晨报'){
  86. getTickerValue()
  87. }
  88. // 获取详情如果为联系销售根据判断条件是否主动申请一次
  89. if(!res.data.auth_ok){
  90. if(info.value.permission_check.type=='contact'&&!info.value.permission_check.customer_info.has_apply){
  91. if(info.value.permission_check.customer_info.status=='冻结'||(info.value.permission_check.customer_info.status=='试用'&&info.value.permission_check.customer_info.is_suspend==1)){
  92. apiApplyPermission({
  93. company_name:info.value.permission_check.customer_info.company_name,
  94. real_name:info.value.permission_check.customer_info.name,
  95. source:4,
  96. from_page:'报告详情'
  97. }).then(res=>{
  98. if(res.code===200){
  99. console.log('主动申请成功');
  100. }
  101. })
  102. }
  103. }
  104. }
  105. //向小程序发送分享数据
  106. const postData={
  107. path:'/pages-report/chapterDetail',
  108. params:{
  109. chapterId:chapterId.value
  110. },
  111. title:`FICC【${res.data.report_chapter_item.classify_name_first}】`,
  112. shareImg:''
  113. }
  114. wx.miniProgram.postMessage({ data: postData })
  115. }
  116. }
  117. getChapterReportDetail()
  118. //点击底部切换章节
  119. const handleChangeChapter=(item)=>{
  120. chapterId.value=item.report_chapter_id
  121. document.body.scrollTop=document.documentElement.scrollTop=0
  122. getChapterReportDetail()
  123. }
  124. // 获取小程序码
  125. let QRCodeImg=ref('')
  126. const getQRCodeImg=async ()=>{
  127. const res=await apiGetWechatQRCode({
  128. CodeScene:JSON.stringify({chapterId:chapterId.value}),
  129. CodePage:'pages-report/chapterDetail'
  130. })
  131. if(res.code===200){
  132. QRCodeImg.value=res.data
  133. }
  134. }
  135. getQRCodeImg()
  136. let preViewImgs=ref([])
  137. let preViewImgIndex=ref(0)
  138. let showPreViewImg=ref(false)
  139. onMounted(()=>{
  140. $(document).on('click', '.rich-content img',function(event) {
  141. let imgArray = [];
  142. let curImageSrc = $(this).attr('src');
  143. let oParent = $(this).parent();
  144. if (curImageSrc && !oParent.attr('href')) {
  145. if(preViewImgs.value.length===0){
  146. $('.rich-content img').each(function(index, el) {
  147. let itemSrc = $(this).attr('src');
  148. imgArray.push(itemSrc);
  149. });
  150. preViewImgs.value=imgArray
  151. }
  152. preViewImgIndex.value=preViewImgs.value.indexOf(curImageSrc)||0
  153. showPreViewImg.value=true
  154. }
  155. })
  156. })
  157. // 无权限点击申请
  158. const handleGoApply=async ()=>{
  159. if(info.value.permission_check.type=='apply'){
  160. if(info.value.permission_check.customer_info.has_apply){// 已经申请过
  161. const htmlStr=`<p>您已提交过申请,请耐心等待</p>`
  162. ElMessageBox({
  163. title:'温馨提醒',
  164. message:htmlStr,
  165. center: true,
  166. dangerouslyUseHTMLString: true,
  167. confirmButtonText:'知道了',
  168. confirmButtonClass:'self-elmessage-confirm-btn'
  169. })
  170. }else{
  171. if(!info.value.permission_check.customer_info.status||info.value.permission_check.customer_info.status!='流失'){
  172. router.push('/apply/permission?source=4&fromPage=报告详情')
  173. }else{//主动调一次申请权限接口
  174. const res=await apiApplyPermission({
  175. company_name:info.value.permission_check.customer_info.company_name,
  176. real_name:info.value.permission_check.customer_info.name,
  177. source:4,
  178. from_page:'报告详情'
  179. })
  180. if(res.code===200){
  181. getChapterReportDetail()
  182. const htmlStr=`<p>申请已提交</p><p>请等待销售人员与您联系</p>`
  183. ElMessageBox({
  184. title:'温馨提醒',
  185. message:htmlStr,
  186. center: true,
  187. dangerouslyUseHTMLString: true,
  188. confirmButtonText:'知道了',
  189. confirmButtonClass:'self-elmessage-confirm-btn'
  190. })
  191. }
  192. }
  193. }
  194. }
  195. }
  196. let showDisclaimers=ref(false)//显示免责声明
  197. </script>
  198. <template>
  199. <div class="report-chapter-detail-page" v-if="info">
  200. <div class="hasrightaside-box">
  201. <div class="content-box">
  202. <div class="report-box">
  203. <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>
  204. <div class="time">
  205. <span>FICC团队</span>
  206. <span>{{moment(info.report_chapter_item.publish_time).format('YYYY.MM.DD HH:mm')}}</span>
  207. </div>
  208. <div class="tips">
  209. <span>注:请务必阅读</span>
  210. <span style="color:#F3A52F;margin-left:20px;cursor: pointer;" @click="showDisclaimers=true">免责声明</span>
  211. </div>
  212. <AudioBox :data="audioData" v-if="info.report_chapter_item.video_url&&info.report_chapter_item.video_play_seconds>0"></AudioBox>
  213. <div class="abstract" v-if="info.report_chapter_item.abstract">摘要:{{info.report_chapter_item.abstract}}</div>
  214. <div class="rich-content">
  215. <div v-html="info.report_chapter_item.content" v-if="info.auth_ok"></div>
  216. <div v-html="info.report_chapter_item.content_sub" v-else ></div>
  217. </div>
  218. <!-- 指标数据模块 -->
  219. <div class="ticker-wrap" v-if="tickerInfo">
  220. <div class="top-title">{{tickerInfo.ticker_title.report_chapter_type_name}}数据表</div>
  221. <div class="table-box">
  222. <div class="table-row table-head">
  223. <div class="table-item" v-for="item in tickerHead" :key="item.key">{{item.label}}</div>
  224. </div>
  225. <div class="table-row table-body" v-for="(tr,index) in tickerInfo.list" :key="tr.base_column_name">
  226. <div :class="['table-item',index%2==0?'grey':'',tr[td.key]<0?'minus':'']" v-for="td in tickerHead" :key="td.key">{{tr[td.key]}}</div>
  227. </div>
  228. </div>
  229. <div v-if="tickerInfo.ticker_title.report_chapter_type_id ===26" style="text-align:center;font-weight:bold">注:与新加坡TSR20相关数据均取展示日期前一交易日数据</div>
  230. </div>
  231. <!-- 无权限 -->
  232. <div class="no-auth-wrap" v-if="!info.auth_ok">
  233. <div class="apply-box" v-if="info.permission_check.type=='apply'">
  234. <div>您暂无权限查看报告,若想查看请申请开通</div>
  235. <div class="global-main-btn btn" @click="handleGoApply">立即申请</div>
  236. </div>
  237. <div class="apply-box" v-else>
  238. <div>您暂无权限查看报告 </div>
  239. <div>若想查看请联系对口销售:{{info.permission_check.name}}--{{info.permission_check.mobile}}</div>
  240. </div>
  241. </div>
  242. </div>
  243. <!-- 章节列表 -->
  244. <div class="chapter-list-wrap" v-if="frompage=='reportdetail'">
  245. <div class="top-name">更多</div>
  246. <div class="flex list">
  247. <div
  248. :class="['item',item.report_chapter_id==chapterId&&'active']"
  249. v-for="item in info.report_chapter_menu_list"
  250. :key="item.report_chapter_id"
  251. @click="handleChangeChapter(item)"
  252. >
  253. <img :src="item.report_chapter_type_thumb" alt="">
  254. <span>{{item.report_chapter_type_name}}</span>
  255. </div>
  256. </div>
  257. </div>
  258. </div>
  259. <div class="right-aside-box" v-if="info.auth_ok">
  260. <div class="fix-top">
  261. <div class="share-box">
  262. <div class="label">分享</div>
  263. <el-popover
  264. :width="200"
  265. popper-style="box-shadow: rgb(14 18 22 / 35%) 0px 10px 38px -10px, rgb(14 18 22 / 20%) 0px 10px 20px -15px; padding: 20px;"
  266. >
  267. <template #reference><div class="icon"></div></template>
  268. <template #default>
  269. <img :src="QRCodeImg" class="share-xcx-img" alt="" style="width: 150px;display: block;margin: 0 auto;">
  270. </template>
  271. </el-popover>
  272. </div>
  273. <div class="hot-box" style="margin-top: 60px;">
  274. <div class="label">热门栏目</div>
  275. <div class="img-con"></div>
  276. </div>
  277. <div class="recmd-box" style="margin-top: 60px;">
  278. <div class="label">更多推荐</div>
  279. <div class="recmd-item">
  280. <div class="title">股债日评</div>
  281. <div>178 | 关注中美领导交流</div>
  282. </div>
  283. <div class="recmd-item">
  284. <div class="title">股债日评</div>
  285. <div>178 | 关注中美领导交流</div>
  286. </div>
  287. <div class="recmd-item">
  288. <div class="title">股债日评</div>
  289. <div>178 | 关注中美领导交流</div>
  290. </div>
  291. </div>
  292. </div>
  293. </div>
  294. </div>
  295. </div>
  296. <!-- 图片预览 -->
  297. <el-image-viewer
  298. v-if="showPreViewImg"
  299. :initial-index="preViewImgIndex"
  300. @close="showPreViewImg=false"
  301. :url-list="preViewImgs"
  302. />
  303. <!-- 免责申明 -->
  304. <el-dialog v-model="showDisclaimers" title="免责声明" center draggable width="40%">
  305. <div class="disclaimers-box">
  306. <div style="margin-bottom:10px">1、本报告仅供弘则弥道(上海)投资咨询有限公司正式签约的机构客户使用,不会仅因接收人/接受机构收到本报告而将其视为客户。</div>
  307. <div style="margin-bottom:10px">2、本报告根据国际和行业通行的准则,以合法渠道获得这些信息,尽可能保证可靠、准确和完整,但并不保证报告所述信息的准确性和完整性,也不保证本报告所包含的信息或建议在本报告发出后不会发生任何变更。本报告中所提供的信息仅供参考。</div>
  308. <div style="margin-bottom:10px">3、报告中的内容不对投资者做出的最终操作建议做任何的担保,也没有任何形式的分享投资收益或者分担投资损失的书面或口头承诺。不作为客户在投资、法律、会计或税务等方面的最终操作建议,也不作为道义的、责任的和法律的依据或者凭证,无论是否已经明示或者暗示。</div>
  309. <div style="margin-bottom:10px">4、在任何情况下,本公司不对客户/接受人/接受机构因使用报告中内容所引致的一切损失负责任,客户/接受人/接受机构需自行承担全部风险。</div>
  310. </div>
  311. </el-dialog>
  312. </template>
  313. <style lang="scss" scoped>
  314. .report-chapter-detail-page{
  315. .content-box{
  316. flex: 1;
  317. padding-right: 30px;
  318. }
  319. .report-box{
  320. .title{
  321. display: inline;
  322. font-size: 24px;
  323. font-weight: bold;
  324. margin-left: -14px;
  325. }
  326. .time{
  327. color: #666;
  328. margin-top: 20px;
  329. margin-bottom: 30px;
  330. font-size: 16px;
  331. span:last-child{
  332. float: right;
  333. }
  334. }
  335. .tips{
  336. font-size: 18px;
  337. margin-bottom: 30px;
  338. &::before{
  339. content: '';
  340. width: 6px;
  341. height: 30px;
  342. display: inline-block;
  343. background-color: #F3A52F;
  344. margin-right: 10px;
  345. position: relative;
  346. top: 10px;
  347. }
  348. }
  349. .abstract{
  350. font-size: 18px;
  351. font-weight: bold;
  352. margin-top: 20px;
  353. &::before{
  354. content: '';
  355. width: 6px;
  356. height: 30px;
  357. display: inline-block;
  358. background-color: #F3A52F;
  359. margin-right: 10px;
  360. position: relative;
  361. top: 10px;
  362. }
  363. }
  364. .rich-content{
  365. margin-top: 30px;
  366. line-height: 1.8;
  367. font-size: 18px;
  368. :deep(img){
  369. width: 100% !important;
  370. }
  371. :deep(span){
  372. font-size: 18px !important;
  373. line-height: 1.8 !important;
  374. }
  375. :deep(p){
  376. font-size: 18px !important;
  377. line-height: 1.8 !important;
  378. }
  379. }
  380. }
  381. .no-auth-wrap{
  382. text-align: center;
  383. color: #F3A52F;
  384. margin-top: -140px;
  385. padding-top: 140px;
  386. min-height: 200px;
  387. position: relative;
  388. z-index: 5;
  389. background: linear-gradient(360deg, #FFFFFF 60%, rgba(255, 255, 255, 0) 88%);
  390. .btn{
  391. width: 218px;
  392. margin-left: auto;
  393. margin-right: auto;
  394. margin-top: 20px;
  395. }
  396. }
  397. .chapter-list-wrap{
  398. .top-name{
  399. text-align: center;
  400. color: #F3A52F;
  401. font-size: 18px;
  402. margin-bottom: 50px;
  403. &::before,&::after{
  404. content: '';
  405. display: inline-block;
  406. width: 83px;
  407. height: 1px;
  408. background-color: #F3A52F;
  409. vertical-align: middle;
  410. margin: 0 22px;
  411. }
  412. }
  413. .list{
  414. flex-wrap: wrap;
  415. .item{
  416. display: flex;
  417. justify-content: center;
  418. align-items: center;
  419. width: 148px;
  420. height: 36px;
  421. background-color: #F7F7F7;
  422. border-radius: 4px;
  423. margin-right: 20px;
  424. margin-bottom: 20px;
  425. cursor: pointer;
  426. img{
  427. width: 20px;
  428. height: 20px;
  429. }
  430. }
  431. .active{
  432. background-color: #F3A52F;
  433. color: #fff;
  434. }
  435. }
  436. }
  437. }
  438. </style>