| 12345678910111213141516171819202122232425262728293031 |
- import request from '../../Utils/RequestUtils';
- import Toast from '../../flooks/Toast';
- const userCoupon = (now) => ({
- userCouponList: [],
- userCouponListHis: [],
- // 获取未过期的优惠券
- init() {
- return request
- .get(`/userCoupon/my`)
- .then((res) => {
- now({ userCouponList: res });
- })
- .catch(() => {
- now({ userCouponList: [] });
- });
- },
- // 获取过期的优惠券
- getBadList() {
- return request
- .get(`/userCoupon/myHis`)
- .then((res) => {
- now({ userCouponListHis: res });
- })
- .catch(() => {
- now({ userCouponListHis: [] });
- });
- },
- });
- export default userCoupon;
|