| | |
| | | } |
| | | |
| | | function ajax(option) { |
| | | bui.ajax({ |
| | | method: 'POST', |
| | | async: true, |
| | | url: CORS+option.url, |
| | | data: option.data, |
| | | dataType: 'json' |
| | | }).then(function(res) { |
| | | if(typeof(option.success) == 'function') { |
| | | option.success(res); |
| | | } |
| | | if(typeof(option.complete) == 'function') { |
| | | option.complete(); |
| | | } |
| | | }, |
| | | function() { |
| | | if(typeof(option.complete) == 'function') { |
| | | option.complete(); |
| | | } |
| | | }); |
| | | // $.ajax({ |
| | | // type: 'post', |
| | | // bui.ajax({ |
| | | // method: 'POST', |
| | | // async: true, |
| | | // url: CORS+option.url, |
| | | // data: option.data, |
| | | // dataType: 'json', |
| | | // success: option.success, |
| | | // error: option.error, |
| | | // complete: option.complete |
| | | // needNative: true, |
| | | // }).then(function(res) { |
| | | // if(typeof(option.success) == 'function') { |
| | | // option.success(res); |
| | | // } |
| | | // if(typeof(option.complete) == 'function') { |
| | | // option.complete(); |
| | | // } |
| | | // }, |
| | | // function() { |
| | | // if(typeof(option.complete) == 'function') { |
| | | // option.complete(); |
| | | // } |
| | | // }); |
| | | $.ajax({ |
| | | type: 'post', |
| | | async: true, |
| | | url: CORS+option.url, |
| | | data: option.data, |
| | | dataType: 'json', |
| | | success: option.success, |
| | | error: option.error, |
| | | complete: option.complete |
| | | }); |
| | | } |
| | | |
| | | //将秒转化成时:分:秒 |