|
@@ -2,38 +2,32 @@
|
|
|
|
|
|
<template>
|
|
|
<div class="recharge-record__wrap">
|
|
|
- <div class="user-account__wrap">
|
|
|
- <div class="title-bar">
|
|
|
- <text class="border-bar"></text>
|
|
|
- <text class="title">账户信息</text>
|
|
|
- </div>
|
|
|
- <div class="balance-bar">
|
|
|
- <div class="balance">
|
|
|
- <text>余额:</text>
|
|
|
- <text class="balance-number">{{user.balance}}</text>
|
|
|
- <text>书币</text>
|
|
|
- </div>
|
|
|
- <text class="pay-btn" @click="toPay">立即充值</text>
|
|
|
+ <div class="user-account__wrap" if="{{user}}">
|
|
|
+ <div class="account-blance">
|
|
|
+ <text class="blance-title">余额</text>
|
|
|
+ <text class="blance-info">{{user.balance}}书币</text>
|
|
|
</div>
|
|
|
+ <text class="account-pay" @click="toPay">
|
|
|
+ 去充值
|
|
|
+ </text>
|
|
|
</div>
|
|
|
- <div class="user-account__wrap recharge-list__wrap">
|
|
|
+
|
|
|
+ <div class=" recharge-list__wrap">
|
|
|
<div class="title-bar">
|
|
|
- <text class="border-bar"></text>
|
|
|
<text class="title">充值订单</text>
|
|
|
</div>
|
|
|
<div class="recharge-list">
|
|
|
<block for="{{rechargeList}}">
|
|
|
<div class="recharge-item">
|
|
|
<div class="item-info">
|
|
|
- <text class="item-name">订单号:</text>
|
|
|
- <text class="item-number">{{$item.trade_no}}</text>
|
|
|
+ <text class="item-number">订单号:{{$item.trade_no}}</text>
|
|
|
<div class="item-pay">
|
|
|
<text>充值</text>
|
|
|
<text class="pay-number">{{$item.price}}</text>
|
|
|
<text>元</text>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <text class="item-status">{{$item.status==='UNPAID'?'未支付':'已支付'}}</text>
|
|
|
+ <text class="item-status {{$item.status==='UNPAID'?'':'paid'}}">{{$item.status==='UNPAID'?'未支付':'已支付'}}</text>
|
|
|
</div>
|
|
|
</block>
|
|
|
</div>
|
|
@@ -48,10 +42,10 @@ import { rechargeApi, getUserInfo } from "../../api/index";
|
|
|
export default {
|
|
|
private: {
|
|
|
rechargeList: [],
|
|
|
- user:{},
|
|
|
- page:{
|
|
|
- total:0,
|
|
|
- current:1
|
|
|
+ user: {},
|
|
|
+ page: {
|
|
|
+ total: 0,
|
|
|
+ current: 1
|
|
|
},
|
|
|
user: {},
|
|
|
},
|
|
@@ -59,17 +53,18 @@ export default {
|
|
|
this.getOrder();
|
|
|
this.getUserInfo();
|
|
|
},
|
|
|
- async getUserInfo(){
|
|
|
- let user =await getUserInfo();
|
|
|
- this.user=user;
|
|
|
+ async getUserInfo() {
|
|
|
+ let user = await getUserInfo();
|
|
|
+ this.user = user;
|
|
|
+ console.log(this.user, 'rrrrrrrrrrr')
|
|
|
},
|
|
|
- async getOrder(page=1,page_size=10) {
|
|
|
- let res= await rechargeApi({page:page,page_size});
|
|
|
- let {list,meta}=res;
|
|
|
- this.rechargeList=list;
|
|
|
- this.page={
|
|
|
- total:meta.last_page,
|
|
|
- current:meta.current_page
|
|
|
+ async getOrder(page = 1, page_size = 10) {
|
|
|
+ let res = await rechargeApi({ page: page, page_size });
|
|
|
+ let { list, meta } = res;
|
|
|
+ this.rechargeList = list;
|
|
|
+ this.page = {
|
|
|
+ total: meta.last_page,
|
|
|
+ current: meta.current_page
|
|
|
}
|
|
|
},
|
|
|
toPay() {
|