reportSecretDetail.vue 16 KB

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