Commit f4ccffe9 by LJM

bug

parent 70a392dd
Showing with 22 additions and 7 deletions
......@@ -15,7 +15,7 @@
<view class="tab row avarage verCenter">
<view class="box row rowCenter verCenter" v-for="(item, index) in arr" :class="{ curr: index == curr }" :key="index" @click="tab(index)">
<text class="t2">{{ item }}</text>
<text class="t3">0</text>
<text class="t3">{{ count[index] }}</text>
</view>
</view>
</view>
......@@ -155,12 +155,13 @@ export default {
return {
kfqq: '',
time: currentDate,
arr: ['全部', '待付款', '待收货', '已完结订单'],
arr: [],
curr: 0,
list: [],
currencyIndex: 0,
currency_arr: ['全部', '人民币', '美元'],
tipType: 1,
count: [],
searchParams: {
order_sn: '',
p: 1,
......@@ -187,7 +188,7 @@ export default {
*/
handleInput: debounce(function(event) {
this.getData();
}, 800),
}, 500),
getDate(type) {
const date = new Date();
let year = date.getFullYear();
......@@ -206,13 +207,13 @@ export default {
tab(index) {
this.curr = index;
if (index == 0) {
this.searchParams.status = '';
this.searchParams.status = 0;
} else if (index == 1) {
this.searchParams.status = 2;
this.searchParams.status = '2,3';
} else if (index == 2) {
this.searchParams.status = 8;
this.searchParams.status = '7,8';
} else if (index == 3) {
this.searchParams.status = 10;
this.searchParams.status = '-1,10';
}
this.getData();
},
......@@ -440,6 +441,20 @@ export default {
});
},
getData() {
this.request(Api_Url + '/order/count', 'POST', { status: '1,2,3,4,7,8,10,-1', mul: 1 }, false, true).then(res => {
if (res.err_code === 0) {
this.arr = ['全部', '待付款', '待收货', '已完结订单'];
let num = 0;
for (var i in res.data) {
num += Number(res.data[i]);
}
this.count[0] = num;
this.count[1] = Number(res.data[2]) + Number(res.data[3]); //待付款
this.count[2] = Number(res.data[7]) + Number(res.data[8]); //待收货
this.count[3] = Number(res.data[-1]) + Number(res.data[10]); //已完结订单
}
});
this.request(Api_Url + '/order/lists', 'POST', this.searchParams, true, true).then(res => {
if (res.err_code === 0) {
this.list = res.data.list;
......
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 sign in to comment