1 /**
  2  * 绑定手机
  3  * @type {Object}
  4  */
  5 define(
  6 	"bind_mobile", 
  7 	[
  8 		"component/process_ui",
  9 		"business/bind_mobile",
 10 		"business/safety_verification",
 11 		"business/modify_password"
 12 	], 
 13 	function() {
 14 		$we.process.config.bind_mobile = {
 15 			processes: [{
 16 				name: "填写手机",
 17 				widget: "bind_mobile",
 18 				beforeAction: function() {
 19 					if ($we.process.getData("phone")) {
 20 						$we.comp.alert("您的账号已经绑定了手机"+$we.process.getData("phone")+",<br />不能重复操作!");
 21 						this.notify("abort");
 22 						return false;
 23 					}
 24 					return true;
 25 				}
 26 			}, {
 27 				name: "安全验证",
 28 				widget: "safety_verification",
 29 				beforeAction: function() {
 30 					return $we.process.getData("safety_verify");
 31 				}
 32 			}, {
 33 				name: '绑定成功',
 34 				widget: "modify_password",
 35 				beforeAction: function() {
 36 					return !$we.process.getData("safety_verify") && $we.process.getData("need_pwd");
 37 				}
 38 			}, {
 39 				widget: "bind_mobile.end"
 40 			}],
 41 			config: {
 42 				flow: "bindMobile",
 43 				title: "绑定手机",
 44 				prev: false
 45 			},
 46 			data: ["safety_verify", "phone"],
 47 			init: function(conf) {
 48 				if ($we.process.getData("safety_verify")) {
 49 					conf.processes[1].hidden = false;
 50 				} else {
 51 					conf.processes[1].hidden = true;
 52 				}
 53 				$we.process.setData("need_pwd", true);
 54 			}
 55 		};
 56 
 57 		return $we.process.use;
 58 	}
 59 );