detail.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <view class="main">
  3. <view class="content">
  4. <view class="top">
  5. <image :src="ip + item.avatar" mode="widthFix" class="avatar" v-if="item.avatar"></image>
  6. <view class="title">{{ item.name }}</view>
  7. </view>
  8. <view class="con">
  9. <u-divider text="人物介绍"></u-divider>
  10. <u-parse :content="item.introduce" v-if="item.introduce"></u-parse>
  11. <u-empty v-else text="暂无介绍资料"></u-empty>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. data() {
  19. return {
  20. ip: this.http.ip,
  21. item: {}
  22. };
  23. },
  24. onLoad(e) {
  25. this.http.request({
  26. url: '/app/doctor/detail/' + e.id,
  27. success: (res) => {
  28. this.item = res.data.data;
  29. this.item.introduce = res.data.data.introduce.replace(new RegExp('/profile/upload/', 'g'), this.http.ip + '/profile/upload/');
  30. }
  31. });
  32. },
  33. methods: {}
  34. };
  35. </script>
  36. <style lang="scss">
  37. .main {
  38. padding: 0px 10px 10px 10px;
  39. }
  40. .content {
  41. padding: 15px;
  42. background-color: white;
  43. border-radius: 8px;
  44. .top {
  45. text-align: center;
  46. .avatar {
  47. width: 55%;
  48. border-radius: 5px;
  49. }
  50. .title {
  51. font-size: 18px;
  52. padding-top: 3px;
  53. }
  54. }
  55. .con {
  56. font-size: 14px;
  57. line-height: 23px;
  58. image {
  59. border-radius: 5px !important;
  60. }
  61. }
  62. }
  63. </style>