feat: 对接完接口

This commit is contained in:
anonymous
2025-01-09 15:47:16 +08:00
parent e70ca852d8
commit ffb887f3bf
12 changed files with 416 additions and 255 deletions
+31 -21
View File
@@ -13,30 +13,40 @@ import { useUserStore } from '@/store'
const userStore = useUserStore()
const tabList = [
{ label: '我的余额', value: 0 },
{ label: '救济金余额', value: 1 },
{ label: '养老金余额', value: 2 },
{ label: '金余额', value: 3 },
]
const tabList = computed(() => {
return [
{ label: '我的余额', value: 1, money: userStore.userInfo.money },
{ label: '救济金余额', value: 2, money: userStore.userInfo.moneyjiu },
{ label: '养老金余额', value: 3, money: userStore.userInfo.moneyold },
{ label: '团队佣金余额', value: 4, money: userStore.userInfo.moneyyong },
]
})
const tabIndex = ref(0)
const detailInfo = ref({
point: 1,
score: 1000,
suminvest: '10000',
})
const { list: assetList } = useListPageRequest((params) =>
getMyAssetAPI(params).then((res) => {
detailInfo.value = res.data
res.data.data = res.data.list
return res.data
}),
const { list: assetList, onReload } = useListPageRequest(
(params) =>
getMyAssetAPI(params).then((res) => {
return res
}),
{
autoRequest: false,
},
)
onLoad((options) => {
tabIndex.value = Number(options.tabIndex ?? 0)
})
watch(
() => tabIndex.value,
(index) => {
onReload({
type: unref(tabList)[index].value,
})
},
{
immediate: true,
},
)
</script>
<template>
@@ -44,18 +54,18 @@ onLoad((options) => {
<view class="absolute top-130 -left-55 btn-gradient text-white rounded-full w-172 h-172"></view>
<view class="flex justify-around">
<view
v-for="tabItem in tabList"
@click="tabIndex = tabItem.value"
v-for="(tabItem, index) in tabList"
@click="tabIndex = index"
:key="tabItem.value"
class="flex items-center bg-#DEEBFF text-#3B81F3 rounded-full justify-center py-4 px-10"
:class="{ 'btn-gradient text-white': tabIndex === tabItem.value }"
:class="{ 'btn-gradient text-white': tabIndex === index }"
>
<view class="text-14">{{ tabItem.label }}</view>
</view>
</view>
<view class="p-15">
<view class="text-17">{{ tabList[tabIndex].label }}</view>
<view class="text-30">{{ detailInfo.suminvest }}</view>
<view class="text-30">{{ tabList[tabIndex].money }}</view>
</view>
<view class="relative z-1 main-content pt-40 pb-30 rounded-t-15">
<view class="mb-15 px-25">{{ tabList[tabIndex].label }}明细</view>
+13 -5
View File
@@ -21,7 +21,9 @@
class="m-15 text-white flex rounded-tl-10 rounded-br-10 justify-between items-center p-15 bg-[linear-gradient(90deg,rgba(59,129,243,0.5),#3B81F3)]"
>
<view class="text-14">{{ type === 0 ? '养老金' : '团队佣金' }}余额</view>
<view class="text-17 font-bold">{{ userStore.userInfo.money }}</view>
<view class="text-17 font-bold">
{{ type === 0 ? userStore.userInfo.moneyold : userStore.userInfo.moneyyong }}
</view>
</view>
<view class="p-15 bg-white shadow-[0_-2px_3px_rgba(10,68,245,0.1)] rounded-10">
<view class="mt-15">
@@ -34,7 +36,12 @@
placeholder="转出金额"
class="text-14 text-#333 flex-1"
/>
<view class="text-12 text-gradient" @click="convertNum = userStore.userInfo.score">
<view
class="text-12 text-gradient"
@click="
convertNum = type === 0 ? userStore.userInfo.moneyold : userStore.userInfo.moneyyong
"
>
全部
</view>
</view>
@@ -62,7 +69,7 @@
<script setup lang="ts">
import NavBar from '@/components/NavBar.vue'
import { convertScoreAPI } from '@/service'
import { convertScoreAPI, getOldMoneyTransferAPI, getYongMoneyTransferAPI } from '@/service'
import { useUserStore } from '@/store'
import { mergeStep, showModal } from '@/utils'
@@ -78,8 +85,9 @@ const onWithdrawalDetail = () => {
const onSubmit = mergeStep(async () => {
await showModal('确认转换?')
await convertScoreAPI({
score: convertNum.value,
const request = type.value === 0 ? getOldMoneyTransferAPI : getYongMoneyTransferAPI
await request({
money: convertNum.value,
})
await showModal('转换成功')
userStore.loadUserInfo()
+1 -1
View File
@@ -66,7 +66,7 @@ const onLottery = () => {
<style lang="scss" scoped>
.invite-page {
background-image: url('@/static/images/page-sub/invite-bg.png');
background-image: url('@/static/images/page-sub/invite-bg.jpg');
background-repeat: no-repeat;
background-position: top;
background-size: 100%;
+50 -45
View File
@@ -8,55 +8,60 @@
</route>
<template>
<view class="min-h-screen pb-100">
<view
class="flex px-15 py-8 border-b border-#E5E5E5 border-b-solid"
v-for="item in list"
:key="item.id"
>
<image
src="/static/images/invest/alipay-icon.png"
class="w-32 h-32 self-center"
v-if="item.typedata === '支付宝'"
/>
<image
src="/static/images/invest/wechat-icon.png"
class="w-32 h-32 self-center"
v-if="item.typedata === '微信'"
/>
<image
src="/static/images/invest/unionpay-icon.png"
class="w-32 h-32 self-center"
v-if="item.typedata === '银联'"
/>
<template v-if="list.length > 0">
<view
class="flex px-15 py-8 border-b border-#E5E5E5 border-b-solid"
v-for="item in list"
:key="item.id"
>
<image
src="/static/images/invest/alipay-icon.png"
class="w-32 h-32 self-center"
v-if="item.typedata === '支付宝'"
/>
<image
src="/static/images/invest/wechat-icon.png"
class="w-32 h-32 self-center"
v-if="item.typedata === '微信'"
/>
<image
src="/static/images/invest/unionpay-icon.png"
class="w-32 h-32 self-center"
v-if="item.typedata === '银联'"
/>
<view class="flex flex-col flex-1 justify-between ml-15">
<view class="text-14 text-#333">{{ item.typedata }}</view>
<view class="text-12 text-#999">提现</view>
<view class="text-12 text-#999">{{ item.createtime }}</view>
</view>
<view class="flex flex-col flex-1 justify-between ml-15">
<view class="text-14 text-#333">{{ item.typedata }}</view>
<view class="text-12 text-#999">提现</view>
<view class="text-12 text-#999">{{ item.createtime }}</view>
</view>
<view class="flex flex-col items-end">
<view class="text-16 text-#FF5F5F">{{ item.money }}</view>
<view
class="text-14 mt-18 py-4 px-10 bg-#99999990 text-#fff"
v-if="Number(item.status) === 1"
>
审核中
</view>
<view
class="text-14 mt-18 py-4 px-10 bg-#71C78A1A text-#71C78A"
v-if="Number(item.status) === 2"
>
提现成功
</view>
<view
class="text-14 mt-18 py-4 px-10 bg-#FF5F5F90 text-#fff"
v-if="Number(item.status) === 3"
>
提现失败
<view class="flex flex-col items-end">
<view class="text-16 text-#FF5F5F">{{ item.money }}</view>
<view
class="text-14 mt-18 py-4 px-10 bg-#99999990 text-#fff"
v-if="Number(item.status) === 1"
>
审核中
</view>
<view
class="text-14 mt-18 py-4 px-10 bg-#71C78A1A text-#71C78A"
v-if="Number(item.status) === 2"
>
提现成功
</view>
<view
class="text-14 mt-18 py-4 px-10 bg-#FF5F5F90 text-#fff"
v-if="Number(item.status) === 3"
>
提现失败
</view>
</view>
</view>
</view>
</template>
<template v-else>
<wd-status-tip image="content" tip="暂无内容" />
</template>
</view>
</template>
+1 -30
View File
@@ -71,8 +71,6 @@ const userStore = useUserStore()
const form = ref({
money: '',
bankid: '6',
tpassword: '',
})
const onWithdrawalDetail = () => {
@@ -81,22 +79,6 @@ const onWithdrawalDetail = () => {
})
}
const typeName = computed(() => {
return ['支付宝', '微信', '银行卡'][Number(unref(currentBank)?.typedata) - 1]
})
const currentBank = ref<any>(null)
const onSelectPayType = () => {
uni.$once('withdrawal-type', (data: any) => {
form.value.bankid = data.id
console.log(data)
currentBank.value = data
})
uni.navigateTo({
url: '/pages-sub/withdrawal-type/index?type=select',
})
}
const onSubmit = async () => {
if (!form.value.money) {
return uni.showToast({
@@ -104,18 +86,7 @@ const onSubmit = async () => {
icon: 'none',
})
}
if (!form.value.bankid) {
return uni.showToast({
title: '请选择收款方式',
icon: 'none',
})
}
if (!form.value.tpassword) {
return uni.showToast({
title: '请输入交易密码',
icon: 'none',
})
}
await showModal('确认提现?')
await submitWithdrawalAPI(form.value)
await showModal('提交成功')