zhangzengfei
2022-09-05 fa6247894dd69aa63daa26f12b1a6f99cacbdabb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<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>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                tableList: [],
            }
        },
        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();
            }
        }
    }
</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;
            }
        }
    }
</style>