tongueList.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <view class="content">
  3. <mescroll-body top="0rpx" bottom="0" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
  4. <view class="tongue-list">
  5. <view v-for="(item,index) in dataList" :key="index" class="item" @click="navTo('/pages_user/tongue/report?type=back&id='+item.id)">
  6. <view class="ask-text" >舌苔特征:{{item.taiseName}}</view>
  7. <view class="ask-text" >舌苔描述:{{item.taiseDesc}}</view>
  8. <view class="ask-text">所属体质:{{item.typeName}}</view>
  9. <view class="patient-text">患者:{{item.name}} {{item.age}}岁 {{item.sex==1?'男':'女'}} </view>
  10. <view class="ask-time" v-if="item.createTime!=null">检测时间:{{item.createTime}}</view>
  11. </view>
  12. </view>
  13. </mescroll-body>
  14. </view>
  15. </template>
  16. <script>
  17. import {getHealthTongueList} from '@/api/healthTongue.js'
  18. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  19. export default {
  20. mixins: [MescrollMixin],
  21. data() {
  22. return {
  23. mescroll:null,
  24. // 上拉加载的配置
  25. upOption: {
  26. onScroll:false,
  27. use: true, // 是否启用上拉加载; 默认true
  28. page: {
  29. pae: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  30. size: 10 // 每页数据的数量,默认10
  31. },
  32. noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
  33. textNoMore:"已经到底了",
  34. empty: {
  35. icon:'https://cos.his.cdwjyyh.com/fs/20240423/cf4a86b913a04341bb44e34bb4d37aa2.png',
  36. tip: '暂无数据'
  37. }
  38. },
  39. // 列表数据
  40. dataList: []
  41. }
  42. },
  43. onLoad() {
  44. },
  45. methods: {
  46. navTo(url){
  47. uni.navigateTo({
  48. url: url
  49. })
  50. },
  51. mescrollInit(mescroll) {
  52. this.mescroll = mescroll;
  53. },
  54. /*下拉刷新的回调 */
  55. downCallback(mescroll) {
  56. mescroll.resetUpScroll()
  57. },
  58. upCallback(page) {
  59. //联网加载数据
  60. var that = this;
  61. var data = {
  62. pageNum: page.num,
  63. pageSize: page.size
  64. };
  65. getHealthTongueList(data).then(res => {
  66. if(res.code==200){
  67. //设置列表数据
  68. if (page.num == 1) {
  69. that.dataList = res.data.list;
  70. } else {
  71. that.dataList = that.dataList.concat(res.data.list);
  72. }
  73. that.mescroll.endBySize(res.data.list.length, res.data.total);
  74. }else{
  75. uni.showToast({
  76. icon:'none',
  77. title: "请求失败",
  78. });
  79. that.dataList = null;
  80. that.mescroll.endErr();
  81. }
  82. });
  83. }
  84. }
  85. }
  86. </script>
  87. <style lang="scss">
  88. .content{
  89. .tongue-list{
  90. padding: 20upx;
  91. .item{
  92. background: #FFFFFF;
  93. border-radius: 16upx;
  94. padding: 30upx;
  95. position: relative;
  96. margin-bottom: 20upx;
  97. .ask-text{
  98. margin: 24rpx 0rpx;
  99. font-size: 30upx;
  100. font-family: PingFang SC;
  101. font-weight: 500;
  102. color: #111111;
  103. line-height: 42upx;
  104. }
  105. .patient-text{
  106. font-size: 24upx;
  107. font-family: PingFang SC;
  108. font-weight: 500;
  109. color: #999999;
  110. margin-bottom: 15upx;
  111. }
  112. .ask-time{
  113. font-size: 24upx;
  114. font-family: PingFang SC;
  115. font-weight: 500;
  116. color: #999999;
  117. }
  118. }
  119. }
  120. }
  121. </style>