wuxw
2020-02-18 1c9c4d0b6cd221e685a30b1c8aef53349d45cde0
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
(function(vc){
    var DEFAULT_PAGE = 1;
    var DEFAULT_ROWS = 10;
    vc.extends({
        data:{
            storesCommunityInfo:{
                communityInfo:[],
                errorInfo:'',
                searchCommunityName:'',
                storeId:''
            }
        },
         _initMethod:function(){
 
         },
         _initEvent:function(){
            vc.on('storesCommunity','openStoresCommunity',function(_params){
                $('#storesCommunityModel').modal('show');
                vc.component.storesCommunityInfo.searchCommunityName = '';
                vc.component.storesCommunityInfo.storeId = _params.storeId;
                vc.component.listMyCommunity(DEFAULT_PAGE,DEFAULT_ROWS);
            });
             vc.on('storesCommunity','paginationPlus', 'page_event', function (_currentPage) {
                vc.component.listMyCommunity(_currentPage, DEFAULT_ROWS);
            });
        },
        methods:{
            listMyCommunity:function(_page,_row){
                    var param = {
                        params:{
                            communityName:vc.component.storesCommunityInfo.searchCommunityName,
                            storeId:vc.component.storesCommunityInfo.storeId,
                            page:_page,
                            row:_row
                        }
 
                   }
                   //发送get请求
                   vc.http.get('storesCommunity',
                                'listMyCommunity',
                                 param,
                                 function(json,res){
                                    var _communityInfo =JSON.parse(json);
                                    vc.component.storesCommunityInfo.communityInfo = _communityInfo.communitys
                                    vc.emit('storesCommunity','paginationPlus', 'init', {
                                        total: _communityInfo.records,
                                        currentPage: _page
                                    });
                                 },function(errInfo,error){
                                    console.log('请求失败处理');
                                 }
                   );
             }
        }
    });
 
})(window.vc);