Commit 4c73674e by LJM

css

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