123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253 |
- <template>
- <view>
- <ujp-navbar title="我的余额">
- <view class="slot-wrap">
- <span class="navBtn oldTextjp2" oldstyle="font-size: 16px;" @click="toRefundList">退余额</span>
- </view>
- </ujp-navbar>
- <view class="balance">
- <view class="balanceHead">
- <view class="balanceCard">
- <view class="balanceCard-head">
- <font>总金额</font><u-icon name="question-line" custom-prefix="custom-icon" color="#fff" size="32" @click="show=true"></u-icon>
- </view>
- <view>
- <u-modal v-model="show" :confirm-text="confirmText" confirm-color="#00B962">
- <view class="slot-content">
- <rich-text :nodes="content"></rich-text>
- </view>
- </u-modal>
- </view>
- <view class="balanceCard-main oldTextjp2" oldstyle="font-size: 16px;">
- <h2 v-if="personAccount.availableAmount != null">{{personAccount.availableAmount.toFixed(2)}}元</h2>
- <view class="balanceCard-btn" @click="rechargeNow">立即充值</view>
- </view>
- <view class="balanceCard-foot oldTextjp2" oldstyle="font-size: 16px;">
- <view class="balanceCard-item" v-if="personAccount.totalAmount != null">可用余额{{personAccount.totalAmount.toFixed(2)}}元</view>
- <view class="balanceCard-item" v-if="personAccount.frozenTotal != null">冻结金额{{personAccount.frozenTotal.toFixed(2)}}元</view>
- </view>
- </view>
- </view>
- <view class="balanceMain">
- <view class="balanceMain-title">
- <view class="title">
- <u-icon name="todo-fill" custom-prefix="custom-icon" color="#6BC6A7" size="40"></u-icon>
- <span class="oldTextjp" oldstyle="font-size: 20px;">充值明细</span>
- </view>
- <view class="more oldTextjp2" oldstyle="font-size: 16px;" @click="seeAll">
- <span>查看全部</span>
- <u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#B3B3B3" size="32"></u-icon>
- </view>
- </view>
- <view class="balanceMain-list" v-if="accountList.length > 0">
- <view class="balanceMain-item" v-for="(item,index) in accountList" :key="item.id" @click="gotoUrl('pages/user/finance/rechargeDet?id=' + item.id)">
- <view class="title">
- <font class="oldTextjp2" oldstyle="font-size: 18px;">{{item.payNameStr}}</font>
- <p class="oldTextjp2" oldstyle="font-size: 14px;">{{item.createTime}}</p>
- </view>
- <h4 class="oldTextjp2" oldstyle="font-size: 24px;">{{item.amount}}元</h4>
- </view>
- </view>
- </view>
- <view class="carNone" v-if="accountList.length == 0">
- <img src="static/img/暂无数据-缺省页.png" alt="">
- <p class="oldTextjp2" oldstyle="font-size: 18px;">本月暂无充值记录</p>
- </view>
- </view>
- </view>
- </template>
- <script>
- import * as userApi from '@/apis/user.js'
- import * as API from '@/apis/index.js'
-
- export default {
- data() {
- return {
- dateMonth: '',
- userId: '',
- show: false,
- confirmText: '知道了',
- content: `总金额=可用余额+冻结金额。使用预付费充电时,在充电过程中会冻结部分金额,充电完成后将剩余金额返还至余额账户,每笔预充金额的冻结时间不超过96小时。`,
- personAccount: {},
- accountList: [],
- elderStatus: false,
- }
- },
- onReady() {
- var date = new Date();
- var year = date.getFullYear();
- var monthN = date.getMonth() + 1;
- if(monthN >= 1 && monthN <= 9) {
- monthN = "0" + monthN;
- }
- this.dateMonth = year + '-' + monthN + '-01';
-
- this.getCarPersonAccount();
- this.getAccountRecordData();
-
- if(this.carhelp.get("getElderModeClass") == "长辈模式") {
- this.elderStatus = true;
- } else {
- this.elderStatus = false;
- }
- },
- methods: {
- toRefundList() {
- uni.navigateTo({
- url: '/pages/user/finance/refundList'
- })
- },
- getAccountRecordData() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- API.accountRecordData({
- queryDate: this.dateMonth
- }).then((res) => {
- uni.hideLoading();
-
- this.accountList = res.data.data;
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- getCarPersonAccount() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- userApi.carPersonAccount().then((res) => {
- uni.hideLoading();
-
- this.personAccount = res.data;
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- rechargeNow() {
- uni.navigateTo({
- url: '/pages/user/finance/recharge'
- })
- },
- seeAll() {
- uni.navigateTo({
- url: '/pages/user/finance/rechargeList'
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .slot-content {
- font-size: 28rpx;
- color: $u-content-color;
- padding-left: 30rpx;
- padding-right: 30rpx;
- padding-top: 20px;
- padding-bottom: 20px;
- }
- .slot-wrap{
- flex: 1;
- }
- .navBtn{
- float: right;
- margin-right: 15px;
- color:#3fbd70;
- }
- .carNone{
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- img{
- width: 100%;
- height: 100%;
- }
- p{
- margin-top: -60px;
- }
- }
- .balanceHead{
- background-color: #fff;
- padding: 16px;
- .balanceCard{
- background-color: #00B962;
- border-radius: 12px;
- padding: 16px;
- .balanceCard-head{
- font{
- font-size: 18px;
- color:#fff;
- margin-right: 8px;
- }
- }
- .balanceCard-main{
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-top: 8px;
- h2{
- font-size: 40px;
- color:#fff;
- font-weight: normal;
- }
- .balanceCard-btn{
- padding: 8px 20px;
- background-color: #fff;
- color:#00B962;
- border-radius: 18px;
- }
- }
- .balanceCard-foot{
- display: flex;
- margin-top: 16px;
- .balanceCard-item{
- flex: 1;
- color:#fff;
- }
- }
- }
- }
-
- .balanceMain{
- background-color: #fff;
- margin-top: 12px;
- .balanceMain-title{
- display: flex;
- align-items: center;
- justify-content: space-between;
- height: 48px;
- border-bottom: 1px solid #f7f7f7;
- padding: 0 16PX;
- .title{
- display: flex;
- align-items: center;
- span{
- margin-left: 8px;
- font-size: 16px;
- }
- }
- }
- .balanceMain-item{
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 12px 16px;
- p{
- font-size: 12px;
- color:#888;
- margin-top: 3px;
- }
- }
-
- }
- </style>
|