config.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. //服务端配置
  2. var API = {
  3. // API_ROOT : "http://112.111.142.223:8180/zpdj/",/**/
  4. UNIT_ID: 347517153919893,
  5. // UNIT_ID : 199953234474091,
  6. // API_IP_PORT : "http://localhost:8082",
  7. // API_ROOT : "http://localhost:8082/ynet/",
  8. API_IP_PORT: "http://118.195.146.34:20076",
  9. API_ROOT: "http://118.195.146.34:20076/ynet/",
  10. // API_IP_PORT : "http://114.115.251.11:8088",
  11. // API_ROOT : "http://114.115.251.11:8088/ynet/",
  12. // API_IP_PORT : "http://202.101.109.133:8081",
  13. // API_ROOT : "http://202.101.109.133:8081/ynet/",
  14. API_VERSION: '1',
  15. API_URL: function() {
  16. // return this.API_ROOT + 'clientServices.do?iscrypt=1&date='+new Date();
  17. return this.API_ROOT + 'clientServices.do?iscrypt=1';
  18. }
  19. }
  20. //客户端配置
  21. var APP = {
  22. //列表页数
  23. PageSize: 10
  24. }
  25. function exitApp() {
  26. var wobj = plus.webview.getWebviewById("xboa");
  27. if (!wobj) {
  28. wobj = plus.webview.getWebviewById("HBuilder");
  29. }
  30. mui.fire(wobj, 'loginEvent');
  31. app.setState({});
  32. localStorage.clear();
  33. wobj.show();
  34. }
  35. function endPull(totalPage, pageNo) {
  36. if (totalPage == 0 || totalPage == 1) {
  37. mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
  38. } else {
  39. mui('#pullrefresh').pullRefresh().endPullupToRefresh(totalPage == pageNo); //参数为true代表没有更多数据了。
  40. }
  41. if (pageNo == 1) {
  42. mui('#pullrefresh').pullRefresh().endPulldownToRefresh();
  43. }
  44. pageNo = pageNo + 1;
  45. return pageNo;
  46. }
  47. //文件下载的任务
  48. function openFile222(path) {
  49. if (path.indexOf("http") == -1) {
  50. path = API.API_ROOT + "" + path;
  51. }
  52. //var url = API.API_ROOT + "" + path;//下载文件的方法,按照各自方法自行变动
  53. var dtask = plus.downloader.createDownload(path, {}, function(d, status) { //创建一个下载任务,可以在网上搜索这个方法了解
  54. if (status == 200) {
  55. plus.runtime.openFile(d.filename, {}, function(e) { //调用第三方应用打开文件
  56. alert('打开失败');
  57. });
  58. } else {
  59. alert("Download failed: " + status);
  60. }
  61. });
  62. dtask.start();
  63. }