123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310 |
- <template>
- <view>
- <ujp-navbar title="我的余额">
- <view class="slot-wrap">
- <span class="navBtn oldTextjp222" oldstyle="font-size: 16px;" @click="toRefundList">退余额</span>
- </view>
- </ujp-navbar>
-
- <u-modal v-model="show" :confirm-text="confirmText" confirm-color="#00B962">
- <view class="slot-content">
- <rich-text :nodes="content"></rich-text>
- </view>
- </u-modal>
- <u-modal v-model="show2" :confirm-text="confirmText" confirm-color="#00B962">
- <view class="slot-content">
- <rich-text :nodes="content2"></rich-text>
- </view>
- </u-modal>
- <view class="balance">
- <view class="balanceHead">
- <view class="balanceCard">
- <view class="balanceCard-head">
- <view class="balanceCard-head-item">
- <view>
- 总金额(元)<u-icon name="question-line" custom-prefix="custom-icon" color="#fff" size="36" @click="show=true"></u-icon>
- </view>
- <view class="h2" v-if="personAccount.availableAmount != null">{{personAccount.availableAmount.toFixed(2)}}</view>
- </view>
- <view class="balanceCard-head-item" v-if="personAccount.chargingFunds" >
- <view>
- 充电金(元)<u-icon name="question-line" custom-prefix="custom-icon" color="#fff" size="36" @click="show2=true"></u-icon>
- </view>
-
- <view class="h2" v-if="personAccount.chargingFunds != null">{{personAccount.chargingFunds.toFixed(2)}}</view>
-
- </view>
- </view>
-
- <!-- <view class="balanceCard-main oldTextjp222" 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 oldTextjp222" oldstyle="font-size: 16px;">
- <view class="balanceCard-item" v-if="personAccount.availableAmount != null">可用余额{{personAccount.availableAmount.toFixed(2)}}</view>
- <view class="balanceCard-item" v-if="personAccount.frozenTotal != null">冻结金额{{personAccount.frozenTotal.toFixed(2)}}</view>
- </view>
-
- </view>
- <view class="new-balanceCard-foot" @click="rechargeNow">
- 立即充值
- </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="oldTextjp222" oldstyle="font-size: 20px;">充值明细</span>
- </view>
- <view class="more oldTextjp222" 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?type='+item.type+'&id=' + item.id)">
- <view class="title">
- <font class="oldTextjp222" oldstyle="font-size: 18px;">{{item.remark}}</font>
- <p class="oldTextjp222" oldstyle="font-size: 14px;">{{item.createTime}}</p>
- </view>
- <h4 class="oldTextjp222" oldstyle="font-size: 24px;">{{item.amount?item.amount.toFixed(2):0}}元</h4>
- </view>
- </view>
- </view>
- <view class="carNone" v-if="accountList.length == 0">
- <img src="@/assets/static/img/暂无数据-缺省页.png" alt="">
- <p class="oldTextjp222" 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,
- show2: false,
- confirmText: '知道了',
- content: `总金额=可用余额+冻结金额。使用预付费充电时,在充电过程中会冻结部分金额,充电完成后将剩余金额返还至余额账户,每笔预充金额的冻结时间不超过96小时。`,
- content2:"充电金:只可用于平台内所有自营站充电使用,不能提现",
- personAccount: {},
- accountList: [],
- elderStatus: false,
- }
- },
- onReady() {
-
-
- if(this.carhelp.get("getElderModeClass") == "长辈模式") {
- this.elderStatus = true;
- } else {
- this.elderStatus = false;
- }
- },
- onShow(){
-
- 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.dateMonth = year + '-10-01';
- this.getCarPersonAccount();
- this.getAccountRecordData();
-
- },
- methods: {
- toRefundList() {
- uni.navigateTo({
- url: '/pages/user/finance/refundList'
- })
- },
- getAccountRecordData() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- API.rechargeAmountRecordList({
- 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>
- .oldTextClassF{
-
- }
- .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{
- font-size: 36rpx;
- 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;
- margin: 16px;
- background-color: #00B962;
- border-radius: 12px;
- .new-balanceCard-foot{
- font-size: 18px;
- margin-top: 24rpx;
- padding:4px;
- color: rgba(84, 69, 47, 1);
- border-radius:0 0 12px 12px;
- text-align: center;
- background: linear-gradient(88.81deg, rgba(224,207,180,1) 1.89%,rgba(207,167,106,1) 99.99%);
- }
- .balanceCard{
-
- padding: 16px 16px 0 16px;
- .balanceCard-head{
- display: flex;
- justify-content: flex-start;
- font-size: 36rpx;
- color:#fff;
- .h2{
- font-size:72rpx
- }
- .balanceCard-head-item{
- width: 49%;
- }
- }
- .balanceCard-main{
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-top: 8px;
- h2{
- font-size: 80rpx;
- color:#fff;
- font-weight: normal;
- }
- .balanceCard-btn{
- padding: 8px 20px;
- background-color: #fff;
- color:#00B962;
- border-radius: 18px;
- }
- }
- .balanceCard-foot{
- display: flex;
- margin-top: 8rpx;
- .balanceCard-item{
- font-size: 32rpx;
- 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{
- font-weight: bold;
- display: flex;
- align-items: center;
-
- span{
- margin-left: 8px;
- font-size: 36rpx;
- }
- }
- }
- .balanceMain-item{
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 12px 16px;
- font-size: 32rpx;
- color: rgba(16, 16, 16, 1);
- p{
- font-size: 32rpx;
- color:#888;
- margin-top: 3px;
- }
- }
-
- }
- </style>
|