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
+28 -22
View File
@@ -7,6 +7,26 @@
}
</route>
<script lang="ts" setup>
import { getMyAssetAPI } from '@/service'
import { useUserStore } from '@/store'
const userStore = useUserStore()
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
}),
)
</script>
<template>
<view class="min-h-screen py-15">
<view class="mx-15 text-16 font-bold text-#333">我的资产</view>
@@ -14,38 +34,24 @@
class="mt-15 mx-15 rounded-20 text-#476FFF main-content p-15 rounded-10 shadow-[0_5px_30px_rgba(149,195,255,0.4)]"
>
<view class="text-14 text-#6784C7">总投资金</view>
<view class="text-35 mt-10 font-bold">10000.00</view>
<view class="flex mt-15">
<view class="flex-1">
<view class="text-12 text-#6784C7 font-light">我的分红</view>
<view class="text-16 font-bold mt-5">10000.00</view>
</view>
<view class="flex-1">
<view class="text-12 text-#6784C7 font-light">数字人民币</view>
<view class="text-16 font-bold mt-5">10000.00</view>
</view>
<view class="flex-1">
<view class="text-12 text-#6784C7 font-light">认购点</view>
<view class="text-16 font-bold mt-5">10000.00</view>
</view>
</view>
<view class="text-35 mt-10 font-bold">{{ detailInfo.suminvest }}</view>
</view>
<view class="text-16 mx-15 mb-15 font-bold text-#333 mt-30">资产记录</view>
<view
class="flex px-15 py-8 border-b items-center border-#E5E5E5 border-b-solid"
v-for="item in 10"
:key="item"
v-for="item in assetList"
:key="item.id"
>
<image src="/static/images/page-sub/invite-icon.png" class="w-32 h-32 self-center" />
<view class="flex flex-col flex-1 ml-15">
<view class="text-14 text-#333">邀请好友奖励</view>
<view class="text-12 mt-10 text-#999">奖励</view>
<view class="text-12 mt-10 text-#999">2024-12-27 10:00:00</view>
<view class="text-14 text-#333">{{ item.memo }}</view>
<!-- <view class="text-12 mt-10 text-#999">奖励</view> -->
<view class="text-12 mt-10 text-#999">{{ item.createtime }}</view>
</view>
<view class="flex flex-col items-end">
<view class="text-14 font-bold text-#FF5F5F">+20 </view>
<view class="text-14 mt-10 py-4 px-10 bg-#71C78A1A text-#71C78A">已到账</view>
<view class="text-14 font-bold text-#FF5F5F">{{ item.money }}</view>
<!-- <view class="text-14 mt-10 py-4 px-10 bg-#71C78A1A text-#71C78A">已到账</view> -->
</view>
</view>
</view>
+26 -20
View File
@@ -21,13 +21,20 @@
<view class="mt-15">
<view class="flex items-center justify-between">
<view class="text-14 text-#333">我的股数</view>
<view class="text-12 text-#999">可转换股数1202.45</view>
<view class="text-12 text-#999">可转换股数{{ userStore.userInfo.score }}</view>
</view>
<view
class="flex items-center text-14 mt-15 text-#333 p-16 shadow-[0_0_10px_rgba(10,68,245,0.1)] rounded-10"
>
<input type="number" placeholder="请输入股数" class="text-14 text-#333 flex-1" />
<view class="text-12 text-gradient">全部</view>
<input
v-model="convertNum"
type="number"
placeholder="请输入股数"
class="text-14 text-#333 flex-1"
/>
<view class="text-12 text-gradient" @click="convertNum = userStore.userInfo.score">
全部
</view>
</view>
<view class="text-12 text-#889BC6 mt-15">马尔代夫股权每股价值500元</view>
</view>
@@ -49,30 +56,29 @@
<script setup lang="ts">
import NavBar from '@/components/NavBar.vue'
import { convertScoreAPI } from '@/service'
import { useUserStore } from '@/store'
import { mergeStep, showModal } from '@/utils'
const userStore = useUserStore()
const convertNum = ref('')
const onWithdrawalDetail = () => {
uni.navigateTo({
url: '/pages-sub/withdrawal-detail/index',
url: '/pages-sub/asset/index',
})
}
const onSelectPayType = () => {
uni.$once('withdrawal-type', (data: any) => {
console.log(data)
const onSubmit = mergeStep(async () => {
await showModal('确认转换?')
await convertScoreAPI({
score: convertNum.value,
})
uni.navigateTo({
url: '/pages-sub/withdrawal-type/index?type=select',
})
}
const onSubmit = () => {
uni.showModal({
title: '提示',
content: '转换成功',
showCancel: false,
})
uni.navigateBack()
}
await showModal('转换成功')
userStore.loadUserInfo()
onWithdrawalDetail()
})
</script>
<style scoped></style>
+17 -6
View File
@@ -8,16 +8,27 @@
</route>
<template>
<view class="pt-15 pb-50 min-h-screen">
<view class="text-center text-16 font-bold">国际钱包</view>
<view class="pt-15 pb-50 min-h-screen" v-if="introductionDetail">
<view class="text-center text-16 font-bold">{{ introductionDetail.name }}</view>
<image
class="w-345 h-170 rounded-10 mt-15 mx-auto block"
src="@/static/images/page-sub/introduction.png"
:src="introductionDetail.image"
mode="aspectFill"
/>
<view class="text-gray-500 mx-16 text-14 mt-15">
国际钱包集团有限公司由具有160年历史的上海纺织集团和具有70年外贸历史的原东方国际集团联合重组而成是一家拥有先进制造业与现代服务业以时尚产业健康产业和供应链服务为核心主业以科技实业产业地产金融投资为支撑构建一体两翼三支撑总体格局的大型综合性企业集团名列中国企业500强第275位上海企业100强第25位
集团拥有总资产627亿元员工5.8万人海外员工占70%2023年快报营业收入780亿元进出口56.64亿美元出口41.34亿美元进口15.3亿美元集团在海外拥有96家业务机构分布在五大洲27个国家和地区所属企业389家上市公司4家东方创业申达股份龙头股份香港联泰控股
<view class="text-gray-500 mx-16 text-14 mt-15 break-all">
{{ introductionDetail.content }}
</view>
</view>
</template>
<script setup lang="ts">
import { getIntroductionAPI } from '@/service'
const { list: introductionList } = useListPageRequest((params) =>
getIntroductionAPI({ type: 3, ...params }),
)
const introductionDetail = computed(() => {
return introductionList.value[0]
})
</script>
+31 -15
View File
@@ -6,24 +6,40 @@
},
}
</route>
<script setup lang="ts">
import { getInvestmentRecordAPI } from '@/service'
const { list: investmentRecordList } = useListPageRequest(getInvestmentRecordAPI)
</script>
<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 10"
:key="item"
>
<image src="/static/images/page-sub/money-icon.png" class="w-32 h-32 self-center" />
<view class="flex flex-col flex-1 justify-between ml-15">
<view class="text-14 text-#333">5G通信</view>
<view class="text-12 text-#999">投资</view>
<view class="text-12 text-#999">2024-12-27 10:00:00</view>
</view>
<template v-if="investmentRecordList.length">
<view
class="flex px-15 py-8 border-b border-#E5E5E5 border-b-solid"
v-for="item in investmentRecordList"
:key="item.id"
>
<image src="/static/images/page-sub/money-icon.png" class="w-32 h-32 self-center" />
<view class="flex flex-col flex-1 justify-between ml-15">
<view class="text-14 text-#333">{{ item.name }}</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">+1000 RMB</view>
<view class="text-14 mt-18 py-4 px-10 bg-#71C78A1A text-#71C78A">投资成功</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-#71C78A1A text-#71C78A"
v-if="Number(item.status) === 1"
>
投资成功
</view>
</view>
</view>
</view>
</template>
<template v-else>
<wd-status-tip image="content" tip="暂无内容" />
</template>
</view>
</template>
+32
View File
@@ -0,0 +1,32 @@
<route lang="json5" type="page">
{
style: {
navigationBarTitleText: '新闻详情',
navigationBarBackgroundColor: '#fff',
},
}
</route>
<script setup lang="ts">
import { getIntroductionDetailAPI } from '@/service'
import { getImageUrl } from '@/utils'
import dayjs from 'dayjs'
const newsDetail = ref<any>({})
onLoad(async (options) => {
const { data } = await getIntroductionDetailAPI({ id: options.id })
newsDetail.value = data
})
</script>
<template>
<view class="min-h-screen pb-100 pt-30 px-15">
<view class="text-20 text-black font-bold">{{ newsDetail.name }}</view>
<view class="flex justify-between py-10">
<view class="text-14 text-gray-500">{{ newsDetail.source }}</view>
<view class="text-14 text-gray-500">
{{ dayjs(newsDetail.createtime * 1000).format('YYYY-MM-DD HH:mm') }}
</view>
</view>
<image class="w-full mt-15" mode="widthFix" :src="getImageUrl(newsDetail.image)" />
<view class="text-14 text-gray-600 mt-15">{{ newsDetail.content }}</view>
</view>
</template>
+96 -59
View File
@@ -1,4 +1,4 @@
<route lang="json5">
<route lang="json5" type="page">
{
style: {
navigationBarTitleText: '实名认证',
@@ -9,80 +9,117 @@
<template>
<view class="withdrawal-type-edit-page pb-100 min-h-screen">
<view class="p-15 m-15 shadow-[0_0_10px_rgba(10,68,245,0.1)] rounded-10">
<view class="flex items-center py-15 text-14">
<image src="@/static/images/page-sub/realname/realname-type.png" class="w-20 h-20" />
<view class="ml-8">证件类型</view>
<view class="flex-1 text-right text-14">身份</view>
<template v-if="!realnameInfo">
<view class="p-15 m-15 shadow-[0_0_10px_rgba(10,68,245,0.1)] rounded-10">
<view class="flex items-center py-15 text-14">
<image src="@/static/images/page-sub/realname/realname-type.png" class="w-20 h-20" />
<view class="ml-8">件类型</view>
<view class="flex-1 text-right text-14">身份证</view>
</view>
<view class="flex items-center py-15 text-14">
<image src="@/static/images/page-sub/realname/realname-name.png" class="w-20 h-20" />
<view class="ml-8">真实姓名</view>
<input
class="flex-1 text-right text-14"
placeholder-class=" text-#889BC6 text-right"
type="text"
placeholder="请输入真实姓名"
v-model="form.realname"
/>
</view>
<view class="flex items-center py-15 text-14">
<image src="@/static/images/page-sub/realname/realname-number.png" class="w-20 h-20" />
<view class="ml-8">身份证号</view>
<input
class="flex-1 text-right text-14"
placeholder-class=" text-#889BC6 text-right"
type="text"
placeholder="请输入身份证号"
v-model="form.cardnum"
/>
</view>
</view>
<view class="flex items-center py-15 text-14">
<image src="@/static/images/page-sub/realname/realname-name.png" class="w-20 h-20" />
<view class="ml-8">真实姓名</view>
<input
class="flex-1 text-right text-14"
placeholder-class=" text-#889BC6 text-right"
type="text"
placeholder="请输入真实姓名"
v-model="form.name"
<view class="fixed bottom-0 left-0 right-0 pb-safe">
<button class="btn-gradient text-white rounded-full m-15 text-16" @click="onSubmit">
提交
</button>
</view>
</template>
<view v-else class="flex flex-col items-center">
<template v-if="Number(realnameInfo.status) === 1">
<image
src="@/static/images/page-sub/realname/realname-checking.png"
class="w-150 mx-auto h-150 block"
mode="aspectFit"
/>
</view>
<view class="flex items-center py-15 text-14">
<image src="@/static/images/page-sub/realname/realname-number.png" class="w-20 h-20" />
<view class="ml-8">身份证号</view>
<input
class="flex-1 text-right text-14"
placeholder-class=" text-#889BC6 text-right"
type="text"
placeholder="请输入身份证号"
v-model="form.idCard"
<view class="text-center mt-15 text-14 text-#999">您的实名认证正在审核中请耐心等待</view>
<button class="btn-gradient px-30 text-white rounded-full m-15 text-16" @click="onBack">
返回
</button>
</template>
<template v-else-if="Number(realnameInfo.status) === 2">
<image
src="@/static/images/page-sub/realname/realname-success.png"
class="w-150 h-150 block"
mode="aspectFit"
/>
</view>
</view>
<view class="fixed bottom-0 left-0 right-0 pb-safe">
<button class="btn-gradient text-white rounded-full m-15 text-16" @click="onAddType">
提交
</button>
</view>
<view class="flex flex-col items-center" v-if="false">
<image
src="@/static/images/page-sub/realname/realname-success.png"
class="w-150 h-150 block"
mode="aspectFit"
/>
<view class="text-center mt-15 text-14 text-#999">恭喜您实名认证成功</view>
<button class="btn-gradient px-30 text-white rounded-full m-15 text-16" @click="onBack">
返回
</button>
<image
src="@/static/images/page-sub/realname/realname-fail.png"
class="w-150 h-150 block"
mode="aspectFit"
/>
<view class="text-center mt-15 text-14 text-#999">您的实名认证正在审核中请耐心等待</view>
<button class="btn-gradient px-30 text-white rounded-full m-15 text-16" @click="onBack">
返回
</button>
<image
src="@/static/images/page-sub/realname/realname-checking.png"
class="w-150 h-150 block"
mode="aspectFit"
/>
<view class="text-center mt-15 text-14 text-#999">您的实名认证审核未通过请重新提交</view>
<button class="btn-gradient px-30 text-white rounded-full m-15 text-16">重新提交</button>
<view class="text-center mt-15 text-14 text-#999">恭喜您实名认证成功</view>
<button class="btn-gradient px-30 text-white rounded-full m-15 text-16" @click="onBack">
返回
</button>
</template>
<template v-else>
<image
src="@/static/images/page-sub/realname/realname-checking.png"
class="w-150 h-150 block"
mode="aspectFit"
/>
<view class="text-center mt-15 text-14 text-#999">您的实名认证审核未通过请重新提交</view>
<button
@click="() => (realnameInfo = null)"
class="btn-gradient px-30 text-white rounded-full m-15 text-16"
>
重新提交
</button>
</template>
</view>
</view>
</template>
<script setup lang="ts">
import { getRealNameAuthAPI, realNameAuthAPI } from '@/service'
import { useUserStore } from '@/store'
import { showModal } from '@/utils'
import { ref } from 'vue'
const form = ref({
type: '',
realname: '',
cardnum: '',
})
const onBack = () => {
uni.navigateBack()
}
const onSubmit = async () => {
if (!form.value.realname || !form.value.cardnum) {
await showModal('请填写完整信息')
return
}
await realNameAuthAPI(form.value)
await showModal('提交成功,请耐心等待审核!')
realnameInfo.value = await getRealNameAuthAPI().then((res) => {
return res.data
})
}
const realnameInfo = ref(null)
onLoad(async () => {
realnameInfo.value = await getRealNameAuthAPI().then((res) => {
return res.data
})
})
</script>
<style lang="scss" scoped>
.withdrawal-type-edit-page {
+35 -14
View File
@@ -22,8 +22,8 @@
mode="aspectFit"
/>
<view class="flex flex-col">
<view class="text-14 text-#6784C7">看看人数</view>
<view class="text-35 font-bold text-#476FFF mt-10 leading-35">1234</view>
<view class="text-14 text-#6784C7">邀请人数</view>
<view class="text-35 font-bold text-#476FFF mt-10 leading-35">{{ totalCount }}</view>
</view>
</view>
<image
@@ -45,25 +45,24 @@
<view class="text-14 mt-10 text-center">{{ item.title }}</view>
</view>
</view>
<view class="mt-25 bg-white rounded-10 w-345 mx-auto">
<view class="flex p-15 items-center" v-for="item in 10" :key="item">
<Avatar class="w-40 h-40" />
<view class="mt-25 bg-white rounded-10 w-345 mx-auto" v-if="list.length">
<view class="flex p-15 items-center" v-for="item in list" :key="item">
<Avatar class="w-40 h-40" :src="item.avatar" />
<view class="flex-1 flex flex-col ml-15">
<view class="text-14 text-#333">用户名</view>
<view class="text-12 mt-10 text-#999">1234567890</view>
<view class="text-12 mt-10 text-#999">2024-12-27 12:00:00</view>
<view class="text-14 text-#333">{{ item.nickname }}</view>
<view class="text-12 mt-10 text-#999">{{ item.username }}</view>
<view class="text-12 mt-10 text-#999">{{ item.jointime }}</view>
</view>
<!-- <view class="bg-#71C78A80 text-white text-12 rounded-10 px-10 py-5">邀请成功</view> -->
<view class="text-14 font-bold text-#FF5F5F">+20 </view>
<view class="text-14 font-bold text-#FF5F5F">+{{ item.score }} </view>
</view>
</view>
<view class="mt-25 bg-white rounded-10 w-345 mx-auto p-15" v-else>
<wd-status-tip image="content" tip="暂无内容" />
</view>
<wd-action-sheet v-model="showRule" title="邀请奖励规则">
<view class="text-16 text-#333 p-15">
<view class="mb-10">1.每邀请一人可以获得1万投资金2000数字人民币 1点认购点</view>
<view class="mb-10">2.邀请满5人可以额外获得5万投资金1万数字人民币 5点认购点</view>
<view class="mb-10">3.邀请满10人可以额外获得10万投资金2万数字人民币 10点认购点</view>
<view class="mb-10">4.邀请满20人可以额外获得20万投资金5万数字人民币 20点认购点</view>
<view class="mb-10">5.邀请满50人可以额外获得50万投资金10万数字人民币 50点认购点</view>
<view class="mb-10 text-center">每邀请一人可以获得20股马尔代夫股权</view>
</view>
</wd-action-sheet>
</view>
@@ -72,6 +71,7 @@
<script setup lang="ts">
import Avatar from '@/components/Avatar.vue'
import NavBar from '@/components/NavBar.vue'
import { getMyTeamAPI, getMyTeamApi } from '@/service'
import Level1 from '@/static/images/page-sub/team/level-1.png'
import Level2 from '@/static/images/page-sub/team/level-2.png'
import Level3 from '@/static/images/page-sub/team/level-3.png'
@@ -87,16 +87,37 @@ const levelList = ref([
{
title: '一级用户',
icon: Level1,
level: 1,
},
{
title: '二级用户',
icon: Level2,
level: 2,
},
{
title: '三级用户',
icon: Level3,
level: 3,
},
])
const totalCount = ref(0)
const { list, onReload } = useListPageRequest((...rest) => {
return getMyTeamAPI(...rest).then((res) => {
totalCount.value = (res.data as any).num
res.data.data = res.data.list
return res.data
})
})
watch(
() => unref(levelList)[currentLevelIndex.value].level,
(level) => {
onReload({
level,
})
},
)
</script>
<style lang="scss" scoped>
+45 -7
View File
@@ -10,20 +10,58 @@
<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 10"
:key="item"
v-for="item in list"
:key="item.id"
>
<image src="/static/images/invest/unionpay-icon.png" class="w-32 h-32 self-center" />
<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">银行卡</view>
<view class="text-14 text-#333">{{ item.typedata }}</view>
<view class="text-12 text-#999">提现</view>
<view class="text-12 text-#999">2024-12-27 10:00:00</view>
<view class="text-12 text-#999">{{ item.createtime }}</view>
</view>
<view class="flex flex-col items-end">
<view class="text-16 text-#FF5F5F">-1000 RMB</view>
<view class="text-14 mt-18 py-4 px-10 bg-#71C78A1A text-#71C78A">提现成功</view>
<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>
<script setup lang="ts">
import { getWithdrawalRecordAPI } from '@/service'
const { list } = useListPageRequest(getWithdrawalRecordAPI)
</script>
+58 -26
View File
@@ -1,4 +1,4 @@
<route lang="json5">
<route lang="json5" type="page">
{
style: {
navigationBarTitleText: '编辑收款方式',
@@ -18,42 +18,42 @@
custom-value-class="text-14 text-#889BC6 text-right"
class="flex-1"
placeholder="请选择收款类型"
v-model="form.type"
v-model="form.typedata"
:columns="columns"
@change="handleChange"
></wd-select-picker>
</view>
<view class="flex items-center py-15 text-14">
<view class="flex items-center py-15 text-14" v-if="form.typedata === 3">
<view>开户行</view>
<input
class="flex-1 text-right text-14"
placeholder-class=" text-#889BC6 text-right"
type="text"
placeholder="请输入开户行"
v-model="form.bank"
v-model="form.kaihuhang"
/>
</view>
<view class="flex items-center py-15 text-14">
<view>持卡人姓名</view>
<view>{{ typeName }}账号</view>
<input
class="flex-1 text-right text-14"
placeholder-class=" text-#889BC6 text-right"
type="text"
placeholder="请输入持卡人姓名"
:placeholder="`请输入${typeName}账号`"
v-model="form.banknum"
/>
</view>
<view class="flex items-center py-15 text-14">
<view>{{ form.typedata === 3 ? '持卡人' : '' }}姓名</view>
<input
class="flex-1 text-right text-14"
placeholder-class=" text-#889BC6 text-right"
type="text"
:placeholder="`请输入${form.typedata === 3 ? '持卡人' : ''}姓名`"
v-model="form.name"
/>
</view>
<view class="flex items-center py-15 text-14">
<view>银行账号</view>
<input
class="flex-1 text-right text-14"
placeholder-class=" text-#889BC6 text-right"
type="text"
placeholder="请输入银行账号"
v-model="form.account"
/>
</view>
<view class="flex items-center py-15 text-14">
<!-- <view class="flex items-center py-15 text-14">
<view>备注</view>
<input
class="flex-1 text-right text-14"
@@ -62,7 +62,7 @@
placeholder="请输入备注"
v-model="form.remark"
/>
</view>
</view> -->
</view>
<view class="fixed bottom-0 left-0 right-0 pb-safe">
<button class="btn-gradient text-white rounded-full m-15 text-16" @click="onAddType">
@@ -73,29 +73,61 @@
</template>
<script setup lang="ts">
import { addBankCardAPI } from '@/service'
import { mergeStep, showModal } from '@/utils'
import { ref } from 'vue'
const form = ref({
type: '',
typedata: 1,
kaihuhang: '',
name: '',
banknum: '',
})
const columns = [
{
label: '支付宝',
value: '1',
value: 1,
},
{
label: '微信',
value: '2',
value: 2,
},
{
label: '银行卡',
value: '3',
value: 3,
},
]
const handleChange = (value: string) => {
console.log(value)
}
const typeName = computed(() => {
return ['支付宝', '微信', '银行卡'][Number(form.value.typedata) - 1]
})
const onAddType = mergeStep(async () => {
if (form.value.typedata === 3) {
if (!form.value.kaihuhang) {
return uni.showToast({
title: '请输入开户行',
icon: 'none',
})
}
}
if (!form.value.banknum) {
return uni.showToast({
title: '请输入账号',
icon: 'none',
})
}
if (!form.value.name) {
return uni.showToast({
title: '请输入姓名',
icon: 'none',
})
}
await addBankCardAPI(form.value)
await showModal('添加成功')
uni.navigateBack()
})
</script>
<style lang="scss" scoped>
.withdrawal-type-edit-page {
+72 -20
View File
@@ -1,4 +1,4 @@
<route lang="json5">
<route lang="json5" type="page">
{
style: {
navigationBarTitleText: '收款方式',
@@ -9,19 +9,48 @@
<template>
<view class="withdrawal-type-page min-h-screen pb-100">
<view
class="flex items-center justify-between py-15 text-14 shadow-[0_0_10px_rgba(10,68,245,0.1)] rounded-10 m-15 p-15"
v-for="item in 10"
:key="item"
@click="onSelectType(item)"
>
<image class="w-45 h-45" src="@/static/images/invest/alipay-icon.png" mode="aspectFit" />
<view class="flex-1 ml-15">
<view class="text-16 font-bold">支付宝</view>
<view class="mt-10 text-14 text-#889BC6">132****113</view>
</view>
<wd-icon name="arrow-right" size="14px"></wd-icon>
</view>
<template v-if="list.length > 0">
<wd-swipe-action v-for="item in list" :key="item.id">
<view
class="flex items-center justify-between py-15 text-14 shadow-[0_0_10px_rgba(10,68,245,0.1)] rounded-10 m-15 p-15"
@click="onSelectType(item)"
>
<image
v-if="Number(item.typedata) === 3"
class="w-45 h-45"
src="@/static/images/invest/unionpay-icon.png"
mode="aspectFit"
/>
<image
v-if="Number(item.typedata) === 1"
class="w-45 h-45"
src="@/static/images/invest/alipay-icon.png"
mode="aspectFit"
/>
<image
v-if="Number(item.typedata) === 2"
class="w-45 h-45"
src="@/static/images/invest/wechat-icon.png"
mode="aspectFit"
/>
<view class="flex-1 ml-15">
<view class="text-16 font-bold">
{{ ['支付宝', '微信', '银行卡'][Number(item.typedata) - 1] }}
</view>
<view class="mt-10 text-14 text-#889BC6">{{ item.banknum }}</view>
</view>
<wd-icon v-if="isSelect" name="arrow-right" size="14px"></wd-icon>
</view>
<template #right>
<view class="h-full flex items-center text-14 text-#889BC6">
<wd-button plain @click="onDelete(item)">删除</wd-button>
</view>
</template>
</wd-swipe-action>
</template>
<template v-else>
<wd-status-tip image="content" tip="暂无内容" />
</template>
<view class="fixed bottom-0 left-0 right-0 pb-safe">
<button class="text-16 btn-gradient text-white rounded-full m-15" @click="onAddType">
添加收款方式
@@ -31,23 +60,25 @@
</template>
<script setup lang="ts">
import { deleteBankCardAPI, getBankCardAPI } from '@/service'
import { showModal } from '@/utils'
import { onLoad } from '@dcloudio/uni-app'
let isSelect = false
const isSelect = ref(false)
onLoad((options) => {
if (options.type === 'select') {
isSelect = true
isSelect.value = true
}
})
const onSelectType = (item) => {
if (isSelect) {
if (isSelect.value) {
uni.$emit('withdrawal-type', item)
uni.navigateBack()
} else {
uni.navigateTo({
url: '/pages-sub/withdrawal-type/edit?id=1',
})
// uni.navigateTo({
// url: '/pages-sub/withdrawal-type/edit?id=1',
// })
}
}
@@ -56,4 +87,25 @@ const onAddType = () => {
url: '/pages-sub/withdrawal-type/edit',
})
}
const onDelete = async (item) => {
await showModal('确认删除?')
await deleteBankCardAPI({
id: item.id,
})
await showModal('删除成功')
loadData()
}
const loadData = async () => {
list.value = (await getBankCardAPI({
limit: 1000,
page: 1,
}).then((res) => res.data)) as any
}
const list = ref([])
onShow(async () => {
loadData()
})
</script>
+60 -10
View File
@@ -23,10 +23,17 @@
<view
class="flex items-center text-14 mt-15 text-#333 p-16 shadow-[0_0_10px_rgba(10,68,245,0.1)] rounded-10"
>
<input type="number" placeholder="请输入提现金额" class="text-14 text-#333 flex-1" />
<view class="text-12 text-#04A9F9">全部</view>
<input
v-model="form.money"
type="number"
placeholder="请输入提现金额"
class="text-14 text-#333 flex-1"
/>
<view class="text-12 text-#04A9F9" @click="form.money = userStore.userInfo.money">
全部
</view>
</view>
<view class="text-12 text-#889BC6 mt-15">当前余额10012.12</view>
<view class="text-12 text-#889BC6 mt-15">当前余额{{ userStore.userInfo.money }}</view>
</view>
<view class="mt-50">
@@ -35,7 +42,9 @@
class="flex items-center text-14 mt-15 text-#333 p-16 shadow-[0_0_10px_rgba(10,68,245,0.1)] rounded-10"
@click="onSelectPayType"
>
<view class="flex-1">请选择收款方式</view>
<view class="flex-1">
{{ typeName ? `${typeName}${currentBank?.card_account}` : '请选择收款方式' }}
</view>
<wd-icon name="arrow-right" size="16px"></wd-icon>
</view>
</view>
@@ -43,7 +52,12 @@
<view class="mt-50">
<view class="text-14 text-#333">交易密码</view>
<view class="text-14 mt-15 text-#333 p-16 shadow-[0_0_10px_rgba(10,68,245,0.1)] rounded-10">
<input type="password" placeholder="请输入交易密码" class="text-14 text-#333" />
<input
v-model="form.tpassword"
type="password"
placeholder="请输入交易密码"
class="text-14 text-#333"
/>
</view>
</view>
</view>
@@ -65,6 +79,17 @@
<script setup lang="ts">
import NavBar from '@/components/NavBar.vue'
import { submitWithdrawalAPI } from '@/service'
import { useUserStore } from '@/store'
import { showModal } from '@/utils'
const userStore = useUserStore()
const form = ref({
money: '',
bankid: '6',
tpassword: '',
})
const onWithdrawalDetail = () => {
uni.navigateTo({
@@ -72,19 +97,44 @@ const onWithdrawalDetail = () => {
})
}
const typeName = computed(() => {
return ['支付宝', '微信', '银行卡'][Number(unref(currentBank)?.card_type) - 1]
})
const currentBank = ref<any>(null)
const onSelectPayType = () => {
uni.$once('withdrawal-type', (data: any) => {
console.log(data)
form.value.bankid = data.id
currentBank.value = data
})
uni.navigateTo({
url: '/pages-sub/withdrawal-type/index?type=select',
})
}
const onSubmit = () => {
uni.redirectTo({
url: '/pages-sub/invest-result/index',
})
const onSubmit = async () => {
if (!form.value.money) {
return uni.showToast({
title: '请输入提现金额',
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('提交成功')
onWithdrawalDetail()
}
</script>