userInfo.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. (function () {
  2. var page = {
  3. isScroll: true,
  4. init: function ($page) {
  5. // 获取登录者信息
  6. var userinfo = renlian.storage.get('userinfo');
  7. var baseinfo = userinfo.baseinfo;
  8. //$page.find('img').attr('src', config.webapi + 'renlian/adms/user/img?data=' + baseinfo.userId);
  9. if(userinfo.baseinfo.photoUrl){
  10. $page.find('img').attr('src', userinfo.baseinfo.photoUrl);
  11. }
  12. $page.find('.account').text(baseinfo.account);
  13. $page.find('.enCode').text(baseinfo.enCode);
  14. $page.find('.realName').text(baseinfo.realName);
  15. $page.find('.gender').text(baseinfo.gender == 1 ? '男' : '女');
  16. if (baseinfo.companyId) {
  17. renlian.clientdata.get('company', {
  18. key: baseinfo.companyId,
  19. callback: function (data) {
  20. $page.find('.company').text(data.name);
  21. }
  22. });
  23. }
  24. if (baseinfo.departmentId) {
  25. renlian.clientdata.get('department', {
  26. key: baseinfo.departmentId,
  27. callback: function (data) {
  28. $page.find('.department').text(data.name);
  29. }
  30. });
  31. }
  32. var post = [];
  33. var role = [];
  34. $.each(userinfo.post, function (id, item) {
  35. post.push(item.F_Name);
  36. });
  37. $.each(userinfo.role, function (id, item) {
  38. role.push(item.F_FullName);
  39. });
  40. $page.find('.post').text(String(post));
  41. $page.find('.role').text(String(role));
  42. }
  43. };
  44. return page;
  45. })();