1 /**
  2  * 多账号-更换手机
  3  * @type {Object}
  4  */
  5 define("change_group_phone", [
  6 	"component/process_ui", 
  7 	"business/phone_change_welcome", 
  8 	"business/bind_mobile", 
  9 	"business/set_login_name_confirm",
 10 	"business/set_login_name",
 11 	"business/phone_change_success"
 12 	], function() {
 13 	$we.process.config.change_group_phone = {
 14 		processes: [{
 15 			name: '原手机验证',
 16 			widget: 'phone_change_welcome',
 17 			beforeAction: function() {
 18 				var group = $we.process.getData("group");
 19 				if(group && group.length > 0) {
 20 					$we.process.setData("phone", group);
 21 					var data = $we.process.getData("group_check_change_mobile");
 22 					if(data && data.errno) {
 23 						$we.comp.alert(data.msg);
 24 						this.notify("abort");
 25 						return false;
 26 					} else {
 27 						// $we.process.setData('old_is_mobile_acc',data['old_is_mobile_acc']);
 28 						return true;
 29 					}
 30 				} else {
 31 					$we.comp.alert('参数不全!');
 32 					this.notify("abort");
 33 					return false;
 34 				}
 35 			}
 36 		}, {
 37 			widget: "bind_mobile",
 38 			params: {
 39 				tips: ""
 40 			}
 41 		}, {
 42 			name: '新手机验证',
 43 			widget: "bind_mobile",
 44 			params: {
 45 				verifyName: 'new_phone',
 46 				// saveVerifyName: 'phone',
 47 				cookieName: '_we_comp_vm_n'
 48 			}
 49 		}, {
 50 			widget: "set_login_name_confirm",
 51 			params: {
 52 				group: true
 53 			},
 54 			beforeAction: function() {
 55 				var phone = $we.process.getData('phone');
 56 				var newPhone = $we.process.getData('new_phone');
 57 				var alias = $we.process.getData('alias');
 58 				var tips = "";
 59 				if(alias) {
 60 					tips = "<span class='we_yellow'>" + newPhone + "</span>已经是手机账号,更换后不能用手机号码<span class='we_yellow'>" + newPhone + "</span>直接登录,只能用" + alias + "登录";
 61 				} else {
 62 					tips = "<span class='we_yellow'>" + newPhone + "</span>已经是手机账号,需要设置新的登录名作为账号名登录";
 63 				}
 64 				this.params.tips = tips;
 65 				return $we.process.getData('need_demote');
 66 			}
 67 		}, {
 68 			widget: "set_login_name",
 69 			beforeAction: function() {
 70 				var phone = $we.process.getData('phone');
 71 				var newPhone = $we.process.getData('new_phone');
 72 				var tips = "<span class='we_yellow'>" + newPhone + "</span>已经是手机账号,需要设置新的登录名作为账号名登录";
 73 				this.params.tips = tips;
 74 				var alias = $we.process.getData('alias');
 75 				var needDemote = $we.process.getData('need_demote');
 76 				return needDemote && !(alias && alias.length > 0);
 77 			}
 78 		}, {
 79 			name: '更换成功',
 80 			widget: "phone_change_success"
 81 		}],
 82 		config: {
 83 			independent: true,
 84 			flow: "changeGroupMobile",
 85 			title: "更换手机",
 86 			prev: false
 87 		},
 88 		data: ["group", "group_check_change_mobile"]
 89 	};
 90 
 91 	return $we.process.use;
 92 });