feat: 对接完接口
This commit is contained in:
+52
-16
@@ -1,4 +1,4 @@
|
||||
<route lang="json5">
|
||||
<route lang="json5" type="page">
|
||||
{
|
||||
style: {
|
||||
navigationStyle: 'custom',
|
||||
@@ -11,17 +11,21 @@
|
||||
<view class="my-page">
|
||||
<NavBar />
|
||||
<view class="flex flex-col items-center justify-center mt-30">
|
||||
<Avatar class="w-80 h-80 mx-auto" />
|
||||
<view class="text-16 mt-10">默认用户</view>
|
||||
<view class="text-12 mt-8">手机号:199****654</view>
|
||||
<Avatar
|
||||
class="w-80 h-80 mx-auto"
|
||||
:src="userStore.userInfo?.member_portrait"
|
||||
@click="uploadAvatar"
|
||||
/>
|
||||
<view class="text-16 mt-10">{{ userStore.userInfo?.member_username }}</view>
|
||||
<!-- <view class="text-12 mt-8">账号:{{ userStore.userInfo?.member_username }}</view> -->
|
||||
</view>
|
||||
<view class="flex justify-center text-center mt-15">
|
||||
<view class="">
|
||||
<view class="text-30 font-bold">1002</view>
|
||||
<view class="text-30 font-bold">{{ userStore.userInfo?.member_dividend }}</view>
|
||||
<view class="text-14 mt-10 text-#3B81F3">我的分红</view>
|
||||
</view>
|
||||
<view class="ml-30">
|
||||
<view class="text-30 font-bold">1231.23</view>
|
||||
<view class="text-30 font-bold">{{ userStore.userInfo?.member_currency }}</view>
|
||||
<view class="text-14 mt-10 text-#3B81F3">数字人民币</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -38,15 +42,26 @@
|
||||
提现
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
<!-- <view
|
||||
class="ml-10 flex py-30 justify-center items-center rounded-tl-10 rounded-br-10 flex-1 bg-[linear-gradient(180deg,#D9EBFF,#9EDAFF)] border-1 border-#5FAEFF80 border-solid"
|
||||
@click="handleWithdrawalDetail"
|
||||
@click="handleWithdrawalRecord"
|
||||
>
|
||||
<image class="w-40 h-40" src="@/static/images/my/top-up.png" mode="aspectFit" />
|
||||
<view
|
||||
class="text-white text-14 px-15 py-5 ml-15 rounded-full bg-[linear-gradient(45deg,#3B81F3_0%,#37E6EC_100%)]"
|
||||
>
|
||||
提现明细
|
||||
提现记录
|
||||
</view>
|
||||
</view> -->
|
||||
<view
|
||||
class="ml-10 flex py-30 justify-center items-center rounded-tl-10 rounded-br-10 flex-1 bg-[linear-gradient(180deg,#D9EBFF,#9EDAFF)] border-1 border-#5FAEFF80 border-solid"
|
||||
@click="handleRecharge"
|
||||
>
|
||||
<image class="w-40 h-40" src="@/static/images/my/top-up.png" mode="aspectFit" />
|
||||
<view
|
||||
class="text-white text-14 px-15 py-5 ml-15 rounded-full bg-[linear-gradient(45deg,#3B81F3_0%,#37E6EC_100%)]"
|
||||
>
|
||||
充值
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -55,7 +70,7 @@
|
||||
class="w-330 h-123 mx-auto mt-15 block"
|
||||
src="@/static/images/my/recommend.png"
|
||||
mode="aspectFill"
|
||||
@click="handleInvite"
|
||||
@click="handlePurchaseMember"
|
||||
/>
|
||||
|
||||
<view class="mt-15 grid grid-cols-2 gap-10 p-15">
|
||||
@@ -103,19 +118,21 @@
|
||||
import Avatar from '@/components/Avatar.vue'
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import { loginRoute } from '@/interceptors/route'
|
||||
import { logoutAPI, updateUserAPI } from '@/service'
|
||||
import { useUserStore } from '@/store/user'
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
const handleLogout = () => {
|
||||
userStore.clearUserInfo()
|
||||
const handleLogout = async () => {
|
||||
logoutAPI()
|
||||
userStore.logout()
|
||||
uni.reLaunch({
|
||||
url: loginRoute,
|
||||
})
|
||||
}
|
||||
const handleWithdrawalDetail = () => {
|
||||
const handleRecharge = () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages-sub/withdrawal-detail/index',
|
||||
url: '/pages-sub/recharge/index',
|
||||
})
|
||||
}
|
||||
|
||||
@@ -149,11 +166,30 @@ const handleBankCard = () => {
|
||||
})
|
||||
}
|
||||
|
||||
const handleInvite = () => {
|
||||
const handlePurchaseMember = () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages-sub/invite/index',
|
||||
url: '/pages-sub/purchase-member/index',
|
||||
})
|
||||
}
|
||||
|
||||
const handleWithdrawalRecord = () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages-sub/withdrawal-detail/index',
|
||||
})
|
||||
}
|
||||
|
||||
const { data, run } = useUpload<any>()
|
||||
const uploadAvatar = () => {
|
||||
run()
|
||||
}
|
||||
|
||||
watch(data, async (newVal) => {
|
||||
const path = JSON.parse(newVal)?.data?.path
|
||||
await updateUserAPI({
|
||||
member_portrait: path,
|
||||
})
|
||||
userStore.loadUserInfo()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user