queryList.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <view>
  3. <u-navbar
  4. :title="title"
  5. title-color="#fff"
  6. :is-back="true"
  7. :border-bottom="false"
  8. :custom-back="customBack"
  9. back-icon-color="#CCE8FF"
  10. :background="{background: '#4D68DC' }"></u-navbar>
  11. <!-- <u-tabs :list="tabList" :is-scroll="false" height="108" bar-width="100" :current="tabIndex" @change="tabChange"></u-tabs>
  12. <u-gap height="20" bg-color="#F6F6F6"></u-gap> -->
  13. <mescroll-uni ref="mescrollRef" @init="mescrollInit" :top="60" @down="downCallback" :up="upOption" @up="upCallback" @emptyclick="emptyClick">
  14. <view class="owelist">
  15. <view class="owelist-item" v-for="(item,index) in dataList" :key="item.id">
  16. <view class="item-header u-flex u-row-between">
  17. <view class="vehicle-no">{{item.vehicleNo}}</view>
  18. <view class="order-status" :class="{'order-status-0':item.orderStatus=='0','order-status-1':item.orderStatus=='1','order-status-2':item.orderStatus=='2','order-status-3':item.orderStatus=='3','order-status-4':item.orderStatus=='4'}">{{item.orderStatus|filterOrderStatus}}</view>
  19. </view>
  20. <view class="road-name u-flex">
  21. <u-icon name="map-fill" color="#3397FA" size="36"></u-icon>
  22. {{item.roadName}}
  23. </view>
  24. <view class="info-item">订单号:{{item.orderId}}</view>
  25. <view class="info-item">进场时间:{{item.inTime}}</view>
  26. <view v-if="item.orderStatus != 1" class="info-item">出场时间:{{item.outTime}}</view>
  27. <view v-if="item.orderStatus != 1" class="info-item">停车时长:{{item.duration}}</view>
  28. <view v-if="item.orderStatus != 1" class="info-item">免费时长:{{item.freeDuration}}</view>
  29. <view v-if="item.orderStatus != 1" class="info-item">计费时长:{{item.billinDuration}}</view>
  30. <view v-if="item.orderStatus != 1" class="info-item">应缴金额:{{item.payAmount}}</view>
  31. <view v-if="item.orderStatus != 1" class="info-item">实缴金额:<span class="amount">{{item.payAmount}}元</span></view>
  32. </view>
  33. </view>
  34. </mescroll-uni>
  35. </view>
  36. </template>
  37. <script>
  38. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  39. export default{
  40. mixins: [MescrollMixin], // 使用mixin (在main.js注册全局组件)
  41. data(){
  42. return{
  43. title:"查询结果",
  44. warningType:'环境',
  45. vehicleNo:'',
  46. selectShow:false,
  47. selectList: [
  48. {
  49. value: '1',
  50. label: '环境'
  51. },
  52. {
  53. value: '2',
  54. label: '设备/工艺'
  55. }
  56. ],
  57. tabIndex:0,
  58. tabList:[
  59. {name:'停放中'},
  60. {name:'出场中'},
  61. {name:'欠费'},
  62. {name:'完成'},
  63. ],
  64. upOption:{
  65. // page: {
  66. // size: 10 // 每页数据的数量
  67. // },
  68. // auto:false,
  69. // use:false,
  70. noMoreSize: 4, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
  71. empty:{
  72. tip: '~ 暂无数据 ~', // 提示
  73. // btnText: '去看看'
  74. }
  75. },
  76. dataList: [], //列表数据
  77. }
  78. },
  79. onLoad(page){
  80. this.vehicleNo = page.vehicleNo;
  81. },
  82. onShow(){
  83. setTimeout(()=>{
  84. this.mescroll.resetUpScroll();
  85. },500)
  86. },
  87. methods:{
  88. customBack(){
  89. uni.reLaunch({
  90. url: '/pages/ownersQuery/ownersQuery'
  91. });
  92. },
  93. /*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
  94. upCallback(page) {
  95. // console.log('page',page)
  96. //联网加载数据
  97. // let keyword = this.tabs[this.tabIndex]?.text;
  98. let params ={
  99. // orderStatus:this.tabIndex + 1,//预警状态 1-待处理 2-已处理 3-已解除 如需要状态就放开
  100. vehicleNo:this.vehicleNo,
  101. // queryType:this.deviceTypeId,//查询类型 0-历史预警
  102. pageNum:page.num,
  103. queryType:page.size
  104. }
  105. this.$u.api.getParkingRecord(params).then(curPageData=>{
  106. console.log('curPageData',curPageData)
  107. //联网成功的回调,隐藏下拉刷新和上拉加载的状态;
  108. this.mescroll.endSuccess(curPageData.total);
  109. this.mescroll.endBySize(curPageData.data.rows.length, curPageData.total);
  110. //设置列表数据
  111. if(page.num == 1) this.dataList = []; //如果是第一页需手动制空列表
  112. this.dataList=this.dataList.concat(curPageData.data.rows); //追加新数据
  113. }).catch((err)=>{
  114. uni.showToast({
  115. title:'链接失败'
  116. });
  117. console.log('err',err)
  118. //联网失败, 结束加载
  119. this.mescroll.endErr();
  120. })
  121. },
  122. //点击空布局按钮的回调
  123. emptyClick(){
  124. },
  125. // 切换菜单
  126. tabChange(index) {
  127. this.dataList = [];// 先置空列表,显示加载进度
  128. this.tabIndex = index;
  129. this.mescroll.resetUpScroll(); // 再刷新列表数据
  130. },
  131. selectConfirm(e){
  132. console.log('e',e);
  133. this.warningType = e[0].label;
  134. // this.$emit('workTypeChange', e[0].label);
  135. },
  136. openDetails(item){
  137. this.$u.route({
  138. url: 'pages/warningCenter/warningDetails/warningDetails',
  139. params:{
  140. deviceId:item.deviceId,
  141. warningId:item.id
  142. }
  143. })
  144. }
  145. }
  146. }
  147. </script>
  148. <style lang="scss" scoped>
  149. // @import './warningCenter.scss'
  150. page{
  151. background-color: #f7f7f7;
  152. }
  153. .owelist{
  154. margin: 31rpx auto;
  155. padding: 24rpx;
  156. .owelist-item{
  157. background-color: #fff;
  158. padding: 25rpx 31rpx;
  159. border-radius: 10rpx;
  160. margin-bottom: 19rpx;
  161. .item-header{
  162. margin-bottom: 11rpx;
  163. .vehicle-no{
  164. font-size: 40rpx;
  165. font-weight: 500;
  166. color: #3D3D3D;
  167. line-height: 56rpx;
  168. }
  169. .order-status{
  170. font-size: 24rpx;
  171. font-weight: 500;
  172. color: #8F8F8F;
  173. line-height: 48rpx;
  174. border: 1px solid #ddd;
  175. color: #777;
  176. padding: 0 24rpx;
  177. border-radius: 8rpx;
  178. &.order-status-4{
  179. color: #777;
  180. }
  181. &.order-status-3{
  182. border-color: #FA6400;
  183. color: #FA6400;
  184. }
  185. }
  186. }
  187. .road-name{
  188. font-size: 26rpx;
  189. font-weight: 400;
  190. color: #A2A2A2;
  191. line-height: 37rpx;
  192. padding-bottom: 20rpx;
  193. border-bottom: 1px solid #D5D5D5;
  194. margin-bottom: 21rpx;
  195. }
  196. .info-item{
  197. font-size: 30rpx;
  198. color: #63717F;
  199. line-height: 42rpx;
  200. margin-bottom: 13rpx;
  201. .amount{
  202. font-weight: 500;
  203. color: #FA6400;
  204. }
  205. }
  206. }
  207. }
  208. </style>