|
@@ -23,7 +23,6 @@ Page({
|
|
|
mobileTop: 'TONY WU',
|
|
|
couponNum: 0,
|
|
|
productNum: 0,
|
|
|
- activityId: 1,
|
|
|
couponList: [],
|
|
|
detailList: [],
|
|
|
stateList: [],
|
|
@@ -38,6 +37,9 @@ Page({
|
|
|
this.setData({
|
|
|
isLogin: getMobileCache() != ''
|
|
|
})
|
|
|
+ wx.setNavigationBarTitle({
|
|
|
+ title: '我的优惠',
|
|
|
+ })
|
|
|
if(this.data.isLogin){
|
|
|
this.setData({
|
|
|
hiddenCoupon: false,
|
|
@@ -47,22 +49,35 @@ Page({
|
|
|
noDetail: false,
|
|
|
noUtility: false,
|
|
|
})
|
|
|
- this.getUserAwardCouponList();
|
|
|
this.getUserAwardCouponNum();
|
|
|
+ this.getRequestData();
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ // 类型区分
|
|
|
+ getRequestData() {
|
|
|
+ if (this.data.noCoupon) {
|
|
|
+ this.getUserAwardCouponList();
|
|
|
+ }
|
|
|
+ if (this.data.noDetail) {
|
|
|
this.getUserSignInList();
|
|
|
+ }
|
|
|
+ if (this.data.noUtility) {
|
|
|
this.getCouponStateList();
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
|
|
|
- // 优惠券数据
|
|
|
- getUserAwardCouponList: function() {
|
|
|
- SignIn.getUserAwardCouponList({
|
|
|
+ builtPublicParams() {
|
|
|
+ return {
|
|
|
page: this.data.page,
|
|
|
pageSize: this.data.pageSize,
|
|
|
- mobile: "16602120168",
|
|
|
- activityId: this.data.activityId
|
|
|
- }).then(res => {
|
|
|
+ mobile: getMobileCache(),
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 优惠券数据
|
|
|
+ getUserAwardCouponList: function() {
|
|
|
+ SignIn.getUserAwardCouponList(this.builtPublicParams()).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.userCouponListView(res.data)
|
|
|
}
|
|
@@ -105,12 +120,7 @@ Page({
|
|
|
|
|
|
//未使用的券数量
|
|
|
getUserAwardCouponNum: function() {
|
|
|
- SignIn.getUserAwardCouponNum({
|
|
|
- page: this.data.page,
|
|
|
- pageSize: this.data.pageSize,
|
|
|
- mobile: "16602120168",
|
|
|
- activityId: this.data.activityId
|
|
|
- }).then(res => {
|
|
|
+ SignIn.getUserAwardCouponNum(this.builtPublicParams()).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.setData({
|
|
|
notUseNum: res.data.notUseNum
|
|
@@ -125,12 +135,7 @@ Page({
|
|
|
|
|
|
// 签到明细
|
|
|
getUserSignInList: function() {
|
|
|
- SignIn.getUserSignInList({
|
|
|
- page: this.data.page,
|
|
|
- pageSize: this.data.pageSize,
|
|
|
- mobile: "16602120168",
|
|
|
- activityId: this.data.activityId
|
|
|
- }).then(res => {
|
|
|
+ SignIn.getUserSignInList(this.builtPublicParams()).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.userDetailListView(res.data)
|
|
|
}
|
|
@@ -171,12 +176,7 @@ Page({
|
|
|
|
|
|
// 使用失效
|
|
|
getCouponStateList: function() {
|
|
|
- SignIn.getUserAwardCouponUseStateList({
|
|
|
- page: this.data.page,
|
|
|
- pageSize: this.data.pageSize,
|
|
|
- mobile: "16602120168",
|
|
|
- activityId: this.data.activityId
|
|
|
- }).then(res => {
|
|
|
+ SignIn.getUserAwardCouponUseStateList(this.builtPublicParams()).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.userStateListView(res.data)
|
|
|
}
|
|
@@ -221,13 +221,10 @@ Page({
|
|
|
this.setData({
|
|
|
isLogin: true,
|
|
|
mobileTop: getMobileCache(),
|
|
|
- // hidden1: false,
|
|
|
- // hidden2: true,
|
|
|
+ noCoupon: true,
|
|
|
})
|
|
|
- this.getUserAwardCouponList();
|
|
|
+ this.getRequestData();
|
|
|
this.getUserAwardCouponNum();
|
|
|
- this.getUserSignInList();
|
|
|
- this.getCouponStateList();
|
|
|
})
|
|
|
},
|
|
|
|
|
@@ -249,6 +246,9 @@ Page({
|
|
|
this.data.detailList= [],
|
|
|
this.data.stateList= [],
|
|
|
this.getUserAwardCouponList()
|
|
|
+ wx.setNavigationBarTitle({
|
|
|
+ title: '我的优惠',
|
|
|
+ })
|
|
|
},
|
|
|
//明细
|
|
|
getDetail(e) {
|
|
@@ -268,6 +268,9 @@ Page({
|
|
|
this.data.detailList= [],
|
|
|
this.data.stateList= [],
|
|
|
this.getUserSignInList()
|
|
|
+ wx.setNavigationBarTitle({
|
|
|
+ title: '获取明细',
|
|
|
+ })
|
|
|
|
|
|
},
|
|
|
//使用失效
|
|
@@ -288,6 +291,9 @@ Page({
|
|
|
this.data.detailList= [],
|
|
|
this.data.stateList= [],
|
|
|
this.getCouponStateList()
|
|
|
+ wx.setNavigationBarTitle({
|
|
|
+ title: '使用/失效',
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -334,7 +340,7 @@ Page({
|
|
|
}
|
|
|
this.data.lock = true
|
|
|
this.data.page++
|
|
|
- this.getUserAwardCouponList()
|
|
|
+ this.getRequestData();
|
|
|
},
|
|
|
|
|
|
/**
|