deptDetails.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <template>
  2. <view class="container">
  3. <view class="content" v-if="currentModal == 'base'">
  4. <image class="public_right_imgs" :src="iconUrl.deptlist"></image>
  5. <view class="content_inner contentStyle">
  6. <view class="title">{{queryBean.DeptName}}</view>
  7. <image class="public_right_imgs" :src="iconUrl.deptlist"></image>
  8. <view class="tip">
  9. <text class="tip_tow backgroundCustom">科室简介</text>
  10. </view>
  11. <view class="details">
  12. <view :class="['details_text', showMore ? 'infoTxtMore' : 'infoTxt']" v-if="queryBean.DeptIntro" @click="moreClick">
  13. <rich-text :nodes="processedIntro"></rich-text>
  14. </view>
  15. <view class="details_an" @click="moreClick" v-if="queryBean.DeptIntro">
  16. {{showMore?'收起':'展开'}}
  17. <image :class="['right_img', showMore ? 'right_img_up' : '']" :src="iconUrl.icon_right"></image>
  18. </view>
  19. <view v-else style="text-align: center;">暂无科室介绍</view>
  20. </view>
  21. <view class="doctor_subject" @click="Doctorlist">查看科室医生简介</view>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script setup lang="ts">
  27. import { ref } from 'vue';
  28. import { onLoad } from '@dcloudio/uni-app';
  29. import { common } from '@/utils';
  30. import icon from '@/utils/icon';
  31. const iconUrl = icon;
  32. const showMore = ref(false);
  33. const currentModal = ref('base');
  34. const queryBean = ref<any>({});
  35. const processedIntro = ref('');
  36. onLoad((options: any) => {
  37. currentModal.value = options.currentModal || 'base';
  38. if (options.queryBean) {
  39. try {
  40. queryBean.value = JSON.parse(decodeURIComponent(options.queryBean));
  41. processIntro();
  42. } catch (e) {
  43. console.error('Parse error', e);
  44. }
  45. }
  46. });
  47. const processIntro = () => {
  48. if (queryBean.value.DeptIntro) {
  49. // 模拟原逻辑:去除 style 标签
  50. let info = unescape(queryBean.value.DeptIntro).replace(/ style=".*?"/g, '');
  51. processedIntro.value = info;
  52. }
  53. };
  54. const moreClick = () => {
  55. showMore.value = !showMore.value;
  56. };
  57. const Doctorlist = () => {
  58. const qb = JSON.stringify(queryBean.value);
  59. const url = `/pagesPatient/st1/business/news/doctorList/doctorList?queryBean=${qb}&DeptCode=${queryBean.value.DeptCode}`;
  60. common.goToUrl(url);
  61. };
  62. </script>
  63. <style lang="scss" scoped>
  64. .banner_img {
  65. width: 100%;
  66. height: 424upx;
  67. }
  68. .content{
  69. padding-bottom: 210upx;
  70. }
  71. .content_inner, .tabber_inner, .view_details {
  72. padding: 28upx 30upx 40upx;
  73. background-color: #fff;
  74. }
  75. .title {
  76. /* width: 142upx; */
  77. height: 34upx;
  78. font-size: 36upx;
  79. font-family: PingFang SC;
  80. font-weight: 800;
  81. color: #222326;
  82. line-height: 40upx;
  83. }
  84. .tip {
  85. font-size: 26upx;
  86. font-weight: 400;
  87. color: rgba(166, 166, 166, 1);
  88. padding: 10upx 0 17upx;
  89. overflow: hidden;
  90. }
  91. .tip .tip_tow {
  92. display: inline-block;
  93. padding: 0 8upx;
  94. }
  95. .tip_tow {
  96. width: 148upx;
  97. height: 52upx;
  98. margin-top: 48upx;
  99. line-height: 46upx;
  100. font-family: PingFang SC;
  101. font-weight: 500;
  102. text-align: center;
  103. border-radius: 12upx 12upx 12upx 0upx;
  104. }
  105. .tip_tow::after {
  106. border-color: #a6a6a6;
  107. }
  108. .details_text view {
  109. font-family: Source Han Sans CN !important;
  110. color: rgba(85, 85, 85, 1) !important;
  111. font-size: 30upx !important;
  112. font-weight: 400 !important;
  113. line-height: 48upx !important;
  114. }
  115. .infoTxtMore {
  116. word-wrap: break-word;
  117. text-align: justify;
  118. }
  119. .infoTxt {
  120. overflow: hidden;
  121. text-overflow: ellipsis;
  122. display: -webkit-box;
  123. -webkit-line-clamp: 3;
  124. line-clamp: 3;
  125. -webkit-box-orient: vertical;
  126. text-align: justify;
  127. font-family: PingFangSC-Regular;
  128. }
  129. .details .details_an {
  130. padding-top: 30upx ;
  131. font-size: 26upx;
  132. display: flex;
  133. align-items: center;
  134. justify-content: center;
  135. color: #a6a6a6;
  136. }
  137. .right_img {
  138. width: 12upx;
  139. height: 21upx;
  140. margin-left: 14upx;
  141. transform: rotateZ(90deg);
  142. }
  143. .right_img_up {
  144. transform: rotateZ(-90deg);
  145. }
  146. .message {
  147. background: rgba(255, 255, 255, 1);
  148. box-shadow: 0upx 0upx 40upx 0upx rgba(0, 0, 0, 0.06);
  149. border-radius: 20upx;
  150. }
  151. .message_list {
  152. min-height: 100upx;
  153. font-size: 30upx;
  154. font-weight: 400;
  155. color: rgba(85, 85, 85, 1);
  156. display: flex;
  157. align-items: center;
  158. padding: 20upx 30upx;
  159. position: relative;
  160. }
  161. .item_img {
  162. width: 32upx;
  163. height: 32upx;
  164. margin-right: 26upx;
  165. }
  166. .public_right_img {
  167. right: 30upx;
  168. }
  169. .public_right_imgs {
  170. right: 30upx;
  171. width: 100%;
  172. height: 80upx;
  173. top: 0px;
  174. position: absolute;
  175. }
  176. /* 基础信息 */
  177. .info_item {
  178. padding-bottom: 58upx;
  179. }
  180. .item_title {
  181. font-size: 32upx;
  182. font-weight: 500;
  183. color: rgba(0, 0, 0, 1);
  184. }
  185. .item_tip {
  186. font-size: 28upx;
  187. font-weight: 400;
  188. color: rgba(85, 85, 85, 1);
  189. line-height: 44upx;
  190. margin-top: 29upx;
  191. }
  192. .tip_subject{
  193. width: 670upx;
  194. height: 168upx;
  195. font-size: 30upx;
  196. font-family: PingFang SC;
  197. font-weight: 500;
  198. color: #43434A;
  199. line-height: 46upx;
  200. }
  201. .subject_tow{
  202. height: 6upx;
  203. font-size: 30upx;
  204. font-family: PingFang SC;
  205. font-weight: 500;
  206. color: #43434A;
  207. line-height: 24upx;
  208. }
  209. .doctor_subject{
  210. position: fixed;
  211. bottom: 32upx;
  212. width: 690upx;
  213. height: 102upx;
  214. background: var(--auxiliaryColor);
  215. border-radius: 55upx;
  216. line-height: 102upx;
  217. text-align: center;
  218. font-size: 34upx;
  219. font-family: PingFang SC;
  220. font-weight: bold;
  221. color: #FFFFFF;
  222. }
  223. .contentStyle{
  224. overflow: auto;
  225. }
  226. </style>