Commit 4bef85d6 authored by liaili's avatar liaili

修复IE8 BUG

parent 195ea91a
......@@ -7,7 +7,7 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
function fetch(query, panel) {
var data = _extends({}, query, { p: (parseInt(query.p, 10) || 1) - 1 });
request('/api/1.0/prod/hList.json', data).then(function (_ref) {
request('/api/1.0/prod/hList.json', data).done(function (_ref) {
var hasNext = _ref.hasNext;
var items = _ref.items;
......@@ -27,13 +27,13 @@ function fetch(query, panel) {
$('.pagination', panel).html(pagination.join(''));
history.replaceState && history.replaceState(null, null, location.pathname + '?' + serialize(query));
}
}).catch(function (err) {
}).fail(function (err) {
console.log(err);
});
}
function fetchCates(query) {
request('/api/1.0/cate/cates.json').then(function (_ref2) {
request('/api/1.0/cate/cates.json').done(function (_ref2) {
var pCates = _ref2.pCates;
var cates = [];
......
This diff is collapsed.
......@@ -64,9 +64,9 @@
request('/api/1.0/proj/add.json', {
mobile: mobile,
description: description
}, 'POST').then(function () {
}, 'POST').done(function () {
$successDialog.fadeIn(300);
}).catch(function () {
}).fail(function () {
alert('提交失败, 请稍后再试!');
});
$introducerMobile.val('');
......
This diff is collapsed.
......@@ -11,16 +11,16 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
function request(url, data) {
var method = arguments.length <= 2 || arguments[2] === undefined ? 'GET' : arguments[2];
return new Promise(function (resolve, reject) {
var promise = $.Deferred();
$.ajax(url, {
type: method,
dataType: 'json',
data: data,
success: function success(res) {
if (res && res.status == 1) {
resolve(res.result);
promise.resolve(res.result);
} else {
reject({
promise.reject({
code: res && res.code || 0,
message: res && res.msg || res.message || '系统错误,请稍后再试!'
});
......@@ -28,13 +28,13 @@ function request(url, data) {
},
error: function error(xhr, status, text) {
console.log(xhr, status, text);
reject({
promise.reject({
code: xhr && xhr.status || status,
message: text
});
}
});
});
return promise;
}
function formatMoney() {
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment