绑定邮箱
$we.biz.use("bind_email",{ // safety_verify: 0 // 是否绑定安全卡 });
/** * 声明processes * @type {Array} * 每个item包含 * @param {string} name 流程名称 * @param {string} widget widget名称 * @param {object} params widget需要的参数 */ var processes = [{ name: "输入邮箱", widget: "bind_email.start" },{ name: "安全验证", widget: "safety_verification", beforeAction: function() { return $we.process.getData("safety_verify"); } },{ widget: "modify_password", hidden: true, beforeAction: function() { return !$we.process.getData("safety_verify"); } },{ name: '绑定邮箱', widget: "verify_email", params: { verifyName: "bind_email", saveVerifyName: "email" } },{ widget: "bind_email.end", params: { success: function() {} } }]; /** * 业务流组件的配置 * @type {Object} */ var pConfig = { flow: "bindEmail", title: "邮箱绑定", // 业务流title prev: false, // 上一步按钮的文案 next: "下一步", // 下一步按钮的文案 end: "完成" // 结束按钮的文案 }; $we.process.setData("safety_verify", 0) var pro = $we.widget.add("process.ui", processes, pConfig); /** * 业务流组件的start接口 */ pro.start();
var _html = [ '
', '
$name$
', '
'].join(""); $we.widget.reg("AA", { interfaces: { render: function() { this.append(this.el, _html, { name: "AA", }); }, }, init: function(el) { this.el = el; }, process: { start: function() { this.render(); }, end: function() { $(this.node.root).remove(); }, checkSucc: function() { this.notify("goNext", { email: "zh**@foxmail.com", v_date: "2012年11月10日23时45分13秒" }); } }, }); var abc = $we.widget.add("process.ui", [{ name: "开始", widget: "AA" }, { widget: "bind_email.end", }], { title:"邮箱验证", prev:false }); $we.process.setData("email", "zhang.gd@foxmail.com"); /** * 业务流组件的start接口 */ abc.start();