Authored by 王洪广

增加退换货列表

@@ -124,7 +124,7 @@ const order = { @@ -124,7 +124,7 @@ const order = {
124 res.render('coin', { 124 res.render('coin', {
125 module: 'home', 125 module: 'home',
126 page: 'coin', 126 page: 'coin',
127 - coin: result 127 + coi
128 }); 128 });
129 }).catch(next); 129 }).catch(next);
130 }, 130 },
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 const refundModel = require('../models/refund'); 6 const refundModel = require('../models/refund');
7 const notLoginCode = 400; 7 const notLoginCode = 400;
8 const notLoginTip = '抱歉,您暂未登录!'; 8 const notLoginTip = '抱歉,您暂未登录!';
9 -const testUid = 8050378;// 测试uid 9 +const testUid = 8039837;// 测试uid
10 const isBLK = 1; 10 const isBLK = 1;
11 11
12 const refund = { 12 const refund = {
@@ -72,7 +72,6 @@ const refund = { @@ -72,7 +72,6 @@ const refund = {
72 let uid = req.query.id; 72 let uid = req.query.id;
73 let page = req.query.page; 73 let page = req.query.page;
74 let limit = req.query.limit; 74 let limit = req.query.limit;
75 - let isend = true;  
76 75
77 uid = testUid; 76 uid = testUid;
78 if (!uid && req.xhr) { 77 if (!uid && req.xhr) {
@@ -89,10 +88,7 @@ const refund = { @@ -89,10 +88,7 @@ const refund = {
89 }; 88 };
90 89
91 refundModel.getRefundOrders(param).then(result => { 90 refundModel.getRefundOrders(param).then(result => {
92 - if (result && page < result.pageTotal) {  
93 - isend = false;  
94 - }  
95 - return res.json(Object.assign({isend: isend}, result)); 91 + return res.json(result);
96 }); 92 });
97 } 93 }
98 }; 94 };
@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
23 return { 23 return {
24 page: 0, 24 page: 0,
25 limit: 15, 25 limit: 15,
26 - pageTotal: 0, 26 + pageTotal: 1,
27 coinList: [], 27 coinList: [],
28 busy: false, 28 busy: false,
29 }; 29 };
@@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
38 let _that = this; 38 let _that = this;
39 39
40 this.busy = true; 40 this.busy = true;
41 - if (this.page > this.pageTotal) { 41 + if (this.page >= this.pageTotal) {
42 return; 42 return;
43 } 43 }
44 $.ajax({ 44 $.ajax({
@@ -54,7 +54,7 @@ @@ -54,7 +54,7 @@
54 return { 54 return {
55 page: 0, 55 page: 0,
56 limit: 10, 56 limit: 10,
57 - pageTotal: 0, 57 + pageTotal: 1,
58 type: this.$parent.$data.type, 58 type: this.$parent.$data.type,
59 orderList: [], 59 orderList: [],
60 busy: false, 60 busy: false,
@@ -70,7 +70,7 @@ @@ -70,7 +70,7 @@
70 let _that = this; 70 let _that = this;
71 71
72 this.busy = true; 72 this.busy = true;
73 - if (this.page > this.pageTotal) { 73 + if (this.page >= this.pageTotal) {
74 return; 74 return;
75 } 75 }
76 $.ajax({ 76 $.ajax({
@@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
28 </div> 28 </div>
29 </div> 29 </div>
30 </div> 30 </div>
31 - <div class="order-option"> 31 + <div class="order-option" v-show="order.canCancel == 'Y'">
32 <div class="goods-total"></div> 32 <div class="goods-total"></div>
33 <div class="options" v-show="order.canCancel == 'Y'"> 33 <div class="options" v-show="order.canCancel == 'Y'">
34 <button v-if="order.canCancel == 'Y'" class="normal">取消申请</button> 34 <button v-if="order.canCancel == 'Y'" class="normal">取消申请</button>
@@ -51,6 +51,7 @@ @@ -51,6 +51,7 @@
51 return { 51 return {
52 page: 0, 52 page: 0,
53 limit: 10, 53 limit: 10,
  54 + pageTotal: 1,
54 orderList: [], 55 orderList: [],
55 busy: false, 56 busy: false,
56 }; 57 };
@@ -65,6 +66,9 @@ @@ -65,6 +66,9 @@
65 let _that = this; 66 let _that = this;
66 67
67 this.busy = true; 68 this.busy = true;
  69 + if (this.page >= this.pageTotal) {
  70 + return;
  71 + }
68 $.ajax({ 72 $.ajax({
69 url: '/home/refund/get-orders', 73 url: '/home/refund/get-orders',
70 data: { 74 data: {
@@ -72,13 +76,10 @@ @@ -72,13 +76,10 @@
72 limit: this.limit 76 limit: this.limit
73 } 77 }
74 }).then(result => { 78 }).then(result => {
75 - if (result.isend) {  
76 - _that.busy = true;  
77 - } else {  
78 - _that.busy = false;  
79 - } 79 + _that.busy = false;
80 if (result.data.list.length > 0) { 80 if (result.data.list.length > 0) {
81 - this.$set('orderList', result.data.list); 81 + this.$set('orderList', _that.orderList.concat(result.data.list));
  82 + _that.pageTotal = result.data.totalPage;
82 } 83 }
83 }).fail(() => { 84 }).fail(() => {
84 tip('网络错误'); 85 tip('网络错误');
@@ -112,13 +113,4 @@ @@ -112,13 +113,4 @@
112 113
113 @import "../../scss/home/_order.css"; 114 @import "../../scss/home/_order.css";
114 115
115 - .order-wrapper {  
116 - height: 100%;  
117 -  
118 - ul {  
119 - height: 100%;  
120 - overflow-y: auto;  
121 - -webkit-overflow-scrolling: touch;  
122 - }  
123 - }  
124 </style> 116 </style>