roadEssence.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  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="require('../image/suspend_icon.png')"></image>
  19. <image v-else @click="audioPlay" :src="require('../image/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. <!-- <rich-text :nodes="detali.Body"></rich-text> -->
  34. <mp-html :content="detali.Body"/>
  35. </view>
  36. </view>
  37. <view class="content-link" v-if="detali.ReportLink" @click="goDetali">
  38. 查看深度报告
  39. </view>
  40. <statement :show="isShowStatement"/>
  41. </block>
  42. <view class="noauth-cont" v-else-if="haveAuth===3||haveAuth===4">
  43. <image src="https://hzstatic.hzinsights.com/cygx/czbk/noauth.png" class="noauth-ico"></image>
  44. <block>
  45. <view class="tip">您暂无权限查看内容,若想查看可以申请开通哦</view>
  46. <view class="btn-cont" @click="applyAuth">
  47. 立即申请
  48. </view>
  49. </block>
  50. <view class="btn-cont back-btn" @click="backIndex">返回首页</view>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. import { Reports,User} from '@/config/api.js'
  56. import statement from '@/components/statement.vue'
  57. let app = getApp()
  58. export default {
  59. data() {
  60. return {
  61. id: '',//
  62. detali:'',//详情
  63. audioContext:'', //音频
  64. isPlay:false, //mp3 播放的图片
  65. isShowStatement:false ,//免责声明隐现
  66. haveAuth:'',//权限判断
  67. videoUrl:''
  68. }
  69. },
  70. methods: {
  71. async getDetail() {
  72. const res = await Reports.roadshowEssence({
  73. ArticleId: this.id
  74. })
  75. if(res.Ret===200){
  76. this.detali=res.Data.Detail
  77. this.haveAuth=res.Data.HasPermission
  78. this.videoUrl= res.Data.Detail.VideoUrl
  79. if( app.globalData.bgAudioManager.src === this.videoUrl) {
  80. this.isPlay = true
  81. }
  82. }
  83. },
  84. goDetali(){
  85. uni.navigateTo({
  86. url:'/pages/reportDetail/reportDetail?id='+this.detali.ReportLink
  87. })
  88. },
  89. /* 无权限申请开通权限 */
  90. applyAuth() {
  91. this.haveAuth === 4
  92. ? uni.navigateTo({
  93. url:"/pages/applyTrial/applyTrial"
  94. })
  95. : uni.showModal({
  96. title: '',
  97. content: '您已经提交过申请了,请耐心等待',
  98. showCancel:false,
  99. confirmColor:'#365595',
  100. success: function (res) {
  101. uni.navigateBack({
  102. fail(){
  103. uni.switchTab({
  104. url:'/pages/index/index'
  105. })
  106. }
  107. })
  108. }
  109. });
  110. },
  111. // 返回首頁
  112. backIndex() {
  113. uni.switchTab({
  114. url:'/pages/index/index'
  115. })
  116. },
  117. audioPlay(){
  118. this.isPlay=true
  119. app.globalData.bgAudioManager.title = this.detali.VideoName
  120. app.globalData.bgAudioManager.src = this.videoUrl
  121. },
  122. audiouspend(){
  123. this.isPlay=false
  124. app.globalData.bgAudioManager.pause()
  125. },
  126. },
  127. components:{
  128. statement
  129. },
  130. onLoad(option) {
  131. this.id = Number(option.id) ||''
  132. app.globalData.bgAudioManager.onEnded(res=>{
  133. this.isPlay=true
  134. }
  135. },
  136. onShow() {
  137. this.$store.dispatch('checkHandle').then(res => {
  138. app.globalData.isAuth = res.IsAuth;
  139. app.globalData.isBind = res.IsBind;
  140. if((!res.IsAuth) && (!res.IsBind)) { //已授权已绑定
  141. this.getDetail()
  142. this.audioContext = uni.createInnerAudioContext()
  143. //音频播放错误事件
  144. this.audioContext.onError((res) => {
  145. console.log(res.errMsg);
  146. console.log(res.errCode);
  147. });
  148. //音频自然播放结束事件
  149. this.audioContext.onEnded(res=>{
  150. this.isPlay=true
  151. })
  152. }else if(res.IsAuth) { //未授权
  153. uni.navigateTo({
  154. url:'/pages/authGuide/authGuide'
  155. })
  156. }else if(res.IsBind && !res.IsAuth){ //已授权未绑定
  157. uni.navigateTo({
  158. url:'/pages/login/login'
  159. })
  160. }
  161. })
  162. },
  163. /**
  164. * 用户点击分享
  165. */
  166. onShareAppMessage: function (res) {
  167. return {
  168. title: this.detali.Title,
  169. url:'reportPages/roadEssence/roadEssence?id='+this.id,
  170. success: (res)=> {
  171. },
  172. fail: (err)=> {
  173. }
  174. }
  175. },
  176. }
  177. </script>
  178. <style lang="scss" scoped>
  179. .content-road {
  180. padding:10rpx 34rpx 34rpx;
  181. .container-top {
  182. font-size: 28rpx;
  183. .content-title {
  184. color: #4A4A4A;
  185. font-size: 34rpx;
  186. font-weight: bold;
  187. }
  188. .content-time {
  189. margin:24rpx 0 34rpx 0;
  190. display: flex;
  191. justify-content: space-between;
  192. color: #333333;
  193. }
  194. .content-statement {
  195. display: flex;
  196. color: #707070;
  197. .statement {
  198. margin-left: 10rpx;
  199. color: #3385FF;
  200. }
  201. }
  202. .content-audio {
  203. margin: 60rpx 0;
  204. width: 682rpx;
  205. align-items: center;
  206. background: #FFFFFF;
  207. box-shadow: 0rpx 0rpx 12rpx rgba(33, 74, 135, 0.16);
  208. opacity: 1;
  209. border-radius: 16rpx;
  210. display: flex;
  211. padding: 24rpx 21rpx 18rpx;
  212. .audio-img{
  213. width: 154rpx;
  214. height: 154rpx;
  215. margin-right: 20rpx;
  216. image {
  217. width: 154rpx;
  218. height: 154rpx;
  219. }
  220. }
  221. .audio-title {
  222. font-size: 28rpx;
  223. color:#333;
  224. :first-child{
  225. width: 450rpx;
  226. overflow: hidden;
  227. text-overflow:ellipsis;
  228. white-space: nowrap;
  229. margin-bottom:30rpx ;
  230. font-size: 32rpx
  231. }
  232. }
  233. }
  234. .content-abstract {
  235. margin-bottom: 30rpx;
  236. font-size: 32rpx;
  237. color: #4A4A4A;
  238. :first-child{
  239. float:left;
  240. font-weight: 700;
  241. }
  242. }
  243. .content-boby {
  244. font-size: 32rpx;
  245. image,img {
  246. width: 100%;
  247. }
  248. }
  249. }
  250. .content-link {
  251. width: 368rpx;
  252. height: 80rpx;
  253. border: 2rpx solid #2C83FF;
  254. opacity: 1;
  255. border-radius: 4rpx;
  256. line-height:76rpx;
  257. text-align: center;
  258. color: #2C83FF;
  259. font-size: 32rpx;
  260. box-sizing: border-box;
  261. margin: 100rpx auto;
  262. }
  263. @import '../jurisdiction.scss';
  264. }
  265. </style>