noteAndViewpoint.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <view class="container note-and-viewpoint">
  3. <view class="content-item">
  4. <view class="author-name">
  5. <view class="img-box">
  6. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/T2ddwIIaULVdkGM6gVMuNxBSft8Y.png"></image>
  7. </view>
  8. <text style="margin-left: 10rpx">{{ detailDataForm.NickName }}</text>
  9. </view>
  10. <view class="type-time">
  11. <view class="type"> 笔 记</view>
  12. <view class="time">{{ detailDataForm.NickName }}</view>
  13. </view>
  14. <view class="title-item"> {{ detailDataForm.Title }}</view>
  15. <view class="text-conten">
  16. <mp-html :content="detailDataForm.Content" />
  17. </view>
  18. <view class="file-item"> 文档名称.docx </view>
  19. <view class="image-conten">
  20. <image v-for="key in dataProcessing(detailDataForm.ImgUrl)" :key="key" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/Maskgroupbg.png" @click="previewImageMediahandler"></image>
  21. </view>
  22. <view class="lable-conten">
  23. <text v-for="key in dataProcessing(detailDataForm.Tags)" :key="key">{{ key }}</text>
  24. </view>
  25. <view class="collect-conten">
  26. <image v-if="detailDataForm.IsCollect" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/collect_act.png"></image>
  27. <image v-else src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/collect_icon.png"></image>
  28. {{ detailDataForm.CollectNum }}
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. import { purchaserApi } from "@/config/api";
  35. export default {
  36. data() {
  37. return {
  38. detailDataForm: "",
  39. detailId: 0,
  40. };
  41. },
  42. methods: {
  43. previewImageMediahandler() {
  44. uni.previewImage({
  45. urls: ["https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/Maskgroupbg.png"], //查看图片的数组
  46. });
  47. },
  48. // 获取专栏详情
  49. async getDetaliData() {
  50. const res = await purchaserApi.yanxuanSpecialDetail({
  51. Id: this.detailId,
  52. });
  53. if (res.Ret === 200) {
  54. this.detailDataForm = res.Data;
  55. }
  56. },
  57. // 数据处理
  58. dataProcessing(item) {
  59. return item ? item.split(",") : [];
  60. },
  61. },
  62. onLoad(options) {
  63. this.detailId = Number(options.id) || 0;
  64. console.log(this.detailId);
  65. this.detailId > 0 && this.getDetaliData();
  66. },
  67. };
  68. </script>
  69. <style lang="scss" scope>
  70. .note-and-viewpoint {
  71. padding: 30rpx;
  72. background: #f3f5f9;
  73. .content-item {
  74. padding: 40rpx;
  75. background-color: #fff;
  76. .type-time {
  77. display: flex;
  78. align-items: center;
  79. justify-content: space-between;
  80. color: #666666;
  81. .type {
  82. width: 110rpx;
  83. height: 42rpx;
  84. line-height: 42rpx;
  85. text-align: center;
  86. border-radius: 38rpx;
  87. color: #928563;
  88. background-color: #fff6de;
  89. font-weight: 500;
  90. }
  91. }
  92. .title-item {
  93. margin: 10rpx 0 20rpx;
  94. color: #333;
  95. font-size: 32rpx;
  96. font-weight: 500;
  97. line-height: 46rpx;
  98. }
  99. .file-item {
  100. width: 100%;
  101. height: 42rpx;
  102. margin: 20rpx 0;
  103. display: flex;
  104. align-items: center;
  105. background-color: #f8f8fa;
  106. color: #376cbb;
  107. }
  108. .image-conten {
  109. display: flex;
  110. flex-wrap: wrap;
  111. image {
  112. width: 144rpx;
  113. height: 144rpx;
  114. margin-right: 20rpx;
  115. }
  116. }
  117. .lable-conten {
  118. display: flex;
  119. margin: 20rpx 0;
  120. font-size: 24rpx;
  121. text {
  122. height: 34rpx;
  123. border-radius: 44rpx;
  124. padding: 3rpx 35rpx 3rpx 35rpx;
  125. background-color: #f0f1f3;
  126. margin-right: 20rpx;
  127. }
  128. }
  129. .collect-conten {
  130. display: flex;
  131. justify-content: flex-end;
  132. align-items: center;
  133. color: #666666;
  134. image {
  135. width: 27rpx;
  136. height: 26rpx;
  137. margin-right: 8rpx;
  138. }
  139. }
  140. .author-name {
  141. display: flex;
  142. align-items: center;
  143. margin-bottom: 50rpx;
  144. .img-box {
  145. width: 48rpx;
  146. height: 48rpx;
  147. overflow: hidden;
  148. font-size: 28rpx;
  149. color: #333;
  150. image {
  151. width: 100%;
  152. height: 100%;
  153. }
  154. }
  155. }
  156. }
  157. }
  158. </style>