micro_mall_xcx/pages/coupon/coupon-center/index.js
2023-10-26 23:20:48 +08:00

36 lines
473 B
JavaScript

import {
getCouponList
} from '~/services/coupon/getCouponList';
Page({
data: {
couponList: [],
},
onLoad() {
this.init();
},
init() {
this.fetchList();
},
fetchList() {
// 优惠券接口
getCouponList().then((couponList) => {
this.setData({
couponList
});
});
},
onPullDownRefresh_() {
this.setData({
couponList: [],
},
() => {
this.fetchList();
},
);
},
});