能量碎片接口页面处理

This commit is contained in:
2021-09-27 16:21:08 +08:00
parent d6af7dca6c
commit bb0e42104a
7 changed files with 120 additions and 80 deletions

View File

@@ -10,11 +10,8 @@
<view :class="['record-top-item',type==='day'?'selectTopItem':'']"
@click="selectType('day')">日账单</view>
</view>
<view class="record-mouth-year">
<view class="record-type-right">
<view class="record-title">碎片个数</view>
<view class="record-money">{{account || '0.00'}} <span></span> </view>
</view>
<!-- <view class="record-mouth-year">
<view class="record-type-left">
<u-picker mode="time" v-model="show" :params="params"
@confirm ='confirm' title ='筛选日期' start-year='2021' :end-year='currentYear'/>
@@ -23,9 +20,23 @@
<uni-icons type="arrowdown" color="#fff" size="12" />
</view>
</view>
</view> -->
<view class="record-mouth-year">
<view class="record-type-left">
<u-picker mode="time" v-model="show" :params="params" @confirm ='confirm' title ='筛选日期' start-year='2021' :end-year='currentYear'/>
<view @click="show = true">
{{date?date:'选择日期'}}
<uni-icons type="arrowdown" color="#fff" size="12" />
</view>
</view>
<view class="record-type-right">
<view :class="['pay_type_item',cointype==='all'?'pay_type_item_select':'']" @click="selectCoinType('all')">全部</view>
<view :class="['pay_type_item',cointype==='1'?'pay_type_item_select':'']" @click="selectCoinType('1')">待发放</view>
<view :class="['pay_type_item',cointype==='0'?'pay_type_item_select':'']" @click="selectCoinType('0')">已发放</view>
</view>
</view>
<!-- <view class="record-title">碎片个数</view>
<view class="record-money"><span></span>{{account || '0.00'}}</view> -->
<view class="record-title">当前碎片个数</view>
<view class="record-money">{{score || '0.00'}} <span></span></view>
</view>
<!-- 列表 -->
@@ -34,10 +45,10 @@
<image src="/static/imgs/record-icon.png" mode="widthFix" class="record-icon" />
<view class="">
<view class="record-list-item-top">
<view class="title ellipsis-2">完成任务获得碎片</view>
<view class="money" >{{cointype==='in'?'+':'-'}}5</view>
<view class="title ellipsis-2">{{item.remark}}</view>
<view class="money" >{{item.amount}}</view>
</view>
<view class="record-list-item-date">2021-12-22 12:12:12</view>
<view class="record-list-item-date">{{item.created_at}}</view>
</view>
</view>
</view>
@@ -50,15 +61,14 @@
</template>
<script>
import {chaineb} from '@/apis/interfaces/mine';
import {userAccoutScores} from '@/apis/interfaces/withdraws';
export default {
data() {
return {
lists:[1,1.1,1,1],
lists:[],
has_next_page:true,
page:1,
type:'year', // 统计类型day日month月year年
cointype:'in',// in 收入 out 支出
date:new Date().toISOString().slice(0,4), // 日Y-m-d月Y-m年Y
params: {
year: true,
@@ -69,10 +79,11 @@
currentDay:new Date().toISOString().slice(0,10),
currentMonth:new Date().toISOString().slice(0,7),
currentYear:new Date().toISOString().slice(0,4),
account:''
score:'',
cointype:'all'
}
},
onLoad(){
onShow(){
this.getList()
},
onReachBottom(){
@@ -94,12 +105,13 @@
page:this.page,
type:this.type,
date:this.date,
cointype:this.cointype
frozen:this.cointype
}
chaineb(data).then(res => {
this.account = res.account
this.lists = this.lists.concat(res.lists)
this.has_next_page = res.has_next_page
userAccoutScores(data).then(res => {
console.log(res)
this.score = res.score
this.lists = this.lists.concat(res.lists.data)
this.has_next_page = res.lists.page.has_more
}).catch(err => {
this.$refs.uToast.show({
title: err.message,
@@ -149,8 +161,8 @@
this.type = type
this.params= {
year: true,
month: false,
day: false
month: true,
day: true
}
this.date = this.currentDay
this.reset()
@@ -183,7 +195,7 @@
<style lang="scss" scoped>
.Record {
width: 100%;
height: 100vh;
min-height: 100vh;
padding-top: 30rpx;
background-color: #fff;
}
@@ -224,6 +236,11 @@
// padding-top: 20rpx;
position: relative;
top: 20rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-end;
box-sizing: border-box;
}
}
@@ -236,14 +253,14 @@
}
.record-top {
width: calc(100% - 60rpx);
height: 360rpx;
// height: 360rpx;
background-image: linear-gradient(to right, #7c52fc, #976dff);
box-shadow: 0 10rpx 20rpx 0rpx rgba($color: #976dff, $alpha: 0.4);
margin: 0 30rpx;
border-radius: 20rpx;
box-sizing: border-box;
position: relative;
padding: 10rpx 50rpx 20rpx 50rpx;
padding: 30rpx 30rpx 50rpx 50rpx;
z-index: 1;
.record-bg {
@@ -283,7 +300,7 @@
z-index: 2;
color: #fff;
font-size: 30rpx;
margin-top: 20rpx;
// margin-top: 20rpx;
.record-type-left {
display: flex;
@@ -299,15 +316,14 @@
.record-type-right {
display: flex;
flex-direction: column;
align-items: flex-start;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
font-size: 24rpx;
flex: 1;
.pay_type_item {
margin: 0 10rpx;
// margin: 0 10rpx;
padding: 2rpx 20rpx;
border-radius: 30rpx;
border: solid 1rpx rgba($color: #000000, $alpha: 0);
@@ -322,6 +338,7 @@
font-size: 28rpx;
color: #fff;
padding:0 0 20rpx 0;
margin-top: 30rpx;
}
.record-money {