reportDetail.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416
  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. }
  94. }
  95. })
  96. },
  97. /* 获取详情 */
  98. getDetailTwo() {
  99. Report.reportDtlTwo({
  100. ArticleId:Number(this.idReport)
  101. }).then(res => {
  102. if(res.Ret === 200) {
  103. this.haveAuth = res.Data.HasPermission;
  104. this.industry = res.Data.Detail.CategoryName;
  105. this.sale_name = res.Data.Detail.SellerName;
  106. this.sale_number = res.Data.Detail.SellerMobile;
  107. if(res.Data.HasPermission === 1) { //有访问权限
  108. this.reportInfo = res.Data.Detail;
  109. this.access_token = this.access_token || this.$db.get('access_token');
  110. }
  111. }
  112. })
  113. },
  114. /* 无权限申请开通权限 */
  115. applyAuth() {
  116. /* 区分是否是潜在用户 */
  117. this.haveAuth === 2
  118. ? User.applyTry({
  119. ApplyMethod:3
  120. }).then(res => {
  121. if(res.Ret === 200) {
  122. uni.navigateTo({
  123. url:"/pages/applyResult/applyResult"
  124. })
  125. }
  126. })
  127. : this.haveAuth === 4
  128. ? uni.navigateTo({
  129. url:"/pages/applyTrial/applyTrial"
  130. })
  131. : uni.showModal({
  132. title: '',
  133. content: '您已经提交过申请了,请耐心等待',
  134. showCancel:false,
  135. confirmColor:'#365595',
  136. success: function (res) {
  137. }
  138. });
  139. },
  140. // 返回首頁
  141. backIndex() {
  142. uni.switchTab({
  143. url:'/pages/index/index',
  144. })
  145. },
  146. callPhone(num) {
  147. uni.makePhoneCall({
  148. phoneNumber: num
  149. })
  150. },
  151. /* 申请访谈 */
  152. applyHandle() {
  153. // 申请访谈
  154. !this.reportInfo.IsInterviewApply && this.$util.modal('','专家访谈申请会提交给您的对口销售,销售会线下与您取得联系,确定申请吗?',()=> {
  155. this.interviewApi()
  156. })
  157. // 取消申请访谈 区分状态 '待邀请','待访谈','已完成','已取消'
  158. if( this.reportInfo.IsInterviewApply) {
  159. // this.reportInfo.InterviewApplyStatus
  160. this.$util.modal('',
  161. this.reportInfo.InterviewApplyStatus=='待访谈'
  162. ?'当前无法取消访谈,若有疑问,请联系对口销售'
  163. :this.reportInfo.InterviewApplyStatus=='待邀请'
  164. ?'您要取消此次访谈申请吗?'
  165. :'该访谈已完成',
  166. ()=> {
  167. this.reportInfo.InterviewApplyStatus=='待邀请'
  168. ? this.interviewApi()
  169. :this.reportInfo.InterviewApplyStatus=='待访谈'
  170. ? uni.makePhoneCall({
  171. phoneNumber: '18767183922',
  172. })
  173. :''
  174. })
  175. }
  176. },
  177. /* 访谈接口 */
  178. interviewApi() {
  179. Report.applyRpt({
  180. ArticleId: Number(this.id)||Number(this.idReport)
  181. }).then(res => {
  182. this.reportInfo.IsInterviewApply = !this.reportInfo.IsInterviewApply;
  183. })
  184. },
  185. /* 收藏 */
  186. collectHandle() {
  187. Report.collectRpt({
  188. ArticleId: Number(this.id) ||Number(this.idReport)
  189. }).then(res => {
  190. this.reportInfo.IsCollect = !this.reportInfo.IsCollect;
  191. this.$util.toast(res.Msg)
  192. })
  193. }
  194. },
  195. onShow() {
  196. this.readTiem=0
  197. this.setIntervalTiem=setInterval(() => {
  198. this.readTiem++
  199. },1000)
  200. let page = getCurrentPages();//查看路径
  201. if(page.length === 1) { //分享入口
  202. this.$store.dispatch('checkHandle').then(res => {
  203. app.globalData.isAuth = res.IsAuth;
  204. app.globalData.isBind = res.IsBind;
  205. if((!res.IsAuth) && (!res.IsBind)) { //已授权已绑定
  206. if(this.idReport) {
  207. this.getDetailTwo()
  208. }else {
  209. this.getDetail();
  210. }
  211. }else if(res.IsAuth) { //未授权
  212. uni.navigateTo({
  213. url:'/pages/authGuide/authGuide'
  214. })
  215. }else if(res.IsBind && !res.IsAuth){ //已授权未绑定
  216. uni.navigateTo({
  217. url:'/pages/login/login'
  218. })
  219. }
  220. })
  221. }else { // 跳转入口
  222. if(this.idReport) {
  223. this.getDetailTwo()
  224. }else {
  225. this.getDetail();
  226. }
  227. }
  228. },
  229. onLoad(option) {
  230. // console.log(option)
  231. /* 兼容iphonex底部 */
  232. // uni.getSystemInfo({
  233. // success: res => {
  234. // let ua = res.model;
  235. // if (ua.search('iPhone X') != -1 || ua.search('iPhone 11') != -1 || ua.search('iPhone 11 Pro Max') != -1) {
  236. // this.isIphoneX = true;
  237. // }
  238. // }
  239. // })
  240. // let pages = getCurrentPages();
  241. // let prevPage = pages[pages.length - 2]; //当前页面
  242. // console.log(prevPage)
  243. uni.setNavigationBarTitle({
  244. title: option.idReport?'报告详情':'纪要详情'
  245. });
  246. // this.idReport=option.idReport
  247. this.id = option.id || '';
  248. this.idReport= option.idReport ||null;
  249. },
  250. /**
  251. * 用户点击分享
  252. */
  253. onShareAppMessage: function (res) {
  254. if(this.idReport) {
  255. return {
  256. title: this.reportInfo.Title,
  257. path: '/pages/reportDetail/reportDetail?idReport='+this.idReport,
  258. // imageUrl: '/static/img/detail_share.jpg',
  259. success: (res)=> {
  260. },
  261. fail: (err)=> {
  262. }
  263. }
  264. }else if(this.id) {
  265. return {
  266. title: this.reportInfo.Title,
  267. path: '/pages/reportDetail/reportDetail?id='+this.id,
  268. // imageUrl: '/static/img/detail_share.jpg',
  269. success: (res)=> {
  270. },
  271. fail: (err)=> {
  272. }
  273. }
  274. }
  275. },
  276. onHide(){
  277. clearInterval(this.setIntervalTiem)
  278. Reports.addStopTime({
  279. ArticleId:Number(this.id)||Number( this.idReport) ,
  280. StopTime:this.readTiem
  281. }).then(res=>{
  282. })
  283. },
  284. onUnload(){
  285. clearInterval(this.setIntervalTiem)
  286. Reports.addStopTime({
  287. ArticleId:Number(this.id)||Number( this.idReport) ,
  288. StopTime:this.readTiem
  289. }).then(res=>{
  290. })
  291. }
  292. }
  293. </script>
  294. <style lang="scss" scoped>
  295. .reportDetail-container {
  296. background-color: #fff;
  297. padding: 20rpx 34rpx 134rpx;
  298. .report-top {
  299. color: #999999;
  300. .report-title {
  301. color: #4A4A4A;
  302. font-size: 34rpx;
  303. }
  304. .report_desc {
  305. display: flex;
  306. justify-content: space-between;
  307. align-items: center;
  308. margin: 20rpx 0;
  309. }
  310. .tip {
  311. color: #586EB5;
  312. display: inline;
  313. }
  314. }
  315. .detail-report {
  316. padding: 40rpx 0;
  317. }
  318. .statement {
  319. max-width: 670rpx;
  320. max-height: 900rpx;
  321. line-height: 42rpx;
  322. overflow-y: auto;
  323. padding: 40rpx;
  324. }
  325. .fixed_cont {
  326. width: 100%;
  327. // height: 114rpx;
  328. padding: 10rpx 0;
  329. position: fixed;
  330. bottom: 0;
  331. left: 0;
  332. z-index: 99999;
  333. display: flex;
  334. justify-content: center;
  335. align-items: center;
  336. flex-direction: row;
  337. background-color: #fff;
  338. box-shadow: 0 -3rpx 6rpx rgba($color: #6A6A6A, $alpha: 0.16); .handle-item {
  339. font-size: 24rpx;
  340. color: #D0CFD5;
  341. text-align: center;
  342. margin-right: 130rpx;
  343. &:last-child {
  344. margin-right: 0;
  345. }
  346. .img_ico {
  347. width: 56rpx;
  348. height: 54rpx;
  349. margin: 0 auto;
  350. }
  351. }
  352. .button-item {
  353. background-color: transparent;
  354. line-height: normal;
  355. }
  356. }
  357. .noauth-cont {
  358. padding-top: 150rpx;
  359. text-align: center;
  360. font-size: 28rpx;
  361. .noauth-ico {
  362. width: 365rpx;
  363. height: 229rpx;
  364. margin-bottom: 70rpx;
  365. }
  366. .tip {
  367. width: 532rpx;
  368. margin: 0 auto 100rpx;
  369. .contract {
  370. padding: 40rpx 90rpx 0;
  371. line-height: 44rpx;
  372. text {
  373. display: inline-block;
  374. }
  375. }
  376. }
  377. .btn-cont {
  378. width: 368rpx;
  379. height: 80rpx;
  380. // position: relative;
  381. background-color: #3385FF;
  382. color: #fff;
  383. font-size: 34rpx;
  384. margin: 0 auto;
  385. text-align: center;
  386. line-height: 80rpx;
  387. &.back-btn {
  388. background-color: #fff !important;
  389. border: 2rpx solid #3385FF;
  390. color: #3385FF;
  391. margin-top: 30rpx;
  392. }
  393. .btn_bg {
  394. width: 100%;
  395. height: 80rpx;
  396. position: absolute;
  397. left: 0;
  398. top: 0;
  399. }
  400. .btn-txt {
  401. width: 100%;
  402. position: absolute;
  403. z-index: 1;
  404. }
  405. }
  406. }
  407. }
  408. </style>