1234567891011121314151617181920212223242526272829303132333435 |
- var baseUrl = 'http://pay-test.278740.cn'
- /**
- * 获取请求ajax数据
- * @param url 请求地址
- * @param type 请求类型
- * @param data 需要发送的数据
- * @param callback 成功回调方法
- * @param alert 成功后是否提示成功信息
- */
- var getAjax = function (url, type, data, callback, alert, noneShow,errorF) {
- // !noneShow ? showLoading() : null;
- $.ajax({
- url: url,
- type: type,
- dataType: 'JSON',
- data: data,
- success: function (result) {
- if (result.state == 0) {
- typeof callback == 'function' ? callback(result) : null;
- if (alert) Popup.toast(result.msg || " ");
- // !noneShow ? hideLoading() : null;
- } else {
- Popup.toast(result.msg || " ");
- // !noneShow ? hideLoading() : null;
- typeof errorF == 'function'?errorF():null;
- }
- },
- error: function (err) {
- Popup.toast(err || " ");
- // !noneShow ? hideLoading() : null;
- typeof errorF == 'function'?errorF():null;
- }
- })
- };
|