reportSecretDetail.vue 14 KB

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