|
@@ -9,10 +9,13 @@
|
|
</route>
|
|
</route>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
-// 必须导入需要用到的页面生命周期(即使在当前页面上没有直接使用到)
|
|
|
|
// eslint-disable-next-line unused-imports/no-unused-imports
|
|
// eslint-disable-next-line unused-imports/no-unused-imports
|
|
import { onPageScroll, onReachBottom } from '@dcloudio/uni-app'
|
|
import { onPageScroll, onReachBottom } from '@dcloudio/uni-app'
|
|
import useZPaging from 'z-paging/components/z-paging/js/hooks/useZPaging.js'
|
|
import useZPaging from 'z-paging/components/z-paging/js/hooks/useZPaging.js'
|
|
|
|
+// 必须导入需要用到的页面生命周期(即使在当前页面上没有直接使用到)
|
|
|
|
+
|
|
|
|
+import { getWalletInfo as _getWalletInfo, accountFlowList } from '@/api/wallet'
|
|
|
|
+import { formatNumber } from '@/utils'
|
|
|
|
|
|
defineOptions({
|
|
defineOptions({
|
|
name: 'Income', // 收益
|
|
name: 'Income', // 收益
|
|
@@ -27,22 +30,35 @@ const dayType = ref(1)
|
|
|
|
|
|
// 搜索结果
|
|
// 搜索结果
|
|
const dataList = ref([])
|
|
const dataList = ref([])
|
|
-function queryList(pageNo, pageSize) {
|
|
|
|
- // 此处请求仅为演示,请替换为自己项目中的请求
|
|
|
|
- setTimeout(() => {
|
|
|
|
- dataList.value = [
|
|
|
|
- { title: '123' },
|
|
|
|
- { title: '123' },
|
|
|
|
- { title: '123' },
|
|
|
|
- { title: '12345' },
|
|
|
|
- ]
|
|
|
|
- paging.value.complete(dataList.value)
|
|
|
|
- }, 1000)
|
|
|
|
|
|
+const walletInfo = ref<any>({})
|
|
|
|
+async function getWalletInfo() {
|
|
|
|
+ const res = await _getWalletInfo()
|
|
|
|
+ console.log(res)
|
|
|
|
+ if (res.code === '200') {
|
|
|
|
+ walletInfo.value = res.data
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+async function queryList(pageNo, pageSize) {
|
|
|
|
+ const data = {
|
|
|
|
+ page: pageNo,
|
|
|
|
+ size: pageSize,
|
|
|
|
+ type: dayType.value,
|
|
|
|
+ }
|
|
|
|
+ try {
|
|
|
|
+ const res = await accountFlowList(data)
|
|
|
|
+ paging.value.complete(res.data.list)
|
|
|
|
+ }
|
|
|
|
+ catch (error) {
|
|
|
|
+ paging.value.complete(false)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+onShow(() => {
|
|
|
|
+ getWalletInfo()
|
|
|
|
+})
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<template>
|
|
<template>
|
|
- <z-paging ref="paging" refresher-only use-page-scroll @query="queryList">
|
|
|
|
|
|
+ <z-paging ref="paging" v-model="dataList" use-page-scroll @on-refresh="getWalletInfo" @query="queryList">
|
|
<view class="px-24rpx pb-24rpx">
|
|
<view class="px-24rpx pb-24rpx">
|
|
<view
|
|
<view
|
|
class="mb-20rpx rounded-16rpx from-[rgba(52,52,52,0.95)] to-[rgba(16,16,16,0.95)] bg-gradient-to-br pb-28rpx pt-44rpx text-white"
|
|
class="mb-20rpx rounded-16rpx from-[rgba(52,52,52,0.95)] to-[rgba(16,16,16,0.95)] bg-gradient-to-br pb-28rpx pt-44rpx text-white"
|
|
@@ -53,7 +69,7 @@ function queryList(pageNo, pageSize) {
|
|
Total Earnings
|
|
Total Earnings
|
|
</view>
|
|
</view>
|
|
<view class="text-40rpx font-bold">
|
|
<view class="text-40rpx font-bold">
|
|
- 152,418
|
|
|
|
|
|
+ {{ formatNumber(walletInfo.totalEarnings) }}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view>
|
|
<view>
|
|
@@ -61,7 +77,7 @@ function queryList(pageNo, pageSize) {
|
|
Account Balance
|
|
Account Balance
|
|
</view>
|
|
</view>
|
|
<view class="relative text-40rpx font-bold">
|
|
<view class="relative text-40rpx font-bold">
|
|
- <text>51,200</text>
|
|
|
|
|
|
+ <text>{{ formatNumber(walletInfo.balance) }}</text>
|
|
<wd-icon custom-class="absolute -right-24rpx top-1/2 -translate-y-1/2" name="arrow-right" size="24rpx" />
|
|
<wd-icon custom-class="absolute -right-24rpx top-1/2 -translate-y-1/2" name="arrow-right" size="24rpx" />
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -75,7 +91,7 @@ function queryList(pageNo, pageSize) {
|
|
<wd-icon name="help-circle" size="20rpx" />
|
|
<wd-icon name="help-circle" size="20rpx" />
|
|
</view>
|
|
</view>
|
|
<view class="text-40rpx font-bold">
|
|
<view class="text-40rpx font-bold">
|
|
- 102,566
|
|
|
|
|
|
+ {{ formatNumber(walletInfo.settledAmount) }}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<wd-divider dashed custom-class="h-60rpx!" color="#A4A4A4" vertical />
|
|
<wd-divider dashed custom-class="h-60rpx!" color="#A4A4A4" vertical />
|
|
@@ -87,7 +103,7 @@ function queryList(pageNo, pageSize) {
|
|
<wd-icon name="help-circle" size="20rpx" />
|
|
<wd-icon name="help-circle" size="20rpx" />
|
|
</view>
|
|
</view>
|
|
<view class="text-40rpx font-bold">
|
|
<view class="text-40rpx font-bold">
|
|
- 28,925
|
|
|
|
|
|
+ {{ formatNumber(walletInfo.pendingAmount) }}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -99,25 +115,25 @@ function queryList(pageNo, pageSize) {
|
|
TD Earnings
|
|
TD Earnings
|
|
</view>
|
|
</view>
|
|
<view class="text-26rpx font-bold">
|
|
<view class="text-26rpx font-bold">
|
|
- 12,566
|
|
|
|
|
|
+ {{ formatNumber(walletInfo.tdeamings) }}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<wd-divider dashed custom-class="h-40rpx!" color="#A4A4A4" vertical />
|
|
<wd-divider dashed custom-class="h-40rpx!" color="#A4A4A4" vertical />
|
|
<view class="flex-[33.33%]">
|
|
<view class="flex-[33.33%]">
|
|
<view class="text-22rpx text-#5B5B5B">
|
|
<view class="text-22rpx text-#5B5B5B">
|
|
- TD Earnings
|
|
|
|
|
|
+ YD Earnings
|
|
</view>
|
|
</view>
|
|
<view class="text-26rpx font-bold">
|
|
<view class="text-26rpx font-bold">
|
|
- 12,566
|
|
|
|
|
|
+ {{ formatNumber(walletInfo.ydeamings) }}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<wd-divider dashed custom-class="h-40rpx!" color="#A4A4A4" vertical />
|
|
<wd-divider dashed custom-class="h-40rpx!" color="#A4A4A4" vertical />
|
|
<view class="flex-[33.33%]">
|
|
<view class="flex-[33.33%]">
|
|
<view class="text-22rpx text-#5B5B5B">
|
|
<view class="text-22rpx text-#5B5B5B">
|
|
- TD Earnings
|
|
|
|
|
|
+ MTD Earnings
|
|
</view>
|
|
</view>
|
|
<view class="text-26rpx font-bold">
|
|
<view class="text-26rpx font-bold">
|
|
- 12,566
|
|
|
|
|
|
+ {{ formatNumber(walletInfo.mtdeamings) }}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -131,7 +147,7 @@ function queryList(pageNo, pageSize) {
|
|
</view>
|
|
</view>
|
|
<view class="flex-1 rounded-16rpx bg-#FEE750/50 py-32rpx shadow-[4rpx_4rpx_8rpx_0rpx_rgba(0,0,0,0.5)]">
|
|
<view class="flex-1 rounded-16rpx bg-#FEE750/50 py-32rpx shadow-[4rpx_4rpx_8rpx_0rpx_rgba(0,0,0,0.5)]">
|
|
<text class="pr-16rpx">
|
|
<text class="pr-16rpx">
|
|
- My Group Data
|
|
|
|
|
|
+ Withdraw Now
|
|
</text>
|
|
</text>
|
|
<wd-icon name="chevron-right-circle" size="32rpx" />
|
|
<wd-icon name="chevron-right-circle" size="32rpx" />
|
|
</view>
|
|
</view>
|