feat:礼物

This commit is contained in:
dzc committed 2025-12-08 13:17:26 +08:00
1 parent 001a545633
commit be80fd2b4b
1 file changed
+17 -3
+17 -3
View File
@@ -10,7 +10,7 @@
<view class="mt-30rpx mx-30rpx">
<view class="flex justify-between items-center">
<view class="flex items-end">
<text class="text-3xl font-bold">0</text>
<text class="text-3xl font-bold">{{ fen2yuan(state.wallet.giftBalance) }}</text>
<text class="ml-10rpx text-xs">可提现总{{ dictData.unit }}</text>
</view>
<view>
@@ -47,6 +47,7 @@ import { computed, reactive, ref } from 'vue';
import sheep from '@/sheep';
import { onLoad, onShow } from '@dcloudio/uni-app';
import { fen2yuan } from '@/sheep/hooks/useGoods';
import ScrollList from '@/sheep/components/scroll-list/scroll-list.vue';
import useScroll from '@/sheep/hooks/use-scroll';
import { formatDate } from '@/sheep/helper/utils';
@@ -54,15 +55,18 @@ import { formatDate } from '@/sheep/helper/utils';
import PayWalletApi from "@/sheep/api/pay/wallet.js"
const dictData = {
unit: "砖石"
unit: "缘豆"
}
const state = reactive({
wallet: {
giftBalance: ""
}
})
onShow(() => {
refreshList()
getWithdrawableAmount()
})
const {
@@ -72,4 +76,14 @@ const {
listLoadMore: listLoadMore,
} = useScroll(PayWalletApi.giftPage);
// 查询可以提现的礼物金额
const getWithdrawableAmount = async () => {
try {
const { data } = await PayWalletApi.getPayWallet()
state.wallet = data
} catch (error) {
console.log("|查询可以提现的礼物金额|,意外的错误error:", error);
}
}
</script>