reportSecretDetail.vue 15 KB

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