reportSecretDetail.vue 9.5 KB

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