wuxw
2019-08-01 2f73a671db8bf132baaba12a5c2a9c3b611589e9
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
/**
    入驻小区
**/
(function(vc){
    var DEFAULT_PAGE = 1;
    var DEFAULT_ROWS = 10;
    vc.extends({
        data:{
            serviceBindingInfo:{
                $step:{},
                index:0,
                infos:[]
            }
        },
        _initMethod:function(){
            vc.component._initStep();
        },
        _initEvent:function(){
            vc.on("serviceBinding", "notify", function(_info){
                vc.component.serviceBindingInfo.infos[vc.component.serviceBindingInfo.index] = _info;
            });
 
        },
        methods:{
            _initStep:function(){
                vc.component.serviceBindingInfo.$step = $("#step");
                vc.component.serviceBindingInfo.$step.step({
                    index: 0,
                    time: 500,
                    title: ["选择应用", "选择服务", "确认绑定"]
                });
                vc.component.serviceBindingInfo.index = vc.component.serviceBindingInfo.$step.getIndex();
            },
            _prevStep:function(){
                vc.component.serviceBindingInfo.$step.prevStep();
                vc.component.serviceBindingInfo.index = vc.component.serviceBindingInfo.$step.getIndex();
 
                 vc.emit('viewAppInfo', 'onIndex', vc.component.serviceBindingInfo.index);
                 vc.emit('viewServiceInfo', 'onIndex', vc.component.serviceBindingInfo.index);
            },
            _nextStep:function(){
                var _currentData = vc.component.serviceBindingInfo.infos[vc.component.serviceBindingInfo.index];
                if( _currentData == null || _currentData == undefined){
                    vc.message("请选择相关信息");
                    return ;
                }
                vc.component.serviceBindingInfo.$step.nextStep();
                vc.component.serviceBindingInfo.index = vc.component.serviceBindingInfo.$step.getIndex();
 
                vc.emit('viewAppInfo', 'onIndex', vc.component.serviceBindingInfo.index);
                vc.emit('viewServiceInfo', 'onIndex', vc.component.serviceBindingInfo.index);
            },
            _finishStep:function(){
 
 
 
                var param = {
                    data:vc.component.serviceBindingInfo.infos
                }
 
               vc.http.post(
                   'serviceBinding',
                   'binding',
                   JSON.stringify(param),
                   {
                       emulateJSON:true
                    },
                    function(json,res){
                       if(res.status == 200){
                           vc.message('处理成功',true);
                           //关闭model
                           //vc.jumpToPage("/flow/ownerRoomFlow?" + vc.objToGetParam(vc.component.sellRoomInfo.ownerInfo));
                           return ;
                       }
                       vc.message(json);
                    },
                    function(errInfo,error){
                       console.log('请求失败处理');
 
                       vc.message(errInfo);
                    });
            }
        }
    });
})(window.vc);