patient.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <view style="width: 100%;height: 100%;">
  3. <view style="height: 100rpx;width: 100%;display: flex;align-items: center;justify-content: center;background-color: #FFFFFF;">
  4. <u-search placeholder="搜索用户姓名" v-model="keyword" :show-action='false' style="width: 90%;" search-icon-color="red"
  5. @change="change"></u-search>
  6. </view>
  7. <view style="padding: 20rpx 28rpx;" v-if="keyword == ''">
  8. <u-collapse :item-style="itemStyle" accordion ref="collapse">
  9. <view v-for="(item, index) in followList" :key="index">
  10. <u-collapse-item>
  11. <!-- 标题 -->
  12. <view slot="title" style="font-size: 30rpx;">
  13. <text style="font-weight: bold;margin-right: 20rpx;">{{item.title}}</text>
  14. <text style="color: #666666;">{{item.sum !=0?item.sum:''}}</text>
  15. </view>
  16. <!-- 面板内容 -->
  17. <view class="he" :style="item.sum!=0?(item.sum<5?'height:'+item.sum*100+'rpx;':'height:500rpx'):''">
  18. <view v-for="nitem,nindex in item.content" style="display: flex;align-items: center;padding: 10rpx 0;overflow:auto;height: auto;"
  19. @click="xq" :id="nitem.user_id" :key='index'>
  20. <image :src="nitem.avatar" mode="aspectFit" style="height: 68rpx;width: 68rpx;border-radius: 50%;margin-right: 20rpx;"></image>
  21. <text style="font-size: 28rpx;margin: 28rpx;color: #000000;">{{nitem.nickname}}</text>
  22. <text style="font-size: 28rpx;">{{nitem.remark==null?'':nitem.remark}}</text>
  23. </view>
  24. </view>
  25. </u-collapse-item>
  26. </view>
  27. </u-collapse>
  28. </view>
  29. <view v-else>
  30. <view v-for="item, index in followList" :key="index">
  31. <view style="padding:30rpx 50rpx;font-weight: bold;font-size: 30rpx;background-color: #EEEEEF;">{{item.title}}</view>
  32. <view v-for="citem,cindex in item.content" @click="xq" :id="citem.user_id" :key='cindex' v-if="citem.nickname.indexOf(keywordSearch)>=0">
  33. <view class="flex align-center" style="height: 150rpx;padding: 10rpx;margin: 0 30rpx;">
  34. <image :src="citem.avatar==null?'../../static/login/moren.png':citem.avatar" mode="aspectFit" style="height: 75rpx;width: 75rpx;border-radius: 50%;margin-right: 20rpx;"></image>
  35. <text style="font-size: 28rpx;margin: 28rpx;color: #000000;">{{citem.nickname==null?'未知':citem.nickname}}</text>
  36. <text style="font-size: 28rpx;">{{citem.remark==null?'未知':citem.remark}}</text>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. export default {
  45. data() {
  46. return {
  47. //
  48. listHeight: {
  49. height: '600rpx',
  50. overflow: 'auto',
  51. overflowX: 'hidden',
  52. },
  53. //搜索
  54. keyword: '',
  55. keywordSearch: '',
  56. itemStyle: {
  57. marginBottom: '20rpx',
  58. background: '#FFFFFF',
  59. padding: '28rpx',
  60. boxshadow: '0px 2px 12px 0px rgba(0, 0, 0, 0.04)',
  61. borderRadius: '12px',
  62. },
  63. followList: [{
  64. title: '咨询患者',
  65. sum: '',
  66. content: []
  67. }, {
  68. title: '门诊患者',
  69. sum: '',
  70. content: []
  71. }, {
  72. title: '关注患者',
  73. sum: '',
  74. content: []
  75. }, {
  76. title: '服务包患者',
  77. sum: '',
  78. content: []
  79. }]
  80. }
  81. },
  82. methods: {
  83. //搜索
  84. change(e) {
  85. this.keywordSearch = e.trim()
  86. console.log(this.keywordSearch)
  87. },
  88. //详情
  89. xq(e) {
  90. let id = e.currentTarget.id
  91. uni.navigateTo({
  92. url: '/pages/patient/patientxq?id=' + id
  93. })
  94. },
  95. getLists: async function(e) {
  96. var that = this
  97. let res = await this.$request.post("doctor/userList", {})
  98. console.log('医生列表:', res)
  99. if (res.status == 0) {
  100. this.followList[0].content = res.data.user_pic.data
  101. this.followList[0].sum = res.data.user_pic.count
  102. this.followList[1].content = res.data.user_relation.data
  103. this.followList[1].sum = res.data.user_relation.count
  104. this.followList[2].content = res.data.user_collection.data
  105. this.followList[2].sum = res.data.user_collection.count
  106. this.followList[3].content = res.data.user_pack.data
  107. this.followList[3].sum = res.data.user_pack.count
  108. this.$nextTick(() => {
  109. that.$refs.collapse.init()
  110. })
  111. }
  112. },
  113. // collapse: async function() {
  114. // this.$nextTick(() => {
  115. // this.$refs.collapse.init()
  116. // })
  117. // }
  118. },
  119. onShow() {
  120. this.getLists();
  121. console.log(this.followList)
  122. },
  123. onLoad() {
  124. }
  125. }
  126. </script>
  127. <style>
  128. .list {
  129. margin-bottom: 20rpx;
  130. background-color: #FFFFFF;
  131. padding: 28rpx;
  132. box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.04);
  133. border-radius: 12px;
  134. }
  135. .he {
  136. overflow: auto;
  137. overflow-x: hidden;
  138. }
  139. </style>