12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- (function () {
- var userinfo = null;
- var page = {
- isScroll: true,
- init: function ($page) {
- // 获取登录者信息
- userinfo = renlian.storage.get('userinfo');
- $page.find('.name').text(userinfo.baseinfo.realName);
- if(userinfo.baseinfo.photoUrl){
- $page.find('img').attr('src', userinfo.baseinfo.photoUrl);
- }
- /*
- // 人员列表数据初始化
- 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.location.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');
- console.log('*******reload**********');
- 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);
- }
- /*
- // 人员列表数据初始化
- renlian.clientdata.get('department', {
- key: userinfo.baseinfo.departmentId,
- callback: function (data) {
- $page.find('.subname').text(data.name || '总集团公司');
- }
- });
- */
- }
- }
- };
- return page;
- })();
|