disinfect-Index.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <view>
  3. <view class="box">
  4. <view class="top">
  5. <text class="title">业务项</text>
  6. </view>
  7. </view>
  8. <view class="card-box">
  9. <uni-list>
  10. <uni-list-item v-for="(item,index) in typeList" link="reLaunch" @click="onClick(item)" >
  11. <template v-slot:body>{{item.name}}</template>
  12. </uni-list-item>
  13. </uni-list>
  14. </view>
  15. <noData v-if="typeList.length==0"></noData>
  16. <u-loadmore style="margin: 30rpx;" :status="status" />
  17. </view>
  18. </template>
  19. <script>
  20. export default {
  21. data() {
  22. return {
  23. status: 'loadmore',
  24. customemrId: '1',
  25. typeList:[],
  26. p: {
  27. business: 0,
  28. pageNo: 1,
  29. pageSize: 3,
  30. dataCount: 0
  31. },
  32. }
  33. },
  34. onShow() {
  35. this.getItemTypeList();
  36. },
  37. onBackPress() {
  38. this.$common.to('/pages/onely-disinfect/Index')
  39. return true;
  40. },
  41. methods: {
  42. onClick(item){
  43. this.$common.to('/pages/onely-disinfect/type-business?typeId='+item.id)
  44. },
  45. getItemTypeList(){
  46. this.$api.getItemTypeList(this.p).then(resp=>{
  47. this.typeList=resp.data;
  48. })
  49. }
  50. },
  51. //上拉加载更多,分页模拟数据
  52. onReachBottom() {
  53. if (parseInt(this.p.dataCount) > parseInt(this.p.pageSize) * parseInt(this.p.pageNo)) {
  54. this.status = 'loading';
  55. this.p.pageSize += 5;
  56. this.getCarDisinFect();
  57. } else {
  58. this.status = 'nomore';
  59. }
  60. }
  61. }
  62. </script>
  63. <style lang="scss">
  64. page {
  65. background-color: #fff;
  66. }
  67. .add {
  68. position: absolute;
  69. right: 40rpx;
  70. top: -60rpx;
  71. z-index: 999;
  72. border: 1rpx solid #359aff;
  73. border-radius: 8rpx;
  74. color: #c8e4ff;
  75. padding: 10rpx 20rpx;
  76. font-size: 28rpx;
  77. }
  78. @import '@/common/common.scss'
  79. </style>