充值页面

This commit is contained in:
2025-11-24 17:56:34 +08:00
parent b357225703
commit a63bd684b5
3 changed files with 386 additions and 297 deletions

View File

@@ -215,3 +215,31 @@ export async function verifyIAP(data: any) {
}) })
return res return res
} }
/**
* 获取充值列表
* @param type 固定值 point
* @param qudao 支付类型
*/
export async function getBookBuyConfigList(type: string, qudao: string) {
const res = await mainClient.request<IApiResponse>({
url: 'common/bookBuyConfig/getBookBuyConfigList',
method: 'POST',
data: {type, qudao}
})
return res
}
/**
* 获取隐私协议
* @param id 101众妙之门隐私政策
*/
export async function getAgreement(id: string) {
console.log(id, 'id');
const res = await mainClient.request<IApiResponse>({
url: '/sys/agreement/getAgreement',
method: 'POST',
data: {id}
})
return res
}

View File

@@ -67,6 +67,18 @@
"navigationBarTitleText": "%user.feedback%", "navigationBarTitleText": "%user.feedback%",
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, {
"path": "pages/user/recharge/index",
"style": {
"navigationBarTitleText": "%user.recharge%",
"navigationStyle": "custom"
}
},{
"path": "pages/user/virtual/index",
"style": {
"navigationBarTitleText": "%user.virtual%",
"navigationStyle": "custom"
}
}, { }, {
"path": "pages/user/myBook/index", "path": "pages/user/myBook/index",
"style": { "style": {

View File

@@ -9,11 +9,7 @@
<!-- 用户信息区域 --> <!-- 用户信息区域 -->
<view class="user-info-section"> <view class="user-info-section">
<view class="user-info"> <view class="user-info">
<image <image :src="userInfo.avatar || defaultAvatar" class="avatar" @click="goProfile" />
:src="userInfo.avatar || defaultAvatar"
class="avatar"
@click="goProfile"
/>
<view class="user-details"> <view class="user-details">
<text class="nickname">{{ userInfo.nickname || $t('user.notSet') }}</text> <text class="nickname">{{ userInfo.nickname || $t('user.notSet') }}</text>
<text v-if="userInfo.email" class="email">{{ userInfo.email }}</text> <text v-if="userInfo.email" class="email">{{ userInfo.email }}</text>
@@ -46,7 +42,21 @@
<!-- 我的资产 --> <!-- 我的资产 -->
<view class="vip-card-section wallet-section"> <view class="vip-card-section wallet-section">
<view class="vip-card wallet_l"> <view class="vip-card wallet_l">
我的资产功能重写中 <view class="assets">
<view @click="goVirtualList">
<view class="assets_row">天医币</view>
<view>{{userInfo.peanutCoin ?? 1}}</view>
</view>
<view>
<view class="assets_row">积分</view>
<view>{{userInfo.jf ?? 1}}</view>
</view>
<view>
<view class="assets_row">优惠卷</view>
<view>0</view>
</view>
</view>
<view class="chong_btn" @click="goRecharge"> </view>
<!-- <text class="wallet_title">{{$t('my.coin')}}<uni-icons type="help" size="19" color="#666"></uni-icons></text> <!-- <text class="wallet_title">{{$t('my.coin')}}<uni-icons type="help" size="19" color="#666"></uni-icons></text>
<text class="wallet_count">{{userMes.peanutCoin}}</text> --> <text class="wallet_count">{{userMes.peanutCoin}}</text> -->
</view> </view>
@@ -55,12 +65,7 @@
<!-- 功能菜单列表 --> <!-- 功能菜单列表 -->
<view class="menu-section"> <view class="menu-section">
<view class="menu-list"> <view class="menu-list">
<view <view v-for="item in menuItems" :key="item.id" class="menu-item" @click="handleMenuClick(item)">
v-for="item in menuItems"
:key="item.id"
class="menu-item"
@click="handleMenuClick(item)"
>
<text class="menu-text">{{ item.name }}</text> <text class="menu-text">{{ item.name }}</text>
<wd-icon name="arrow-right" size="16px" color="#aaa" /> <wd-icon name="arrow-right" size="16px" color="#aaa" />
</view> </view>
@@ -145,6 +150,7 @@ const getData = async () => {
try { try {
// 获取用户信息 // 获取用户信息
const userRes = await getUserInfo() const userRes = await getUserInfo()
console.log(userRes);
if (userRes.user) { if (userRes.user) {
userStore.setUserInfo(userRes.user) userStore.setUserInfo(userRes.user)
} }
@@ -204,6 +210,26 @@ const handleMenuClick = (item: any) => {
} }
} }
/**
* 跳转充值页面
*/
const goRecharge = () => {
uni.navigateTo({
url: '/pages/user/recharge/index'
})
}
/**
* 跳转虚拟币页面
*/
const goVirtualList = () => {
uni.navigateTo({
url: '/pages/user/virtual/index'
})
}
onMounted(() => { onMounted(() => {
getPlatform() getPlatform()
getData() getData()
@@ -340,4 +366,27 @@ $theme-color: #54a966;
line-height: 40rpx; line-height: 40rpx;
} }
} }
.chong_btn {
font-size: 26rpx;
display: block;
border-radius: 50rpx;
color: #fffbf6;
padding: 10rpx 32rpx;
background-image: linear-gradient(90deg, #3ab3ae 0%, #d5ecdd 200%);
}
.assets {
display: flex;
flex: 1;
justify-content: space-around;
text-align: center;
transform:translateX(-20px);
.assets_row {
margin-bottom: 20rpx;
}
}
</style> </style>