tongueList.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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. downOption: {
  25. //下拉刷新
  26. use: true,
  27. auto: false // 不自动加载 (mixin已处理第一个tab触发downCallback)
  28. },
  29. // 上拉加载的配置
  30. upOption: {
  31. onScroll:false,
  32. use: true, // 是否启用上拉加载; 默认true
  33. page: {
  34. pae: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  35. size: 10 // 每页数据的数量,默认10
  36. },
  37. noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
  38. textNoMore:"已经到底了",
  39. empty: {
  40. icon:'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/empty_icon.png',
  41. tip: '暂无数据'
  42. }
  43. },
  44. // 列表数据
  45. dataList: []
  46. }
  47. },
  48. onLoad() {
  49. },
  50. methods: {
  51. navTo(url){
  52. uni.navigateTo({
  53. url: url
  54. })
  55. },
  56. mescrollInit(mescroll) {
  57. this.mescroll = mescroll;
  58. },
  59. /*下拉刷新的回调 */
  60. downCallback(mescroll) {
  61. mescroll.resetUpScroll()
  62. },
  63. upCallback(page) {
  64. //联网加载数据
  65. var that = this;
  66. var data = {
  67. pageNum: page.num,
  68. pageSize: page.size
  69. };
  70. getHealthTongueList(data).then(res => {
  71. if(res.code==200){
  72. //设置列表数据
  73. if (page.num == 1) {
  74. that.dataList = res.data.list;
  75. } else {
  76. that.dataList = that.dataList.concat(res.data.list);
  77. }
  78. that.mescroll.endBySize(res.data.list.length, res.data.total);
  79. }else{
  80. uni.showToast({
  81. icon:'none',
  82. title: "请求失败",
  83. });
  84. that.dataList = null;
  85. that.mescroll.endErr();
  86. }
  87. });
  88. }
  89. }
  90. }
  91. </script>
  92. <style lang="scss">
  93. .content{
  94. .tongue-list{
  95. padding: 20upx;
  96. .item{
  97. background: #FFFFFF;
  98. border-radius: 16upx;
  99. padding: 30upx;
  100. position: relative;
  101. margin-bottom: 20upx;
  102. .ask-text{
  103. margin: 24rpx 0rpx;
  104. font-size: 30upx;
  105. font-family: PingFang SC;
  106. font-weight: 500;
  107. color: #111111;
  108. line-height: 42upx;
  109. }
  110. .patient-text{
  111. font-size: 24upx;
  112. font-family: PingFang SC;
  113. font-weight: 500;
  114. color: #999999;
  115. margin-bottom: 15upx;
  116. }
  117. .ask-time{
  118. font-size: 24upx;
  119. font-family: PingFang SC;
  120. font-weight: 500;
  121. color: #999999;
  122. }
  123. }
  124. }
  125. }
  126. </style>