(function () { var userinfo = null; var page = { isScroll: true, init: function ($page) { // 获取登录者信息 userinfo = renlian.storage.get('userinfo'); $page.find('.name').text(userinfo.baseinfo.realName); $page.find('img').attr('src', config.webapi + 'renlian/adms/user/img?data=' + userinfo.baseinfo.userId); // 人员列表数据初始化 renlian.clientdata.get('department', { key: userinfo.baseinfo.departmentId, callback: function (data) { $page.find('.subname').text(data.name || '总集团公司'); } }); $page.find('#outloginbtn').on('tap', function () { renlian.layer.confirm('确定要退出账号?', function (_index) { if (_index === '1') { renlian.isOutLogin = true; renlian.storage.set('logininfo', null); renlian.nav.go({ path: 'login', isBack: false, isHead: false }); window.reload() } }, '', ['取消', '退出']); }); $page.find('.lr-list-item-icon').on('tap', function () { var path ='my/' + $(this).attr('data-value'); var title = $(this).text(); renlian.nav.go({ path: path, title: title, type: 'right' }); }); $page.find('.userinfo').on('tap', function () { renlian.nav.go({ path: 'my/userInfo', title: '个人信息', type: 'right' }); }); }, reload: function ($page, pageinfo) { // 获取登录者信息 var newUserinfo = renlian.storage.get('userinfo'); if (userinfo.baseinfo.userId != newUserinfo.baseinfo.userId) { userinfo = newUserinfo; $page.find('.name').text(userinfo.baseinfo.realName); $page.find('img').attr('src', config.webapi + 'renlian/adms/user/img?data=' + userinfo.baseinfo.userId); // 人员列表数据初始化 renlian.clientdata.get('department', { key: userinfo.baseinfo.departmentId, callback: function (data) { $page.find('.subname').text(data.name || '总集团公司'); } }); } } }; return page; })();