1 /**
  2  * 单账号解绑手机
  3  * 
  4  * @fileOverView 单账号解绑手机
  5  * @author  <a href="mailto:zhang.gd@foxmail.com">Zhang Guangda</a>
  6  * @date    2012-12-20
  7  */
  8 define(
  9 	"unbind_mobile",
 10 	[
 11 		"component/process_ui",
 12 		"business/unbind_mobile",
 13 		"business/bind_mobile",
 14 		"business/set_login_name"
 15 	], 
 16 	function() {
 17 		
 18 		$we.process.config.unbind_mobile = {
 19 			processes: [{
 20 				name: "确认解绑",
 21 				widget: "unbind_mobile.start",
 22 				beforeAction: function() {
 23 					if (!$we.process.getData("phone")) {
 24 						$we.comp.alert("您未绑定手机或者您绑定的手机未通过验证期,不能解绑!");
 25 						this.notify("abort");
 26 						return false;
 27 					}
 28 					if ($we.process.getData("is_mobile_acc")) {
 29 						this.params.tips = "解绑手机后,该账号将不能使用手机号码"+$we.process.getData("phone")+"作为账号名登录,同时失去G家提供的安全服务,请谨慎操作";
 30 					}
 31 					return true;
 32 				}
 33 			}, {
 34 				name: "当前手机验证",
 35 				widget: "bind_mobile",
 36 				params: {
 37 					tips: "",
 38 					label1: "当前绑定的手机"
 39 				}
 40 			}, {
 41 				widget: "set_login_name",
 42 				params: {
 43 					title: "",
 44 					btmTips: ""
 45 				},
 46 				beforeAction: function() {
 47 					if (!$we.process.getData("need_alias")) {
 48 						return false;
 49 					} else {
 50 						this.params.tips = "解绑手机后,将不能再使用手机号码"+$we.process.getData("phone")+"作为账号名登录,请设置新的登录名";
 51 						return true;
 52 					}
 53 				}
 54 			}, {
 55 				name: "解绑成功",
 56 				widget: "process.end",
 57 				params: {
 58 					title: "解绑手机成功!",
 59 					content: function() {
 60 						if ($we.process.getData("is_mobile_acc"))
 61 							return "现在您可以用账号名 "+$we.process.getData("alias")+" 登录了";
 62 						else
 63 							return "";
 64 					}
 65 				}
 66 			}],
 67 			config: {
 68 				flow: "unbindMobile",
 69 				title: "解绑手机"
 70 			},
 71 			data: ["phone", "is_mobile_acc"]
 72 		};
 73 		
 74 		return $we.process.use;
 75 	}
 76 );