reportDetail.vue 10 KB

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