|
|
@@ -19,19 +19,20 @@ Page({
|
|
|
companyName: '',
|
|
|
versionName: '',
|
|
|
active: 0,
|
|
|
- tagList: [{ title: '使用', code: '使用' }, { title: '未使用', code: '未使用' }, { title: '失效', code: '失效' }],
|
|
|
- saleStatus: '使用',
|
|
|
+ tagList: [{ title: '使用', code: Constants.couponStatus.use }, { title: '未使用', code: Constants.couponStatus.unused }, { title: '失效', code: Constants.couponStatus.expired }],
|
|
|
+ saleStatus: Constants.couponStatus.use,
|
|
|
itemList: [{
|
|
|
type: '签到',
|
|
|
- date: '2024-07-05',
|
|
|
- time: '2024-07-06',
|
|
|
- user: '李小双',
|
|
|
- value: '5折优惠劵'
|
|
|
+ receiveDate: '2024-07-05',
|
|
|
+ useDate: '2024-07-06',
|
|
|
+ receiveUser: '李小双',
|
|
|
+ couponName: '5折优惠劵'
|
|
|
}],
|
|
|
gradeCode: null,
|
|
|
// 路由
|
|
|
routeObjName: 'integralItem',
|
|
|
integral: 0,
|
|
|
+ couponNumber: 0,
|
|
|
avatarUrl: config.image_url + '/static/img/' + '/order_billing_detail_01.png',
|
|
|
},
|
|
|
|
|
|
@@ -41,10 +42,18 @@ Page({
|
|
|
* @author : 刘尧
|
|
|
*/
|
|
|
onChangeTabs(e) {
|
|
|
- let code = e.detail.detail.code
|
|
|
- this.setData({
|
|
|
- saleStatus: code,
|
|
|
- active: e.detail.detail.index
|
|
|
+ let code = e.detail.detail.title
|
|
|
+ let params = {
|
|
|
+ couponStatus: e.detail.detail.code,
|
|
|
+ flgValid: true
|
|
|
+ }
|
|
|
+ let service = app.globalData['couponUseService']
|
|
|
+ this.excute(service, service.selectByCond,params).then(res => {
|
|
|
+ this.setData({
|
|
|
+ saleStatus: code,
|
|
|
+ active: e.detail.detail.index,
|
|
|
+ itemList: res.data.data.list
|
|
|
+ })
|
|
|
})
|
|
|
},
|
|
|
/**
|
|
|
@@ -61,6 +70,8 @@ Page({
|
|
|
this.getIntegral()
|
|
|
// 头像
|
|
|
this.getUser()
|
|
|
+ // 优惠劵
|
|
|
+ this.getCouponNumber()
|
|
|
|
|
|
},
|
|
|
|
|
|
@@ -99,6 +110,23 @@ Page({
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ /**
|
|
|
+ * @desc : 优惠劵数量获取
|
|
|
+ * @author : 刘尧
|
|
|
+ * @date : 2024/7/29 15:54
|
|
|
+ */
|
|
|
+ getCouponNumber(){
|
|
|
+ let params = {
|
|
|
+ couponStatus: Constants.couponStatus.unused,
|
|
|
+ flgValid: true
|
|
|
+ }
|
|
|
+ let service = app.globalData['couponUseService']
|
|
|
+ this.excute(service, service.countByCond, params).then(res => {
|
|
|
+ this.setData({
|
|
|
+ couponNumber: res.data
|
|
|
+ })
|
|
|
+ });
|
|
|
+},
|
|
|
|
|
|
|
|
|
|