shiyj
2019-09-02 b784175e978b0fcfca8ca8bed7953ae4eacf49e8
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
/**
    入驻小区
**/
(function(vc){
    vc.extends({
        data:{
            @@templateCode@@Info:{
                $step:{},
                index:0,
                infos:[]
            }
        },
        _initMethod:function(){
            vc.component._initStep();
        },
        _initEvent:function(){
            vc.on("@@templateCode@@", "notify", function(_info){
                vc.component.@@templateCode@@Info.infos[vc.component.@@templateCode@@Info.index] = _info;
            });
 
        },
        methods:{
            _initStep:function(){
                vc.component.@@templateCode@@Info.$step = $("#step");
                vc.component.@@templateCode@@Info.$step.step({
                    index: 0,
                    time: 500,
                    title: @@stepTitle@@
                });
                vc.component.@@templateCode@@Info.index = vc.component.@@templateCode@@Info.$step.getIndex();
            },
            _prevStep:function(){
                vc.component.@@templateCode@@Info.$step.prevStep();
                vc.component.@@templateCode@@Info.index = vc.component.@@templateCode@@Info.$step.getIndex();
 
                @@notifyOnIndex@@
            },
            _nextStep:function(){
                var _currentData = vc.component.@@templateCode@@Info.infos[vc.component.@@templateCode@@Info.index];
                if( _currentData == null || _currentData == undefined){
                    vc.message("请选择或填写必选信息");
                    return ;
                }
                vc.component.@@templateCode@@Info.$step.nextStep();
                vc.component.@@templateCode@@Info.index = vc.component.@@templateCode@@Info.$step.getIndex();
 
                 @@notifyOnIndex@@
            },
            _finishStep:function(){
 
 
                @@needCheckCurrentData@@
 
                var param = {
                    data:vc.component.@@templateCode@@Info.infos
                }
 
               vc.http.post(
                   '@@templateCode@@Binding',
                   'binding',
                   JSON.stringify(param),
                   {
                       emulateJSON:true
                    },
                    function(json,res){
                       if(res.status == 200){
 
                           vc.message('处理成功',true);
                           //关闭model
                           vc.jumpToPage("@@jumpUrl@@?" + vc.objToGetParam(JSON.parse(json)));
                           return ;
                       }
                       vc.message(json);
                    },
                    function(errInfo,error){
                       console.log('请求失败处理');
 
                       vc.message(errInfo);
                    });
            }
        }
    });
})(window.vc);