提现功能需要添加
This commit is contained in:
@@ -1,26 +1,38 @@
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { navigateTo } from '@/utils/router'
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
import { getUserPayPwd } from '@/api/my-index'
|
||||
import { useAuthUser } from '@/composables/useAuthUser'
|
||||
|
||||
const itemList = [
|
||||
{
|
||||
title: '提现卡',
|
||||
key: '1',
|
||||
url: '/pages/my-index/wallet/bank-card/index'
|
||||
},
|
||||
{ title: '交易记录', key: '2', url: '' },
|
||||
{
|
||||
title: '修改支付密码',
|
||||
key: '3',
|
||||
url: '/pages/my-index/wallet/edit-password'
|
||||
},
|
||||
{ title: '实名认证', key: '4', url: '/pages/my-index/wallet/real-id' }
|
||||
]
|
||||
const { userInfo } = useAuthUser()
|
||||
|
||||
const itemList = ref([])
|
||||
|
||||
const getData = async () => {
|
||||
itemList.value = []
|
||||
const res = await getUserPayPwd()
|
||||
console.log(res, '===')
|
||||
const isSetPayPwd = res?.data ? '修改支付密码' : '设置支付密码'
|
||||
|
||||
itemList.value = [
|
||||
{
|
||||
title: '提现卡',
|
||||
key: '1',
|
||||
url: '/pages/my-index/wallet/bank-card/index'
|
||||
},
|
||||
{ title: '交易记录', key: '2', url: '' },
|
||||
{
|
||||
title: isSetPayPwd,
|
||||
key: '3',
|
||||
isType: !!res?.data,
|
||||
url: '/pages/my-index/wallet/edit-password'
|
||||
},
|
||||
{
|
||||
title: '实名认证',
|
||||
key: '4',
|
||||
url: '/pages/my-index/wallet/real-id'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
onShow(() => {
|
||||
@@ -34,7 +46,7 @@
|
||||
<view class="top-card">
|
||||
<view class="left-box">
|
||||
<text>我的资产</text>
|
||||
<text>1222</text>
|
||||
<text>{{ userInfo?.totalPoints }}</text>
|
||||
</view>
|
||||
<view class="right-box">
|
||||
<button>充值</button>
|
||||
@@ -46,7 +58,13 @@
|
||||
v-for="(item, index) in itemList"
|
||||
:key="index"
|
||||
class="public-card"
|
||||
@click="item.url && navigateTo(item.url)"
|
||||
@click="
|
||||
item.url &&
|
||||
navigateTo(
|
||||
item.url,
|
||||
item.key === '3' ? { type: item.isType ? 1 : 0 } : null
|
||||
)
|
||||
"
|
||||
>
|
||||
<view class="left-box">
|
||||
<text>{{ item.title }}</text>
|
||||
|
||||
Reference in New Issue
Block a user