reportSecretDetail.vue 14 KB

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