reportSecretDetail.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  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. <Loading />
  128. </block>
  129. </template>
  130. <script>
  131. import statement from "@/reportPages/components/statement.vue";
  132. import researchSummary from "./components/researchSummary.vue";
  133. import reportChoiceness from "./components/reportChoiceness.vue";
  134. import audioModule from "@/components/audioModule/index";
  135. import freeCharge from "@/components/freeCharge";
  136. import { Reports, FreeButton, Mine } from "@/config/api.js";
  137. import NotHaveLogin from "@/components/notHaveLogin.vue";
  138. let app = getApp({ allowDefault: true });
  139. export default {
  140. data() {
  141. return {
  142. isShowStatement: false,
  143. isPlay: false,
  144. audioContext: "", //音频
  145. isType: "", //类型
  146. id: "", //
  147. detali: "", //详情
  148. dataList: [], //精选,上周 数组
  149. dataListResearch: [], //本周数组
  150. hasPermission: "", //权限判断
  151. videoUrl: "",
  152. isShowAlert: false,
  153. timesTheSpeed: [
  154. { name: "倍速", value: 1 },
  155. { name: "1.25倍", value: 1.25 },
  156. { name: "1.5倍", value: 1.5 },
  157. { name: "2倍", value: 2 },
  158. ],
  159. showAudioBox: false,
  160. curTime: 0,
  161. titleTxT: "",
  162. readTiem: 0,
  163. setIntervalTiem: null,
  164. };
  165. },
  166. filters: {
  167. formatVoiceTime(e) {
  168. let m = parseInt(e / 60);
  169. let s = parseInt(e % 60);
  170. return `${m > 9 ? m : "0" + m}:${s > 9 ? s : "0" + s}`;
  171. },
  172. },
  173. computed: {
  174. curVoiceId() {
  175. //当前正在播放的音频id
  176. return this.$store.state.audioBg.reportId;
  177. },
  178. curAudioPaused() {
  179. //当前音频是否暂停状态
  180. return this.$store.state.audioBg.paused;
  181. },
  182. //几倍的播放数度
  183. isTimes() {
  184. let isMultiple = this.curVoiceId === this.detali.ArticleId ? this.$store.state.audioBg.multiple : 1;
  185. return isMultiple;
  186. },
  187. showAudioPop() {
  188. return this.$store.state.audioBg.show;
  189. },
  190. },
  191. watch: {
  192. "$store.state.audioBg.curTime": {
  193. handler(newVal) {
  194. this.curTime = this.curVoiceId === this.detali.ArticleId ? newVal : 0;
  195. },
  196. immediate: true,
  197. deep: true,
  198. },
  199. },
  200. methods: {
  201. //获取数据详情
  202. async getDetilaiList() {
  203. const res =
  204. this.isType == 1
  205. ? await Reports.reportSelectionDetail({
  206. ArticleId: this.id,
  207. PageRouter: this.$store.state.pageRouterReport,
  208. })
  209. : this.isType == 3
  210. ? await Reports.minutesSummaryDetail({
  211. ArticleId: this.id,
  212. PageRouter: this.$store.state.pageRouterReport,
  213. })
  214. : await Reports.researchSummaryDetail({
  215. ArticleId: this.id,
  216. PageRouter: this.$store.state.pageRouterReport,
  217. });
  218. if (res.Ret === 200) {
  219. this.hasPermission = res.Data.HasPermission;
  220. this.isType == 1 ? (this.dataList = res.Data.List || []) : (this.dataListResearch = res.Data.List || []);
  221. if (res.Data.Detail) {
  222. let arr = res.Data.Detail.VideoPlaySeconds.split(":");
  223. res.Data.Detail.VideoPlaySeconds = arr[0] * 60 + (arr[1] - 0);
  224. this.detali = res.Data.Detail;
  225. this.videoUrl = res.Data.Detail.VideoUrl;
  226. if (this.globalBgAudioManager.src === this.videoUrl && this.globalBgAudioManager.paused === false) {
  227. this.isPlay = true;
  228. }
  229. }
  230. }
  231. },
  232. /* 无权限申请开通权限 */
  233. applyAuth() {
  234. let istype = this.isType == 2 ? "Researchsummary" : "Minutessummary";
  235. this.hasPermission === 4
  236. ? uni.navigateTo({
  237. url: "/pageMy/applyTrial/applyTrial?tryType=Article&detailId=" + this.id,
  238. })
  239. : uni.showModal({
  240. title: "",
  241. content: "您已经提交过申请了,请耐心等待",
  242. showCancel: false,
  243. confirmColor: "#365595",
  244. success: function (res) {
  245. uni.navigateBack({
  246. fail() {
  247. uni.switchTab({
  248. url: "/pages/index/index",
  249. });
  250. },
  251. });
  252. },
  253. });
  254. },
  255. // 返回首頁
  256. backIndex() {
  257. uni.switchTab({
  258. url: "/pages/index/index",
  259. });
  260. },
  261. //获取权限弹窗是否展示免费月卡接口
  262. async userIsShowAlert() {
  263. const res = await FreeButton.userIsShowAlert();
  264. if (res.Ret === 200) {
  265. this.isShowAlert = res.Data.IsShow;
  266. }
  267. },
  268. //音频点击暂停播放
  269. audioPlayBack() {
  270. let list = { Url: this.detali.VideoUrl, Name: this.detali.Title, PlaySeconds: this.detali.VideoPlaySeconds };
  271. if (this.$store.state.audioBg.reportId == this.detali.ArticleId) {
  272. if (this.globalBgAudioManager.paused) {
  273. this.globalBgAudioManager.play();
  274. } else {
  275. this.globalBgAudioManager.pause();
  276. }
  277. } else {
  278. this.$store.commit("audioBg/updateAudioTime", 0);
  279. this.$store.commit("audioBg/addAudio", { list, reportId: this.detali.ArticleId });
  280. }
  281. },
  282. //拖动进度条
  283. handleAudioSliderChangeing(e) {
  284. this.curTime = e.detail.value;
  285. },
  286. //拖动进度条
  287. handleAudioSliderChange(e) {
  288. const value = e.detail.value;
  289. this.globalBgAudioManager.seek(value);
  290. setTimeout(() => {
  291. this.$store.commit("audioBg/setSlide", false);
  292. }, 300);
  293. },
  294. touchstartHandler() {
  295. this.$store.commit("audioBg/setSlide", true);
  296. },
  297. //倍速播放
  298. isTimesHandler(i) {
  299. let list = { Url: this.detali.VideoUrl, Name: this.detali.Title, PlaySeconds: this.detali.VideoPlaySeconds };
  300. let index = i == 3 ? 0 : i + 1;
  301. this.$store.commit("audioBg/setMultiple", this.timesTheSpeed[index].value);
  302. this.globalBgAudioManager.playbackRate = this.isTimes;
  303. this.globalBgAudioManager.startTime = this.curTime;
  304. if (this.$store.state.audioBg.reportId != this.detali.ArticleId) {
  305. this.$store.commit("audioBg/addAudio", { list, reportId: this.detali.ArticleId });
  306. this.globalBgAudioManager.play();
  307. } else {
  308. if (this.globalBgAudioManager.paused) {
  309. this.globalBgAudioManager.play();
  310. }
  311. }
  312. },
  313. //快进 快退
  314. speedReverseHandler(type) {
  315. let isTime = type == "reverse" ? this.curTime - 15 : this.curTime + 15;
  316. isTime = isTime <= 0 ? 0 : isTime >= this.audioTime ? this.audioTime - 1 : isTime;
  317. this.globalBgAudioManager.seek(isTime);
  318. },
  319. // 跳转往期汇总
  320. goSecret() {
  321. uni.navigateTo({
  322. url: "/reportPages/secretDetails/secretDetails?type=" + this.isType,
  323. });
  324. },
  325. // 上传阅读时长的记录
  326. async postStopTime(type) {
  327. const res = await Mine.report_selectionAddStopTime({
  328. ArticleId: this.id,
  329. StopTime: this.readTiem,
  330. OutType: type,
  331. Source: +this.isType,
  332. });
  333. },
  334. },
  335. components: {
  336. statement,
  337. researchSummary,
  338. reportChoiceness,
  339. freeCharge,
  340. audioModule,
  341. NotHaveLogin,
  342. },
  343. async onLoad(option) {
  344. this.isType = option.type;
  345. this.id = Number(option.id) || "";
  346. this.titleTxT = this.isType == 1 ? "报告精选" : this.isType == 2 ? "本周研究汇总" : "上周纪要汇总";
  347. uni.setNavigationBarTitle({
  348. title: this.titleTxT,
  349. });
  350. },
  351. onShow() {
  352. this.readTiem = 0;
  353. this.setIntervalTiem = setInterval(() => {
  354. this.readTiem++;
  355. }, 1000);
  356. if (!this.$store.state.isAuth && !this.$store.state.isBind) {
  357. this.getDetilaiList();
  358. }
  359. this.$store.commit("setRouterReport", this.titleTxT);
  360. this.showAudioBox = true;
  361. },
  362. // 页面隐藏/切入后台时触发
  363. async onHide() {
  364. this.showAudioBox = false;
  365. clearInterval(this.setIntervalTiem);
  366. this.postStopTime(2);
  367. },
  368. // 页面卸载时触发
  369. async onUnload() {
  370. clearInterval(this.setIntervalTiem);
  371. this.postStopTime(1);
  372. },
  373. /**
  374. * 用户点击分享
  375. */
  376. onShareAppMessage: function (res) {
  377. return {
  378. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : this.detali.Title,
  379. path: "/reportPages/reportSecretDetail/reportSecretDetail?type=" + this.isType + "&id=" + this.id,
  380. success: (res) => {},
  381. fail: (err) => {},
  382. };
  383. },
  384. };
  385. </script>
  386. <style lang="scss" scoped>
  387. .content-secret {
  388. @import "../jurisdiction.scss";
  389. padding: 10rpx 34rpx 34rpx;
  390. .container-top {
  391. font-size: 28rpx;
  392. .content-time {
  393. margin: 24rpx 0 34rpx 0;
  394. display: flex;
  395. justify-content: space-between;
  396. color: #333333;
  397. }
  398. .content-statement {
  399. display: flex;
  400. color: #707070;
  401. justify-content: space-between;
  402. .statement {
  403. margin-left: 10rpx;
  404. color: #3385ff;
  405. }
  406. }
  407. .audio-card {
  408. width: 100%;
  409. height: 282rpx;
  410. background: #f9f9f9;
  411. border-radius: 16rpx;
  412. margin: 30rpx auto;
  413. padding: 30rpx;
  414. .slider {
  415. width: 100%;
  416. margin: 0;
  417. }
  418. .slider-paly {
  419. display: flex;
  420. height: 80rpx;
  421. align-items: center;
  422. padding-left: 20rpx;
  423. }
  424. .card-title {
  425. font-size: 28rpx;
  426. padding: 0 40rpx;
  427. text-align: center;
  428. margin-bottom: 35rpx;
  429. }
  430. .card-time {
  431. display: flex;
  432. justify-content: space-between;
  433. color: #999999;
  434. font-size: 20rpx;
  435. }
  436. .is-paly-card {
  437. width: 70rpx;
  438. height: 70rpx;
  439. flex-shrink: 0;
  440. margin-left: 30rpx;
  441. image {
  442. width: 70rpx;
  443. height: 70rpx;
  444. }
  445. }
  446. .fast-reverse {
  447. display: flex;
  448. align-items: center;
  449. justify-content: center;
  450. margin-top: 30rpx;
  451. .speed-button {
  452. width: 96rpx;
  453. height: 47rpx;
  454. background: #eaeaea;
  455. border-radius: 8rpx;
  456. text-align: center;
  457. line-height: 47rpx;
  458. margin: 0 70rpx;
  459. }
  460. .speed-img {
  461. width: 50rpx;
  462. height: 50rpx;
  463. }
  464. }
  465. }
  466. .content-abstract {
  467. margin-bottom: 30rpx;
  468. font-size: 32rpx;
  469. color: #4a4a4a;
  470. :first-child {
  471. float: left;
  472. font-weight: 700;
  473. }
  474. }
  475. .content-focuson {
  476. font-size: 32rpx !important;
  477. margin-bottom: 30rpx;
  478. color: #4a4a4a;
  479. .focuson {
  480. font-weight: 700;
  481. }
  482. }
  483. }
  484. .month_card {
  485. width: 100%;
  486. height: 565rpx;
  487. padding-left: -20rpx;
  488. }
  489. .btn-dl {
  490. background: linear-gradient(253deg, #fcf3e9 0%, #eedec8 100%) !important;
  491. color: #333 !important;
  492. margin: 30rpx auto !important;
  493. }
  494. .month-back {
  495. background: #f6f6f6 !important;
  496. color: #999 !important;
  497. }
  498. .moneh-text {
  499. text-align: center;
  500. width: 632rpx;
  501. margin: 0 auto 20rpx;
  502. color: #999999;
  503. }
  504. .nodata-tip {
  505. color: #999;
  506. font-size: 30rpx;
  507. }
  508. }
  509. </style>