articleDetail.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <view>
  3. <u-navbar back-text="文章详情" back-icon-size="28" back-icon-color="#ffffff"
  4. :background="{backgroundColor: '#2795FD',}" :back-text-style="{color: '#ffffff'}"></u-navbar>
  5. <view class="main">
  6. <!-- 标题 -->
  7. <view class="title">
  8. {{form.title}}
  9. </view>
  10. <!-- 其他信息 -->
  11. <view class="infos">
  12. <view class="photo">
  13. <img src="@/assets/img/headPortrait.png"></img>
  14. </view>
  15. <view class="name">
  16. {{form.author}}
  17. </view>
  18. <view class="date" v-if="form.createTime != null">
  19. {{form.createTime.slice(0,10)}}
  20. </view>
  21. <view class="tag1" v-if="form.type == '1'">
  22. 急需用工
  23. </view>
  24. <view class="tag2" v-if="form.type == '2'">
  25. 资源共享
  26. </view>
  27. </view>
  28. <u-line color="#CFD2D5" />
  29. <!-- 文章内容 -->
  30. <view class="content">
  31. {{form.content}}
  32. </view>
  33. <!-- 图片 -->
  34. <view class="picture">
  35. <!-- <img src="@/assets/img/articlePicture.png" alt=""> -->
  36. </view>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. import * as API_packages from '@/apis/pagejs/packages.js'
  42. export default {
  43. data() {
  44. return {
  45. form: {
  46. id: ''
  47. },
  48. }
  49. },
  50. onLoad(op) {
  51. if(op.id) {
  52. this.form.id = op.id;
  53. this.getShareWorksDetail();
  54. }
  55. },
  56. methods: {
  57. getShareWorksDetail() {
  58. uni.showLoading({
  59. title: "加载中",
  60. mask: true,
  61. })
  62. API_packages.shareWorksDetail({id: this.form.id}).then((res) => {
  63. this.form = res.data.shareWorksInfo;
  64. uni.hideLoading();
  65. }).catch(error => {
  66. uni.showToast({
  67. title: error,
  68. icon: "none"
  69. })
  70. })
  71. },
  72. }
  73. }
  74. </script>
  75. <style scoped lang="scss">
  76. .main {
  77. padding: 40rpx 32rpx;
  78. // 标题
  79. .title {
  80. color: rgba(16, 16, 16, 1);
  81. font-size: 36rpx;
  82. }
  83. // 其他信息
  84. .infos {
  85. display: flex;
  86. align-items: center;
  87. margin-top: 24rpx;
  88. margin-bottom: 36rpx;
  89. .photo {
  90. width: 48rpx;
  91. height: 48rpx;
  92. border-radius: 50px;
  93. img {
  94. width: 48rpx;
  95. height: 48rpx;
  96. }
  97. }
  98. .name {
  99. color: rgba(16, 16, 16, 1);
  100. margin-left: 8rpx;
  101. }
  102. .date {
  103. color: rgba(119, 119, 119, 1);
  104. margin-left: 32rpx;
  105. }
  106. .tag1 {
  107. flex: 1;
  108. color: rgba(39, 149, 253, 1);
  109. text-align: right;
  110. }
  111. .tag2 {
  112. flex: 1;
  113. color: rgba(0, 185, 98, 1);
  114. text-align: right;
  115. }
  116. }
  117. // 文章内容
  118. .content{
  119. color: rgba(16, 16, 16, 1);
  120. line-height: 56rpx;
  121. // text-align: j;
  122. }
  123. // 图片
  124. .picture{
  125. margin-top: 24rpx;
  126. border-radius: 4px;
  127. width: 100%;
  128. height: 400rpx;
  129. img{
  130. width: 100%;
  131. height: 100%;
  132. }
  133. }
  134. }
  135. </style>
  136. r