<template>
|
<view class="list">
|
<view class="list_item" v-for="(item, index) in list" :key="index" @click="jump(item.type, item.orderId)">
|
<view class="list_item_a">
|
<text>{{item.title}}</text>
|
<text v-if="item.type === 0">¥{{(item.money / 100).toFixed(2)}}</text>
|
<text style="color: #FC2525;" v-if="item.type === 1 || item.type === 2 || item.type === 3">-¥{{(item.money / 100).toFixed(2)}}</text>
|
</view>
|
<view class="list_item_b">
|
<text>{{item.doneDate}}</text>
|
<text v-if="item.type === 0">微信支付</text>
|
<text v-if="item.type === 1">查看明细</text>
|
<text v-if="item.type === 2">微信退款</text>
|
<text v-if="item.type === 3">微信退款</text>
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
page: 1,
|
list: [],
|
next: false
|
};
|
},
|
onLoad() {
|
this.getList()
|
},
|
onReachBottom() {
|
console.log('触底加载')
|
this.getList()
|
},
|
methods: {
|
jump(type, id) {
|
if (type === 1) {
|
uni.navigateTo({
|
url: `/pages/settlementDetails/settlementDetails?id=${id}`
|
});
|
}
|
},
|
getList() {
|
if (!this.next) {
|
this.$u.api.transactionsPage({
|
capacity: 10,
|
model: {},
|
page: this.page,
|
sorts: [
|
{
|
direction: 'DESC',
|
property: 'createDate'
|
}
|
]
|
}).then(res => {
|
if (res.code === 200) {
|
this.page += 1
|
this.list.push(...res.data.records)
|
if (res.data.total === this.list.length) {
|
this.next = true
|
}
|
}
|
})
|
}
|
}
|
}
|
}
|
</script>
|
<style>
|
page {
|
background-color: #f7f7f7;
|
}
|
</style>
|
<style lang="scss" scoped>
|
.list {
|
width: 100%;
|
padding: 20rpx;
|
box-sizing: border-box;
|
.list_item {
|
width: 100%;
|
background: #FFFFFF;
|
border-radius: 20rpx;
|
margin-bottom: 20rpx;
|
padding: 30rpx;
|
box-sizing: border-box;
|
&:last-child {
|
margin: 0;
|
}
|
.list_item_a {
|
width: 100%;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
text {
|
&:first-child {
|
font-size: 32rpx;
|
font-family: PingFangSC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #222222;
|
}
|
&:last-child {
|
font-size: 30rpx;
|
font-family: PingFangSC-Medium, PingFang SC;
|
font-weight: 500;
|
color: #222222;
|
}
|
}
|
}
|
.list_item_b {
|
width: 100%;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
margin-top: 20rpx;
|
text {
|
font-size: 26rpx;
|
font-family: PingFangSC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #999999;
|
}
|
}
|
}
|
}
|
</style>
|