123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <template>
- <view class="jpmain ">
- <view class="top">
- </view>
- <view class="body">
- <view class="item" v-for="(item,i) in list" @click="gotoUrl('/pages/information/parkingInfo?id='+item.id)"
- :key="i">
- <view class="data">
- <view class="view1">
- </view>
- <view class="view2">
- </view>
- <view class="view3">
- </view>
- </view>
- <view class="goto">
- 使用中
- <u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import * as API from '@/apis/pagejs/index.js'
-
- export default {
- data() {
- return {
- list: [],
- listForm: {
- name: "",
- pageIndex: 1,
- pageSize: 20,
- recordsTotal: 1,
- }
- };
- },
- onLoad() {
- this.getList()
- },
- onReachBottom() {
- if (this.list.length < this.listForm.recordsTotal) {
- this.myLoadmore();
- }
- },
- methods: {
- myLoadmore() {
- this.listForm.pageIndex += 1;
- this.getList()
- },
- getList() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- API.recordList(this.listForm).then((res) => {
- var list = []
- if (this.listForm.pageIndex == 1) {
- list = res.data.data;
- } else {
- list = [
- ...list,
- ...res.data.data
- ];
- }
- this.list = res.data.data
- uni.hideLoading();
- }).catch(error => {
- uni.hideLoading();
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- }
- }
- }
- </script>
- <style lang="scss">
- </style>
|