zhangzengfei
2021-09-16 38430ddb8612fce15a2f1c940f9bd57d4da3e70b
pages/parkInfo/parkInfo.vue
@@ -1,22 +1,22 @@
<template>
   <view>
      <table >
         <th class="index">序号</th>
         <th class="posNum">车位号</th>
         <th class="carNum">车牌号</th>
         <th class="name">姓名</th>
         <th class="phone">手机号</th>
         <th class="type">类型</th>
         <tbody>
            <tr v-for="(item,index) in tableList">
               <td class="index">{{index+1}}</td>
               <td class="posNum">{{item.spaceNo}}</td>
               <td class="carNum">{{item.plateNo}}</td>
               <td class="name">{{item.username}}</td>
               <td class="phone">{{item.phoneNum}}</td>
               <td class="type">{{item.carType}}</td>
            </tr>
         </tbody>
      <table >
         <th class="index">序号</th>
         <th class="posNum">车位号</th>
         <th class="carNum">车牌号</th>
         <th class="name">姓名</th>
         <th class="phone">手机号</th>
         <th class="type">类型</th>
         <tbody>
            <tr v-for="(item,index) in tableList">
               <td class="index">{{index+1}}</td>
               <td class="posNum">{{item.spaceNo}}</td>
               <td class="carNum">{{item.plateNo}}</td>
               <td class="name">{{item.username}}</td>
               <td class="phone">{{item.phoneNum}}</td>
               <td class="type">{{item.carType}}</td>
            </tr>
         </tbody>
      </table>
   </view>
</template>
@@ -27,84 +27,84 @@
         return {
            tableList: [],
         }
      },
      onShow() {
         this.getParkInfo();
      },
      onPullDownRefresh(){
         this.getParkInfo();
      },
      onShow() {
         this.getParkInfo();
      },
      onPullDownRefresh(){
         this.getParkInfo();
      },
      methods: {
         async getParkInfo(){
            let {userId} = uni.getStorageSync('user') && JSON.parse(uni.getStorageSync('user'));
            let res = await this.$api.syncRequest({
               url:'/basic/api/car/spaceUser?userId=${userId}',
               loading: true
            });
            debugger
            this.tableList = res.data.data;
            uni.stopPullDownRefresh();
         async getParkInfo(){
            let {userId} = uni.getStorageSync('user') && JSON.parse(uni.getStorageSync('user'));
            let res = await this.$api.syncRequest({
               url:'/basic/api/car/spaceUser?userId=${userId}',
               loading: true
            });
            debugger
            this.tableList = res.data.data;
            uni.stopPullDownRefresh();
         }
      }
   }
</script>
<style lang="scss" scoped>
   table{
      border: 2rpx solid #E9EAEC;
      border-collapse: collapse;
      font-size: 12px;
      margin: 0 auto 10px;
      th{
         background-color: #7fa4f9;
         color: #fff;
         line-height: 70rpx;
         &.index{
            //width: 60rpx;
            width: 68rpx;
         }
         &.posNum{
            width: 94rpx;
         }
         &.carNum{
            width: 180rpx;
            //width: 196rpx;
         }
         &.name{
            width: 152rpx;
         }
         &.phone{
            width: 176rpx;
         }
         &.type{
            width: 100rpx;
         }
      }
      td{
         text-align: center;
         line-height: 56rpx;
         background: #fdfdfd;
         border-color: #fff;
         &.index{
            //width: 60rpx;
            width: 68rpx;
         }
         &.posNum{
            width: 94rpx;
         }
         &.carNum{
            width: 180rpx;
            //width: 196rpx;
         }
         &.name{
            width: 152rpx;
         }
         &.phone{
            width: 176rpx;
         }
         &.type{
            width: 100rpx;
         }
      }
   table{
      border: 2rpx solid #E9EAEC;
      border-collapse: collapse;
      font-size: 12px;
      margin: 0 auto 10px;
      th{
         background-color: #7fa4f9;
         color: #fff;
         line-height: 70rpx;
         &.index{
            //width: 60rpx;
            width: 68rpx;
         }
         &.posNum{
            width: 94rpx;
         }
         &.carNum{
            width: 180rpx;
            //width: 196rpx;
         }
         &.name{
            width: 152rpx;
         }
         &.phone{
            width: 176rpx;
         }
         &.type{
            width: 100rpx;
         }
      }
      td{
         text-align: center;
         line-height: 56rpx;
         background: #fdfdfd;
         border-color: #fff;
         &.index{
            //width: 60rpx;
            width: 68rpx;
         }
         &.posNum{
            width: 94rpx;
         }
         &.carNum{
            width: 180rpx;
            //width: 196rpx;
         }
         &.name{
            width: 152rpx;
         }
         &.phone{
            width: 176rpx;
         }
         &.type{
            width: 100rpx;
         }
      }
   }
</style>