reportSecretDetail.vue 14 KB

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