1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- (function () {
- var userinfo = null;
- var page = {
- isScroll: true,
- init: function ($page) {
- // 获取登录者信息
- userinfo = learun.storage.get('userinfo');
- //console.log(userinfo);
- $page.find('.name').text(userinfo.baseinfo.realName);
- //$page.find('img').attr('src', config.webapi + 'learun/adms/user/img?data=' + userinfo.baseinfo.userId);
- //user_info = '{"baseinfo":{"photoUrl":"http://rltest.oss-cn-hangzhou.aliyuncs.com/fd-images/20190109/5c35c13da4e734.14062420.png","userId":"System","enCode":"System","account":"System","password":null,"secretkey":null,"realName":"测试","nickName":null,"headIcon":".jpg","gender":1,"mobile":null,"telephone":null,"email":null,"oICQ":null,"weChat":null,"companyId":"","companyIds":[],"departmentId":"sys","departmentIds":[],"openId":null,"roleIds":"","postIds":"","isSystem":true,"appId":"Learun_ADMS_6.1_App","logTime":"2019-02-22 09:58:50","iPAddress":"115.194.188.126","browser":"Safari 11.0","loginMark":"594b7a78_2302_4b3d_1168_84f3dc63a476","token":"86d56cce-3662-4de3-a335-196f6e7b30cf","imUrl":null,"imOpen":null,"wfProcessId":null},"post":[],"role":[]}';
- //userinfo = JSON.parse(user_info);
- //console.log(userinfo);
- //$page.find('.name').text(userinfo.baseinfo.realName);
- if(userinfo.baseinfo.photoUrl){
- $page.find('img').attr('src', userinfo.baseinfo.photoUrl);
- }
-
- // 人员列表数据初始化
- learun.clientdata.get('department', {
- key: userinfo.baseinfo.departmentId,
- callback: function (data) {
- $page.find('.subname').text(data.name || '总集团公司');
- }
- });
- $page.find('#outloginbtn').on('tap', function () {
- learun.layer.confirm('确定要退出账号?', function (_index) {
- if (_index === '1') {
- learun.isOutLogin = true;
- learun.storage.set('logininfo', null);
- learun.nav.go({ path: 'login', isBack: false, isHead: false });
- learun.nav.getpage('amap').destroy()
- }
- }, '', ['取消', '退出']);
- });
- $page.find('.lr-list-item-icon').on('tap', function () {
- var path ='my/' + $(this).attr('data-value');
- var title = $(this).text();
- learun.nav.go({ path: path, title: title, type: 'right' });
- });
- $page.find('.userinfo').on('tap', function () {
- learun.nav.go({ path: 'my/userInfo', title: '个人信息', type: 'right' });
- });
- },
- reload: function ($page, pageinfo) {
- // 获取登录者信息
- var newUserinfo = learun.storage.get('userinfo');
- if (userinfo.baseinfo.userId != newUserinfo.baseinfo.userId) {
- userinfo = newUserinfo;
- $page.find('.name').text(userinfo.baseinfo.realName);
- if(userinfo.baseinfo.photoUrl){
- $page.find('img').attr('src', userinfo.baseinfo.photoUrl);
- }
- // 人员列表数据初始化
- learun.clientdata.get('department', {
- key: userinfo.baseinfo.departmentId,
- callback: function (data) {
- $page.find('.subname').text(data.name || '总集团公司');
- }
- });
- }
- }
- };
- return page;
- })();
|