同步数据

This commit is contained in:
2022-06-11 16:25:24 +08:00
parent 83e82ed31e
commit f9b81ba51e
6 changed files with 202 additions and 164 deletions

View File

@@ -9,9 +9,11 @@
import { request } from '../index'
// dt账户
const dt = () =>{
const dt = (data) =>{
console.log(data)
return request({
url: "user/account/dt_logs"
url: "user/account/dt_logs",
data
})
}

View File

@@ -252,11 +252,13 @@
}, {
"path": "pages/account/dt",
"name": "AccountDt",
"style": {
"navigationBarTitleText": "DT积分",
"navigationBarBackgroundColor": "#34CE98",
"backgroundColorTop": "#34CE98",
"navigationBarTextStyle": "white",
"enablePullDownRefresh":true,
"app-plus": {
"titleNView": {
"buttons": [{

View File

@@ -18,11 +18,7 @@
</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 icon="http://cdn.uviewui.com/uview/empty/list.png" textColor="#999" text="暂无账户记录">
</u-empty>
</view>
</block>
@@ -30,64 +26,92 @@
</template>
<script>
import { dt } from '@/apis/interfaces/account.js'
import {
dt
} from '@/apis/interfaces/account.js'
export default {
data() {
return {
score: '0.00',
logs : [],
pages: {}
logs: [],
page: 1,
has_more: true,
};
},
onShow() {
this.getDt()
},
onReachBottom() {
if (this.has_more) {
this.page = this.page + 1;
this.getDt()
}
},
onPullDownRefresh() {
this.page = 1;
this.getDt();
},
methods: {
getDt(){
dt().then(res => {
this.score = res.score
this.logs = res.lists.data
this.page = res.lists.page
getDt() {
dt({
page: this.page
}).then(res => {
if (this.page == 1) {
this.logs = [];
}
this.score = res.score;
this.logs = this.logs.concat(res.lists.data);
this.has_more = res.lists.page.has_more;
uni.stopPullDownRefresh();
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
icon: 'none'
})
})
},
// 转账
onTransfer(name){
this.$Router.push({name})
onTransfer(name) {
this.$Router.push({
name
})
}
},
onNavigationBarButtonTap() {
this.$Router.push({name: 'AccountRecharge'})
this.$Router.push({
name: 'AccountRecharge'
})
}
}
</script>
<style lang="scss">
.pages-empty{
.pages-empty {
height: 50vh;
}
.content{
.content {
background: $window-color;
min-height: 100vh;
.dt-header{
.dt-header {
display: flex;
justify-content: space-between;
flex-direction: row;
background: $main-color;
padding: $padding*3 $padding $padding*2;
align-items: center;
.dt-header-number{
.dt-header-number {
width: calc(100% - 330rpx);
.title{
.title {
color: rgba(255, 255, 255, .9);
font-size: 28rpx;
@extend .nowrap;
}
.num{
.num {
font-weight: bold;
font-size: 60rpx;
padding-top: 10rpx;
@@ -95,7 +119,8 @@
@extend .nowrap;
}
}
.transfer[size="mini"]{
.transfer[size="mini"] {
width: 150rpx;
height: 80rpx;
border-radius: 40rpx;
@@ -105,20 +130,23 @@
color: $main-color;
margin: 0;
font-weight: bold;
&::after{
&::after {
display: none;
}
}
}
// 账户记录
.logs-title{
.logs-title {
padding: 0 $padding;
font-weight: bold;
line-height: 90rpx;
color: #333;
font-size: 30rpx;
}
.logs-item{
.logs-item {
position: relative;
background: white;
border-radius: $radius;
@@ -126,17 +154,20 @@
padding-right: 240rpx;
box-sizing: border-box;
margin: 0 $margin ($margin - 10);
.logs-item-title{
.logs-item-title {
font-weight: bold;
font-size: 30rpx;
line-height: 50rpx;
}
.logs-item-time{
.logs-item-time {
font-size: 28rpx;
line-height: 40rpx;
color: gray;
}
.logs-item-price{
.logs-item-price {
position: absolute;
right: $padding;
top: $padding - 10;
@@ -145,10 +176,12 @@
text-align: right;
font-weight: bold;
@extend .nowrap;
&.add{
&.add {
color: $main-color;
}
&.remove{
&.remove {
color: $text-price;
}
}

View File

@@ -159,6 +159,7 @@
getInfo() {
if (this.$store.state.token === '') return;
info().then(res => {
console.log(res);
uni.setNavigationBarTitle({
title: res.nickname
});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long