reportSecretDetail.vue 8.1 KB

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