提交优惠券,积分修改(领券部分没做)
This commit is contained in:
@@ -1,11 +1,18 @@
|
||||
// pages/discountCoupon/index.js
|
||||
|
||||
import request from "../../utils/request"
|
||||
import { getCurrentCoupons, getCurrentIntegral, getRedeemableCoupons } from "../../service/system";
|
||||
import { alertInfo, loadingFunc } from "../../utils/index";
|
||||
const { OK } = request;
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
currentList: [],
|
||||
canGetList: [],
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -28,7 +35,32 @@ Page({
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
async getCurrent() {
|
||||
const that = this;
|
||||
loadingFunc(async() => {
|
||||
const { code, message, data = [], } = await getCurrentCoupons();
|
||||
if (code !== OK) {
|
||||
alertInfo(message)
|
||||
return
|
||||
}
|
||||
that.setData({
|
||||
currentList: data
|
||||
})
|
||||
})
|
||||
},
|
||||
getCanGet() {
|
||||
const that = this;
|
||||
loadingFunc(async() => {
|
||||
const { code, message, data = [], } = await getRedeemableCoupons({ type: 1 });
|
||||
if (code !== OK) {
|
||||
alertInfo(message)
|
||||
return
|
||||
}
|
||||
that.setData({
|
||||
currentList: data
|
||||
})
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
|
Reference in New Issue
Block a user