提交优惠券,积分修改(领券部分没做)

This commit is contained in:
2024-12-06 17:41:26 +08:00
parent 34c2cb76e7
commit 9bc3cb5584
20 changed files with 198 additions and 105 deletions

View File

@@ -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
})
})
},
/**
* 生命周期函数--监听页面隐藏
*/