disinfect-Index.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. pageNo: 1,
  28. pageSize: 3,
  29. dataCount: 0
  30. },
  31. }
  32. },
  33. onShow() {
  34. this.getGoodsList();
  35. },
  36. onBackPress() {
  37. this.$common.to('/pages/onely-disinfect/Index')
  38. return true;
  39. },
  40. methods: {
  41. onClick(item) {
  42. this.$common.to('/pages/onely-disinfect/type-business?goodsJson=' + JSON.stringify(item))
  43. },
  44. getGoodsList() {
  45. this.$api.getGoodsList(this.p).then(resp => {
  46. this.typeList = resp.data;
  47. })
  48. }
  49. },
  50. //上拉加载更多,分页模拟数据
  51. onReachBottom() {
  52. if (parseInt(this.p.dataCount) > parseInt(this.p.pageSize) * parseInt(this.p.pageNo)) {
  53. this.status = 'loading';
  54. this.p.pageSize += 5;
  55. this.getCarDisinFect();
  56. } else {
  57. this.status = 'nomore';
  58. }
  59. }
  60. }
  61. </script>
  62. <style lang="scss">
  63. page {
  64. background-color: #fff;
  65. }
  66. .add {
  67. position: absolute;
  68. right: 40rpx;
  69. top: -60rpx;
  70. z-index: 999;
  71. border: 1rpx solid #359aff;
  72. border-radius: 8rpx;
  73. color: #c8e4ff;
  74. padding: 10rpx 20rpx;
  75. font-size: 28rpx;
  76. }
  77. @import '@/common/common.scss'
  78. </style>