reportDetail.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  1. <template>
  2. <view class="container reportDetail-container">
  3. <!-- <view class="report-top">
  4. <view class="report-title">国内风能企业国产替代路径分析</view>
  5. <view class="report_desc">
  6. <text class="author">弘则权益研究</text>
  7. <text>2020.12.18 10:10:10</text>
  8. </view>
  9. <view>
  10. 注:请务必阅读<text class="tip" @click="isShowTip=true">免责声明</text>
  11. </view>
  12. </view> -->
  13. <block v-if="haveAuth===1 && !idReport">
  14. <!-- 链接地址 -->
  15. <web-view :src="linkurl+'?id='+userId+'&fromType=mpwechat&token='+access_token"></web-view>
  16. </block>
  17. <block v-else-if="haveAuth===1 && idReport">
  18. <!-- 链接地址 -->
  19. <web-view :src="linkurl+'?idReport='+userId+'&fromType=mpwechat&token='+access_token"></web-view>
  20. </block>
  21. <view class="noauth-cont" v-else-if="haveAuth===2||haveAuth===3||haveAuth===4||haveAuth===5">
  22. <image src="@/static/img/noauth.png" class="noauth-ico"></image>
  23. <block v-if="haveAuth!==3">
  24. <view class="tip">您暂无权限查看{{industry}}内容,若想查看可以申请开通哦</view>
  25. <view class="btn-cont" @click="applyAuth">
  26. 立即申请
  27. <!-- <image src="@/static/img/btn_bg.png" class="btn_bg"></image> -->
  28. <!-- <text class="btn-txt" @click="applyAuth">立即申请</text> -->
  29. </view>
  30. </block>
  31. <view class="tip" v-if="haveAuth===3">
  32. 您暂无权限查看{{industry}}内容
  33. <view class="contract">
  34. 若想查看可以联系对口销售
  35. <text @click="callPhone(sale_number)">{{sale_name}}:<text style="color:#D4BF86;">{{sale_number}}</text></text>
  36. </view>
  37. <view>开通该行业的试用权限</view>
  38. </view>
  39. <!-- <view class="btn-cont back-btn" @click="backIndex">
  40. <text>返回首页</text>
  41. </view> -->
  42. <view class="btn-cont back-btn" @click="backIndex">
  43. 返回
  44. <!-- <image src="@/static/img/btn_bg.png" class="btn_bg"></image> -->
  45. <!-- <text class="btn-txt">返回首页</text> -->
  46. </view>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. import { Report,User ,Reports} from '@/config/api.js'
  52. let app = getApp();
  53. export default {
  54. data() {
  55. return {
  56. haveAuth:false,
  57. // haveFree:false,//是否付费
  58. access_token:'',//用户标识
  59. isIphoneX:false,//判断机型
  60. reportInfo:'',
  61. //linkurl:'https://details.hzinsights.com/raiReportDtl',//线上链接地址
  62. linkurl:'http://192.168.1.25:2000/raiReportDtl',//链接地址
  63. showNav:false,
  64. id:'',
  65. idReport:null,
  66. isShowTip:false,
  67. sale_name:'',//可联系销售名称
  68. sale_number:'',//可联系销售电话
  69. industry:'',//行业
  70. readTiem:0,
  71. setIntervalTiem:null
  72. };
  73. },
  74. computed:{
  75. userId(){
  76. return this.id ? this.id : this.idReport
  77. }
  78. },
  79. methods: {
  80. /* 获取详情 */
  81. getDetail() {
  82. Report.reportDtl({
  83. ArticleId: Number(this.id)
  84. }).then(res => {
  85. if(res.Ret === 200) {
  86. this.haveAuth = res.Data.HasPermission;
  87. this.industry = res.Data.Detail.CategoryName;
  88. this.sale_name = res.Data.Detail.SellerName;
  89. this.sale_number = res.Data.Detail.SellerMobile;
  90. if(res.Data.HasPermission === 1) { //有访问权限
  91. this.reportInfo = res.Data.Detail;
  92. this.access_token = this.access_token || this.$db.get('access_token');
  93. this.$store.dispatch("statistics",{PageType:'ReportParticulars',DetailId:this.id})
  94. }
  95. }
  96. })
  97. },
  98. /* 获取详情 */
  99. getDetailTwo() {
  100. Report.reportDtlTwo({
  101. ArticleId:Number(this.idReport)
  102. }).then(res => {
  103. if(res.Ret === 200) {
  104. this.haveAuth = res.Data.HasPermission;
  105. this.industry = res.Data.Detail.CategoryName;
  106. this.sale_name = res.Data.Detail.SellerName;
  107. this.sale_number = res.Data.Detail.SellerMobile;
  108. if(res.Data.HasPermission === 1) { //有访问权限
  109. this.reportInfo = res.Data.Detail;
  110. this.access_token = this.access_token || this.$db.get('access_token');
  111. }
  112. }
  113. })
  114. },
  115. /* 无权限申请开通权限 */
  116. applyAuth() {
  117. /* 区分是否是潜在用户 */
  118. this.haveAuth === 2
  119. ? User.applyTry({
  120. ApplyMethod:3
  121. }).then(res => {
  122. if(res.Ret === 200) {
  123. uni.navigateTo({
  124. url:"/pages/applyResult/applyResult"
  125. })
  126. }
  127. })
  128. : this.haveAuth === 4
  129. ? uni.navigateTo({
  130. url:"/pages/applyTrial/applyTrial"
  131. })
  132. : uni.showModal({
  133. title: '',
  134. content: '您已经提交过申请了,请耐心等待',
  135. showCancel:false,
  136. confirmColor:'#365595',
  137. success: function (res) {
  138. }
  139. });
  140. },
  141. // 返回首頁
  142. backIndex() {
  143. uni.navigateBack({
  144. fail(){
  145. uni.switchTab({
  146. url:'/pages/index/index'
  147. })
  148. }
  149. })
  150. },
  151. callPhone(num) {
  152. uni.makePhoneCall({
  153. phoneNumber: num
  154. })
  155. },
  156. /* 申请访谈 */
  157. applyHandle() {
  158. // 申请访谈
  159. !this.reportInfo.IsInterviewApply && this.$util.modal('','专家访谈申请会提交给您的对口销售,销售会线下与您取得联系,确定申请吗?',()=> {
  160. this.interviewApi()
  161. })
  162. // 取消申请访谈 区分状态 '待邀请','待访谈','已完成','已取消'
  163. if( this.reportInfo.IsInterviewApply) {
  164. // this.reportInfo.InterviewApplyStatus
  165. this.$util.modal('',
  166. this.reportInfo.InterviewApplyStatus=='待访谈'
  167. ?'当前无法取消访谈,若有疑问,请联系对口销售'
  168. :this.reportInfo.InterviewApplyStatus=='待邀请'
  169. ?'您要取消此次访谈申请吗?'
  170. :'该访谈已完成',
  171. ()=> {
  172. this.reportInfo.InterviewApplyStatus=='待邀请'
  173. ? this.interviewApi()
  174. :this.reportInfo.InterviewApplyStatus=='待访谈'
  175. ? uni.makePhoneCall({
  176. phoneNumber: '18767183922',
  177. })
  178. :''
  179. })
  180. }
  181. },
  182. /* 访谈接口 */
  183. interviewApi() {
  184. Report.applyRpt({
  185. ArticleId: Number(this.id)||Number(this.idReport)
  186. }).then(res => {
  187. this.reportInfo.IsInterviewApply = !this.reportInfo.IsInterviewApply;
  188. })
  189. },
  190. /* 收藏 */
  191. collectHandle() {
  192. Report.collectRpt({
  193. ArticleId: Number(this.id) ||Number(this.idReport)
  194. }).then(res => {
  195. this.reportInfo.IsCollect = !this.reportInfo.IsCollect;
  196. this.$util.toast(res.Msg)
  197. })
  198. }
  199. },
  200. onShow() {
  201. this.readTiem=0
  202. this.setIntervalTiem=setInterval(() => {
  203. this.readTiem++
  204. },1000)
  205. let page = getCurrentPages();//查看路径
  206. if(page.length === 1) { //分享入口
  207. this.$store.dispatch('checkHandle').then(res => {
  208. app.globalData.isAuth = res.IsAuth;
  209. app.globalData.isBind = res.IsBind;
  210. if((!res.IsAuth) && (!res.IsBind)) { //已授权已绑定
  211. if(this.idReport) {
  212. this.getDetailTwo()
  213. }else {
  214. this.getDetail();
  215. }
  216. }else if(res.IsAuth) { //未授权
  217. uni.navigateTo({
  218. url:'/pages/authGuide/authGuide'
  219. })
  220. }else if(res.IsBind && !res.IsAuth){ //已授权未绑定
  221. uni.navigateTo({
  222. url:'/pages/login/login'
  223. })
  224. }
  225. })
  226. }else { // 跳转入口
  227. if(this.idReport) {
  228. this.getDetailTwo()
  229. }else {
  230. this.getDetail();
  231. }
  232. }
  233. },
  234. onLoad(option) {
  235. // console.log(option)
  236. /* 兼容iphonex底部 */
  237. // uni.getSystemInfo({
  238. // success: res => {
  239. // let ua = res.model;
  240. // if (ua.search('iPhone X') != -1 || ua.search('iPhone 11') != -1 || ua.search('iPhone 11 Pro Max') != -1) {
  241. // this.isIphoneX = true;
  242. // }
  243. // }
  244. // })
  245. uni.setNavigationBarTitle({
  246. title: option.idReport?'报告详情':'纪要详情'
  247. });
  248. // this.idReport=option.idReport
  249. this.id = option.id || '';
  250. this.idReport= option.idReport ||null;
  251. },
  252. /**
  253. * 用户点击分享
  254. */
  255. onShareAppMessage: function (res) {
  256. if(this.idReport) {
  257. return {
  258. title: this.reportInfo.Title,
  259. path: '/pages/reportDetail/reportDetail?idReport='+this.idReport,
  260. // imageUrl: '/static/img/detail_share.jpg',
  261. success: (res)=> {
  262. },
  263. fail: (err)=> {
  264. }
  265. }
  266. }else if(this.id) {
  267. return {
  268. title: this.reportInfo.Title,
  269. path: '/pages/reportDetail/reportDetail?id='+this.id,
  270. // imageUrl: '/static/img/detail_share.jpg',
  271. success: (res)=> {
  272. },
  273. fail: (err)=> {
  274. }
  275. }
  276. }
  277. },
  278. onHide(){
  279. clearInterval(this.setIntervalTiem)
  280. Reports.addStopTime({
  281. ArticleId:Number(this.id)||Number( this.idReport) ,
  282. StopTime:this.readTiem
  283. }).then(res=>{
  284. })
  285. },
  286. onUnload(){
  287. clearInterval(this.setIntervalTiem)
  288. Reports.addStopTime({
  289. ArticleId:Number(this.id)||Number( this.idReport) ,
  290. StopTime:this.readTiem
  291. }).then(res=>{
  292. })
  293. }
  294. }
  295. </script>
  296. <style lang="scss" scoped>
  297. .reportDetail-container {
  298. background-color: #fff;
  299. padding: 20rpx 34rpx 134rpx;
  300. .report-top {
  301. color: #999999;
  302. .report-title {
  303. color: #4A4A4A;
  304. font-size: 34rpx;
  305. }
  306. .report_desc {
  307. display: flex;
  308. justify-content: space-between;
  309. align-items: center;
  310. margin: 20rpx 0;
  311. }
  312. .tip {
  313. color: #586EB5;
  314. display: inline;
  315. }
  316. }
  317. .detail-report {
  318. padding: 40rpx 0;
  319. }
  320. .statement {
  321. max-width: 670rpx;
  322. max-height: 900rpx;
  323. line-height: 42rpx;
  324. overflow-y: auto;
  325. padding: 40rpx;
  326. }
  327. .fixed_cont {
  328. width: 100%;
  329. // height: 114rpx;
  330. padding: 10rpx 0;
  331. position: fixed;
  332. bottom: 0;
  333. left: 0;
  334. z-index: 99999;
  335. display: flex;
  336. justify-content: center;
  337. align-items: center;
  338. flex-direction: row;
  339. background-color: #fff;
  340. box-shadow: 0 -3rpx 6rpx rgba($color: #6A6A6A, $alpha: 0.16); .handle-item {
  341. font-size: 24rpx;
  342. color: #D0CFD5;
  343. text-align: center;
  344. margin-right: 130rpx;
  345. &:last-child {
  346. margin-right: 0;
  347. }
  348. .img_ico {
  349. width: 56rpx;
  350. height: 54rpx;
  351. margin: 0 auto;
  352. }
  353. }
  354. .button-item {
  355. background-color: transparent;
  356. line-height: normal;
  357. }
  358. }
  359. .noauth-cont {
  360. padding-top: 150rpx;
  361. text-align: center;
  362. font-size: 28rpx;
  363. .noauth-ico {
  364. width: 365rpx;
  365. height: 229rpx;
  366. margin-bottom: 70rpx;
  367. }
  368. .tip {
  369. width: 532rpx;
  370. margin: 0 auto 100rpx;
  371. .contract {
  372. padding: 40rpx 90rpx 0;
  373. line-height: 44rpx;
  374. text {
  375. display: inline-block;
  376. }
  377. }
  378. }
  379. .btn-cont {
  380. width: 368rpx;
  381. height: 80rpx;
  382. // position: relative;
  383. background:linear-gradient(268deg, #2DDBFF 0%, #1599FF 49%, #005EFF 100%);
  384. color: #fff;
  385. font-size: 34rpx;
  386. margin: 0 auto;
  387. text-align: center;
  388. line-height: 80rpx;
  389. &.back-btn {
  390. background:linear-gradient(268deg, #2DDBFF 0%, #1599FF 49%, #005EFF 100%)!important;
  391. // border: 2rpx solid #3385FF;
  392. color: #fff;
  393. margin-top: 30rpx;
  394. }
  395. .btn_bg {
  396. width: 100%;
  397. height: 80rpx;
  398. position: absolute;
  399. left: 0;
  400. top: 0;
  401. }
  402. .btn-txt {
  403. width: 100%;
  404. position: absolute;
  405. z-index: 1;
  406. }
  407. }
  408. }
  409. }
  410. </style>