mattercontent.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <view>
  3. <!-- 心理咨询详情 -->
  4. <view class="container">
  5. <h1 class="title">{{matterlist.title}}</h1>
  6. <view class="fengexian"></view>
  7. <view class="wenzhangCont article">
  8. <view v-html="matterlist.content"></view>
  9. <image class="uni-header-image" :src="loadImgSrcLocalhost(matterlist.picture)"></image>
  10. <button class="likeBtn" @click="toggleFavorite">{{ isFavorite ? '❤️' : '🤍' }}</button>
  11. </view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. import {
  17. getDept, scadd, delDept, getsc
  18. } from '@/api/handleAffairs/matter.js';
  19. export default {
  20. data() {
  21. return {
  22. matterlist:[],
  23. isFavorite: false,
  24. };
  25. },
  26. created() {
  27. this.getList();
  28. },
  29. methods: {
  30. getList(){
  31. const _that = this;
  32. const id = uni.getStorageSync('id');
  33. getDept(id).then(res =>{
  34. _that.matterlist = res.data
  35. this.checkFavorite();
  36. })
  37. },
  38. toggleFavorite() {
  39. const userId = getApp().globalData.userId;
  40. if (this.isFavorite) {
  41. delDept(this.matterlist.id).then(() => {
  42. this.isFavorite = false;
  43. });
  44. } else {
  45. const userId = getApp().globalData.userId
  46. const matterId = this.matterlist.id
  47. scadd({ matterId:this.matterlist.id , userId }).then(() => {
  48. this.isFavorite = true;
  49. });
  50. }
  51. },
  52. checkFavorite() {
  53. const userId = getApp().globalData.userId
  54. const matterId = this.matterlist.id
  55. getsc({ matterId , userId }).then(res => {
  56. this.isFavorite = res.data;
  57. });
  58. },
  59. },
  60. }
  61. </script>
  62. <style scoped>
  63. /* pages/wenbaxiangqing.wxss */
  64. .title {
  65. font-size: 44rpx;
  66. text-align: center;
  67. line-height: 70rpx;
  68. color: #333;
  69. margin: 30rpx 0;
  70. }
  71. .wenzhangLy {
  72. width: 100%;
  73. display: flex;
  74. justify-content: space-between;
  75. border-bottom: solid 2rpx #e8e8e8;
  76. padding: 0 0 14rpx 0;
  77. }
  78. .txTime {
  79. display: flex;
  80. flex-direction: row;
  81. }
  82. .txTime image {
  83. width: 80rpx;
  84. height: 80rpx;
  85. }
  86. .time {
  87. display: flex;
  88. flex-direction: column;
  89. padding: 10rpx 0 0 8px;
  90. }
  91. .time p {
  92. font-size: 28rpx;
  93. color: #9c9c9c;
  94. }
  95. .time span {
  96. font-size: 24rpx;
  97. color: #c4c4c4;
  98. }
  99. .jf {
  100. color: #07c160;
  101. line-height: 80rpx;
  102. font-size: 24rpx;
  103. }
  104. .icon-jifen {
  105. font-size: 28rpx;
  106. color: #07c160;
  107. margin: 0 0 0 6rpx;
  108. }
  109. .ck {
  110. color: #c4c4c4;
  111. font-size: 28rpx;
  112. }
  113. .icon-pinglun,
  114. .icon-chakan,
  115. .ck .icon-shoucang {
  116. font-size: 28rpx;
  117. margin: 0 6rpx 0 20rpx;
  118. color: #c4c4c4;
  119. line-height: 0;
  120. }
  121. .wenzhangCont {
  122. font-size: 34rpx;
  123. margin: 30rpx 0;
  124. }
  125. .wenzhangCont image {
  126. width: 100%;
  127. height: 320rpx;
  128. margin: 20rpx auto;
  129. }
  130. .pinglunTj {
  131. width: 100%;
  132. display: flex;
  133. justify-content: space-between;
  134. margin: 30rpx 0;
  135. }
  136. .pinglunTitle {
  137. font-size: 34rpx;
  138. color: #2e2e2e;
  139. font-weight: 600;
  140. }
  141. .pinglunTitle em {
  142. font-size: 34rpx;
  143. color: #9b9b9b;
  144. font-weight: normal;
  145. margin: 0 0 0 10rpx;
  146. }
  147. .pinglunList {
  148. width: 100%;
  149. padding: 0 0 120rpx 0;
  150. }
  151. .pinglunList li {
  152. margin: 20rpx 0;
  153. border-bottom: solid 2rpx #e8e8e8;
  154. padding: 0 0 20rpx 0;
  155. display: flex;
  156. flex-direction: column;
  157. }
  158. .plListcont {
  159. font-size: 30rpx;
  160. color: #696868;
  161. margin: 20rpx 0;
  162. }
  163. .pinglunList li button {
  164. width: 80%;
  165. border-radius: 10rpx;
  166. background: #07c160;
  167. color: #fff;
  168. font-size: 28rpx;
  169. font-weight: normal;
  170. margin: 16rpx auto;
  171. }
  172. .fabiaoPl {
  173. width: 100%;
  174. display: flex;
  175. justify-content: space-between;
  176. position: fixed;
  177. left: 0;
  178. bottom: 0;
  179. height: 112rpx;
  180. background: #e8e8e8;
  181. box-shadow: 0rpx 0rpx 16rpx #999;
  182. }
  183. .shuRu {
  184. width: 72%;
  185. display: flex;
  186. flex-direction: row;
  187. height: 76rpx;
  188. background: #e0e0e0;
  189. border-radius: 60rpx;
  190. margin: 20rpx 0 0 20rpx;
  191. }
  192. .shuRu input {
  193. line-height: 38px;
  194. height: 76rpx;
  195. font-size: 30rpx;
  196. width: 83%;
  197. }
  198. .icon-bianji {
  199. font-size: 38rpx;
  200. line-height: 76rpx;
  201. margin: 0 10rpx 0 20rpx;
  202. color: #828181;
  203. }
  204. .icon-shoucang {
  205. font-size: 50rpx;
  206. line-height: 112rpx;
  207. color: #828181;
  208. }
  209. .fasong {
  210. width: 58rpx;
  211. height: 58rpx;
  212. border-radius: 50rpx;
  213. background: #07c160;
  214. margin: 26rpx 20rpx 0 10rpx;
  215. text-align: center;
  216. line-height: 58rpx;
  217. }
  218. .icon-fasong {
  219. font-size: 40rpx;
  220. color: #fff;
  221. }
  222. .likeBtn{
  223. width: 15vw;
  224. height: 9vh;
  225. border-radius: 50%;
  226. background-color: #007AFF;
  227. position: absolute;
  228. right: 3%;
  229. bottom: 3%;
  230. font-size: 218%;
  231. text-indent: -16%;
  232. line-height: 190%;
  233. }
  234. </style>