index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <template>
  2. <view class="main">
  3. <view class="one">
  4. <view class="one_1">群组成员({{total||0}})</view>
  5. <view class="one_2">
  6. <view class="list" v-for="(item, index) in personList" :key="index" @tap="toChat(item)">
  7. <view class="url">
  8. <image class="image"
  9. :src="item.icon&&item.icon.length>0?item.icon[0].url:config.user_url[0].url" mode="">
  10. </image>
  11. </view>
  12. <view class="name textOne">{{item.name||'暂无姓名'}}</view>
  13. </view>
  14. </view>
  15. <view class="one_3">
  16. <view class="more" @tap="toMore">查看更多群成员 <text class="iconfont icon-dayuhao"></text></view>
  17. </view>
  18. </view>
  19. <view class="two">
  20. <view class="two_1">医生信息</view>
  21. <view class="two_2">
  22. <image class="image"
  23. :src="doctorInfo.icon&&doctorInfo.icon.length>0?doctorInfo.icon[0].url:config.user_url[0].url"
  24. mode="">
  25. </image>
  26. <view class="name textOver">姓名:{{doctorInfo.name||'暂无'}}</view>
  27. <view class="other">
  28. <view class="other_1 textOne">
  29. <text>手机号:</text>{{doctorInfo.mobile||'暂无'}}
  30. </view>
  31. <view class="other_1 textOne">
  32. <text>医院名称:</text>{{doctorInfo.hos_name||'暂无'}}
  33. </view>
  34. <view class="other_1 textOne">
  35. <text>科室名称:</text>{{doctorInfo.dept_name||'暂无'}}
  36. </view>
  37. <view class="other_1 textOne">
  38. <text>职称:</text>{{doctorInfo.post||'暂无'}}
  39. </view>
  40. <view class="other_1 textOne">
  41. <text>职务:</text>{{doctorInfo.title||'暂无'}}
  42. </view>
  43. <view class="other_1 textOne">
  44. <text>简介:</text>{{doctorInfo.content||'暂无'}}
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="thr">
  50. <view class="thr_1">群简介</view>
  51. <view class="thr_2">{{info.content||'暂无'}}</view>
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. export default {
  57. data() {
  58. return {
  59. id: '',
  60. config: {},
  61. info: {},
  62. // 群成员
  63. personList: [],
  64. doctorInfo: {},
  65. total: 0,
  66. skip: 0,
  67. limit: 20,
  68. }
  69. },
  70. onLoad: async function(e) {
  71. const that = this;
  72. that.$set(that, `id`, e && e.id || '');
  73. uni.setNavigationBarTitle({
  74. title: e && e.title || '群组'
  75. });
  76. await that.searchConfig();
  77. await that.search();
  78. },
  79. methods: {
  80. searchConfig() {
  81. const that = this;
  82. try {
  83. const res = uni.getStorageSync('config');
  84. if (res) that.$set(that, `config`, res);
  85. } catch (e) {}
  86. },
  87. async search() {
  88. const that = this;
  89. if (that.id) {
  90. const res = await that.$api(`/group/${that.id}`, 'GET', {})
  91. if (res.errcode == '0') {
  92. that.$set(that, `info`, res.data)
  93. that.$set(that, `total`, res.data.patients.length)
  94. that.$set(that, `doctorInfo`, res.data.doctor)
  95. } else {
  96. uni.showToast({
  97. title: res.errmsg,
  98. icon: 'none'
  99. });
  100. }
  101. // 群成员
  102. let info = {
  103. skip: that.skip,
  104. limit: that.limit,
  105. groupId: that.id
  106. }
  107. const arr = await that.$api(`/group/getPaitentList`, 'GET', {
  108. ...info
  109. })
  110. if (arr.errcode == '0') {
  111. that.$set(that, `personList`, arr.data)
  112. } else {
  113. uni.showToast({
  114. title: arr.errmsg,
  115. icon: 'none'
  116. });
  117. }
  118. }
  119. },
  120. // 聊天
  121. toChat(item) {
  122. console.log(item);
  123. },
  124. // 查看更多成员
  125. toMore() {
  126. console.log('查看更多成员');
  127. },
  128. }
  129. }
  130. </script>
  131. <style lang="scss" scoped>
  132. .main {
  133. padding: 2vw;
  134. background-color: var(--f9Color);
  135. .one {
  136. background-color: var(--mainColor);
  137. .one_1 {
  138. text-align: center;
  139. padding: 2vw 0;
  140. font-size: var(--font16Size);
  141. font-weight: bold;
  142. }
  143. .one_2 {
  144. display: flex;
  145. flex-wrap: wrap;
  146. .list {
  147. display: flex;
  148. flex-direction: column;
  149. align-items: center;
  150. width: 15vw;
  151. margin: 2vw;
  152. .image {
  153. width: 15vw;
  154. height: 15vw;
  155. border-radius: 2vw;
  156. }
  157. .name {
  158. margin: 1vw 0 0 0;
  159. font-size: var(--font12Size);
  160. color: var(--f85Color);
  161. }
  162. }
  163. }
  164. .one_3 {
  165. .more {
  166. text-align: center;
  167. padding: 4vw;
  168. font-size: var(--font14Size);
  169. color: var(--f69Color);
  170. }
  171. }
  172. }
  173. .two {
  174. padding: 2vw;
  175. margin: 2vw 0;
  176. background-color: var(--mainColor);
  177. .two_1 {
  178. font-size: var(--font16Size);
  179. font-weight: bold;
  180. }
  181. .two_2 {
  182. padding: 2vw 0;
  183. .image {
  184. width: 20vw;
  185. height: 20vw;
  186. border-radius: 2vw;
  187. }
  188. .name {
  189. font-size: var(--font14Size);
  190. font-weight: bold;
  191. }
  192. .other {
  193. font-size: var(--font14Size);
  194. color: var(--f69Color);
  195. .other_1 {
  196. margin: 1vw 0 0 0;
  197. }
  198. }
  199. }
  200. }
  201. .thr {
  202. padding: 2vw;
  203. margin: 2vw 0;
  204. background-color: var(--mainColor);
  205. .thr_1 {
  206. font-size: var(--font16Size);
  207. font-weight: bold;
  208. }
  209. .thr_2 {
  210. padding: 2vw 0;
  211. font-size: var(--font14Size);
  212. color: var(--f69Color);
  213. }
  214. }
  215. }
  216. </style>