292 lines
8.8 KiB
Vue
292 lines
8.8 KiB
Vue
<template>
|
|
<view class="content">
|
|
<view class="dt-header">
|
|
<view class="dt-header-number">
|
|
<view class="title">DT积分余额</view>
|
|
<view class="num">{{score}}</view>
|
|
</view>
|
|
|
|
</view>
|
|
<view class="dt-header1">
|
|
<view class="dt-header-number">
|
|
<view class="title" @click="frozenInfo(description)">
|
|
DT积分冻结
|
|
<image src="/static/rank/help.png" style="width: 30rpx;" mode="widthFix" />
|
|
</view>
|
|
<view class="num">{{frozenScore}}</view>
|
|
</view>
|
|
<button class="transfer" size="mini" @click="onTransfer('AccountRecharge')">充值</button>
|
|
<button class="transfer" size="mini" @click="onTransfer('AccountTransfer')">转账</button>
|
|
</view>
|
|
<block v-if="logs.length > 0">
|
|
<view class="logs-title">账户记录</view>
|
|
<view class="logs-item" v-for="(item,index) in logs" :key="index" @click="frozenInfo(item.description)">
|
|
<view class="logs-item-title">
|
|
{{item.remark}}
|
|
<image v-if ="item.description!== ''" src="/static/rank/help3.png" mode="widthFix" />
|
|
</view>
|
|
<view class="logs-item-time">{{item.created_at}}</view>
|
|
<view class="logs-item-price" :class="item.amount > 0 ? 'add': 'remove'">
|
|
{{item.amount}}
|
|
<view v-if="item.frozen.value === 1"> {{item.frozen.value === 1?'冻结中':item.frozen.text}}</view>
|
|
</view>
|
|
</view>
|
|
</block>
|
|
<block v-else>
|
|
<view class="vertical pages-empty">
|
|
<u-empty icon="http://cdn.uviewui.com/uview/empty/list.png" textColor="#999" text="暂无账户记录">
|
|
</u-empty>
|
|
</view>
|
|
</block>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import {
|
|
dt
|
|
} from '@/apis/interfaces/account.js'
|
|
export default {
|
|
data() {
|
|
return {
|
|
score: '0.00',
|
|
frozenScore: '0.00',
|
|
logs: [],
|
|
page: 1,
|
|
has_more: true,
|
|
description:'',
|
|
};
|
|
},
|
|
onShow() {
|
|
this.getDt()
|
|
},
|
|
onReachBottom() {
|
|
if (this.has_more) {
|
|
this.page = this.page + 1;
|
|
this.getDt()
|
|
}
|
|
},
|
|
onPullDownRefresh() {
|
|
this.page = 1;
|
|
this.getDt();
|
|
},
|
|
methods: {
|
|
getDt() {
|
|
dt({
|
|
page: this.page
|
|
}).then(res => {
|
|
if (this.page == 1) {
|
|
this.logs = [];
|
|
}
|
|
this.score = res.score;
|
|
this.frozenScore = res.frozenScore;
|
|
this.logs = this.logs.concat(res.lists.data);
|
|
this.description = res.description;
|
|
this.has_more = res.lists.page.has_more;
|
|
uni.stopPullDownRefresh();
|
|
}).catch(err => {
|
|
uni.showToast({
|
|
title: err.message,
|
|
icon: 'none'
|
|
})
|
|
})
|
|
},
|
|
// 转账
|
|
onTransfer(name) {
|
|
this.$Router.push({
|
|
name
|
|
})
|
|
},
|
|
frozenInfo(description){
|
|
if(description!== ''){
|
|
uni.showModal({
|
|
title:'温馨提示',
|
|
content:description,
|
|
showCancel:false,
|
|
confirmColor:"#34ce98",
|
|
confirmText:' 知道了'
|
|
})
|
|
}
|
|
},
|
|
|
|
},
|
|
onNavigationBarButtonTap() {
|
|
this.$Router.push({
|
|
name: 'AccountCode'
|
|
})
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.pages-empty {
|
|
height: 50vh;
|
|
}
|
|
|
|
.content {
|
|
background: $window-color;
|
|
min-height: 100vh;
|
|
|
|
.dt-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
flex-direction: row;
|
|
background: $main-color;
|
|
padding: $padding*2 $padding 0;
|
|
align-items: center;
|
|
|
|
.dt-header-number {
|
|
width: calc(100% - 330rpx);
|
|
|
|
.title {
|
|
color: rgba(255, 255, 255, .9);
|
|
font-size: 28rpx;
|
|
@extend .nowrap;
|
|
}
|
|
|
|
.num {
|
|
font-weight: bold;
|
|
font-size: 60rpx;
|
|
padding-top: 10rpx;
|
|
color: white;
|
|
@extend .nowrap;
|
|
}
|
|
}
|
|
|
|
.transfer[size="mini"] {
|
|
width: 150rpx;
|
|
height: 80rpx;
|
|
border-radius: 40rpx;
|
|
line-height: 80rpx;
|
|
background: white;
|
|
font-size: 30rpx;
|
|
color: $main-color;
|
|
margin: 0;
|
|
font-weight: bold;
|
|
|
|
&::after {
|
|
display: none;
|
|
}
|
|
}
|
|
}
|
|
|
|
.dt-header1 {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
flex-direction: row;
|
|
background: $main-color;
|
|
padding: $padding $padding $padding*2;
|
|
align-items: center;
|
|
|
|
.dt-header-number {
|
|
width: calc(100% - 330rpx);
|
|
|
|
.title {
|
|
color: rgba(255, 255, 255, .9);
|
|
font-size: 28rpx;
|
|
@extend .nowrap;
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: center;
|
|
justify-content: flex-start;
|
|
box-sizing: border-box;
|
|
image{
|
|
padding-left: 4rpx;
|
|
}
|
|
}
|
|
|
|
.num {
|
|
font-weight: bold;
|
|
font-size: 40rpx;
|
|
color: white;
|
|
@extend .nowrap;
|
|
}
|
|
}
|
|
|
|
.transfer[size="mini"] {
|
|
width: 160rpx;
|
|
height: 70rpx;
|
|
border-radius: 40rpx;
|
|
line-height: 70rpx;
|
|
background: white;
|
|
font-size: 30rpx;
|
|
color: $main-color;
|
|
margin: 0;
|
|
font-weight: bold;
|
|
|
|
&::after {
|
|
display: none;
|
|
}
|
|
}
|
|
}
|
|
|
|
// 账户记录
|
|
.logs-title {
|
|
padding: 0 $padding;
|
|
font-weight: bold;
|
|
line-height: 90rpx;
|
|
color: #333;
|
|
font-size: 30rpx;
|
|
}
|
|
|
|
.logs-item {
|
|
position: relative;
|
|
background: white;
|
|
border-radius: $radius;
|
|
padding: $padding - 10 $padding;
|
|
padding-right: 240rpx;
|
|
box-sizing: border-box;
|
|
margin: 0 $margin ($margin - 10);
|
|
|
|
.logs-item-title {
|
|
font-weight: bold;
|
|
font-size: 30rpx;
|
|
line-height: 50rpx;
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: center;
|
|
justify-content: flex-start;
|
|
box-sizing: border-box;
|
|
image{
|
|
width: 30rpx;
|
|
padding-left: 4rpx;
|
|
}
|
|
}
|
|
|
|
.logs-item-time {
|
|
font-size: 26rpx;
|
|
line-height: 40rpx;
|
|
color: gray;
|
|
}
|
|
|
|
.logs-item-price {
|
|
position: absolute;
|
|
right: $padding;
|
|
top: $padding - 10;
|
|
line-height: 90rpx;
|
|
width: 180rpx;
|
|
text-align: right;
|
|
font-weight: bold;
|
|
font-size: 30rpx;
|
|
@extend .nowrap;
|
|
|
|
&.add {
|
|
color: $main-color;
|
|
}
|
|
|
|
&.remove {
|
|
color: $text-price;
|
|
}
|
|
|
|
view {
|
|
position: absolute;
|
|
top: $padding+4;
|
|
right: 0;
|
|
color: #999;
|
|
font-size: 22rpx;
|
|
font-weight: normal;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|