reportSecretDetail.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  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, Mine } 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. async postStopTime(type) {
  326. const res = await Mine.report_selectionAddStopTime({
  327. ArticleId: this.id,
  328. StopTime: this.readTiem,
  329. OutType: type,
  330. Source: +this.isType,
  331. });
  332. },
  333. },
  334. components: {
  335. statement,
  336. researchSummary,
  337. reportChoiceness,
  338. freeCharge,
  339. audioModule,
  340. NotHaveLogin,
  341. },
  342. async onLoad(option) {
  343. this.isType = option.type;
  344. this.id = Number(option.id) || "";
  345. this.titleTxT = this.isType == 1 ? "报告精选" : this.isType == 2 ? "本周研究汇总" : "上周纪要汇总";
  346. uni.setNavigationBarTitle({
  347. title: this.titleTxT,
  348. });
  349. },
  350. onShow() {
  351. this.readTiem = 0;
  352. this.setIntervalTiem = setInterval(() => {
  353. this.readTiem++;
  354. }, 1000);
  355. if (!this.$store.state.isAuth && !this.$store.state.isBind) {
  356. this.getDetilaiList();
  357. }
  358. this.$store.commit("setRouterReport", this.titleTxT);
  359. this.showAudioBox = true;
  360. },
  361. // 页面隐藏/切入后台时触发
  362. async onHide() {
  363. this.showAudioBox = false;
  364. clearInterval(this.setIntervalTiem);
  365. this.postStopTime(2);
  366. },
  367. // 页面卸载时触发
  368. async onUnload() {
  369. clearInterval(this.setIntervalTiem);
  370. this.postStopTime(1);
  371. },
  372. /**
  373. * 用户点击分享
  374. */
  375. onShareAppMessage: function (res) {
  376. return {
  377. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : this.detali.Title,
  378. path: "/reportPages/reportSecretDetail/reportSecretDetail?type=" + this.isType + "&id=" + this.id,
  379. success: (res) => {},
  380. fail: (err) => {},
  381. };
  382. },
  383. };
  384. </script>
  385. <style lang="scss" scoped>
  386. .content-secret {
  387. @import "../jurisdiction.scss";
  388. padding: 10rpx 34rpx 34rpx;
  389. .container-top {
  390. font-size: 28rpx;
  391. .content-time {
  392. margin: 24rpx 0 34rpx 0;
  393. display: flex;
  394. justify-content: space-between;
  395. color: #333333;
  396. }
  397. .content-statement {
  398. display: flex;
  399. color: #707070;
  400. justify-content: space-between;
  401. .statement {
  402. margin-left: 10rpx;
  403. color: #3385ff;
  404. }
  405. }
  406. .audio-card {
  407. width: 100%;
  408. height: 282rpx;
  409. background: #f9f9f9;
  410. border-radius: 16rpx;
  411. margin: 30rpx auto;
  412. padding: 30rpx;
  413. .slider {
  414. width: 100%;
  415. margin: 0;
  416. }
  417. .slider-paly {
  418. display: flex;
  419. height: 80rpx;
  420. align-items: center;
  421. padding-left: 20rpx;
  422. }
  423. .card-title {
  424. font-size: 28rpx;
  425. padding: 0 40rpx;
  426. text-align: center;
  427. margin-bottom: 35rpx;
  428. }
  429. .card-time {
  430. display: flex;
  431. justify-content: space-between;
  432. color: #999999;
  433. font-size: 20rpx;
  434. }
  435. .is-paly-card {
  436. width: 70rpx;
  437. height: 70rpx;
  438. flex-shrink: 0;
  439. margin-left: 30rpx;
  440. image {
  441. width: 70rpx;
  442. height: 70rpx;
  443. }
  444. }
  445. .fast-reverse {
  446. display: flex;
  447. align-items: center;
  448. justify-content: center;
  449. margin-top: 30rpx;
  450. .speed-button {
  451. width: 96rpx;
  452. height: 47rpx;
  453. background: #eaeaea;
  454. border-radius: 8rpx;
  455. text-align: center;
  456. line-height: 47rpx;
  457. margin: 0 70rpx;
  458. }
  459. .speed-img {
  460. width: 50rpx;
  461. height: 50rpx;
  462. }
  463. }
  464. }
  465. .content-abstract {
  466. margin-bottom: 30rpx;
  467. font-size: 32rpx;
  468. color: #4a4a4a;
  469. :first-child {
  470. float: left;
  471. font-weight: 700;
  472. }
  473. }
  474. .content-focuson {
  475. font-size: 32rpx !important;
  476. margin-bottom: 30rpx;
  477. color: #4a4a4a;
  478. .focuson {
  479. font-weight: 700;
  480. }
  481. }
  482. }
  483. .month_card {
  484. width: 100%;
  485. height: 565rpx;
  486. padding-left: -20rpx;
  487. }
  488. .btn-dl {
  489. background: linear-gradient(253deg, #fcf3e9 0%, #eedec8 100%) !important;
  490. color: #333 !important;
  491. margin: 30rpx auto !important;
  492. }
  493. .month-back {
  494. background: #f6f6f6 !important;
  495. color: #999 !important;
  496. }
  497. .moneh-text {
  498. text-align: center;
  499. width: 632rpx;
  500. margin: 0 auto 20rpx;
  501. color: #999999;
  502. }
  503. .nodata-tip {
  504. color: #999;
  505. font-size: 30rpx;
  506. }
  507. }
  508. </style>