wuxw
2019-07-20 39ceed7f60905297629a45978cc29b6fe8bd05d8
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
(function(vc){
 
    vc.extends({
        data:{
            indexContextInfo:{
                ownerCount:'0',
                noEnterRoomCount:'0',
                roomCount:'0',
                freeRoomCount:'0',
                parkingSpaceCount:'0',
                freeParkingSpaceCount:'0',
                shopCount:'0',
                freeShopCount:'0'
            }
        },
        _initMethod:function(){
            vc.component._queryIndexContextData();
        },
        _initEvent:function(){
            vc.on("indexContext","_queryIndexContextData",function(){
                vc.component._queryIndexContextData();
            });
        },
        methods:{
            _queryIndexContextData:function(){
 
                if(vc.getCurrentCommunity() == null || vc.getCurrentCommunity() == undefined){
                    return ;
                }
 
                var param = {
                    params:{
                        communityId:vc.getCurrentCommunity().communityId
                    }
                }
 
               //发送get请求
               vc.http.get('indexContext',
                            'getData',
                             param,
                             function(json,res){
                                var indexData =JSON.parse(json);
 
                                vc.copyObject(indexData, vc.component.indexContextInfo);
 
                             },function(errInfo,error){
                                console.log('请求失败处理');
                             }
                           );
 
            }
        }
    })
})(window.vc);