reportSecretDetail.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  1. <template>
  2. <view class="container content-secret forbid-copy">
  3. <block v-if="hasPermission == 1">
  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. this.hasPermission = res.Data.HasPermission;
  192. this.isType == 1 ? (this.dataList = res.Data.List || []) : (this.dataListResearch = res.Data.List || []);
  193. if (res.Data.Detail) {
  194. let arr = res.Data.Detail.VideoPlaySeconds.split(":");
  195. res.Data.Detail.VideoPlaySeconds = arr[0] * 60 + (arr[1] - 0);
  196. this.detali = res.Data.Detail;
  197. this.videoUrl = res.Data.Detail.VideoUrl;
  198. if (this.globalBgAudioManager.src === this.videoUrl && this.globalBgAudioManager.paused === false) {
  199. this.isPlay = true;
  200. }
  201. }
  202. }
  203. },
  204. /* 无权限申请开通权限 */
  205. applyAuth() {
  206. this.hasPermission === 4
  207. ? uni.navigateTo({
  208. url: "/pageMy/applyTrial/applyTrial?tryType=Article&detailId=" + this.id,
  209. })
  210. : uni.showModal({
  211. title: "",
  212. content: "您已经提交过申请了,请耐心等待",
  213. showCancel: false,
  214. confirmColor: "#365595",
  215. success: function (res) {
  216. uni.navigateBack({
  217. fail() {
  218. uni.switchTab({
  219. url: "/pages/index/index",
  220. });
  221. },
  222. });
  223. },
  224. });
  225. },
  226. // 返回首頁
  227. backIndex() {
  228. uni.switchTab({
  229. url: "/pages/index/index",
  230. });
  231. },
  232. //获取权限弹窗是否展示免费月卡接口
  233. async userIsShowAlert() {
  234. const res = await FreeButton.userIsShowAlert();
  235. if (res.Ret === 200) {
  236. this.isShowAlert = res.Data.IsShow;
  237. }
  238. },
  239. //音频点击暂停播放
  240. audioPlayBack() {
  241. let list = { Url: this.detali.VideoUrl, Name: this.detali.Title, PlaySeconds: this.detali.VideoPlaySeconds };
  242. if (this.$store.state.audioBg.reportId == this.detali.ArticleId) {
  243. if (this.globalBgAudioManager.paused) {
  244. this.globalBgAudioManager.play();
  245. } else {
  246. this.globalBgAudioManager.pause();
  247. }
  248. } else {
  249. this.$store.commit("audioBg/updateAudioTime", 0);
  250. this.$store.commit("audioBg/addAudio", { list, reportId: this.detali.ArticleId });
  251. }
  252. },
  253. //拖动进度条
  254. handleAudioSliderChangeing(e) {
  255. this.curTime = e.detail.value;
  256. },
  257. //拖动进度条
  258. handleAudioSliderChange(e) {
  259. const value = e.detail.value;
  260. this.globalBgAudioManager.seek(value);
  261. setTimeout(() => {
  262. this.$store.commit("audioBg/setSlide", false);
  263. }, 300);
  264. },
  265. touchstartHandler() {
  266. this.$store.commit("audioBg/setSlide", true);
  267. },
  268. //倍速播放
  269. isTimesHandler(i) {
  270. let list = { Url: this.detali.VideoUrl, Name: this.detali.Title, PlaySeconds: this.detali.VideoPlaySeconds };
  271. let index = i == 3 ? 0 : i + 1;
  272. this.$store.commit("audioBg/setMultiple", this.timesTheSpeed[index].value);
  273. this.globalBgAudioManager.playbackRate = this.isTimes;
  274. this.globalBgAudioManager.startTime = this.curTime;
  275. if (this.$store.state.audioBg.reportId != this.detali.ArticleId) {
  276. this.$store.commit("audioBg/addAudio", { list, reportId: this.detali.ArticleId });
  277. this.globalBgAudioManager.play();
  278. } else {
  279. if (this.globalBgAudioManager.paused) {
  280. this.globalBgAudioManager.play();
  281. }
  282. }
  283. },
  284. //快进 快退
  285. speedReverseHandler(type) {
  286. let isTime = type == "reverse" ? this.curTime - 15 : this.curTime + 15;
  287. isTime = isTime <= 0 ? 0 : isTime >= this.audioTime ? this.audioTime - 1 : isTime;
  288. this.globalBgAudioManager.seek(isTime);
  289. },
  290. },
  291. components: {
  292. statement,
  293. researchSummary,
  294. reportChoiceness,
  295. freeCharge,
  296. audioModule,
  297. },
  298. async onLoad(option) {
  299. this.isType = option.type;
  300. this.id = Number(option.id) || "";
  301. let titleTxT = this.isType == 1 ? "报告精选" : this.isType == 2 ? "本周研究汇总" : "上周纪要汇总";
  302. uni.setNavigationBarTitle({
  303. title: titleTxT,
  304. });
  305. this.$store.commit("setRouterReport", titleTxT);
  306. await this.$store.dispatch("checkHandle");
  307. if (!this.$store.state.isAuth && !this.$store.state.isBind) this.getDetilaiList();
  308. // 免费送月卡
  309. // this.userIsShowAlert();
  310. },
  311. onShow() {
  312. this.showAudioBox = true;
  313. },
  314. onHide() {
  315. this.showAudioBox = false;
  316. },
  317. /**
  318. * 用户点击分享
  319. */
  320. onShareAppMessage: function (res) {
  321. return {
  322. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : this.detali.Title,
  323. path: "/reportPages/reportSecretDetail/reportSecretDetail?type=" + this.isType + "&id=" + this.id,
  324. success: (res) => {},
  325. fail: (err) => {},
  326. };
  327. },
  328. };
  329. </script>
  330. <style lang="scss" scoped>
  331. .content-secret {
  332. @import "../jurisdiction.scss";
  333. padding: 10rpx 34rpx 34rpx;
  334. .container-top {
  335. font-size: 28rpx;
  336. .content-title {
  337. color: #4a4a4a;
  338. font-size: 34rpx;
  339. font-weight: bold;
  340. }
  341. .content-time {
  342. margin: 24rpx 0 34rpx 0;
  343. display: flex;
  344. justify-content: space-between;
  345. color: #333333;
  346. }
  347. .content-statement {
  348. display: flex;
  349. color: #707070;
  350. .statement {
  351. margin-left: 10rpx;
  352. color: #3385ff;
  353. }
  354. }
  355. .audio-card {
  356. width: 100%;
  357. height: 282rpx;
  358. background: #f9f9f9;
  359. border-radius: 16rpx;
  360. margin: 30rpx auto;
  361. padding: 30rpx;
  362. .slider {
  363. width: 100%;
  364. margin: 0;
  365. }
  366. .slider-paly {
  367. display: flex;
  368. height: 80rpx;
  369. align-items: center;
  370. padding-left: 20rpx;
  371. }
  372. .card-title {
  373. font-size: 28rpx;
  374. padding: 0 40rpx;
  375. text-align: center;
  376. margin-bottom: 35rpx;
  377. }
  378. .card-time {
  379. display: flex;
  380. justify-content: space-between;
  381. color: #999999;
  382. font-size: 20rpx;
  383. }
  384. .is-paly-card {
  385. width: 70rpx;
  386. height: 70rpx;
  387. flex-shrink: 0;
  388. margin-left: 30rpx;
  389. image {
  390. width: 70rpx;
  391. height: 70rpx;
  392. }
  393. }
  394. .fast-reverse {
  395. display: flex;
  396. align-items: center;
  397. justify-content: center;
  398. margin-top: 30rpx;
  399. .speed-button {
  400. width: 96rpx;
  401. height: 47rpx;
  402. background: #eaeaea;
  403. border-radius: 8rpx;
  404. text-align: center;
  405. line-height: 47rpx;
  406. margin: 0 70rpx;
  407. }
  408. .speed-img {
  409. width: 50rpx;
  410. height: 50rpx;
  411. }
  412. }
  413. }
  414. .content-abstract {
  415. margin-bottom: 30rpx;
  416. font-size: 32rpx;
  417. color: #4a4a4a;
  418. :first-child {
  419. float: left;
  420. font-weight: 700;
  421. }
  422. }
  423. .content-focuson {
  424. font-size: 32rpx !important;
  425. margin-bottom: 30rpx;
  426. color: #4a4a4a;
  427. .focuson {
  428. font-weight: 700;
  429. }
  430. }
  431. }
  432. .month_card {
  433. width: 100%;
  434. height: 565rpx;
  435. padding-left: -20rpx;
  436. }
  437. .btn-dl {
  438. background: linear-gradient(253deg, #fcf3e9 0%, #eedec8 100%) !important;
  439. color: #333 !important;
  440. margin: 30rpx auto !important;
  441. }
  442. .month-back {
  443. background: #f6f6f6 !important;
  444. color: #999 !important;
  445. }
  446. .moneh-text {
  447. text-align: center;
  448. width: 632rpx;
  449. margin: 0 auto 20rpx;
  450. color: #999999;
  451. }
  452. }
  453. </style>