<template>
	<view style="position: relative;">
		<!-- 胶囊 -->
		<mvBar :mysNavConfig="mysNavConfig"></mvBar>
		<view :style="{marginTop:navH}"></view>
		<view class="head">
			<view class="show-point">
				<p style="font-size: 36rpx">当前积分</p>
				<p style="margin-top: 20rpx;font-size: 36rpx;font-weight: 600;">0</p>

			</view>
		</view>

		<view class="content">
			<view class="point-card">
				<view class="point-card-left">
					<p>成团新用户</p>
					<p style="margin-top: 20rpx;font-size: 32rpx;">2022-7-12 14:00</p>
				</view>
				<view class="point-card-right">
					<p>+100</p>
				</view>
			</view>

			<view class="point-card">
				<view class="point-card-left">
					<p>成团新用户</p>
					<p style="margin-top: 20rpx;font-size: 32rpx;">2022-7-12 14:00</p>
				</view>
				<view class="point-card-right">
					<p>+100</p>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import mvBar from "@/components/mys_navBar/mysNavBar";
	import {
		fansview
	} from '@/components/utils.js';
	export default {
		components: {
			mvBar,
		},
		data() {
			return {
				navH: getApp().globalData.navHeight,
				mysNavConfig: {
					/* 开启单页显示首页图标 */
					isHome: true,
					/* 固定导航  */
					navFixed: true,
					/* 标题 （屏幕中心居中 两边图标中心居中使用slot center1） */
					navTitle: {
						text: "创作者积分明细",
						color: "",
						fontSize: "32rpx", // px upx rpx
						fontWeight: "normal", // 100 - 700
					},
					btnType: "type2",
					onLeftClick: "/pages/mycenter/mycenter",
					/* type2 按钮 */
					type2Config: {
						// 左图标
						leftPath: "/static/img/png2.png",
						// 右图标
						rightPath: "/static/img/png4.png",
						// 圆角
						radius: "40rpx",
					},
				},

			}
		},
		async onLoad(options) {
			// 判断登录
			await this.isLogin();
			if (this.token === '') {
				uni.showModal({
					content: '请先登录',
					success: function(res) {
						if (res.confirm) {
							uni.navigateTo({
								url: '/pages/login/login'
							});
						} else if (res.cancel) {
							uni.navigateBack();
						}
					}
				});
			}
		},
		methods: {
			// 判断登陆是否过期
			isLogin() {
				return this.$https.get('/youngee/c/t/g/is-login')
					.then(res => {
						if (res.data.code === 403) {
							// 登陆已失效
							this.token = ""
							uni.clearStorage();
						} else {
							this.token = uni.getStorageSync('token')
						}
					})
			},
		}
	}
</script>

<style>
	p {
		font-size: 32rpx;
	}

	.head {
		margin: 10rpx 3%;
		border-radius: 15rpx;
		background-color: #f0d232;
		height: 200rpx;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.show-point {
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.content {
		margin: 10rpx 3%;
	}

	.point-card {
		padding: 20rpx 3%;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.point-card-left {
		display: flex;
		flex-direction: column;
		justify-content: start;
	}

	.point-card-right p {
		color: #f0d232;
		font-weight: 600;
	}
</style>
