reportSecretDetail.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  1. <template>
  2. <block>
  3. <view class="container content-secret forbid-copy" v-if="isUserBindingPhoneNumber">
  4. <block v-if="hasPermission == 1">
  5. <block v-if="detali">
  6. <view class="container-top">
  7. <view class="report-content-title">
  8. {{ detali.Title }}
  9. </view>
  10. <view class="content-time">
  11. <text>{{ detali.Department }}</text>
  12. <text>{{ detali.PublishDate }}</text>
  13. </view>
  14.  
  15. <view class="content-statement">
  16. <view style="display: flex">
  17. <text>注:请务必阅读</text> <text class="statement" @click="isShowStatement = true">免责声明 </text>          
  18. </view>
  19. <text class="statement" @click="goSecret">往期汇总>> </text>        
  20. </view>
  21. <view class="audio-card">
  22. <view class="card-title text_oneLine">
  23. {{ detali.VideoName }}
  24. </view>
  25. <view class="slider-paly">
  26. <view style="flex: 1; padding-top: 20rpx">
  27. <slider
  28. activeColor="#3385FF"
  29. :max="detali.VideoPlaySeconds"
  30. :value="curTime"
  31. @touchstart="touchstartHandler"
  32. @change="handleAudioSliderChange($event)"
  33. @changing="handleAudioSliderChangeing($event)"
  34. block-size="16"
  35. class="slider"
  36. />
  37. <view class="card-time">
  38. <text class="time">{{ curTime | formatVoiceTime }}</text>
  39. <text class="time">{{ detali.VideoPlaySeconds | formatVoiceTime }}</text>
  40. </view>
  41. </view>
  42. <view class="is-paly-card">
  43. <image
  44. @click.stop="audioPlayBack"
  45. :src="
  46. curVoiceId === detali.ArticleId && !curAudioPaused
  47. ? 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/play_icon.gif'
  48. : 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/pause_icon.png'
  49. "
  50. ></image>
  51. </view>
  52. </view>
  53. <view class="fast-reverse">
  54. <image
  55. @click="speedReverseHandler('reverse')"
  56. class="speed-img"
  57. src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/fastReverse_icon.png"
  58. ></image>
  59. <block v-for="(item, index) in timesTheSpeed" :key="item.value">
  60. <view class="speed-button" v-if="isTimes == item.value" @click="isTimesHandler(index)">
  61. {{ item.name }}
  62. </view>
  63. </block>
  64. <image
  65. @click="speedReverseHandler('speed')"
  66. class="speed-img"
  67. src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/speed_icon.png"
  68. ></image>
  69. </view>
  70. </view>
  71. <view v-if="detali.Abstract" class="content-abstract">
  72. <text>摘要:</text>
  73. <text>
  74. {{ detali.Abstract }}
  75. </text>
  76. </view>
  77. <view v-if="detali.ProductDescription && isType == 1" class="content-abstract">
  78. <text>产品说明:</text>
  79. <text>
  80. {{ detali.ProductDescription }}
  81. </text>
  82. </view>
  83. <view v-if="detali.UpdateDescription && isType == 1" class="content-abstract">
  84. <text>变更说明:</text>
  85. <text>
  86. {{ detali.UpdateDescription }}
  87. </text>
  88. </view>
  89. <view v-if="detali.FocusOn && isType == 1" class="content-focuson">
  90. <text class="focuson">近期重点关注方向:</text>
  91. <mp-html :content="strFontSize(detali.FocusOn)" />
  92. </view>
  93. </view>
  94. <view class="container-text">
  95. <researchSummary v-if="isType == 1" :dataList="dataList" />
  96. <reportChoiceness v-if="isType == 2 || isType == 3" :dataListResearch="dataListResearch" />
  97. </view>
  98. <statement :show="isShowStatement" />
  99. </block>
  100. <view class="nodata" v-else>
  101. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/report_loading_icon.png" class="nodata_img"></image>
  102. <view class="nodata-tip">正在努力编辑中,请耐心等待...</view>
  103. </view>
  104. </block>
  105. <view class="noauth-cont" v-else-if="hasPermission == 3 || hasPermission == 4">
  106. <block v-if="!isShowAlert">
  107. <image src="https://hzstatic.hzinsights.com/cygx/czbk/noauth.png" class="noauth-ico"></image>
  108. <block>
  109. <view class="tip">您暂无权限查看此文章内容,若想查看可以申请开通哦</view>
  110. <view class="btn-cont" @click="applyAuth"> 立即申请 </view>
  111. </block>
  112. <view class="btn-cont back-btn" @click="backIndex"> 返回首页 </view>
  113. </block>
  114. <block v-else>
  115. <text class="moneh-text"> 上传名片并填写简单信息,24小时内我们会为您开通一个月的免费月卡 </text>
  116. <img src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/month_card.png" class="month_card" alt="" />
  117. <view class="btn-cont btn-dl" @click="applyAuth"> 立即上传 </view>
  118. <view class="btn-cont month-back" @click="backIndex"> 返回</view>
  119. </block>
  120. </view>
  121. <freeCharge class="free-charge" :isShowFreeBtn="isShowFree" />
  122. <view v-show="false">
  123. <audioModule :showAudioPop="showAudioPop" />
  124. </view>
  125. </view>
  126. <not-have-login v-else />
  127. </block>
  128. </template>
  129. <script>
  130. import statement from "@/reportPages/components/statement.vue";
  131. import researchSummary from "./components/researchSummary.vue";
  132. import reportChoiceness from "./components/reportChoiceness.vue";
  133. import audioModule from "@/components/audioModule/index";
  134. import freeCharge from "@/components/freeCharge";
  135. import { Reports, FreeButton } from "@/config/api.js";
  136. import NotHaveLogin from "@/components/notHaveLogin.vue";
  137. let app = getApp({ allowDefault: true });
  138. export default {
  139. data() {
  140. return {
  141. isShowStatement: false,
  142. isPlay: false,
  143. audioContext: "", //音频
  144. isType: "", //类型
  145. id: "", //
  146. detali: "", //详情
  147. dataList: [], //精选,上周 数组
  148. dataListResearch: [], //本周数组
  149. hasPermission: "", //权限判断
  150. videoUrl: "",
  151. isShowAlert: false,
  152. timesTheSpeed: [
  153. { name: "倍速", value: 1 },
  154. { name: "1.25倍", value: 1.25 },
  155. { name: "1.5倍", value: 1.5 },
  156. { name: "2倍", value: 2 },
  157. ],
  158. showAudioBox: false,
  159. curTime: 0,
  160. titleTxT: "",
  161. readTiem: 0,
  162. setIntervalTiem: null,
  163. };
  164. },
  165. filters: {
  166. formatVoiceTime(e) {
  167. let m = parseInt(e / 60);
  168. let s = parseInt(e % 60);
  169. return `${m > 9 ? m : "0" + m}:${s > 9 ? s : "0" + s}`;
  170. },
  171. },
  172. computed: {
  173. curVoiceId() {
  174. //当前正在播放的音频id
  175. return this.$store.state.audioBg.reportId;
  176. },
  177. curAudioPaused() {
  178. //当前音频是否暂停状态
  179. return this.$store.state.audioBg.paused;
  180. },
  181. //几倍的播放数度
  182. isTimes() {
  183. let isMultiple = this.curVoiceId === this.detali.ArticleId ? this.$store.state.audioBg.multiple : 1;
  184. return isMultiple;
  185. },
  186. showAudioPop() {
  187. return this.$store.state.audioBg.show;
  188. },
  189. },
  190. watch: {
  191. "$store.state.audioBg.curTime": {
  192. handler(newVal) {
  193. this.curTime = this.curVoiceId === this.detali.ArticleId ? newVal : 0;
  194. },
  195. immediate: true,
  196. deep: true,
  197. },
  198. },
  199. methods: {
  200. //获取数据详情
  201. async getDetilaiList() {
  202. const res =
  203. this.isType == 1
  204. ? await Reports.reportSelectionDetail({
  205. ArticleId: this.id,
  206. PageRouter: this.$store.state.pageRouterReport,
  207. })
  208. : this.isType == 3
  209. ? await Reports.minutesSummaryDetail({
  210. ArticleId: this.id,
  211. PageRouter: this.$store.state.pageRouterReport,
  212. })
  213. : await Reports.researchSummaryDetail({
  214. ArticleId: this.id,
  215. PageRouter: this.$store.state.pageRouterReport,
  216. });
  217. if (res.Ret === 200) {
  218. this.hasPermission = res.Data.HasPermission;
  219. this.isType == 1 ? (this.dataList = res.Data.List || []) : (this.dataListResearch = res.Data.List || []);
  220. if (res.Data.Detail) {
  221. let arr = res.Data.Detail.VideoPlaySeconds.split(":");
  222. res.Data.Detail.VideoPlaySeconds = arr[0] * 60 + (arr[1] - 0);
  223. this.detali = res.Data.Detail;
  224. this.videoUrl = res.Data.Detail.VideoUrl;
  225. if (this.globalBgAudioManager.src === this.videoUrl && this.globalBgAudioManager.paused === false) {
  226. this.isPlay = true;
  227. }
  228. }
  229. }
  230. },
  231. /* 无权限申请开通权限 */
  232. applyAuth() {
  233. let istype = this.isType == 2 ? "Researchsummary" : "Minutessummary";
  234. this.hasPermission === 4
  235. ? uni.navigateTo({
  236. url: "/pageMy/applyTrial/applyTrial?tryType=Article&detailId=" + this.id,
  237. })
  238. : uni.showModal({
  239. title: "",
  240. content: "您已经提交过申请了,请耐心等待",
  241. showCancel: false,
  242. confirmColor: "#365595",
  243. success: function (res) {
  244. uni.navigateBack({
  245. fail() {
  246. uni.switchTab({
  247. url: "/pages/index/index",
  248. });
  249. },
  250. });
  251. },
  252. });
  253. },
  254. // 返回首頁
  255. backIndex() {
  256. uni.switchTab({
  257. url: "/pages/index/index",
  258. });
  259. },
  260. //获取权限弹窗是否展示免费月卡接口
  261. async userIsShowAlert() {
  262. const res = await FreeButton.userIsShowAlert();
  263. if (res.Ret === 200) {
  264. this.isShowAlert = res.Data.IsShow;
  265. }
  266. },
  267. //音频点击暂停播放
  268. audioPlayBack() {
  269. let list = { Url: this.detali.VideoUrl, Name: this.detali.Title, PlaySeconds: this.detali.VideoPlaySeconds };
  270. if (this.$store.state.audioBg.reportId == this.detali.ArticleId) {
  271. if (this.globalBgAudioManager.paused) {
  272. this.globalBgAudioManager.play();
  273. } else {
  274. this.globalBgAudioManager.pause();
  275. }
  276. } else {
  277. this.$store.commit("audioBg/updateAudioTime", 0);
  278. this.$store.commit("audioBg/addAudio", { list, reportId: this.detali.ArticleId });
  279. }
  280. },
  281. //拖动进度条
  282. handleAudioSliderChangeing(e) {
  283. this.curTime = e.detail.value;
  284. },
  285. //拖动进度条
  286. handleAudioSliderChange(e) {
  287. const value = e.detail.value;
  288. this.globalBgAudioManager.seek(value);
  289. setTimeout(() => {
  290. this.$store.commit("audioBg/setSlide", false);
  291. }, 300);
  292. },
  293. touchstartHandler() {
  294. this.$store.commit("audioBg/setSlide", true);
  295. },
  296. //倍速播放
  297. isTimesHandler(i) {
  298. let list = { Url: this.detali.VideoUrl, Name: this.detali.Title, PlaySeconds: this.detali.VideoPlaySeconds };
  299. let index = i == 3 ? 0 : i + 1;
  300. this.$store.commit("audioBg/setMultiple", this.timesTheSpeed[index].value);
  301. this.globalBgAudioManager.playbackRate = this.isTimes;
  302. this.globalBgAudioManager.startTime = this.curTime;
  303. if (this.$store.state.audioBg.reportId != this.detali.ArticleId) {
  304. this.$store.commit("audioBg/addAudio", { list, reportId: this.detali.ArticleId });
  305. this.globalBgAudioManager.play();
  306. } else {
  307. if (this.globalBgAudioManager.paused) {
  308. this.globalBgAudioManager.play();
  309. }
  310. }
  311. },
  312. //快进 快退
  313. speedReverseHandler(type) {
  314. let isTime = type == "reverse" ? this.curTime - 15 : this.curTime + 15;
  315. isTime = isTime <= 0 ? 0 : isTime >= this.audioTime ? this.audioTime - 1 : isTime;
  316. this.globalBgAudioManager.seek(isTime);
  317. },
  318. // 跳转往期汇总
  319. goSecret() {
  320. uni.navigateTo({
  321. url: "/reportPages/secretDetails/secretDetails?type=" + this.isType,
  322. });
  323. },
  324. },
  325. components: {
  326. statement,
  327. researchSummary,
  328. reportChoiceness,
  329. freeCharge,
  330. audioModule,
  331. NotHaveLogin,
  332. },
  333. async onLoad(option) {
  334. this.isType = option.type;
  335. this.id = Number(option.id) || "";
  336. this.titleTxT = this.isType == 1 ? "报告精选" : this.isType == 2 ? "本周研究汇总" : "上周纪要汇总";
  337. uni.setNavigationBarTitle({
  338. title: this.titleTxT,
  339. });
  340. },
  341. onShow() {
  342. this.readTiem = 0;
  343. this.setIntervalTiem = setInterval(() => {
  344. this.readTiem++;
  345. }, 1000);
  346. if (!this.$store.state.isAuth && !this.$store.state.isBind) {
  347. this.getDetilaiList();
  348. }
  349. this.$store.commit("setRouterReport", this.titleTxT);
  350. this.showAudioBox = true;
  351. },
  352. // 页面隐藏/切入后台时触发
  353. async onHide() {
  354. this.showAudioBox = false;
  355. clearInterval(this.setIntervalTiem);
  356. },
  357. // 页面卸载时触发
  358. async onUnload() {
  359. clearInterval(this.setIntervalTiem);
  360. },
  361. /**
  362. * 用户点击分享
  363. */
  364. onShareAppMessage: function (res) {
  365. return {
  366. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : this.detali.Title,
  367. path: "/reportPages/reportSecretDetail/reportSecretDetail?type=" + this.isType + "&id=" + this.id,
  368. success: (res) => {},
  369. fail: (err) => {},
  370. };
  371. },
  372. };
  373. </script>
  374. <style lang="scss" scoped>
  375. .content-secret {
  376. @import "../jurisdiction.scss";
  377. padding: 10rpx 34rpx 34rpx;
  378. .container-top {
  379. font-size: 28rpx;
  380. .content-time {
  381. margin: 24rpx 0 34rpx 0;
  382. display: flex;
  383. justify-content: space-between;
  384. color: #333333;
  385. }
  386. .content-statement {
  387. display: flex;
  388. color: #707070;
  389. justify-content: space-between;
  390. .statement {
  391. margin-left: 10rpx;
  392. color: #3385ff;
  393. }
  394. }
  395. .audio-card {
  396. width: 100%;
  397. height: 282rpx;
  398. background: #f9f9f9;
  399. border-radius: 16rpx;
  400. margin: 30rpx auto;
  401. padding: 30rpx;
  402. .slider {
  403. width: 100%;
  404. margin: 0;
  405. }
  406. .slider-paly {
  407. display: flex;
  408. height: 80rpx;
  409. align-items: center;
  410. padding-left: 20rpx;
  411. }
  412. .card-title {
  413. font-size: 28rpx;
  414. padding: 0 40rpx;
  415. text-align: center;
  416. margin-bottom: 35rpx;
  417. }
  418. .card-time {
  419. display: flex;
  420. justify-content: space-between;
  421. color: #999999;
  422. font-size: 20rpx;
  423. }
  424. .is-paly-card {
  425. width: 70rpx;
  426. height: 70rpx;
  427. flex-shrink: 0;
  428. margin-left: 30rpx;
  429. image {
  430. width: 70rpx;
  431. height: 70rpx;
  432. }
  433. }
  434. .fast-reverse {
  435. display: flex;
  436. align-items: center;
  437. justify-content: center;
  438. margin-top: 30rpx;
  439. .speed-button {
  440. width: 96rpx;
  441. height: 47rpx;
  442. background: #eaeaea;
  443. border-radius: 8rpx;
  444. text-align: center;
  445. line-height: 47rpx;
  446. margin: 0 70rpx;
  447. }
  448. .speed-img {
  449. width: 50rpx;
  450. height: 50rpx;
  451. }
  452. }
  453. }
  454. .content-abstract {
  455. margin-bottom: 30rpx;
  456. font-size: 32rpx;
  457. color: #4a4a4a;
  458. :first-child {
  459. float: left;
  460. font-weight: 700;
  461. }
  462. }
  463. .content-focuson {
  464. font-size: 32rpx !important;
  465. margin-bottom: 30rpx;
  466. color: #4a4a4a;
  467. .focuson {
  468. font-weight: 700;
  469. }
  470. }
  471. }
  472. .month_card {
  473. width: 100%;
  474. height: 565rpx;
  475. padding-left: -20rpx;
  476. }
  477. .btn-dl {
  478. background: linear-gradient(253deg, #fcf3e9 0%, #eedec8 100%) !important;
  479. color: #333 !important;
  480. margin: 30rpx auto !important;
  481. }
  482. .month-back {
  483. background: #f6f6f6 !important;
  484. color: #999 !important;
  485. }
  486. .moneh-text {
  487. text-align: center;
  488. width: 632rpx;
  489. margin: 0 auto 20rpx;
  490. color: #999999;
  491. }
  492. .nodata-tip {
  493. color: #999;
  494. font-size: 30rpx;
  495. }
  496. }
  497. </style>