Index.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * 描 述:个人中心
  3. */
  4. var baseinfo;
  5. var bootstrap = function ($, learun) {
  6. "use strict";
  7. var page = {
  8. init: function () {
  9. page.initleft();
  10. page.bind();
  11. page.initData();
  12. },
  13. bind: function () {
  14. },
  15. initleft: function () {
  16. $('#lr_left_list li').on('click', function () {
  17. var $this = $(this);
  18. if (!$this.hasClass('active')) {
  19. var $parent = $this.parent();
  20. $parent.find('.active').removeClass('active');
  21. $this.addClass('active');
  22. var _type = $this.attr('data-value');
  23. $('.lr-layout-wrap-item').removeClass('active');
  24. $('#lr_layout_item' + _type).addClass('active');
  25. }
  26. });
  27. },
  28. initData: function () {
  29. learun.httpAsyncGet(top.$.rootUrl + '/UserCenter/GetUserInfo', function (res) {
  30. if (res.code>0) {
  31. baseinfo = res.data;
  32. /*基础信息*/
  33. $('#F_Account').val(baseinfo.USERITEM.Code);
  34. $('#F_RealName').val(baseinfo.USERITEM.Name);
  35. $('#F_Gender').val(baseinfo.USERITEM.SexNum == 0 ? '女' : '男');
  36. //learun.clientdata.getAsync('department', {
  37. // key: baseinfo.departmentId,
  38. // callback: function (_data) {
  39. // $('#F_Department').val(_data.name);
  40. // }
  41. //});
  42. //var post = [], role = [];
  43. //$.each(res.data.post, function (id, item) {
  44. // post.push(item.F_Name);
  45. //});
  46. //$.each(res.data.role, function (id, item) {
  47. // role.push(item.F_FullName);
  48. //});
  49. //$('#Post').val(String(post));
  50. //$('#Role').val(String(role));
  51. $('#F_Description').val(baseinfo.USERITEM.Memo);
  52. }
  53. else {
  54. learun.alert.error('数据加载失败');
  55. }
  56. });
  57. }
  58. };
  59. page.init();
  60. }