绑定手机
$we.biz.use("bind_mobile",{ // safety_verify: 0, // 是否绑定安全卡 // phone: "" }, function() {alert($we.process.getData("is_new_phone"));});
/** * 声明processes * @type {Array} * 每个item包含 * @param {string} name 流程名称 * @param {string} widget widget名称 * @param {object} params widget需要的参数 */ var processes = [{ name: "填写手机", widget: "bind_mobile" },{ 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") && $we.process.getData("need_pwd"); } },{ name: '绑定成功', widget: "bind_mobile.end" }]; /** * 业务流组件的配置 * @type {Object} */ var pConfig = { flow: "bindMobile", 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", { mobile: "136*****93", v_date: "2012年11月10日23时45分13秒" }); } }, }); $we.process.setData("need_pwd", true); var pro; require(["component/process_ui"], function(f) { pro = f([{ name: "开始", widget: "AA" }, { name: "结束", widget: "bind_mobile.end", params: { success: function() {} } }], { title:"手机绑定", prev:false }); pro.start(); });