feat: 接口对接完成

This commit is contained in:
anonymous
2025-01-03 16:44:05 +08:00
parent 0889d068a8
commit 2d19bbce4c
37 changed files with 1220 additions and 398 deletions
+27 -12
View File
@@ -16,23 +16,25 @@
</NavBar>
<view class="flex mt-30 flex-col mx-15 rounded-10 px-40 py-32 main-content">
<view class="text-14 text-#6784C7">我的投资金</view>
<view class="text-35 leading-35 mt-10 text-#BE7143 font-bold">1000000</view>
<view class="text-35 leading-35 mt-10 text-#BE7143 font-bold">
{{ userStore.userInfo?.money }}
</view>
</view>
<view class="mt-100">
<view
v-for="item in 10"
:key="item"
v-for="item in investmentList"
:key="item.id"
class="invest-item relative flex flex-col items-center pt-15"
>
<view class="text-15 text-#3F88F6">5G通讯</view>
<view class="text-15 text-#3F88F6">{{ item.name }}</view>
<view class="flex w-full mt-15">
<view class="flex-1 text-center">
<view class="text-22 text-#333 font-bold">1000.00</view>
<view class="text-22 text-#333 font-bold">{{ item.money }}</view>
<view class="text-12 mt-4 text-blue-red">投资金额</view>
</view>
<view class="flex-1 text-center">
<view class="text-22 text-#FF3B30 font-bold">1000.00</view>
<view class="text-22 text-#FF3B30 font-bold">{{ item.dividend }}</view>
<view class="text-12 mt-4 text-blue-red">每日分红</view>
</view>
</view>
@@ -58,6 +60,9 @@ import NavBar from '@/components/NavBar.vue'
import AlipayIcon from '@/static/images/invest/alipay-icon.png'
import WechatIcon from '@/static/images/invest/wechat-icon.png'
import UnionpayIcon from '@/static/images/invest/unionpay-icon.png'
import { getInvestmentListAPI, submitInvestAPI } from '@/service'
import { useUserStore } from '@/store'
import { mergeStep, showModal } from '@/utils'
defineOptions({
name: 'Home',
@@ -78,6 +83,10 @@ const panels = ref([
},
])
const { list: investmentList } = useListPageRequest(getInvestmentListAPI)
const userStore = useUserStore()
const onGoInvestDetail = () => {
uni.navigateTo({
url: '/pages-sub/invest-detail/index',
@@ -89,12 +98,18 @@ const onSelectPayType = ({ item, index }: any) => {
alert(item.title)
}
const onInvest = (item: any) => {
// uni.navigateTo({
// url: '/pages-sub/invest-immediately/index',
// })
showPayType.value = true
}
const onInvest = mergeStep(async (item: any) => {
await showModal('确认投资?')
await submitInvestAPI({
investid: item.id,
type: 3,
})
await userStore.loadUserInfo()
uni.showToast({
title: '投资成功',
icon: 'none',
})
})
</script>
<style>