internalDetials.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <template>
  2. <block>
  3. <block v-if="hasPermission === 1">
  4. <view class="container internal-detials" v-if="haveData">
  5. <web-view :src="linkurl + '?id=' + reportId + '&token=' + access_token + '&isBinding=' + isUserBindingPhoneNumber"></web-view>
  6. </view>
  7. <view class="nodata" v-else>
  8. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/report_loading_icon.png" class="nodata_img"></image>
  9. <view class="nodata-tip">正在努力编辑中,请耐心等待...</view>
  10. </view>
  11. </block>
  12. <view class="noauth-cont" v-else-if="hasPermission == 3 || hasPermission == 4">
  13. <block v-if="!isShowAlert">
  14. <image src="https://hzstatic.hzinsights.com/cygx/czbk/noauth.png" class="noauth-ico"></image>
  15. <block>
  16. <view class="tip">您暂无权限查看此文章内容,若想查看可以申请开通哦</view>
  17. <view class="btn-cont" @click="applyAuth"> 立即申请 </view>
  18. </block>
  19. <view class="btn-cont back-btn" @click="backIndex"> 返回首页 </view>
  20. </block>
  21. <block v-else>
  22. <text class="moneh-text"> 上传名片并填写简单信息,24小时内我们会为您开通一个月的免费月卡 </text>
  23. <img src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/month_card.png" class="month_card" alt="" />
  24. <view class="btn-cont btn-dl" @click="applyAuth"> 立即上传 </view>
  25. <view class="btn-cont month-back" @click="backIndex"> 返回</view>
  26. </block>
  27. </view>
  28. <Loading />
  29. </block>
  30. </template>
  31. <script>
  32. import { Reports } from "@/config/api.js";
  33. import statement from "@/reportPages/components/statement.vue";
  34. import { intemalLinkUrl } from "@/config/config.js";
  35. export default {
  36. data() {
  37. return {
  38. reportDetail: {},
  39. isShowStatement: false,
  40. haveData: true,
  41. hasPermission: "",
  42. reportId: 0,
  43. titleTxT: "",
  44. access_token: "",
  45. };
  46. },
  47. computed: {
  48. linkurl() {
  49. return intemalLinkUrl;
  50. },
  51. },
  52. components: { statement },
  53. methods: {
  54. async reportSelectionDetail() {
  55. const res = await Reports.getProductInteriorDetail({
  56. ProductInteriorId: this.reportId,
  57. });
  58. if (res.Ret === 200) {
  59. this.hasPermission = res.Data.HasPermission;
  60. this.reportDetail = res.Data.Detail;
  61. this.haveData = this.reportDetail ? true : false;
  62. this.titleTxT = this.reportDetail.ColumnName;
  63. uni.setNavigationBarTitle({
  64. title: this.titleTxT,
  65. });
  66. this.access_token = this.access_token || this.$db.get("access_token");
  67. } else {
  68. this.haveData = false;
  69. }
  70. },
  71. /* 无权限申请开通权限 */
  72. applyAuth() {
  73. this.hasPermission === 4
  74. ? uni.navigateTo({
  75. url: "/pageMy/applyTrial/applyTrial?tryType=ProductInterior&detailId=" + this.id,
  76. })
  77. : uni.showModal({
  78. title: "",
  79. content: "您已经提交过申请了,请耐心等待",
  80. showCancel: false,
  81. confirmColor: "#365595",
  82. success: function (res) {
  83. uni.navigateBack({
  84. fail() {
  85. uni.switchTab({
  86. url: "/pages/index/index",
  87. });
  88. },
  89. });
  90. },
  91. });
  92. },
  93. // 去往不同的详情页
  94. goIsTypeDetails(item) {
  95. if (item.Type == 1) return;
  96. switch (item.Type) {
  97. case 2:
  98. uni.navigateTo({
  99. url: "/pageMy/reportDetail/reportDetail?id=" + item.SourceId,
  100. });
  101. break;
  102. case 3:
  103. uni.navigateTo({
  104. url: "/activityPages/activityDetail/activityDetail?id=" + item.SourceId,
  105. });
  106. break;
  107. case 4:
  108. uni.navigateTo({
  109. url: "/reportPages/IndustryReport/IndustryReport?id=" + item.SourceId,
  110. });
  111. break;
  112. default:
  113. "";
  114. }
  115. },
  116. // 返回首頁
  117. backIndex() {
  118. uni.switchTab({
  119. url: "/pages/index/index",
  120. });
  121. },
  122. },
  123. onLoad(options) {
  124. this.reportId = Number(options.id) || "";
  125. this.reportId > 0 && this.reportSelectionDetail();
  126. },
  127. onShareAppMessage() {
  128. return {
  129. title: this.titleTxT,
  130. path: "/reportPages/internalDetials/internalDetials?id=" + this.reportId,
  131. };
  132. },
  133. };
  134. </script>
  135. <style lang="scss" scoped>
  136. .internal-detials {
  137. padding: 30rpx 34rpx;
  138. color: #333;
  139. font-size: 28rpx;
  140. .author-time {
  141. display: flex;
  142. justify-content: space-between;
  143. line-height: 39rpx;
  144. margin: 25rpx 0 35rpx;
  145. }
  146. .content-statement {
  147. display: flex;
  148. color: #707070;
  149. .statement {
  150. margin-left: 10rpx;
  151. color: #376cbb;
  152. }
  153. }
  154. .content-abstract {
  155. position: relative;
  156. margin: 30rpx 0 20rpx;
  157. text-indent: 0.5em;
  158. line-height: 50rpx;
  159. padding-bottom: 30rpx;
  160. border-bottom: 1rpx dashed #ececec;
  161. &::before {
  162. content: "";
  163. width: 4rpx;
  164. height: 28rpx;
  165. position: absolute;
  166. top: 11rpx;
  167. left: 0;
  168. background-color: #376cbb;
  169. }
  170. // .abstract {
  171. // display: inline-block;
  172. // }
  173. }
  174. .nodata-tip {
  175. color: #999;
  176. font-size: 30rpx;
  177. }
  178. }
  179. .noauth-cont {
  180. padding-top: 150rpx;
  181. text-align: center;
  182. font-size: 28rpx;
  183. .noauth-ico {
  184. width: 365rpx;
  185. height: 229rpx;
  186. margin-bottom: 70rpx;
  187. }
  188. .tip {
  189. width: 532rpx;
  190. margin: 0 auto 100rpx;
  191. .contract {
  192. padding: 40rpx 90rpx 0;
  193. line-height: 44rpx;
  194. text {
  195. display: inline-block;
  196. }
  197. }
  198. }
  199. .btn-cont {
  200. width: 500rpx;
  201. height: 52rpx;
  202. background: $uni-color-new;
  203. color: #fff;
  204. font-size: 24rpx;
  205. font-weight: 600;
  206. border-radius: 8rpx;
  207. margin: 0 auto;
  208. text-align: center;
  209. line-height: 52rpx;
  210. &.back-btn {
  211. background: #E5EFFF !important;
  212. color: $uni-color-new;
  213. margin-top: 30rpx;
  214. }
  215. .btn_bg {
  216. width: 100%;
  217. height: 80rpx;
  218. position: absolute;
  219. left: 0;
  220. top: 0;
  221. }
  222. .btn-txt {
  223. width: 100%;
  224. position: absolute;
  225. z-index: 1;
  226. }
  227. }
  228. }
  229. </style>