mattercontent.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  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. width: 100%;
  123. font-size: 34rpx;
  124. margin: 30rpx 0;
  125. }
  126. .wenzhangCont image {
  127. width: 100%;
  128. height: 320rpx;
  129. margin: 20rpx auto;
  130. }
  131. .pinglunTj {
  132. width: 100%;
  133. display: flex;
  134. justify-content: space-between;
  135. margin: 30rpx 0;
  136. }
  137. .pinglunTitle {
  138. font-size: 34rpx;
  139. color: #2e2e2e;
  140. font-weight: 600;
  141. }
  142. .pinglunTitle em {
  143. font-size: 34rpx;
  144. color: #9b9b9b;
  145. font-weight: normal;
  146. margin: 0 0 0 10rpx;
  147. }
  148. .pinglunList {
  149. width: 100%;
  150. padding: 0 0 120rpx 0;
  151. }
  152. .pinglunList li {
  153. margin: 20rpx 0;
  154. border-bottom: solid 2rpx #e8e8e8;
  155. padding: 0 0 20rpx 0;
  156. display: flex;
  157. flex-direction: column;
  158. }
  159. .plListcont {
  160. font-size: 30rpx;
  161. color: #696868;
  162. margin: 20rpx 0;
  163. }
  164. .pinglunList li button {
  165. width: 80%;
  166. border-radius: 10rpx;
  167. background: #07c160;
  168. color: #fff;
  169. font-size: 28rpx;
  170. font-weight: normal;
  171. margin: 16rpx auto;
  172. }
  173. .fabiaoPl {
  174. width: 100%;
  175. display: flex;
  176. justify-content: space-between;
  177. position: fixed;
  178. left: 0;
  179. bottom: 0;
  180. height: 112rpx;
  181. background: #e8e8e8;
  182. box-shadow: 0rpx 0rpx 16rpx #999;
  183. }
  184. .shuRu {
  185. width: 72%;
  186. display: flex;
  187. flex-direction: row;
  188. height: 76rpx;
  189. background: #e0e0e0;
  190. border-radius: 60rpx;
  191. margin: 20rpx 0 0 20rpx;
  192. }
  193. .shuRu input {
  194. line-height: 38px;
  195. height: 76rpx;
  196. font-size: 30rpx;
  197. width: 83%;
  198. }
  199. .icon-bianji {
  200. font-size: 38rpx;
  201. line-height: 76rpx;
  202. margin: 0 10rpx 0 20rpx;
  203. color: #828181;
  204. }
  205. .icon-shoucang {
  206. font-size: 50rpx;
  207. line-height: 112rpx;
  208. color: #828181;
  209. }
  210. .fasong {
  211. width: 58rpx;
  212. height: 58rpx;
  213. border-radius: 50rpx;
  214. background: #07c160;
  215. margin: 26rpx 20rpx 0 10rpx;
  216. text-align: center;
  217. line-height: 58rpx;
  218. }
  219. .icon-fasong {
  220. font-size: 40rpx;
  221. color: #fff;
  222. }
  223. .likeBtn{
  224. width: 15vw;
  225. height: 9vh;
  226. border-radius: 50%;
  227. position: absolute;
  228. background-color: #F1F1F1;
  229. right: 3%;
  230. bottom: 3%;
  231. font-size: 218%;
  232. text-indent: -16%;
  233. line-height: 190%;
  234. border: none;
  235. }
  236. .likeBtn::after{
  237. border: none;
  238. }
  239. </style>