my_archives.vue 1.6 KB

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