<template>
	<view>
		<view class="money">
			<view class="moneysize">{{userinfo.member_points}}</view>
			<view>我的圈币</view>
		</view>
		<van-cell v-for="(item,index) in point_list" :key="index" use-label-slot :title="'圈币来源:'+item.pl_desc" >
			<template>
				+{{item.pl_points}}
			</template>
			<template slot="label">
				{{item.pl_addtime}}
			</template>
		</van-cell>
	</view>
</template>

<script>
	    export default {
	        onReady: function() {
				console.log("进来了")
				   uni.setNavigationBarColor({
					   frontColor: '#ffffff',
					   backgroundColor: '#D9332E',
					   animation: {
						   duration: 400,
						   timingFunc: 'easeIn'
					   }
				   })
	        },
			data() {
				return{
					page: 1,
					point_list:[],
					userinfo:{}
				}
			},
			onLoad() {
				this.getuserinfo();
				this.getlist();
			},
			methods:{
				getuserinfo() {
					this.request({
						url:'/v2/member/info',
						method:'GET',
						success:(res)=>{
							let { data } = res.data;
							this.userinfo = data;
						}
					})
				},
				// 获取圈币明细
				getlist() {
					this.request({
						url: '/v2/member/points',
						method: 'post',
						data: {
							page:　this.page,
							page_size:　10
						},
						success: (res) => {
							console.log(res);
							this.point_list = res.data.data.point_list;
						}
					})
				}
			}
	      
	    }
</script>

<style lang="scss">
	.money {
		height: 140upx;
		color: #fff;
		text-align: center;
		background-color: #D9332E;
		font-size: 28upx;
		.moneysize {
			font-size: 42upx;
			padding-top: 25upx;
		}
	
	}
</style>
