This commit is contained in:
@@ -4,8 +4,10 @@ export const GetBetOptList = async (type) =>
|
|||||||
await alovaInst.Get(`/dice/shake?type=${type}`);
|
await alovaInst.Get(`/dice/shake?type=${type}`);
|
||||||
export const GetUserInfo = async (uid) =>
|
export const GetUserInfo = async (uid) =>
|
||||||
await alovaInst.Get(`/dice/userShakeInfo?uid=${uid}`);
|
await alovaInst.Get(`/dice/userShakeInfo?uid=${uid}`);
|
||||||
export const GetBetRecord = async (uid) =>
|
export const GetBetRecord = async (data) =>
|
||||||
await alovaInst.Get(`/dice/userShakeRecord?uid=${uid}`);
|
await alovaInst.Get(
|
||||||
|
`/dice/userShakeRecord?uid=${data.uid}&PageNum=${data.PageNum}&PageSize=${data.PageSize}`
|
||||||
|
);
|
||||||
export const GetLotteryRecord = async (uid) =>
|
export const GetLotteryRecord = async (uid) =>
|
||||||
await alovaInst.Get(`/dice/draw?uid=${uid}`);
|
await alovaInst.Get(`/dice/draw?uid=${uid}`);
|
||||||
export const GetPeriod = async () => await alovaInst.Get(`/dice/periods`);
|
export const GetPeriod = async () => await alovaInst.Get(`/dice/periods`);
|
||||||
|
|||||||
@@ -90,6 +90,12 @@ const uid = ref("");
|
|||||||
// ]);
|
// ]);
|
||||||
const data = ref([]);
|
const data = ref([]);
|
||||||
|
|
||||||
|
const page = ref({
|
||||||
|
page: 1,
|
||||||
|
size: 10,
|
||||||
|
total: 0,
|
||||||
|
});
|
||||||
|
|
||||||
Taro.useLoad((opt) => {
|
Taro.useLoad((opt) => {
|
||||||
uid.value = opt.uid;
|
uid.value = opt.uid;
|
||||||
});
|
});
|
||||||
@@ -98,8 +104,27 @@ Taro.useDidShow(() => {
|
|||||||
getList();
|
getList();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Taro.useReachBottom(async () => {
|
||||||
|
if (page.value.page * page.value.size >= page.value.total) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: "没有更多了",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
page.value.page++;
|
||||||
|
await getList();
|
||||||
|
});
|
||||||
|
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
const res = await GetBetRecord(uid.value);
|
Taro.showLoading({
|
||||||
|
title: "加载中",
|
||||||
|
});
|
||||||
|
const res = await GetBetRecord({
|
||||||
|
uid: uid.value,
|
||||||
|
PageNum: page.value.page,
|
||||||
|
PageSize: page.value.size,
|
||||||
|
});
|
||||||
// console.log(res);
|
// console.log(res);
|
||||||
data.value = res.data.map((item) => ({
|
data.value = res.data.map((item) => ({
|
||||||
type: 1,
|
type: 1,
|
||||||
@@ -111,6 +136,8 @@ const getList = async () => {
|
|||||||
state: item.State,
|
state: item.State,
|
||||||
periods_num: item.PeriodsNum,
|
periods_num: item.PeriodsNum,
|
||||||
}));
|
}));
|
||||||
|
page.value.total = res.data.total || 0;
|
||||||
|
Taro.hideLoading();
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user