<template>
	<view :class="[AppTheme]">
		<view class="content">
			<view class="jl">
				<view class="h69" v-for="(item, index) in fundsLIst" :key="index">
					<view class="jl-c">
						<view class="flex">
							<view class="sr">{{ item.oid }}</view>
							<view class="sr-p text-neutral">{{ item.money }}</view>
						</view>
						<view class="pt16">{{ item.remark }}</view>
					</view>
					<view class="time">{{ item.ctime }}</view>
				</view>
			</view>
		</view>
		<u-loadmore :status="more" />
	</view>
</template>

<script>
	import fundsApi from '@/api/wall/index.js';
	export default {
		name: 'Other',
		data() {
			return {
				primary: this.$theme.primary,
				settingFile: getApp().globalData.siteinfo,
				nodata: '',
				more: 'more', //@value more loading前  	@value loading loading中  	@value 'noMore' 没有更多了
				tabTitle: ['全部', '项目', '收益', '本金'],
				cur: 0, //默认选中第一个tab
				p: 1,
				fundsLIst: []
			};
		},
		onReachBottom() {
			this.p++;
			this.more = 'loading';
			setTimeout(() => {
				this.getFundsLIst();
			}, 500);
		},
		onLoad() {
			this.getFundsLIst();
		},
		methods: {
			getFundsLIst() {
				fundsApi.record({
					p: this.p,
					pagesize: 10,
					type: 5
				}).then(res => {
					if (res.status == 200) {
						this.fundsLIst = this.fundsLIst.concat(res.data);
						if (res.data.length === 0) {
							this.more = 'noMore';
						}
					} else {
						this.more = 'noMore';
					}
				});
			}
		},
		onPullDownRefresh() {
			this.p = 1;
			this.fundsLIst = [];
			this.getFundsLIst();
			setTimeout(() => {
				uni.stopPullDownRefresh();
			}, 600);
		},
	};
</script>

<style lang="scss">
	.content {
		padding: 5rpx 15rpx 0rpx 15rpx;

		.h69 {
			background-color: #ffffff;
			padding: 21rpx 0;
			margin-bottom: 20rpx;
			overflow: hidden;
			border-radius: 15rpx;

		}

		.jl {
			width: 100%;
			margin-top: 20rpx
		}

		.jl .jl-c {
			width: calc(100% - 80rpx);
			margin: 0 auto;

			justify-content: space-between;
			align-items: center;
			overflow: hidden;

			.flex {
				display: flex;
				justify-content: space-between;
				border-bottom: 1px solid #eeeeee;
				padding-bottom: 12rpx;

				.sr {
					font-size: 26rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: rgba(51, 51, 51, 1);
					line-height: 36rpx;
				}

				.sr-p {
					font-size: 30rpx;
					font-family: PingFang SC;
					font-weight: bold;
				}
			}
		}

		.jl .pt16 {
			font-size: 26rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: rgba(51, 51, 51, 1);
			line-height: 36rpx;
			padding-top: 16rpx;
		}


		.jl .time {
			font-size: 24rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: rgba(153, 153, 153, 1);
			margin-left: 40rpx;
			margin-top: 10rpx;
		}

	}
</style>
