更换手机
$we.biz.use("change_account_phone",{ //phone:"13764330752", //check_change_mobile: {errno:0, msg:"", data:''}, //alias:'PT-111' });
$we.biz.use("change_group_phone",{ //phone:"13764330752", //group_check_change_mobile: {errno:0, msg:"", data:''}, //alias:'PT-111' });
/** * 声明processes * @type {Array} * 每个item包含 * @param {string} name 流程名称 * @param {string} widget widget名称 * @param {object} params widget需要的参数 */ var processes = [{ name:'原手机验证', widget:'phone_change_welcome', beforeAction:function(){ var data = $we.process.getData("group_check_change_mobile"); if (data && data.errno) { $we.comp.alert(data.msg); this.notify("abort"); return false; } else { return true; } } },{ widget: "bind_mobile" },{ name:'新手机验证', widget: "bind_mobile", params:{ verifyName: 'new_phone', saveVerifyName: 'phone' } },{ widget: "set_login_name_confirm", beforeAction:function(){ var phone = $we.process.getData('phone'); var alias = $we.process.getData('alias'); var tips = ""; if(alias){ tips= "
"+phone + "
已经是手机帐号,更换后不能用手机号码
"+phone+ "
直接登陆,只能用"+alias+"登陆"; }else{ tips= "
"+phone + "
已经是手机帐号,需要设置新的登录名作为帐号名登陆"; } this.params.tips=tips; return $we.process.getData('is_mobile_acc'); } },{ widget: "set_login_name", beforeAction:function(){ var phone = $we.process.getData('phone'); var tips= "
"+phone + "
已经是手机帐号,需要设置新的登陆名作为帐号名登陆"; this.params.tips=tips; return $we.process.getData('need_alias'); } },{ name: '更换成功', widget: "phone_change_success" }]; /** * 业务流组件的配置 * @type {Object} */ var pConfig = { independent:true, title: "更换手机", // 业务流title prev: false, // 上一步按钮的文案 next: "下一步", // 下一步按钮的文案 end: "完成" // 结束按钮的文案 }; var pro = $we.widget.add("process.ui", processes, pConfig); $we.process.setData('phone','13764330752'); //$we.process.setData("group_check_change_mobile", //{errno:1, msg:"13764330752不是新版手机", data:''}); //$we.process.setData("group_check_change_mobile", //{errno:2, msg:"这个手机已经绑定了超过20个账号啦,不能再绑了!", data:''}); $we.process.setData('is_mobile_acc',true); $we.process.setData('need_alias',true); /** * 业务流组件的start接口 */ pro.start();
/** * 声明processes * @type {Array} * 每个item包含 * @param {string} name 流程名称 * @param {string} widget widget名称 * @param {object} params widget需要的参数 */ var processes = [{ name:'设置别名确认', widget: "set_login_name_confirm", beforeAction:function(){ var phone = $we.process.getData('phone'); var alias = $we.process.getData('alias'); var tips = ""; if(alias){ tips= "
"+phone + "
已经是手机帐号,更换后不能用手机号码
"+phone+ "
直接登陆,只能用"+alias+"登陆"; }else{ tips= "
"+phone + "
已经是手机帐号,需要设置新的登录名作为帐号名登陆"; } this.params.tips=tips; return $we.process.getData('is_mobile_acc'); } },{ name: '设置别名', widget: "set_login_name", beforeAction:function(){ var phone = $we.process.getData('phone'); var tips= "
"+phone + "
已经是手机帐号,需要设置新的登陆名作为帐号名登陆"; this.params.tips=tips; return $we.process.getData('need_alias'); } },{ name: '更换成功', widget: "phone_change_success" }]; /** * 业务流组件的配置 * @type {Object} */ var pConfig = { title: "更换手机", // 业务流title prev: false, // 上一步按钮的文案 next: "下一步", // 下一步按钮的文案 end: "完成" // 结束按钮的文案 }; var pro = $we.widget.add("process.ui", processes, pConfig); $we.process.setData('phone','13764330752'); $we.process.setData('new_phone','13818323123'); $we.process.setData('is_mobile_acc',true); $we.process.setData('need_alias',true); $we.process.setData('alias','PT-111'); /** * 业务流组件的start接口 */ pro.start();