feat:v1.4前端更新
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view>
|
||||
<view :data-theme="theme">
|
||||
<view class='bill-details'>
|
||||
<view class='nav acea-row'>
|
||||
<view class='item' :class='type==="all" ? "on":""' @click='changeType("all")'>全部</view>
|
||||
@@ -11,13 +11,14 @@
|
||||
<view class='item'>
|
||||
<view class='data'>{{item.date}}</view>
|
||||
<view class='listn borRadius14'>
|
||||
<view class='itemn acea-row row-between-wrapper' v-for="(vo,indexn) in item.list" :key="indexn">
|
||||
<view class='itemn acea-row row-between-wrapper' v-for="(vo,indexn) in item.list"
|
||||
:key="indexn">
|
||||
<view>
|
||||
<view class='name line1'>{{vo.title}}</view>
|
||||
<view>{{vo.add_time}}</view>
|
||||
</view>
|
||||
<view class='num' v-if="vo.pm">+{{vo.number}}</view>
|
||||
<view class='num font-color' v-else>-{{vo.number}}</view>
|
||||
<view class='num font_color' v-if="vo.pm">+{{vo.number}}</view>
|
||||
<view class='num' v-else>-{{vo.number}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -30,10 +31,6 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -47,18 +44,11 @@
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
// #ifdef MP
|
||||
import authorize from '@/components/Authorize';
|
||||
// #endif
|
||||
import emptyPage from '@/components/emptyPage.vue';
|
||||
import home from '@/components/home';
|
||||
let app = getApp();
|
||||
export default {
|
||||
components: {
|
||||
// #ifdef MP
|
||||
authorize,
|
||||
// #endif
|
||||
emptyPage,
|
||||
home
|
||||
emptyPage
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -66,11 +56,10 @@
|
||||
loading: false,
|
||||
loadend: false,
|
||||
page: 1,
|
||||
limit: 10,
|
||||
limit: 12,
|
||||
type: 'all',
|
||||
userBillList: [],
|
||||
isAuto: false, //没有授权的不会自动授权
|
||||
isShowAuth: false //是否隐藏授权
|
||||
theme:app.globalData.theme,
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
@@ -85,7 +74,7 @@
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function(options) {
|
||||
this.type = options.type;
|
||||
this.type = options.type?options.type:'all';
|
||||
},
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
@@ -94,23 +83,13 @@
|
||||
this.getUserBillList();
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 授权回调
|
||||
*/
|
||||
onLoadFun: function() {
|
||||
this.getUserBillList();
|
||||
},
|
||||
// 授权关闭
|
||||
authColse: function(e) {
|
||||
this.isShowAuth = e
|
||||
},
|
||||
/**
|
||||
* 获取账户明细
|
||||
*/
|
||||
getUserBillList: function() {
|
||||
let that = this;
|
||||
if (that.loadend) return;
|
||||
|
||||
|
||||
if (that.loading) return;
|
||||
that.loading = true;
|
||||
that.loadTitle = "";
|
||||
@@ -120,14 +99,34 @@
|
||||
type: that.type
|
||||
}
|
||||
getBillList(data).then(function(res) {
|
||||
let list = res.data.list?res.data.list:[],
|
||||
loadend = res.data.list < res.data.limit;
|
||||
that.userBillList = that.$util.SplitArray(list, that.userBillList);
|
||||
that.$set(that, 'userBillList', that.userBillList);
|
||||
let list = res.data.list ? res.data.list : [],
|
||||
loadend = res.data.totalPage <= that.page;
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
let time1 = list[i].date;
|
||||
let array1 = list[i].list;
|
||||
let isEquals = false;
|
||||
for (let j = 0; j < that.userBillList.length; j++) {
|
||||
let time2 = that.userBillList[j].date;
|
||||
let array2 = that.userBillList[j].list;
|
||||
if (time1 == time2) {
|
||||
array2.push.apply(array2, array1);
|
||||
that.userBillList[j].list = array2;
|
||||
isEquals = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!isEquals) {
|
||||
that.userBillList.push({
|
||||
date: time1,
|
||||
list: array1
|
||||
})
|
||||
}
|
||||
}
|
||||
that.$set(that, 'userBillList', that.userBillList);
|
||||
that.page += 1;
|
||||
that.loadend = loadend;
|
||||
that.loading = false;
|
||||
that.loadTitle = loadend ? "哼😕~我也是有底线的~" : "加载更多";
|
||||
that.page = that.page + 1;
|
||||
that.loadTitle = loadend ? "我也是有底线的~" : "加载更多";
|
||||
}, function(res) {
|
||||
that.loading = false;
|
||||
that.loadTitle = '加载更多';
|
||||
@@ -148,16 +147,14 @@
|
||||
</script>
|
||||
|
||||
<style scoped lang='scss'>
|
||||
.sign-record{
|
||||
|
||||
}
|
||||
.sign-record {}
|
||||
|
||||
.bill-details .nav {
|
||||
background-color: #fff;
|
||||
height: 90rpx;
|
||||
width: 100%;
|
||||
line-height: 90rpx;
|
||||
}
|
||||
|
||||
.bill-details .nav .item {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
@@ -166,7 +163,10 @@
|
||||
}
|
||||
|
||||
.bill-details .nav .item.on {
|
||||
color: $theme-color;
|
||||
border-bottom: 3rpx solid $theme-color;
|
||||
@include main_color(theme);
|
||||
@include tab_border_bottom(theme);
|
||||
}
|
||||
.font_color{
|
||||
color: #E93323 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user