reportSecretDetail.vue 16 KB

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