my_archives.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <view class="main">
  3. <view class="cu-list menu-avatar margin-sm" @click="gotoinfo(item)" v-for="(item,index) in patientList" :key="index"
  4. style="border-radius: 16rpx;box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);">
  5. <view class="cu-item">
  6. <view class="cu-avatar round lg" :style="'background-image:url('+item.avatar+');'"></view>
  7. <view class="content">
  8. <view class="text-grey">{{item.name}}</view>
  9. <view class="text-gray text-sm flex">
  10. <text class="text-cut">
  11. {{item.sex==1?'男':'女'}}
  12. </text>
  13. <text class="text-cut margin-left-sm">
  14. {{item.age}}
  15. </text>
  16. </view>
  17. </view>
  18. <view class="action">
  19. <text class="cuIcon-roundright lg text-gray"></text>
  20. </view>
  21. </view>
  22. </view>
  23. <u-empty text="暂无档案" :show="istrue" mode="list" margin-top="300"></u-empty>
  24. <view class="cu-bar bg-white tabbar" style="position: fixed;bottom: 0;width: 100%;">
  25. <view class="submit" style="background-color: #0B73B9;color: white;" @click="addarchives">
  26. 添加健康档案
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. export default {
  33. onLoad(options) {
  34. },
  35. onShow() {
  36. this.getarchives()
  37. },
  38. data() {
  39. return {
  40. patientList: [],
  41. istrue: false
  42. }
  43. },
  44. methods: {
  45. getarchives: async function() {
  46. let res = await this.$request.post("/api/v1/patient/patientList")
  47. console.log(res)
  48. if (res.status == 0) {
  49. this.patientList = res.data.data
  50. if (this.patientList.length == 0) {
  51. this.istrue = true
  52. }
  53. }
  54. },
  55. addarchives() {
  56. uni.navigateTo({
  57. url: "add_archives"
  58. })
  59. },
  60. gotoinfo(item) {
  61. uni.navigateTo({
  62. url: "archives_info?id=" + item.id
  63. })
  64. }
  65. }
  66. };
  67. </script>
  68. <style scoped lang="scss">
  69. .main {}
  70. </style>