detail.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <view class="p-30">
  3. <!-- 头部 -->
  4. <view class="header flex">
  5. <view class="cate-title">{{ item.title }}</view>
  6. </view>
  7. <!-- 基本信息 -->
  8. <view class="talents-item m-t-30">
  9. <view class="flex">
  10. <view class="">{{ item.author }}</view>
  11. <view class="m-l-20">{{timeFormat(item.created_at)}}</view>
  12. </view>
  13. </view>
  14. <!-- 简介信息 -->
  15. <view class="talents-item m-t-30 m-b-30">
  16. <view class="m-t-16 item-info">
  17. <rich-text :nodes="item.content"></rich-text>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. import {
  24. mapActions,
  25. mapGetters
  26. } from 'vuex'
  27. import {
  28. policyDetail
  29. } from '@/api/app';
  30. import {
  31. timeFormat
  32. } from '@/utils/date';
  33. export default {
  34. data() {
  35. return {
  36. statusBarHeight: 0,
  37. id: 0, //分类id
  38. item: {},
  39. // item: {
  40. // title: '晋江市重点产业紧缺人才计划实施办法',
  41. // author: '晋江市发展改革委',
  42. // time: '2023-04-15 11:02',
  43. // content: '为深入实施创新驱动发展战略,营造有利于创新创业创造的良好发展环境,集聚重点产业高层次紧缺人才,促进主导产业和战略性新兴产业发展,根据《厦门市国民经济和社会发展第十四个五年规划和二〇三五年远景目标纲要》、《关于深化人才发展体制机制改革加快推进人才强市战略的意见》(厦委发〔2017〕16号)及有关政策法规,按照厦门市相关人才计划部署,制定本办法。'
  44. // }
  45. };
  46. },
  47. created() {
  48. uni.getSystemInfo({
  49. success: (res) => {
  50. this.statusBarHeight = res.statusBarHeight;
  51. }
  52. });
  53. },
  54. onLoad() {
  55. // this.id = 11
  56. this.item = uni.getStorageSync('policyDetail');
  57. uni.removeStorageSync('policyDetail')
  58. if (!this.item) {
  59. this.id = this.$Route.query.id;
  60. this.getCategoryFun()
  61. }
  62. },
  63. onShow() {
  64. // this.getUser();
  65. },
  66. methods: {
  67. // ...mapActions(['getUser']),
  68. makePhoneCall(tel) {
  69. if (tel) {
  70. uni.makePhoneCall({
  71. phoneNumber: tel
  72. });
  73. }
  74. },
  75. async getCategoryFun() {
  76. const {
  77. status,
  78. data
  79. } = await policyDetail({
  80. id: this.id
  81. });
  82. if (status == 1) {
  83. this.item = data
  84. }
  85. },
  86. timeFormat(time) {
  87. return timeFormat(time)
  88. },
  89. },
  90. computed: {
  91. ...mapGetters(['appConfig']),
  92. }
  93. };
  94. </script>
  95. <style lang="scss">
  96. page {
  97. background-color: #FFFFFF;
  98. }
  99. .header {
  100. .cate-title {
  101. font-size: 40rpx;
  102. font-family: PingFang SC-Medium, PingFang SC;
  103. font-weight: bold;
  104. color: #282C37;
  105. }
  106. }
  107. .talents-item {
  108. background: #FFFFFF;
  109. font-size: 28rpx;
  110. }
  111. </style>