reportDetail.vue 8.9 KB

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