reportSecretDetail.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. <template>
  2. <view class="container content-secret forbid-copy">
  3. <block v-if="hasPermission==1 ||!hasPermission">
  4. <view class="container-top" v-if="detali">
  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 v-if="detali.Abstract" class="content-abstract">
  27. <text>摘要:</text>
  28. <text>
  29. {{detali.Abstract}}
  30. </text>
  31. </view>
  32. <view v-if="detali.ProductDescription&&isType==1" class="content-abstract">
  33. <text>产品说明:</text>
  34. <text>
  35. {{detali.ProductDescription}}
  36. </text>
  37. </view>
  38. <view v-if="detali.UpdateDescription&&isType==1" class="content-abstract">
  39. <text>变更说明:</text>
  40. <text>
  41. {{detali.UpdateDescription}}
  42. </text>
  43. </view>
  44. <view v-if="detali.FocusOn && isType==1" class="content-focuson">
  45. <text class="focuson">近期重点关注方向:</text>
  46. <mp-html :content="detali.FocusOn"/>
  47. </view>
  48. </view>
  49. <view class="container-text">
  50. <researchSummary v-if="isType==1 ||isType==3" :dataList="dataList" />
  51. <reportChoiceness v-if="isType==2" :dataListResearch="dataListResearch" />
  52. </view>
  53. <statement :show="isShowStatement" />
  54. </block>
  55. <view class="noauth-cont" v-else-if="hasPermission==3 || hasPermission==4">
  56. <image src="https://hzstatic.hzinsights.com/cygx/czbk/noauth.png" class="noauth-ico"></image>
  57. <block>
  58. <view class="tip">您暂无权限查看此文章内容,若想查看可以申请开通哦</view>
  59. <view class="btn-cont" @click="applyAuth">
  60. 立即申请
  61. </view>
  62. </block>
  63. <view class="btn-cont back-btn" @click="backIndex"> 返回首页 </view>
  64. </view>
  65. </view>
  66. </template>
  67. <script>
  68. import statement from '@/components/statement.vue'
  69. import researchSummary from './components/researchSummary.vue'
  70. import reportChoiceness from './components/reportChoiceness.vue'
  71. import {
  72. Reports
  73. } from '@/config/api.js'
  74. let app = getApp()
  75. export default {
  76. data() {
  77. return {
  78. isShowStatement: false,
  79. isPlay: false,
  80. audioContext: '', //音频
  81. isType: '', //类型
  82. id: '', //
  83. detali: '', //详情
  84. dataList: [], //精选,上周 数组
  85. dataListResearch: [], //本周数组
  86. hasPermission: '', //权限判断
  87. videoUrl: '',
  88. //bgAudioManager:''
  89. }
  90. },
  91. methods: {
  92. audioPlay() {
  93. this.isPlay = true
  94. app.globalData.bgAudioManager.title = this.detali.VideoName
  95. app.globalData.bgAudioManager.src = this.videoUrl
  96. },
  97. audiouspend() {
  98. this.isPlay = false
  99. app.globalData.bgAudioManager.pause()
  100. },
  101. async getDetilaiList() {
  102. if (this.isType == 1 || this.isType == 3) {
  103. const res = this.isType == 1 ? await Reports.reportSelectionDetail({
  104. ArticleId: this.id
  105. }) :
  106. await Reports.minutesSummaryDetail({
  107. ArticleId: this.id
  108. })
  109. if (res.Ret === 200) {
  110. this.detali = res.Data.Detail
  111. this.hasPermission = res.Data.HasPermission
  112. this.videoUrl = res.Data.Detail.VideoUrl
  113. this.dataList = res.Data.List
  114. if ((app.globalData.bgAudioManager.src === this.videoUrl) && app.globalData.bgAudioManager
  115. .paused === false) {
  116. this.isPlay = true
  117. }
  118. }
  119. } else {
  120. const res = await Reports.researchSummaryDetail({
  121. ArticleId: this.id
  122. })
  123. if (res.Ret === 200) {
  124. this.detali = res.Data.Detail
  125. this.hasPermission = res.Data.HasPermission
  126. this.dataListResearch = res.Data.List
  127. this.videoUrl = res.Data.Detail.VideoUrl
  128. if ((app.globalData.bgAudioManager.src === this.videoUrl) && app.globalData.bgAudioManager
  129. .paused === false) {
  130. this.isPlay = true
  131. }
  132. }
  133. }
  134. },
  135. /* 无权限申请开通权限 */
  136. applyAuth() {
  137. this.hasPermission === 4 ?
  138. uni.navigateTo({
  139. url: "/pages/applyTrial/applyTrial"
  140. }) :
  141. uni.showModal({
  142. title: '',
  143. content: '您已经提交过申请了,请耐心等待',
  144. showCancel: false,
  145. confirmColor: '#365595',
  146. success: function(res) {
  147. uni.navigateBack({
  148. fail() {
  149. uni.switchTab({
  150. url: '/pages/index/index'
  151. })
  152. }
  153. })
  154. }
  155. });
  156. },
  157. // 返回首頁
  158. backIndex() {
  159. uni.switchTab({
  160. url: '/pages/index/index'
  161. })
  162. },
  163. },
  164. components: {
  165. statement,
  166. researchSummary,
  167. reportChoiceness
  168. },
  169. onLoad(option) {
  170. this.isType = option.type
  171. this.id = Number(option.id) || ''
  172. uni.setNavigationBarTitle({
  173. title: this.isType == 1 ? '报告精选' : this.isType == 2 ? '本周研究汇总' : '上周纪要汇总'
  174. })
  175. app.globalData.bgAudioManager.onEnded(res => {
  176. this.isPlay = false
  177. })
  178. app.globalData.bgAudioManager.onPause(res => {
  179. this.isPlay = false
  180. })
  181. app.globalData.bgAudioManager.onPlay(res => {
  182. this.isPlay = true
  183. })
  184. app.globalData.bgAudioManager.onStop(res=>{
  185. this.isPlay = false
  186. })
  187. },
  188. onShow() {
  189. this.$store.dispatch('checkHandle').then(res => {
  190. app.globalData.isAuth = res.IsAuth;
  191. app.globalData.isBind = res.IsBind;
  192. if ((!res.IsAuth) && (!res.IsBind)) { //已授权已绑定
  193. this.getDetilaiList()
  194. } else if (res.IsAuth) { //未授权
  195. uni.navigateTo({
  196. url: '/pages/authGuide/authGuide'
  197. })
  198. } else if (res.IsBind && !res.IsAuth) { //已授权未绑定
  199. uni.navigateTo({
  200. url: '/pages/login/login'
  201. })
  202. }
  203. })
  204. },
  205. onUnload() {},
  206. /**
  207. * 用户点击分享
  208. */
  209. onShareAppMessage: function(res) {
  210. return {
  211. title: this.detali.Title,
  212. path: '/reportPages/reportSecretDetail/reportSecretDetail?type=' + this.isType + '&id=' + this.id,
  213. success: (res) => {},
  214. fail: (err) => {}
  215. }
  216. },
  217. }
  218. </script>
  219. <style lang="scss" scoped>
  220. .content-secret {
  221. @import '../jurisdiction.scss';
  222. padding: 10rpx 34rpx 34rpx;
  223. .container-top {
  224. font-size: 28rpx;
  225. .content-title {
  226. color: #4A4A4A;
  227. font-size: 34rpx;
  228. font-weight: bold;
  229. }
  230. .content-time {
  231. margin: 24rpx 0 34rpx 0;
  232. display: flex;
  233. justify-content: space-between;
  234. color: #333333;
  235. }
  236. .content-statement {
  237. display: flex;
  238. color: #707070;
  239. .statement {
  240. margin-left: 10rpx;
  241. color: #3385FF;
  242. }
  243. }
  244. .content-audio {
  245. margin: 60rpx 0;
  246. width: 682rpx;
  247. align-items: center;
  248. background: #FFFFFF;
  249. box-shadow: 0rpx 0rpx 12rpx rgba(33, 74, 135, 0.16);
  250. opacity: 1;
  251. border-radius: 16rpx;
  252. display: flex;
  253. padding: 24rpx 21rpx 18rpx;
  254. .audio-img {
  255. width: 154rpx;
  256. height: 154rpx;
  257. margin-right: 20rpx;
  258. image {
  259. width: 154rpx;
  260. height: 154rpx;
  261. }
  262. }
  263. .audio-title {
  264. font-size: 28rpx;
  265. color: #333;
  266. :first-child {
  267. width: 450rpx;
  268. overflow: hidden;
  269. text-overflow: ellipsis;
  270. white-space: nowrap;
  271. margin-bottom: 30rpx;
  272. font-size: 32rpx
  273. }
  274. }
  275. }
  276. .content-abstract {
  277. margin-bottom: 30rpx;
  278. font-size: 32rpx;
  279. color: #4A4A4A;
  280. :first-child {
  281. float: left;
  282. font-weight: 700;
  283. }
  284. }
  285. .content-focuson {
  286. font-size: 32rpx !important;
  287. margin-bottom: 30rpx;
  288. color: #4A4A4A;
  289. .focuson {
  290. font-weight: 700;
  291. }
  292. }
  293. }
  294. }
  295. </style>