list.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <view>
  3. <mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
  4. <view @click="goDetail(item)" class="card" v-for="(item,index) in list" :key="index">
  5. <view class="item top" style="padding: 15rpx 0;">
  6. <view class="">
  7. <u-icon name="map"></u-icon>
  8. <text class="padding-left-10">{{item.residentialName}}</text>
  9. </view>
  10. </view>
  11. <view style="margin-left: 30rpx;">
  12. <view class="item">
  13. <view class="">
  14. <text>体温是否异常:</text>
  15. <text v-if="item.temparetureException==0" class="text-green text-bold">否</text>
  16. <text v-if="item.temparetureException==1" class="text-red text-bold">异常</text>
  17. </view>
  18. </view>
  19. <view class="item">
  20. <view >
  21. <text>是否咳嗽不适:</text>
  22. <text v-if="item.symptomException==0" class="text-green text-bold">否</text>
  23. <text v-if="item.symptomException==1" class="text-red text-bold">异常</text>
  24. </view>
  25. </view>
  26. <view class="item">
  27. <text class="padding-right-20">登记时间:</text>
  28. <text>{{item.createDate}}</text>
  29. </view>
  30. </view>
  31. </view>
  32. </mescroll-body>
  33. </view>
  34. </template>
  35. <script>
  36. import MescrollMixin from "@/comps/mescroll-body/mescroll-mixins.js";
  37. export default {
  38. mixins: [MescrollMixin], // 使用mixin
  39. data() {
  40. return {
  41. list:[],
  42. upOption: {
  43. noMoreSize: 5,
  44. auto: true,
  45. page: {
  46. page: 0,
  47. size: 10
  48. }
  49. },
  50. // 下拉配置参数
  51. downOption: {
  52. use: true,
  53. auto: false
  54. }
  55. }
  56. },
  57. onLoad() {
  58. },
  59. methods: {
  60. goDetail(item){
  61. getApp().globalData.pratiqueData=item
  62. uni.navigateTo({
  63. url:"./detail?show=false"
  64. })
  65. },
  66. downCallback(){
  67. setTimeout(()=>{
  68. this.mescroll.resetUpScroll()
  69. },1500)
  70. },
  71. upCallback(mescroll){
  72. let that=this
  73. let member=getApp().globalData.member
  74. let params={
  75. memberId:member.id,
  76. current:mescroll.num,
  77. size:mescroll.size
  78. }
  79. let operation='pratique/getListByMemberId'
  80. try{
  81. getApp().globalData.postRequest(params, operation, function (res) {
  82. let data=res.data.list
  83. mescroll.endBySize(data.length, res.data.total);
  84. if(mescroll.num == 1) that.list = []; //如果是第一页需手动制空列表
  85. that.list=that.list.concat(data); //追加新数据
  86. });
  87. }catch(e){
  88. mescroll.endErr();
  89. }
  90. }
  91. }
  92. }
  93. </script>
  94. <style lang="scss">
  95. .card{
  96. margin: 10rpx;
  97. padding:0 20rpx 20rpx;
  98. background-color: #FFFFFF;
  99. border-radius: 10rpx;
  100. .top{
  101. border-bottom: 1rpx dashed #DEDEDE;
  102. font-weight: 800;
  103. margin-bottom: 20rpx;
  104. }
  105. .item{
  106. padding: 10rpx;
  107. }
  108. .bottom{
  109. border-top: 1rpx dashed #DEDEDE;
  110. margin-top: 10rpx;
  111. padding-right: 20rpx;
  112. }
  113. }
  114. </style>