index.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <view class="index-wrap">
  3. <view class="nav">
  4. <text>患者列表</text>
  5. <view class="handle">
  6. <view class="handle-item">
  7. <text class="zhcx-iconfont zhcx-icon-xindiantu" @click="handleRight(1)"></text>
  8. </view>
  9. <view class="handle-item">
  10. <text class="zhcx-iconfont zhcx-icon-xiaoxi" @click="handleRight(2)"></text>
  11. </view>
  12. </view>
  13. </view>
  14. <fc-contacts :contacts="contacts" @click="showDetail"></fc-contacts>
  15. </view>
  16. </template>
  17. <script>
  18. import {getUserListApi} from '@/api/patient';
  19. import pinYinConvert from '@/libs/pinyin';
  20. export default {
  21. data() {
  22. return {
  23. contacts:[]
  24. }
  25. },
  26. created() {
  27. this.init();
  28. },
  29. onReady() {
  30. //this.setTabBar();
  31. },
  32. methods: {
  33. init(){
  34. this.getUserList();
  35. },
  36. setTabBar(){
  37. //如果用户是患者修改tab
  38. let accountInfo=uni.getStorageSync('accountInfo');
  39. if(!accountInfo){return};
  40. accountInfo=JSON.parse(accountInfo);
  41. let isPatient=accountInfo.userType===2;
  42. if(isPatient){
  43. uni.setTabBarItem({
  44. index: 0,
  45. text: '医生',
  46. iconPath: '/static/tabBar/doctor.png',
  47. selectedIconPath: '/static/tabBar/doctorEd.png'
  48. })
  49. }
  50. },
  51. getUserList(){
  52. getUserListApi({
  53. limit:999,
  54. page:1
  55. }).then((res)=>{
  56. let userList=res.data.records;
  57. userList=userList.map((item)=>{
  58. let pinyinName=pinYinConvert.chineseToPinYin(item.name)
  59. let NameK=pinYinConvert.ucfirst(pinyinName);
  60. item.NameK=NameK
  61. return item;
  62. })
  63. this.contacts=userList;
  64. })
  65. },
  66. showDetail(item){
  67. let info=JSON.parse(JSON.stringify(item));
  68. uni.setStorageSync('patientInfo',info)
  69. uni.navigateTo({
  70. url:'/pages/index/detail/detail'
  71. })
  72. },
  73. handleRight(type){
  74. if(type===2){
  75. uni.navigateTo({
  76. url:"/pages/session/list/list"
  77. })
  78. }else{
  79. uni.navigateTo({
  80. url:"/pages/ECG/webView/webView"
  81. })
  82. }
  83. }
  84. }
  85. }
  86. </script>
  87. <style lang="scss">
  88. .nav{
  89. padding-top: 40upx;
  90. background-color: #fff;
  91. text-align: center;
  92. position: relative;
  93. height: 40px;
  94. line-height: 40px;
  95. font-size: 34upx;
  96. font-weight: 600;
  97. color: #000;
  98. .handle{
  99. position: absolute;
  100. right:0;
  101. top: 30upx;
  102. bottom: 0;
  103. display: flex;
  104. justify-content:flex-end;
  105. .handle-item{
  106. padding:0 20upx;
  107. display: flex;
  108. align-items: center;
  109. cursor: pointer;
  110. font-size: 100upx;
  111. [class*='xindiantu']{
  112. color: #007AFF;
  113. font-size: 50upx;
  114. transform: rotate(-45deg);
  115. }
  116. }
  117. }
  118. }
  119. </style>