...
|
...
|
@@ -4,13 +4,65 @@ |
|
|
* @date: 2016/07/04
|
|
|
*/
|
|
|
|
|
|
var tableOperation = {
|
|
|
$header: $('.table.column-category'),
|
|
|
$body: $('.table.table-body'),
|
|
|
removeBody: function() {
|
|
|
this.$body = $('.table.table-body');
|
|
|
this.$body.remove();
|
|
|
},
|
|
|
appendBody: function(htmlStr) {
|
|
|
$(htmlStr).appendTo(this.$header);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
require('./me');
|
|
|
|
|
|
function getOrderList(type, page) {
|
|
|
tableOperation.removeBody();
|
|
|
|
|
|
$.ajax({
|
|
|
url: 'getOrderList',
|
|
|
data: {
|
|
|
type: type,
|
|
|
page: page
|
|
|
}
|
|
|
}).done(function(res) {
|
|
|
tableOperation.appendBody(res);
|
|
|
}).fail(function(err) {
|
|
|
console.log(err);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
function getQueryString() {
|
|
|
var queryArr = location.search.substr(1).split('&');
|
|
|
var query = {};
|
|
|
|
|
|
queryArr.forEach(function(pair) {
|
|
|
var arr = pair.split('=');
|
|
|
|
|
|
query[arr[0]] = arr[1];
|
|
|
|
|
|
});
|
|
|
|
|
|
return query;
|
|
|
}
|
|
|
|
|
|
$('.tabs li').on('click', function() {
|
|
|
var $this = $(this);
|
|
|
var typeMap = {
|
|
|
all: 1,
|
|
|
paying: 2,
|
|
|
delivering: 3
|
|
|
};
|
|
|
var type = typeMap[$this.data('type')];
|
|
|
var page = getQueryString().page;
|
|
|
|
|
|
if (!$this.hasClass('active')) {
|
|
|
$('.tabs li.active').removeClass('active');
|
|
|
$this.addClass('active');
|
|
|
}
|
|
|
|
|
|
getOrderList(type, page);
|
|
|
}); |
...
|
...
|
|