|
|
@ -3,7 +3,10 @@ |
|
|
|
<!-- 顶部Tabs --> |
|
|
|
<view class="nav-bar" style=""> |
|
|
|
<!-- <text class="nav-title">{{this.$languageData.settings.transRecords}}</text> --> |
|
|
|
<u-tabs @change="tabChg" scrollable :list="[{name:$languageData.tmp.all},{name:$languageData.tmp.salIn},{name:$languageData.tmp.payUti},{name:$languageData.tmp.qrcodeIn},{name:$languageData.tmp.refund}]"></u-tabs> |
|
|
|
<u-tabs @change="tabChg" scrollable |
|
|
|
:list="[{name:$languageData.tmp.all},{name:$languageData.tmp.transferAccounts}, |
|
|
|
{name:$languageData.tmp.proxyPayment},{name:$languageData.tmp.payment}, |
|
|
|
{name:$languageData.tmp.receivePayment},{name:$languageData.tmp.withdrawal}]"></u-tabs> |
|
|
|
</view> |
|
|
|
<!-- 搜索过滤区 --> |
|
|
|
<view class="search-section"> |
|
|
@ -20,7 +23,8 @@ |
|
|
|
</view> |
|
|
|
</picker> |
|
|
|
</view> |
|
|
|
<view style="display: flex; justify-content: space-around; padding: 16rpx 0; background-color: #f5f7fa; border-radius: 12rpx; margin-top: 14rpx;"> |
|
|
|
<view |
|
|
|
style="display: flex; justify-content: space-around; padding: 16rpx 0; background-color: #f5f7fa; border-radius: 12rpx; margin-top: 14rpx;"> |
|
|
|
<view style="display: flex; flex-direction: column;"> |
|
|
|
<view style="color: #333;">{{$languageData.account.outcome}}</view> |
|
|
|
<view style="display: flex; justify-content: baseline; align-items: baseline;"> |
|
|
@ -49,11 +53,11 @@ |
|
|
|
<!-- 交易记录列表 --> |
|
|
|
<scroll-view class="record-list" scroll-y @scrolltolower="loadMore" refresher-enabled |
|
|
|
:refresher-triggered="isRefreshing" @refresherrefresh="onRefresh"> |
|
|
|
<view v-if="showList.length > 0"> |
|
|
|
<view v-for="(item, index) in showList" :key="index" class="record-item" @tap="viewDetail(item)"> |
|
|
|
<view v-if="recordList.length > 0"> |
|
|
|
<view v-for="(item, index) in recordList" :key="index" class="record-item" @tap="viewDetail(item)"> |
|
|
|
<view class="record-header"> |
|
|
|
<!-- <text class="record-id">{{ item.senderName }}</text> --> |
|
|
|
<text class="record-id">{{ item.remark }}</text> |
|
|
|
<text class="record-id">{{ item.billCode.split("@")[0] }}</text> |
|
|
|
<view class="record-amount"> |
|
|
|
<text class="amount-value" :style="{ color: getColor(item.changeBalance) }"> |
|
|
|
{{item.changeBalance>0?'+':''}}{{ item.changeBalance }} (KIP) |
|
|
@ -61,7 +65,7 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="record-content"> |
|
|
|
<text class="record-time">{{ item.time }}</text> |
|
|
|
<text class="record-time">{{ item.timeFormat }}</text> |
|
|
|
<uni-tag :inverted="true" :text="item.typeStr" /> |
|
|
|
<!-- <uni-tag :inverted="true" :text="item.typeStr" :type="getStatusText(item.type)" /> --> |
|
|
|
</view> |
|
|
@ -80,14 +84,14 @@ |
|
|
|
</view> |
|
|
|
</scroll-view> |
|
|
|
|
|
|
|
<loading ref="loading" :custom="false" :shadeClick="false" :type="1" /> |
|
|
|
<!-- <loading ref="loading" :custom="false" :shadeClick="false" :type="1" /> --> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
import { |
|
|
|
getRecordList |
|
|
|
getTransRecord |
|
|
|
} from '@/api/account/transactionRecord.js' |
|
|
|
import { |
|
|
|
getCurrentDate |
|
|
@ -97,28 +101,7 @@ |
|
|
|
return { |
|
|
|
searchText: '', |
|
|
|
selectedDate: '', |
|
|
|
recordList: [{ |
|
|
|
remark: 'salary', |
|
|
|
changeBalance: 4106.32, |
|
|
|
time: "2025/05/01", |
|
|
|
typeStr: this.$languageData.tmp.salIn |
|
|
|
}, |
|
|
|
{remark: 'Electricity bill payment', |
|
|
|
changeBalance: -200.24, |
|
|
|
time: "2025/05/02", |
|
|
|
typeStr: this.$languageData.tmp.payUti, |
|
|
|
}, |
|
|
|
{remark: 'Winning the lottery', |
|
|
|
changeBalance: 2000, |
|
|
|
time: "2025/05/03", |
|
|
|
typeStr: this.$languageData.tmp.qrcodeIn, |
|
|
|
}, |
|
|
|
{remark: 'Tax refund', |
|
|
|
changeBalance: 106.32, |
|
|
|
time: "2025/05/03", |
|
|
|
typeStr: this.$languageData.tmp.refund, |
|
|
|
} |
|
|
|
], |
|
|
|
recordList: [], |
|
|
|
showList: [], |
|
|
|
isLoading: false, |
|
|
|
isRefreshing: false, |
|
|
@ -131,21 +114,27 @@ |
|
|
|
phonenumber: '', |
|
|
|
key: '', |
|
|
|
key2: getCurrentDate(), //获取当前年月, |
|
|
|
type: "1" |
|
|
|
type: "" |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
income(){ |
|
|
|
return this.showList.filter(i=>i.changeBalance > 0).reduce((tot, item)=>tot+item.changeBalance,0) || 0 |
|
|
|
income() { |
|
|
|
return this.showList.filter(i => i.changeBalance > 0).reduce((tot, item) => tot + item.changeBalance, 0) || |
|
|
|
0 |
|
|
|
}, |
|
|
|
outcome(){ |
|
|
|
return -this.showList.filter(i=>i.changeBalance < 0).reduce((tot, item)=>tot+item.changeBalance,0) || 0 |
|
|
|
outcome() { |
|
|
|
return -this.showList.filter(i => i.changeBalance < 0).reduce((tot, item) => tot + item.changeBalance, |
|
|
|
0) || 0 |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.selectRecordList(); |
|
|
|
}, |
|
|
|
onLoad(item) { |
|
|
|
|
|
|
|
//TODO |
|
|
|
this.showList = this.recordList |
|
|
|
//this.showList = this.recordList |
|
|
|
if (item.data) { |
|
|
|
try { |
|
|
|
let jsonString = decodeURIComponent(item.data); // 解码 JSON 字符串 |
|
|
@ -158,20 +147,32 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
// uni.setNavigationBarTitle({title:"Ledger"}) |
|
|
|
this.selectRecordList(); |
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
tabChg(e){ |
|
|
|
if(e.index!==0){ |
|
|
|
this.showList = [this.recordList[e.index-1]] |
|
|
|
}else{ |
|
|
|
this.showList = [...this.recordList] |
|
|
|
//tab 切换 |
|
|
|
tabChg(e) { |
|
|
|
if (e.index == 0) { |
|
|
|
this.params.type = "" |
|
|
|
} else if (e.index == 1) { |
|
|
|
this.params.type = "BTR"; //转账 |
|
|
|
} else if (e.index == 2) { |
|
|
|
this.params.type = "BPY"; //代缴 |
|
|
|
} else if (e.index == 3) { |
|
|
|
this.params.type = "BPT"; //付款 |
|
|
|
} else if (e.index == 4) { |
|
|
|
this.params.type = "BRT"; //收款 |
|
|
|
} else if (e.index == 5) { |
|
|
|
this.params.type = "BWL"; //提现 |
|
|
|
} else if (e.index == 6) { |
|
|
|
this.params.type = "BRE"; //充值 |
|
|
|
} |
|
|
|
this.selectRecordList(); |
|
|
|
}, |
|
|
|
searByName(name){ |
|
|
|
if(this.params.key.length !== 0) |
|
|
|
this.showList = this.recordList.filter(i=>i.remark.includes(this.params.key)) |
|
|
|
|
|
|
|
searByName(name) { |
|
|
|
if (this.params.key.length !== 0) |
|
|
|
this.showList = this.recordList.filter(i => i.remark.includes(this.params.key)) |
|
|
|
|
|
|
|
}, |
|
|
|
getColor(value) { |
|
|
|
if (value > 0) { |
|
|
@ -183,19 +184,36 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
selectRecordList() { |
|
|
|
getTransRecord(this.params).then(res => { |
|
|
|
this.recordList = res.data; |
|
|
|
this.recordList.forEach(item => { |
|
|
|
item.billCode = item.billCode.split("@")[0]; |
|
|
|
if (item.billCode == "BTR") { |
|
|
|
item.billCode = this.$languageData.tmp.transferAccounts; //转账 |
|
|
|
} else if (item.billCode == "BPY") { |
|
|
|
item.billCode = this.$languageData.tmp.proxyPayment; //代缴 |
|
|
|
} else if (item.billCode == "BPT") { |
|
|
|
item.billCode = this.$languageData.tmp.payment; //付款 |
|
|
|
} else if (item.billCode == "BRT") { |
|
|
|
item.billCode = this.$languageData.tmp.receivePayment; //收款 |
|
|
|
} else if (item.billCode == "BWL") { |
|
|
|
item.billCode = this.$languageData.tmp.withdrawal; //提现 |
|
|
|
} else if (item.billCode == "BRE") { |
|
|
|
item.billCode = this.$languageData.tmp.recharge; //充值 |
|
|
|
} else { |
|
|
|
item.billCode = this.$languageData.tmp.other; //其他 |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch(e => { |
|
|
|
//this.$refs.loading.close(); |
|
|
|
}) |
|
|
|
//this.$refs.loading.close(); |
|
|
|
//TODO |
|
|
|
if (false) { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.loading.open(); |
|
|
|
}) |
|
|
|
getRecordList(this.params).then(res => { |
|
|
|
this.recordList = res.rows |
|
|
|
setTimeout(() => { |
|
|
|
this.$refs.loading.close(); |
|
|
|
}, 700) |
|
|
|
}).catch(e => { |
|
|
|
this.$refs.loading.close(); |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
mockrecordList() { |
|
|
@ -215,9 +233,9 @@ |
|
|
|
}, |
|
|
|
handleDateChange(e) { |
|
|
|
//TODO |
|
|
|
if(e.detail.value!=='2025-05'){ |
|
|
|
if (e.detail.value !== '2025-05') { |
|
|
|
this.showList = [] |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
this.showList = [...this.recordList] |
|
|
|
} |
|
|
|
this.params.key2 = e.detail.value |
|
|
|