personal_information.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. mui.ready(function() {
  2. var showCityPickerButton = dc('showCityPicker3');
  3. $.ajax({
  4. data: {},
  5. dataType: "json",
  6. type: 'post',
  7. url: base_path + '/placeInfo/get_placeInfo_detail',
  8. timeout: 10000,
  9. xhrFields: {
  10. withCredentials: true
  11. },
  12. crossDomain: true,
  13. success: function(data) {
  14. if(data.isRedirect) {
  15. location.href = data.redirectURL;
  16. } else {
  17. console.log(data);
  18. var tips = "";
  19. var roleName = data.returnMsg.placeInfo.roleName;
  20. var placeInfoStus = data.returnMsg.placeInfo.placeInfoStus;
  21. if(placeInfoStus == 1) {
  22. $('#updateBtn').show()
  23. }
  24. if(data.resultCode == "200") {
  25. var btn = dc('btn_submit');
  26. switch(data.returnCode) {
  27. case 2002:
  28. btn.setAttribute('disabled', 'disabled');
  29. break;
  30. default:
  31. btn.removeAttribute('disabled');
  32. btn.className = 'mui-btn mui-btn-block mui-btn-red';
  33. btn.innerText = '马上修改';
  34. break
  35. }
  36. dc('nickname').innerText = decodeURI(data.returnMsg.placeInfo.userNickname);
  37. dc('userhead').src = data.returnMsg.placeInfo.userHead;
  38. dc('userRoleName').innerText = data.returnMsg.placeInfo.roleName;
  39. var tel = data.returnMsg.placeInfo.tel;
  40. tel == null ? '' : dc('ipt-phone').innerText = tel;
  41. var name = data.returnMsg.placeInfo.name;
  42. name == null ? '' : dc('ipt-shop-name').innerText = name;
  43. var areaName = data.returnMsg.placeInfo.areaName;
  44. areaName == null ? '' : dc('city').innerText = areaName;
  45. var detailsAdress = data.returnMsg.placeInfo.addr;
  46. detailsAdress == null ? '' : dc('ipt-address').innerText = detailsAdress;
  47. var username = data.returnMsg.placeInfo.userName;
  48. username == null ? '' : dc('ipt-name').innerText = username;
  49. console.log("页面加载完毕");
  50. document.querySelector('.loading-bg').style.display = 'none'
  51. } else {
  52. mui.alert('获取信息失败,请刷新重试!')
  53. }
  54. }
  55. },
  56. error: function(xhr, type, errorThrown) {
  57. console.log(xhr)
  58. }
  59. })
  60. });
  61. mui('body').on('tap', '#btn_submit', function() {
  62. mui.openWindow({
  63. url: base_path + '/drp/placeInfo_update?dates=' + new Date().getTime()
  64. })
  65. });
  66. function toDrpCenter() {
  67. window.location.href = base_path + "/drp/indexPage?dates=" + new Date().getTime()
  68. };