Commit 4c73674e by LJM

css

parent 94a03a0a
Showing with 15 additions and 6 deletions
......@@ -82,6 +82,9 @@ export default {
coupon_list: []
};
},
onLoad(options) {
this.curr = options.curr || 0;
},
onShow() {
this.getData();
},
......
......@@ -2,7 +2,7 @@
<view class="page-userCoupon">
<navElement title="我的优惠券">
<template slot="title-bar">
<navigator class="go-coupon" url="/user/activity" hover-class="none">去领券</navigator>
<navigator class="go-coupon" url="/user/activity?curr=1" hover-class="none">去领券</navigator>
</template>
</navElement>
<view class="tab row avarage verCenter">
......@@ -69,7 +69,7 @@ export default {
curr: 0,
text_arr: ['未使用', '已使用', '已过期'],
list: [],
count: [],
count: [0, 0, 0],
searchParams: {
status: -1
}
......@@ -90,17 +90,23 @@ export default {
}
this.getData();
},
getData() {
/**
* 获取统计数据
*/
getCount() {
this.request(Api_Url + '/ucoupon/count', 'POST', {}, true, true).then(res => {
if (res.err_code === 0) {
this.count[0] = res.data[-1];
this.count[1] = res.data[1];
this.count[2] = res.data[-2];
this.$set(this.count, 0, res.data[-1]);
this.$set(this.count, 1, res.data[1]);
this.$set(this.count, 2, res.data[-2]);
}
});
},
getData() {
this.request(Api_Url + '/ucoupon/lists', 'POST', this.searchParams, true, true).then(res => {
if (res.err_code === 0) {
this.list = res.data;
this.getCount();
} else if (res.err_code == 11012) {
uni.navigateTo({
url: '/login?referer=/user/inquery'
......
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