修复:余额明细不显示的问题
This commit is contained in:
parent
f876daf328
commit
2ebe9615fc
|
|
@ -13,6 +13,7 @@ Page({
|
|||
expenditure: [],
|
||||
balanceLang: '余额',
|
||||
recordsList: [],
|
||||
recordsListLength: 0,
|
||||
//more
|
||||
isLoadMore: true,
|
||||
page: 1,
|
||||
|
|
@ -98,31 +99,27 @@ Page({
|
|||
getNetData(index) {
|
||||
let that = this;
|
||||
this.data.page = 1;
|
||||
let urlStr = app.getNetAddresss("finance.balance.record");
|
||||
urlStr += '&record_type=' + index;
|
||||
app._getNetWork({
|
||||
url: urlStr,
|
||||
url: app.getNetAddresss("finance.balance.record"),
|
||||
data: {
|
||||
search:{
|
||||
record_type: index,
|
||||
}
|
||||
},
|
||||
success: function(resdata) {
|
||||
var res = resdata.data;
|
||||
if (res.result == 1) {
|
||||
var myData = res.data.data;
|
||||
var myData = res.data;
|
||||
// console.log("首次获取信息",{
|
||||
// total_page: myData.record_list.last_page,
|
||||
// recordsList: myData.record_list.data,
|
||||
// recordsListLength: Object.keys(myData.record_list.data).length
|
||||
// });
|
||||
that.setData({
|
||||
total_page: res.data.last_page,
|
||||
recordsList: myData
|
||||
total_page: myData.record_list.last_page,
|
||||
recordsList: myData.record_list.data,
|
||||
recordsListLength: Object.keys(myData.record_list.data).length
|
||||
});
|
||||
// if (index == 0) {
|
||||
// that.setData({
|
||||
// all: myData
|
||||
// })
|
||||
// } else if (index == 1) {
|
||||
// that.setData({
|
||||
// income: myData
|
||||
// })
|
||||
// } else if (index == 2) {
|
||||
// that.setData({
|
||||
// expenditure: myData
|
||||
// })
|
||||
// }
|
||||
}
|
||||
},
|
||||
fail: function(res) {
|
||||
|
|
@ -139,16 +136,18 @@ Page({
|
|||
return;
|
||||
} else {
|
||||
this.data.page = this.data.page + 1;
|
||||
let urlStr = app.getNetAddresss("finance.balance.record");
|
||||
urlStr = urlStr + '&record_type=' + index + '&page=' + this.data.page;
|
||||
app._getNetWork({
|
||||
url: urlStr,
|
||||
url: app.getNetAddresss("finance.balance.record"),
|
||||
data: {
|
||||
record_type: index,
|
||||
page: that.data.page
|
||||
},
|
||||
success: function(resdata) {
|
||||
var res = resdata.data;
|
||||
if (res.result == 1) {
|
||||
var myData = res.data.data;
|
||||
that.setData({
|
||||
recordsList: that.data.recordsList.concat(myData)
|
||||
recordsList: that.data.recordsList.concat(myData.record_list.data)
|
||||
});
|
||||
} else {
|
||||
that.setData({
|
||||
|
|
|
|||
|
|
@ -1,64 +1,64 @@
|
|||
<view class="detailed">
|
||||
<van-tabs active="{{ selected }}" bind:change="swichTabTItem">
|
||||
<van-tab title="全部">
|
||||
<view wx:if="{{recordsList && recordsList.length > 0}}">
|
||||
<view class="a" wx:for-item="item" wx:for="{{recordsList}}" wx:key="index" catchtap="godetails" data-item="{{item}}">
|
||||
<view class="tbs">
|
||||
<view class="item2 ul">
|
||||
<view class="li">{{ item.service_type_name }}</view>
|
||||
<view class="li">{{ balanceLang }}:{{ item.new_money }}</view>
|
||||
<view class="item1 li">{{ item.created_at }}</view>
|
||||
</view>
|
||||
<view class="item3" wx:if="{{item.type == 1}}">
|
||||
<view class="span add">+{{ item.change_money }}</view>
|
||||
</view>
|
||||
<view class="item3" wx:if="{{item.type == 2}}">
|
||||
<view class="span reduce">{{ item.change_money }}</view>
|
||||
<view wx:if="{{recordsList && recordsListLength > 0}}">
|
||||
<view wx:for="{{recordsList}}" wx:for-item="value" wx:for-index="key" wx:key="key">
|
||||
<view class="a" wx:for-item="item" wx:for="{{value}}" wx:key="index" catchtap="godetails" data-item="{{item}}">
|
||||
<view class="tbs">
|
||||
<view class="item2 ul">
|
||||
<view class="li">{{ item.service_type_name }}</view>
|
||||
<view class="li">{{ balanceLang }}:{{ item.new_money }}</view>
|
||||
<view class="item1 li">{{ item.created_at }}</view>
|
||||
</view>
|
||||
<view class="item3" wx:if="{{item.type == 1}}">
|
||||
<view class="span add">+{{ item.change_money }}</view>
|
||||
</view>
|
||||
<view class="item3" wx:if="{{item.type == 2}}">
|
||||
<view class="span reduce">{{ item.change_money }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:else class="textNone">
|
||||
没有记录
|
||||
</view>
|
||||
<view wx:else class="textNone">没有记录</view>
|
||||
</van-tab>
|
||||
<van-tab title="收入">
|
||||
<view wx:if="{{recordsList && recordsList.length > 0}}">
|
||||
<view class="a" wx:for-item="item" wx:for="{{recordsList}}" wx:key="index" catchtap="godetails" data-item="{{item}}">
|
||||
<view class="tbs">
|
||||
<view class="ul item2">
|
||||
<view class="li">{{ item.service_type_name }}</view>
|
||||
<view class="li">{{ balanceLang }}:{{ item.new_money }}</view>
|
||||
<view class="li item1">{{ item.created_at }}</view>
|
||||
</view>
|
||||
<view class="item3">
|
||||
<view class="span add">+{{ item.change_money }}</view>
|
||||
<view wx:if="{{recordsList && recordsListLength > 0}}">
|
||||
<view wx:for="{{recordsList}}" wx:for-item="value" wx:for-index="key" wx:key="key">
|
||||
<view class="a" wx:for-item="item" wx:for="{{value}}" wx:key="index" catchtap="godetails" data-item="{{item}}">
|
||||
<view class="tbs">
|
||||
<view class="ul item2">
|
||||
<view class="li">{{ item.service_type_name }}</view>
|
||||
<view class="li">{{ balanceLang }}:{{ item.new_money }}</view>
|
||||
<view class="li item1">{{ item.created_at }}</view>
|
||||
</view>
|
||||
<view class="item3">
|
||||
<view class="span add">+{{ item.change_money }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:else class="textNone">
|
||||
没有记录
|
||||
</view>
|
||||
<view wx:else class="textNone">没有记录</view>
|
||||
</van-tab>
|
||||
<van-tab title="支出">
|
||||
<view wx:if="{{recordsList && recordsList.length > 0}}">
|
||||
<view class="a" wx:for-item="item" wx:for="{{recordsList}}" wx:key="index" catchtap="godetails" data-item="{{item}}">
|
||||
<view class="tbs">
|
||||
<view class="item2">
|
||||
<view class="li">{{ item.service_type_name }}</view>
|
||||
<view class="li">{{ balanceLang }}:{{ item.new_money }}</view>
|
||||
<view class="li item1">{{ item.created_at }}</view>
|
||||
</view>
|
||||
<view class="item3">
|
||||
<view class="span reduce">{{ item.change_money }}</view>
|
||||
<view wx:if="{{recordsList && recordsListLength > 0}}">
|
||||
<view wx:for="{{recordsList}}" wx:for-item="value" wx:for-index="key" wx:key="key">
|
||||
<view class="a" wx:for-item="item" wx:for="{{value}}" wx:key="index" catchtap="godetails" data-item="{{item}}">
|
||||
<view class="tbs">
|
||||
<view class="item2">
|
||||
<view class="li">{{ item.service_type_name }}</view>
|
||||
<view class="li">{{ balanceLang }}:{{ item.new_money }}</view>
|
||||
<view class="li item1">{{ item.created_at }}</view>
|
||||
</view>
|
||||
<view class="item3">
|
||||
<view class="span reduce">{{ item.change_money }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:else class="textNone">
|
||||
没有记录
|
||||
</view>
|
||||
<view wx:else class="textNone">没有记录</view>
|
||||
</van-tab>
|
||||
</van-tabs>
|
||||
</view>
|
||||
|
|
|
|||
Loading…
Reference in New Issue