zhangjiaqing
8 天以前 1cef3adee31c6934c0da4b4f0b8a6f5ac03b364f
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
(function (vc) {
    vc.extends({
        data: {
            remainingParkingSpaceInfo: {
                total: 0,
                freeCount: 0,
                createTime: vc.dateTimeFormat(new Date().getTime())
            }
        },
        _initMethod: function () {
            //$that._listRemainingParkingSpaceData();
        },
        _initEvent: function () {
        },
        methods: {
            _listRemainingParkingSpaceData: function () {
                let param = {
                    params: {
                        communityId: vc.getCurrentCommunity().communityId,
                        iotApiCode:'getFreeParkingSpaceBmoImpl'
                    }
                }
                //发送get请求
                vc.http.apiGet('/iot.getOpenApi',
                    param,
                    function (json, res) {
                        let _json = JSON.parse(json);
                        if (_json.code == 0) {
                            let _json = JSON.parse(json).data;
                            $that.remainingParkingSpaceInfo.total = _json.total;
                            $that.remainingParkingSpaceInfo.freeCount = _json.freeCount;
                            $that.remainingParkingSpaceInfo.createTime = vc.dateTimeFormat(new Date().getTime());
                            vc.toast("刷新成功");
                        } else {
                            vc.toast(_json.msg);
                        }
                    },
                    function (errInfo, error) {
                        console.log('请求失败处理');
                    }
                );
            },
            _freshRemainingParkingSpace: function () {
                $that._listRemainingParkingSpaceData();
            }
        }
    })
})(window.vc);