|
@@ -2,10 +2,8 @@ jqMultipleShow("click", ".navList", ".tab", ".con");
|
|
|
var helpSuggestion = new Vue({
|
|
|
el: "#dashboard",
|
|
|
data: {
|
|
|
- btnLoading: false,
|
|
|
- isRequset:false,
|
|
|
+ isRequset:true,
|
|
|
userId: 0,
|
|
|
- degree:'',
|
|
|
orderTabBarIndex:0,
|
|
|
orderTabBar: [
|
|
|
{state: 0,text: '全部订单',bages:2},
|
|
@@ -15,33 +13,66 @@ var helpSuggestion = new Vue({
|
|
|
{state: 4,text: '已发货',bages:30},
|
|
|
{state: 5,text: '退货/款',bages:20}
|
|
|
],
|
|
|
- formData:new FormData(),
|
|
|
- unReadMessageCount:'',//消息数
|
|
|
- confirmedCount:'',//待確認數量
|
|
|
- paymentCount:'',//待付款
|
|
|
- waitShipmentsCount:'',//待发货
|
|
|
- shipmentsCount:'',//已发货
|
|
|
- salesReturnCount:'',//退货款
|
|
|
- productList:[],//推荐商品
|
|
|
- newsList:[],//新闻动态
|
|
|
+ listQuery:{
|
|
|
+ searchWord:'',
|
|
|
+ orderState:0,
|
|
|
+ userId:0,
|
|
|
+ pageNum:1,
|
|
|
+ pageSize:10
|
|
|
+ },
|
|
|
+ listRecord: 0,
|
|
|
+ pageInput: '1',
|
|
|
+ orderList:[],
|
|
|
+ },
|
|
|
+ filters: {
|
|
|
+ NumFormat:function(text) {
|
|
|
+ return Number(text).toFixed(2);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ pageTotal: function () {
|
|
|
+ var total = Math.ceil(this.listRecord / this.listQuery.pageSize);
|
|
|
+ return total > 0 ? total : 1;
|
|
|
+ },
|
|
|
+ showPageBtn: function () {
|
|
|
+ var total = Math.ceil(this.listRecord / this.listQuery.pageSize);
|
|
|
+ total = total > 0 ? total : 1;
|
|
|
+ var index = this.listQuery.pageNum, arr = [];
|
|
|
+ if (total <= 6) {
|
|
|
+ for (var i = 1; i <= total; i++) {
|
|
|
+ arr.push(i);
|
|
|
+ }
|
|
|
+ return arr;
|
|
|
+ }
|
|
|
+ if (index <= 3) return [1, 2, 3, 4, 5, 0, total];
|
|
|
+ if (index >= total - 2) return [1, 0, total - 4, total - 3, total - 2, total - 1, total];
|
|
|
+ return [1, 0, index - 2, index - 1, index, index + 1, index + 2, 0, total];
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
- GetMyPcCenterInfo:function(){
|
|
|
+ toPagination: function (pageNum) {
|
|
|
+ if (pageNum <= this.pageTotal) {
|
|
|
+ var params = {pageNum: pageNum};
|
|
|
+ window.location.href = updateUrlParam(params);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ checkNum: function () {
|
|
|
+ if (this.pageInput > this.pageTotal) {
|
|
|
+ this.pageInput = this.pageTotal;
|
|
|
+ } else if (this.pageInput < 1) {
|
|
|
+ this.pageInput = 1;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ GetQueryOrderListData:function(){
|
|
|
var _self = this;
|
|
|
- UserApi.GetMyPcCenterInfo({userId:_self.userId},function (response) {
|
|
|
+ OrderApi.GetQueryOrderListData(_self.listQuery,function (response) {
|
|
|
if(response.code == 0){
|
|
|
var data = response.data;
|
|
|
- _self.userInfo = data.user;
|
|
|
- _self.degree = data.degree;
|
|
|
- _self.unReadMessageCount = _self.showBadge(data.unReadMessageCount);
|
|
|
- _self.confirmedCount = _self.showBadge(data.confirmedCount);
|
|
|
- _self.paymentCount = _self.showBadge(data.paymentCount);
|
|
|
- _self.waitShipmentsCount = _self.showBadge(data.waitShipmentsCount);
|
|
|
- _self.shipmentsCount = _self.showBadge(data.shipmentsCount);
|
|
|
- _self.salesReturnCount = _self.showBadge(data.salesReturnCount);
|
|
|
- _self.productList = data.homePageAdvertiseList;
|
|
|
- _self.newsList = data.homePageInfoList;
|
|
|
- _self.isRequset = true;
|
|
|
+ if(data.results && data.results.length>0) {
|
|
|
+ _self.orderList = data.results;
|
|
|
+ _self.listRecord = data.totalRecord;
|
|
|
+ }
|
|
|
+ _self.isRequset = false;
|
|
|
}else{
|
|
|
CAIMEI.Alert(response.msg, '确定', false);
|
|
|
}
|
|
@@ -77,9 +108,13 @@ var helpSuggestion = new Vue({
|
|
|
mounted: function () {
|
|
|
if(globalUserData){
|
|
|
this.userId = globalUserData.userId;
|
|
|
- // this.GetMyPcCenterInfo();
|
|
|
+ this.listQuery.orderState = CAIMEI.getUrlParam('state');
|
|
|
+ this.listQuery.userId = this.userId;
|
|
|
+ this.GetQueryOrderListData();
|
|
|
}
|
|
|
+ console.log(this.listQuery.orderState)
|
|
|
$('.navLayout').find('.navList').removeClass("on").find('.con').hide().find('a').removeClass("on");
|
|
|
$('.navLayout').find('.navList').eq(0).addClass("on").find('.con').show().find('a').eq(0).addClass("on");
|
|
|
+
|
|
|
}
|
|
|
});
|