roadEssence.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558
  1. <template>
  2. <block>
  3. <view class="container content-road forbid-copy" v-if="isUserBindingPhoneNumber">
  4. <block v-if="haveAuth === 1">
  5. <view class="container-top">
  6. <view class="report-content-title">
  7. {{ detali.Title }}
  8. </view>
  9. <view class="content-time">
  10. <text>{{ detali.Department }}</text>
  11. <text>{{ detali.PublishDate }}</text>
  12. </view>
  13. <view class="content-statement">
  14. <text>注:请务必阅读</text>
  15. <text class="statement" @click="isShowStatement = true">免责声明 </text>
  16. </view>
  17. <view class="audio-card">
  18. <view class="card-title text_oneLine">
  19. {{ detali.VideoName }}
  20. </view>
  21. <view class="slider-paly">
  22. <view style="flex: 1; padding-top: 20rpx">
  23. <slider
  24. activeColor="#376cbb"
  25. :max="detali.VideoPlaySeconds"
  26. :value="curTime"
  27. @touchstart="touchstartHandler"
  28. @change="handleAudioSliderChange($event)"
  29. @changing="handleAudioSliderChangeing($event)"
  30. block-size="16"
  31. class="slider"
  32. />
  33. <view class="card-time">
  34. <text class="time">{{ curTime | formatVoiceTime }}</text>
  35. <text class="time">{{ detali.VideoPlaySeconds | formatVoiceTime }}</text>
  36. </view>
  37. </view>
  38. <view class="is-paly-card">
  39. <image
  40. @click.stop="audioPlayBack"
  41. :src="
  42. curVoiceId === detali.ArticleId && !curAudioPaused
  43. ? 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/play_icon.gif'
  44. : 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/pause_icon.png'
  45. "
  46. ></image>
  47. </view>
  48. </view>
  49. <view class="fast-reverse">
  50. <image
  51. @click="speedReverseHandler('reverse')"
  52. class="speed-img"
  53. src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/fastReverse_icon.png"
  54. ></image>
  55. <block v-for="(item, index) in timesTheSpeed" :key="item.value">
  56. <view class="speed-button" v-if="isTimes == item.value" @click="isTimesHandler(index)">
  57. {{ item.name }}
  58. </view>
  59. </block>
  60. <image
  61. @click="speedReverseHandler('speed')"
  62. class="speed-img"
  63. src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/speed_icon.png"
  64. ></image>
  65. </view>
  66. </view>
  67. <view class="content-abstract">
  68. <text>摘要:</text>
  69. <text>
  70. {{ detali.Abstract }}
  71. </text>
  72. </view>
  73. <view class="content-boby">
  74. <mp-html :content="strFontSize(detali.Body)" />
  75. </view>
  76. </view>
  77. <view class="content-link" v-if="detali.ReportLink" @click="goDetali"> 查看深度报告 </view>
  78. <view class="bottom-icon">
  79. <view class="item" @click="leavingMessage">
  80. <image class="icon-img" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/leaving_message.png"></image>
  81. <view>留言</view>
  82. </view>
  83. <view class="item" @click="collectHandle">
  84. <image
  85. class="icon-img"
  86. :src="
  87. isCollection
  88. ? 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/collect_act.png'
  89. : 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/collect_ico.png'
  90. "
  91. ></image>
  92. <view>收藏</view>
  93. </view>
  94. </view>
  95. <statement :show="isShowStatement" />
  96. </block>
  97. <view class="noauth-cont" v-else-if="haveAuth === 3 || haveAuth === 4">
  98. <block v-if="!isShowAlert">
  99. <image src="https://hzstatic.hzinsights.com/cygx/czbk/noauth.png" class="noauth-ico"></image>
  100. <block>
  101. <view class="tip">您暂无权限查看此文章内容,若想查看可以申请开通哦</view>
  102. <view class="btn-cont" @click="applyAuth"> 立即申请 </view>
  103. </block>
  104. <view class="btn-cont back-btn" @click="backIndex"> 返回首页 </view>
  105. </block>
  106. <block v-else>
  107. <text class="moneh-text"> 上传名片并填写简单信息,24小时内我们会为您开通一个月的免费月卡 </text>
  108. <img src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/month_card.png" class="month_card" alt="" />
  109. <view class="btn-cont btn-dl" @click="applyAuth"> 立即上传 </view>
  110. <view class="btn-cont month-back" @click="backIndex"> 返回</view>
  111. </block>
  112. </view>
  113. <freeCharge class="free-charge" :isShowFreeBtn="isShowFree" />
  114. <view v-show="false">
  115. <audioModule :showAudioPop="showAudioPop" />
  116. </view>
  117. </view>
  118. <not-have-login v-else />
  119. <Loading />
  120. </block>
  121. </template>
  122. <script>
  123. import { Reports, Report, User, FreeButton } from "@/config/api.js";
  124. import statement from "@/reportPages/components/statement.vue";
  125. import freeCharge from "@/components/freeCharge";
  126. import audioModule from "@/components/audioModule/index";
  127. import NotHaveLogin from "../../components/notHaveLogin.vue";
  128. let app = getApp({ allowDefault: true });
  129. export default {
  130. data() {
  131. return {
  132. id: "", //
  133. detali: "", //详情
  134. audioContext: "", //音频
  135. isPlay: false, //mp3 播放的图片
  136. isShowStatement: false, //免责声明隐现
  137. haveAuth: "", //权限判断
  138. videoUrl: "",
  139. isShowAlert: false,
  140. isCollection: false, //是否收藏
  141. timesTheSpeed: [
  142. { name: "倍速", value: 1 },
  143. { name: "1.25倍", value: 1.25 },
  144. { name: "1.5倍", value: 1.5 },
  145. { name: "2倍", value: 2 },
  146. ],
  147. showAudioBox: false,
  148. curTime: 0,
  149. };
  150. },
  151. computed: {
  152. curVoiceId() {
  153. //当前正在播放的音频id
  154. return this.$store.state.audioBg.reportId;
  155. },
  156. curAudioPaused() {
  157. //当前音频是否暂停状态
  158. return this.$store.state.audioBg.paused;
  159. },
  160. //几倍的播放数度
  161. isTimes() {
  162. let isMultiple = this.curVoiceId === this.detali.ArticleId ? this.$store.state.audioBg.multiple : 1;
  163. return isMultiple;
  164. },
  165. showAudioPop() {
  166. return this.$store.state.audioBg.show;
  167. },
  168. },
  169. filters: {
  170. formatVoiceTime(e) {
  171. let m = parseInt(e / 60);
  172. let s = parseInt(e % 60);
  173. return `${m > 9 ? m : "0" + m}:${s > 9 ? s : "0" + s}`;
  174. },
  175. },
  176. watch: {
  177. "$store.state.audioBg.curTime": {
  178. handler(newVal) {
  179. this.curTime = this.curVoiceId === this.detali.ArticleId ? newVal : 0;
  180. },
  181. immediate: true,
  182. deep: true,
  183. },
  184. },
  185. methods: {
  186. // 留言
  187. leavingMessage() {
  188. uni.navigateTo({
  189. url: "/activityPages/generationAsk/generationAsk?id=" + this.id + "&type=文章",
  190. });
  191. },
  192. /* 收藏 */
  193. collectHandle() {
  194. Report.collectRpt({
  195. ArticleId: this.id,
  196. PageRouter: this.$store.state.pageRouterReport,
  197. }).then((res) => {
  198. this.isCollection = !this.isCollection;
  199. this.$util.toast(res.Msg);
  200. });
  201. },
  202. // 获取报告详情
  203. async getDetail() {
  204. const res = await Reports.roadshowEssence({
  205. ArticleId: this.id,
  206. });
  207. if (res.Ret === 200) {
  208. this.haveAuth = res.Data.HasPermission;
  209. if (res.Data.Detail) {
  210. let arr = res.Data.Detail.VideoPlaySeconds.split(":");
  211. res.Data.Detail.VideoPlaySeconds = arr[0] * 60 + (arr[1] - 0);
  212. this.detali = res.Data.Detail;
  213. this.isCollection = this.detali.IsCollect;
  214. this.videoUrl = res.Data.Detail.VideoUrl;
  215. if (this.globalBgAudioManager.src === this.videoUrl && this.globalBgAudioManager.paused === false) {
  216. this.isPlay = true;
  217. }
  218. }
  219. }
  220. },
  221. goDetali() {
  222. uni.navigateTo({
  223. url: "/pageMy/reportDetail/reportDetail?id=" + this.detali.ReportLink,
  224. });
  225. },
  226. /* 无权限申请开通权限 */
  227. applyAuth() {
  228. this.haveAuth === 4
  229. ? uni.navigateTo({
  230. url: "/pageMy/applyTrial/applyTrial?tryType=Article&detailId=" + this.id,
  231. })
  232. : uni.showModal({
  233. title: "",
  234. content: "您已经提交过申请了,请耐心等待",
  235. showCancel: false,
  236. confirmColor: "#365595",
  237. success: function (res) {
  238. uni.navigateBack({
  239. fail() {
  240. uni.switchTab({
  241. url: "/pages/index/index",
  242. });
  243. },
  244. });
  245. },
  246. });
  247. },
  248. // 返回首頁
  249. backIndex() {
  250. uni.switchTab({
  251. url: "/pages/index/index",
  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. audiouspend() {
  269. this.isPlay = false;
  270. this.globalBgAudioManager.pause();
  271. },
  272. //获取权限弹窗是否展示免费月卡接口
  273. async userIsShowAlert() {
  274. const res = await FreeButton.userIsShowAlert();
  275. if (res.Ret === 200) {
  276. this.isShowAlert = res.Data.IsShow;
  277. }
  278. },
  279. // //拖动进度条
  280. // handleAudioSliderChange(e) {
  281. // const value = e.detail.value;
  282. // this.globalBgAudioManager.seek(value);
  283. // },
  284. // handleAudioSliderChangeing(e) {
  285. // this.curTime = e.detail.value;
  286. // },
  287. //拖动进度条
  288. handleAudioSliderChangeing(e) {
  289. this.curTime = e.detail.value;
  290. },
  291. //拖动进度条
  292. handleAudioSliderChange(e) {
  293. const value = e.detail.value;
  294. this.globalBgAudioManager.seek(value);
  295. setTimeout(() => {
  296. this.$store.commit("audioBg/setSlide", false);
  297. }, 300);
  298. },
  299. touchstartHandler() {
  300. this.$store.commit("audioBg/setSlide", true);
  301. },
  302. //倍速播放
  303. isTimesHandler(i) {
  304. let list = { Url: this.detali.VideoUrl, Name: this.detali.Title, PlaySeconds: this.detali.VideoPlaySeconds };
  305. let index = i == 3 ? 0 : i + 1;
  306. this.$store.commit("audioBg/setMultiple", this.timesTheSpeed[index].value);
  307. this.globalBgAudioManager.playbackRate = this.isTimes;
  308. this.globalBgAudioManager.startTime = this.curTime;
  309. if (this.$store.state.audioBg.reportId != this.detali.ArticleId) {
  310. this.$store.commit("audioBg/addAudio", { list, reportId: this.detali.ArticleId });
  311. this.globalBgAudioManager.play();
  312. } else {
  313. if (this.globalBgAudioManager.paused) {
  314. this.globalBgAudioManager.play();
  315. }
  316. }
  317. },
  318. //快进 快退
  319. speedReverseHandler(type) {
  320. let isTime = type == "reverse" ? this.curTime - 15 : this.curTime + 15;
  321. isTime = isTime <= 0 ? 0 : isTime >= this.detali.VideoPlaySeconds ? this.detali.VideoPlaySeconds - 1 : isTime;
  322. this.globalBgAudioManager.seek(isTime);
  323. },
  324. },
  325. components: {
  326. statement,
  327. freeCharge,
  328. audioModule,
  329. NotHaveLogin,
  330. },
  331. onLoad(option) {
  332. this.id = Number(option.id) || "";
  333. // 免费送月卡
  334. // this.userIsShowAlert();
  335. },
  336. onShow() {
  337. if (!this.$store.state.isAuth && !this.$store.state.isBind) {
  338. //已授权已绑定
  339. this.getDetail();
  340. }
  341. this.$store.commit("setRouterReport", "路演精华");
  342. this.showAudioBox = true;
  343. },
  344. onHide() {
  345. this.showAudioBox = false;
  346. },
  347. /**
  348. * 用户点击分享
  349. */
  350. onShareAppMessage: function (res) {
  351. return {
  352. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : this.detali.Title,
  353. url: "reportPages/roadEssence/roadEssence?id=" + this.id,
  354. success: (res) => {},
  355. fail: (err) => {},
  356. };
  357. },
  358. };
  359. </script>
  360. <style lang="scss" scoped>
  361. .content-road {
  362. padding: 10rpx 34rpx 134rpx 34rpx;
  363. .container-top {
  364. font-size: 28rpx;
  365. .content-time {
  366. margin: 24rpx 0 34rpx 0;
  367. display: flex;
  368. justify-content: space-between;
  369. color: #333333;
  370. }
  371. .content-statement {
  372. display: flex;
  373. color: #707070;
  374. .statement {
  375. margin-left: 10rpx;
  376. color: #376cbb;
  377. }
  378. }
  379. .content-audio {
  380. margin: 60rpx 0;
  381. width: 682rpx;
  382. align-items: center;
  383. background: #ffffff;
  384. box-shadow: 0rpx 0rpx 12rpx rgba(33, 74, 135, 0.16);
  385. opacity: 1;
  386. border-radius: 16rpx;
  387. display: flex;
  388. padding: 24rpx 21rpx 18rpx;
  389. .audio-img {
  390. width: 154rpx;
  391. height: 154rpx;
  392. margin-right: 20rpx;
  393. image {
  394. width: 154rpx;
  395. height: 154rpx;
  396. }
  397. }
  398. .audio-title {
  399. font-size: 28rpx;
  400. color: #333;
  401. :first-child {
  402. width: 450rpx;
  403. overflow: hidden;
  404. text-overflow: ellipsis;
  405. white-space: nowrap;
  406. margin-bottom: 30rpx;
  407. font-size: 32rpx;
  408. }
  409. }
  410. }
  411. .content-abstract {
  412. margin-bottom: 30rpx;
  413. font-size: 32rpx;
  414. color: #4a4a4a;
  415. :first-child {
  416. float: left;
  417. font-weight: 700;
  418. }
  419. }
  420. .content-boby {
  421. font-size: 32rpx;
  422. image,
  423. img {
  424. width: 100%;
  425. }
  426. }
  427. }
  428. .content-link {
  429. width: 368rpx;
  430. height: 80rpx;
  431. border: 2rpx solid #2c83ff;
  432. opacity: 1;
  433. border-radius: 4rpx;
  434. line-height: 76rpx;
  435. text-align: center;
  436. color: #2c83ff;
  437. font-size: 32rpx;
  438. box-sizing: border-box;
  439. margin: 100rpx auto;
  440. }
  441. .month_card {
  442. width: 100%;
  443. height: 565rpx;
  444. padding-left: -20rpx;
  445. }
  446. .btn-dl {
  447. background: linear-gradient(253deg, #fcf3e9 0%, #eedec8 100%) !important;
  448. color: #333 !important;
  449. margin: 30rpx auto !important;
  450. }
  451. .month-back {
  452. background: #f6f6f6 !important;
  453. color: #999 !important;
  454. }
  455. .moneh-text {
  456. text-align: center;
  457. width: 632rpx;
  458. margin: 0 auto 20rpx;
  459. color: #999999;
  460. }
  461. .audio-card {
  462. width: 100%;
  463. height: 282rpx;
  464. background: #f9f9f9;
  465. border-radius: 16rpx;
  466. margin: 30rpx auto;
  467. padding: 30rpx;
  468. .slider {
  469. width: 100%;
  470. margin: 0;
  471. }
  472. .slider-paly {
  473. display: flex;
  474. height: 80rpx;
  475. align-items: center;
  476. padding-left: 20rpx;
  477. }
  478. .card-title {
  479. font-size: 28rpx;
  480. padding: 0 40rpx;
  481. text-align: center;
  482. margin-bottom: 35rpx;
  483. }
  484. .card-time {
  485. display: flex;
  486. justify-content: space-between;
  487. color: #999999;
  488. font-size: 20rpx;
  489. }
  490. .is-paly-card {
  491. width: 70rpx;
  492. height: 70rpx;
  493. flex-shrink: 0;
  494. margin-left: 30rpx;
  495. image {
  496. width: 70rpx;
  497. height: 70rpx;
  498. }
  499. }
  500. .fast-reverse {
  501. display: flex;
  502. align-items: center;
  503. justify-content: center;
  504. margin-top: 30rpx;
  505. .speed-button {
  506. width: 96rpx;
  507. height: 47rpx;
  508. background: #eaeaea;
  509. border-radius: 8rpx;
  510. text-align: center;
  511. line-height: 47rpx;
  512. margin: 0 70rpx;
  513. }
  514. .speed-img {
  515. width: 50rpx;
  516. height: 50rpx;
  517. }
  518. }
  519. }
  520. .bottom-icon {
  521. position: fixed;
  522. display: flex;
  523. width: 100%;
  524. height: constant(100rpx + safe-area-inset-bottom);
  525. height: env(100rpx + safe-area-inset-bottom);
  526. justify-content: space-around;
  527. z-index: 99;
  528. bottom: 0;
  529. padding-bottom: constant(safe-area-inset-bottom);
  530. padding-bottom: env(safe-area-inset-bottom);
  531. left: 0;
  532. font-size: 20rpx;
  533. color: #999;
  534. background-color: #fff;
  535. border-top: 1px solid #dddddd;
  536. padding-top: 20rpx;
  537. .item {
  538. display: flex;
  539. align-items: center;
  540. flex-direction: column;
  541. justify-content: center;
  542. .icon-img {
  543. width: 44rpx;
  544. height: 44rpx;
  545. margin-bottom: 4rpx;
  546. }
  547. }
  548. }
  549. @import "../jurisdiction.scss";
  550. }
  551. </style>