Nenhuma Descrição

updateinfo-res04.js 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. mui.ready(function() {
  2. mui.plusReady(function() {
  3. var userid = plus.storage.getItem('userid');
  4. var ws = plus.webview.currentWebview();
  5. function personalMessage() {
  6. mui.ajax(baseUrl + "/ajax/resource/" + ws.rsId, {
  7. dataType: 'json', //数据格式类型
  8. type: 'GET', //http请求类型
  9. timeout: 10000, //超时设置
  10. success: function(data) {
  11. plus.nativeUI.closeWaiting();
  12. ws.show("slide-in-right", 150);
  13. var $data = data.data;
  14. //详细介绍
  15. if($data.descp)
  16. document.getElementsByClassName("textareabox ")[0].innerText = $data.descp;
  17. },
  18. error: function() {
  19. plus.nativeUI.toast("服务器链接超时", toastStyle);
  20. return;
  21. }
  22. });
  23. }
  24. document.getElementsByClassName("topsave")[0].addEventListener("tap", function() {
  25. mui.ajax(baseUrl + '/ajax/resource/descp', {
  26. data: {
  27. "resourceId": ws.rsId,
  28. "descp": document.getElementsByClassName("textareabox ")[0].value
  29. },
  30. dataType: 'json', //数据格式类型
  31. async: true,
  32. type: 'POST', //http请求类型
  33. timeout: 10000, //超时设置
  34. success: function(data) {
  35. console.log(data.success);
  36. if(data.success) {
  37. plus.nativeUI.showWaiting();
  38. var web = plus.webview.getWebviewById("resinforupdate.html");
  39. mui.fire(web, "resourceMess");
  40. mui.back();
  41. if(ws.reFlag==0) {
  42. var web1 = plus.webview.getWebviewById("html/proinforupdate.html");
  43. mui.fire(web1,"newId",{rd:1});
  44. }else if(ws.reFlag==1){
  45. var web2 = plus.webview.getWebviewById("html/companyUpdata.html");
  46. mui.fire(web2,"newId",{rd:1});
  47. }else if(ws.reFlag==2){
  48. var web2 = plus.webview.getWebviewById("html/studentUpdata.html");
  49. mui.fire(web2,"newId",{rd:1});
  50. }
  51. }
  52. },
  53. error: function() {
  54. plus.nativeUI.toast("服务器链接超时", toastStyle);
  55. return;
  56. }
  57. });
  58. });
  59. personalMessage();
  60. });
  61. })