userInfo.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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('.my-plate').text(baseinfo.plate);
  14. $page.find('.my-gpsNumber').text(baseinfo.gpsNumber);
  15. $page.find('.enCode').text(baseinfo.enCode);
  16. $page.find('.realName').text(baseinfo.realName);
  17. $page.find('.gender').text(baseinfo.gender == 1 ? '男' : '女');
  18. if (baseinfo.companyId) {
  19. renlian.clientdata.get('company', {
  20. key: baseinfo.companyId,
  21. callback: function (data) {
  22. $page.find('.company').text(data.name);
  23. }
  24. });
  25. }
  26. if (baseinfo.departmentId) {
  27. renlian.clientdata.get('department', {
  28. key: baseinfo.departmentId,
  29. callback: function (data) {
  30. $page.find('.department').text(data.name);
  31. }
  32. });
  33. }
  34. var post = [];
  35. var role = [];
  36. $.each(userinfo.post, function (id, item) {
  37. post.push(item.F_Name);
  38. });
  39. $.each(userinfo.role, function (id, item) {
  40. role.push(item.F_FullName);
  41. });
  42. $page.find('.post').text(String(post));
  43. $page.find('.role').text(String(role));
  44. }
  45. };
  46. return page;
  47. })();