| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- //服务端配置
- var API = {
- // API_ROOT : "http://112.111.142.223:8180/zpdj/",/**/
- UNIT_ID: 347517153919893,
- // UNIT_ID : 199953234474091,
- // API_IP_PORT : "http://localhost:8082",
- // API_ROOT : "http://localhost:8082/ynet/",
- API_IP_PORT: "http://118.195.146.34:20076",
- API_ROOT: "http://118.195.146.34:20076/ynet/",
- // API_IP_PORT : "http://114.115.251.11:8088",
- // API_ROOT : "http://114.115.251.11:8088/ynet/",
- // API_IP_PORT : "http://202.101.109.133:8081",
- // API_ROOT : "http://202.101.109.133:8081/ynet/",
- API_VERSION: '1',
- API_URL: function() {
- // return this.API_ROOT + 'clientServices.do?iscrypt=1&date='+new Date();
- return this.API_ROOT + 'clientServices.do?iscrypt=1';
- }
- }
- //客户端配置
- var APP = {
- //列表页数
- PageSize: 10
- }
- function exitApp() {
- var wobj = plus.webview.getWebviewById("xboa");
- if (!wobj) {
- wobj = plus.webview.getWebviewById("HBuilder");
- }
- mui.fire(wobj, 'loginEvent');
- app.setState({});
- localStorage.clear();
- wobj.show();
- }
- function endPull(totalPage, pageNo) {
- if (totalPage == 0 || totalPage == 1) {
- mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
- } else {
- mui('#pullrefresh').pullRefresh().endPullupToRefresh(totalPage == pageNo); //参数为true代表没有更多数据了。
- }
- if (pageNo == 1) {
- mui('#pullrefresh').pullRefresh().endPulldownToRefresh();
- }
- pageNo = pageNo + 1;
- return pageNo;
- }
- //文件下载的任务
- function openFile222(path) {
- if (path.indexOf("http") == -1) {
- path = API.API_ROOT + "" + path;
- }
- //var url = API.API_ROOT + "" + path;//下载文件的方法,按照各自方法自行变动
- var dtask = plus.downloader.createDownload(path, {}, function(d, status) { //创建一个下载任务,可以在网上搜索这个方法了解
- if (status == 200) {
- plus.runtime.openFile(d.filename, {}, function(e) { //调用第三方应用打开文件
- alert('打开失败');
- });
- } else {
- alert("Download failed: " + status);
- }
- });
- dtask.start();
- }
|