index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <template>
  2. <view class="page-container">
  3. <!-- 头部筛选 -->
  4. <view class="page-head">
  5. <u-row>
  6. <u-col :span="!hasHostPlat(['dingH5'])?11:12" style="padding: 16rpx 24rpx;">
  7. <view>
  8. <view class="input-wapper">
  9. <u--input
  10. v-model="params.nickName"
  11. :disabled="false"
  12. :clearable="true"
  13. placeholder="请输入驾驶员名称"
  14. prefixIcon="search"
  15. shape="circle"
  16. prefixIconStyle="font-size: 22px;color: #909399"
  17. inputAlign="center"
  18. fontSize="28rpx"
  19. disabledColor="#F2F2F2"
  20. border="none"
  21. :customStyle="{
  22. height: '62rpx',
  23. padding: '4rpx 28rpx',
  24. background: '#F2F2F2'
  25. }"
  26. @confirm="handleQuery"
  27. >
  28. </u--input>
  29. </view>
  30. </view>
  31. </u-col>
  32. <u-col :span="1" style="padding: 0;" v-if="$hasPermi('mobile:index:baseMange:driverManage:add') && !hasHostPlat(['dingH5'])">
  33. <u-icon name="plus-circle-fill" color="#4573FC" size="22" @click="handleAdd"></u-icon>
  34. </u-col>
  35. </u-row>
  36. </view>
  37. <!-- 内容 -->
  38. <view class="page-body">
  39. <scroll-view scroll-y style="height: 100%" enable-back-to-top refresher-enabled
  40. refresher-background="#F6F6F6" :refresher-triggered="refresher" @refresherrefresh="handleRefresher"
  41. @scrolltolower="handleScrollLower">
  42. <template v-for="(e,index) in tableList">
  43. <item :item="e" @getList="handleQuery"
  44. :key="index"
  45. >
  46. </item>
  47. </template>
  48. <view class="nodata-warp" v-if="!tableList.length">
  49. <image :src="$getImages('/assetsMobile/images/no-data.png')" class="nodata-image"></image>
  50. </view>
  51. <u-loadmore :status="loadStatus" height="30"/>
  52. <!-- <u-empty mode="data" v-if="tableList.length === 0" marginTop="200"></u-empty> -->
  53. </scroll-view>
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. import {listDriverManage} from '@/api/system/driverManage.js'
  59. import listMixin from '@/utils/mixins/list.js'
  60. import item from './module/item'
  61. export default {
  62. mixins: [listMixin],
  63. components: {
  64. item,
  65. },
  66. data() {
  67. return {
  68. params: {
  69. nickName: '',
  70. },
  71. }
  72. },
  73. onLoad() {
  74. this.handleQuery()
  75. },
  76. onShow() {
  77. },
  78. methods: {
  79. handleAdd() {
  80. uni.navigateTo({
  81. url: `/pagesBase/driverManage/add`
  82. })
  83. },
  84. async handleTableList() {
  85. this.loadStatus = 'loading'
  86. let ajaxData = {
  87. ...this.params,
  88. page: this.page,
  89. size: this.pageSize
  90. }
  91. let {code,data} = await listDriverManage(ajaxData)
  92. if (code == "0" ) {
  93. data.list.map((e) => {
  94. this.tableList.push({
  95. ...e,
  96. });
  97. })
  98. this.loadStatus = 'loadmore'
  99. this.total = data.total;
  100. if (this.page * this.pageSize >= this.total) {
  101. this.loadStatus = 'nomore'
  102. }
  103. this.refresher = false;
  104. }
  105. },
  106. }
  107. }
  108. </script>
  109. <style lang="scss" scoped>
  110. .disflex {
  111. display: flex;
  112. justify-content: center;
  113. align-items: center;
  114. }
  115. .page-container {
  116. font-size: 28rpx;
  117. min-height: 100%;
  118. height: 100%;
  119. position: relative;
  120. overflow: hidden;
  121. .page-head {
  122. background: #fff;
  123. }
  124. .page-body {
  125. width: 100%;
  126. // height: calc(100% - 146rpx - 20rpx);
  127. height: calc(100% - 76rpx - 20rpx);
  128. overflow: hidden;
  129. padding-bottom: 40rpx;
  130. }
  131. }
  132. .nodata-warp{
  133. display: flex;
  134. justify-content: center;
  135. align-items: center;
  136. padding: 100rpx 0;
  137. .nodata-image{
  138. width: 218rpx;
  139. height: 150rpx;
  140. }
  141. }
  142. ::v-deep {
  143. }
  144. </style>