登录方式重构

This commit is contained in:
Aaron
2021-07-19 19:37:35 +08:00
parent 79305d7497
commit b196b5237d
21 changed files with 858 additions and 323 deletions

View File

@ -97,18 +97,17 @@ export default {
})
})
},
getUseCoupons: function() {
let that = this
if (that.loading) return //阻止下次请求false可以进行请求
if (that.loadend) return //阻止结束当前请求false可以进行请求
that.loading = true
let q = { page: that.page, limit: that.limit }
getUseCoupons() {
if (this.loading) return //阻止下次请求false可以进行请求
if (this.loadend) return //阻止结束当前请求false可以进行请求
this.loading = true
let q = { page: this.page, limit: this.limit }
getCoupon(q).then(res => {
that.loading = false
this.loading = false
//apply();js将一个数组插入另一个数组;
that.couponsList.push.apply(that.couponsList, res.data)
that.loadend = res.data.length < that.limit //判断所有数据是否加载完成;
that.page = that.page + 1
this.couponsList.push.apply(this.couponsList, res.data)
this.loadend = res.data.length < this.limit //判断所有数据是否加载完成;
this.page = this.page + 1
})
},
},