roadEssence.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <template>
  2. <view class="container content-road forbid-copy">
  3. <block v-if="haveAuth === 1">
  4. <view class="container-top">
  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="content-audio">
  17. <view class="audio-img">
  18. <image v-if="isPlay" @click="audiouspend" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/suspend_icon.png"></image>
  19. <image v-else @click="audioPlay" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/play_icon.png" mode=""></image>
  20. </view>
  21. <view class="audio-title">
  22. <text>{{ detali.VideoName }}</text>
  23. <text>{{ detali.VideoPlaySeconds }}</text>
  24. </view>
  25. </view>
  26. <view class="content-abstract">
  27. <text>摘要:</text>
  28. <text>
  29. {{ detali.Abstract }}
  30. </text>
  31. </view>
  32. <view class="content-boby">
  33. <mp-html :content="detali.Body" />
  34. </view>
  35. </view>
  36. <view class="content-link" v-if="detali.ReportLink" @click="goDetali"> 查看深度报告 </view>
  37. <statement :show="isShowStatement" />
  38. </block>
  39. <view class="noauth-cont" v-else-if="haveAuth === 3 || haveAuth === 4">
  40. <block v-if="!isShowAlert">
  41. <image src="https://hzstatic.hzinsights.com/cygx/czbk/noauth.png" class="noauth-ico"></image>
  42. <block>
  43. <view class="tip">您暂无权限查看此文章内容,若想查看可以申请开通哦</view>
  44. <view class="btn-cont" @click="applyAuth"> 立即申请 </view>
  45. </block>
  46. <view class="btn-cont back-btn" @click="backIndex"> 返回首页 </view>
  47. </block>
  48. <block v-else>
  49. <text class="moneh-text"> 上传名片并填写简单信息,24小时内我们会为您开通一个月的免费月卡 </text>
  50. <img src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/month_card.png" class="month_card" alt="" />
  51. <view class="btn-cont btn-dl" @click="applyAuth"> 立即上传 </view>
  52. <view class="btn-cont month-back" @click="backIndex"> 返回</view>
  53. </block>
  54. </view>
  55. <freeCharge class="free-charge" :isShowFreeBtn="isShowFree" />
  56. </view>
  57. </template>
  58. <script>
  59. import { Reports, User, FreeButton } from "@/config/api.js";
  60. import statement from "@/reportPages/components/statement.vue";
  61. import freeCharge from "@/components/freeCharge";
  62. let app = getApp({ allowDefault: true });
  63. export default {
  64. data() {
  65. return {
  66. id: "", //
  67. detali: "", //详情
  68. audioContext: "", //音频
  69. isPlay: false, //mp3 播放的图片
  70. isShowStatement: false, //免责声明隐现
  71. haveAuth: "", //权限判断
  72. videoUrl: "",
  73. isShowAlert: false,
  74. };
  75. },
  76. methods: {
  77. async getDetail() {
  78. const res = await Reports.roadshowEssence({
  79. ArticleId: this.id,
  80. });
  81. if (res.Ret === 200) {
  82. this.detali = res.Data.Detail;
  83. this.haveAuth = res.Data.HasPermission;
  84. this.videoUrl = res.Data.Detail.VideoUrl;
  85. if (app.globalData.bgAudioManager.src === this.videoUrl && app.globalData.bgAudioManager.paused === false) {
  86. this.isPlay = true;
  87. }
  88. }
  89. },
  90. goDetali() {
  91. uni.navigateTo({
  92. url: "/pageMy/reportDetail/reportDetail?id=" + this.detali.ReportLink,
  93. });
  94. },
  95. /* 无权限申请开通权限 */
  96. applyAuth() {
  97. this.haveAuth === 4
  98. ? uni.navigateTo({
  99. url: "/pageMy/applyTrial/applyTrial?tryType=Article&detailId=" + this.id,
  100. })
  101. : uni.showModal({
  102. title: "",
  103. content: "您已经提交过申请了,请耐心等待",
  104. showCancel: false,
  105. confirmColor: "#365595",
  106. success: function (res) {
  107. uni.navigateBack({
  108. fail() {
  109. uni.switchTab({
  110. url: "/pages/index/index",
  111. });
  112. },
  113. });
  114. },
  115. });
  116. },
  117. // 返回首頁
  118. backIndex() {
  119. uni.switchTab({
  120. url: "/pages/index/index",
  121. });
  122. },
  123. audioPlay(e) {
  124. if (this.videoUrl === app.globalData.bgAudioManager.src) {
  125. app.globalData.bgAudioManager.play();
  126. } else {
  127. app.globalData.bgAudioManager.title = this.detali.VideoName;
  128. app.globalData.bgAudioManager.src = this.videoUrl;
  129. }
  130. this.isPlay = true;
  131. },
  132. audiouspend() {
  133. this.isPlay = false;
  134. app.globalData.bgAudioManager.pause();
  135. },
  136. //获取权限弹窗是否展示免费月卡接口
  137. async userIsShowAlert() {
  138. const res = await FreeButton.userIsShowAlert();
  139. if (res.Ret === 200) {
  140. this.isShowAlert = res.Data.IsShow;
  141. }
  142. },
  143. },
  144. components: {
  145. statement,
  146. freeCharge,
  147. },
  148. onLoad(option) {
  149. this.id = Number(option.id) || "";
  150. app.globalData.bgAudioManager.onEnded((res) => {
  151. this.isPlay = false;
  152. });
  153. app.globalData.bgAudioManager.onPause((res) => {
  154. this.isPlay = false;
  155. });
  156. app.globalData.bgAudioManager.onPlay((res) => {
  157. this.isPlay = true;
  158. });
  159. app.globalData.bgAudioManager.onStop((res) => {
  160. this.isPlay = false;
  161. });
  162. this.userIsShowAlert();
  163. },
  164. async onShow() {
  165. await this.$store.dispatch("checkHandle");
  166. if (!this.$store.state.isAuth && !this.$store.state.isBind) {
  167. //已授权已绑定
  168. this.getDetail();
  169. this.audioContext = uni.createInnerAudioContext();
  170. //音频自然播放结束事件
  171. this.audioContext.onEnded((res) => {
  172. this.isPlay = true;
  173. });
  174. }
  175. },
  176. /**
  177. * 用户点击分享
  178. */
  179. onShareAppMessage: function (res) {
  180. return {
  181. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费试用月卡!" : this.detali.Title,
  182. url: "reportPages/roadEssence/roadEssence?id=" + this.id,
  183. success: (res) => {},
  184. fail: (err) => {},
  185. };
  186. },
  187. };
  188. </script>
  189. <style lang="scss" scoped>
  190. .content-road {
  191. padding: 10rpx 34rpx 34rpx;
  192. .container-top {
  193. font-size: 28rpx;
  194. .content-title {
  195. color: #4a4a4a;
  196. font-size: 34rpx;
  197. font-weight: bold;
  198. }
  199. .content-time {
  200. margin: 24rpx 0 34rpx 0;
  201. display: flex;
  202. justify-content: space-between;
  203. color: #333333;
  204. }
  205. .content-statement {
  206. display: flex;
  207. color: #707070;
  208. .statement {
  209. margin-left: 10rpx;
  210. color: #3385ff;
  211. }
  212. }
  213. .content-audio {
  214. margin: 60rpx 0;
  215. width: 682rpx;
  216. align-items: center;
  217. background: #ffffff;
  218. box-shadow: 0rpx 0rpx 12rpx rgba(33, 74, 135, 0.16);
  219. opacity: 1;
  220. border-radius: 16rpx;
  221. display: flex;
  222. padding: 24rpx 21rpx 18rpx;
  223. .audio-img {
  224. width: 154rpx;
  225. height: 154rpx;
  226. margin-right: 20rpx;
  227. image {
  228. width: 154rpx;
  229. height: 154rpx;
  230. }
  231. }
  232. .audio-title {
  233. font-size: 28rpx;
  234. color: #333;
  235. :first-child {
  236. width: 450rpx;
  237. overflow: hidden;
  238. text-overflow: ellipsis;
  239. white-space: nowrap;
  240. margin-bottom: 30rpx;
  241. font-size: 32rpx;
  242. }
  243. }
  244. }
  245. .content-abstract {
  246. margin-bottom: 30rpx;
  247. font-size: 32rpx;
  248. color: #4a4a4a;
  249. :first-child {
  250. float: left;
  251. font-weight: 700;
  252. }
  253. }
  254. .content-boby {
  255. font-size: 32rpx;
  256. image,
  257. img {
  258. width: 100%;
  259. }
  260. }
  261. }
  262. .content-link {
  263. width: 368rpx;
  264. height: 80rpx;
  265. border: 2rpx solid #2c83ff;
  266. opacity: 1;
  267. border-radius: 4rpx;
  268. line-height: 76rpx;
  269. text-align: center;
  270. color: #2c83ff;
  271. font-size: 32rpx;
  272. box-sizing: border-box;
  273. margin: 100rpx auto;
  274. }
  275. .month_card {
  276. width: 100%;
  277. height: 565rpx;
  278. padding-left: -20rpx;
  279. }
  280. .btn-dl {
  281. background: linear-gradient(253deg, #fcf3e9 0%, #eedec8 100%) !important;
  282. color: #333 !important;
  283. margin: 30rpx auto !important;
  284. }
  285. .month-back {
  286. background: #f6f6f6 !important;
  287. color: #999 !important;
  288. }
  289. .moneh-text {
  290. text-align: center;
  291. width: 632rpx;
  292. margin: 0 auto 20rpx;
  293. color: #999999;
  294. }
  295. @import "../jurisdiction.scss";
  296. }
  297. </style>