<template>
    <div class="incomeExpenses">
        <div class="head_card">
            <div class="property">余额：{{local_uinfo.property}}</div>
        </div>
        <div class="detailList" v-if="List.length">
            <div class="li" v-for="(i,s) in List" :key="s">
                <p class="flex_r flex_jb">
                    <span class="s1">{{ i.remark }}</span>
                    <span class="s2">{{ parseFloat(i.money).toFixed(2) }}</span>
                </p>
                <p class="flex_r flex_jb">
                    <span class="s3">{{ i.create_time }}</span>
                </p>
            </div>
        </div>
        <div class="zanwu" v-else>
            <img src="http://teaclub.oss-cn-chengdu.aliyuncs.com/CloudShop/head_pic/5a3c6b1e2d098aa6695394c927c38586545188b8png" alt="" class="zanwuimg">
            <view class="zanwutxt">暂无收支记录</view>
        </div>
    </div>
</template>
<script>
import { post } from "@/request/api.js";
export default {
    name: "incomeExpenses",
    props: {},
    components: {},
    data() {
        return {
            List: [],
            Query: {
                page: 1,
                rows: 20
            },
            local_uinfo: {},
        };
    },
    methods: {
        async getLU() {
            this.local_uinfo = await uni.Luserfun()
        },
        getList() {
            post("local/revenue").then(res => {
                if (res.code == 0) {
                    let list = res.data.data;
                    this.List = [...this.List, ...list]
                    this.Query.page++
                }
            })
        },
    },
    onLoad(da) {
        this.getList();
        this.getLU();
    },
    onShow() {},
    mounted() {},
    onReachBottom() {
        if (this.Query.page < this.merchant.last_page) this.getlists();
    },
};
</script>
<style scoped lang='scss'>
.incomeExpenses{
    min-height: 100vh;
    background-color: #fff;
}
.head_card {
    background-color: #d3aa79;
    padding: 30rpx;
    margin-bottom: 20rpx;

    .property {
        color: #fff;
    }
}
.detailList{
    .li{
        padding: 22rpx 30rpx;
        border-bottom: 1px solid rgba($color: #d3aa79, $alpha: 0.3);
        p{
            margin-bottom: 8rpx;
            font-size: 30rpx;
            &:last-child{
                margin-bottom: 0;
                font-size: 25rpx;
                color: #999;
            }
        }
        .s2{
            font-weight: bold;
            &::before{
                content: "￥";
                font-size: 25rpx;
            }
        }
    }
}
</style>