36 lines
473 B
JavaScript
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();
|
|
},
|
|
);
|
|
},
|
|
}); |