```feat(user): 添加导航至充值页面的按钮

用户余额页面现在包含一个“充值”按钮,点击后将导向充值页面,以提升用户交互体验。
```
master
wxy 2024-08-25 11:52:08 +08:00
parent 2cbe023108
commit 95b3db2f10
1 changed files with 4 additions and 1 deletions

View File

@ -3,11 +3,11 @@
<el-card style="margin-top: 50px;">
<h1>用户余额</h1>
<p>余额{{ userBalanceData.userBalance || '加载中...' }}</p>
<el-button type="primary" @click="navigateToRecharge"></el-button>
</el-card>
</div>
</template>
<script>
import { userBalance } from "@/api/system/user"; // userBalance@/api/money
@ -23,6 +23,9 @@ export default {
this.fetchUserBalance();
},
methods: {
navigateToRecharge() {
this.$router.push('/money/zfb');
},
async fetchUserBalance() {
try {
const userId = localStorage.getItem('userId');