<template>
	<view class="intro-page common">
		<view class="top-class"></view>
		<view class="title">
			个人中心
		</view>
		<view class="head">
			<u-row class="row-class">
				<u-col span="4">
					<image class="logo-img"
						src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/logo.png"
						mode="aspectFit" />
				</u-col>
				<u-col span="4">
					<image class="commodity-img"
						src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/commodity.png"
						mode="aspectFit" />
				</u-col>
				<u-col span="4">
					<image class="logo-rules"
						src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/rules.png"
						@click="openDetail" />
				</u-col>
			</u-row>
		</view>
		<view class="topImg">
			<image class="img_1" src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/topImg.png"
				mode="heightFix" />
		</view>



		<view class="content">
			<view class="cardTop">

			</view>
			<view class="">
				<u-row customStyle="margin-bottom: 10px">
					<u-col span="4">
						<image class="tubiao"
							src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/logo3.png"
							mode="aspectFit" />
					</u-col>
					<u-col span="8">
						<view class="jf_phone">
							{{userPhone}}
						</view>
						<view class="text-class">
							我的积分: <span class="point">{{ point }} </span>
						</view>
					</u-col>

				</u-row>
			</view>
			<view class="content_text">
				<u-row style="height: 200rpx;">
					<u-col span="4" textAlign="center" @click="jumpScanLog">
						<image class="tubiao" src="/static/images/tabbar/cjx/scan.png" mode="aspectFit" />
						<view class="text-class">
							扫码记录
						</view>
					</u-col>
					<u-col span="4" textAlign="center" @click="jumpScanAddress">
						<image class="tubiao"
							src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/shopIco.png"
							mode="aspectFit" />
						<view class="text-class">
							积分商城
						</view>
					</u-col>
					<u-col span="4">

					</u-col>
				</u-row>
			</view>
			<view class="return_view">
				<view class="return-button" @click="goBack()">返回</view>
			</view>

		</view>
		<!--			<CustomTabbar />-->
	</view>
</template>

<script>
	import CustomTabbar from '@/components/tabbar_common.vue';
	import {
		getMiniCustomerUserInfo
	} from '@/api/scan';
	export default {
		components: {
			CustomTabbar
		},
		data() {
			return {
				userPhone: '',
				point: 0
			}
		},
		onLoad() {
			this.initUserData();
		},
		methods: {
			initUserData() {
				let that = this;
				getMiniCustomerUserInfo().then(res => {

					if (res.code == 0) {
						that.userPhone = res.data.phone;
						that.point = res.data.point;
						console.log(that.point);
					}
				})
			},
			goBack() {
				uni.navigateBack();
			},
			jumpScanLog() {
				uni.navigateTo({
					url: '/pages/cjx/record/record'
				});
			},
			jumpScanAddress() {
				uni.navigateTo({
					url: '/pages/cjx/shop/shop?type=0'
				});
			}

		}
	}
</script>

<style lang="scss" scoped>
	@import url('../../../static/scss/common_cjx.css');

	.row-class {
		height: 80rpx;
	}
	.cardTop{
		background-image:
			url("https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/myCardType.png");
	}
	.content_text {
		height: calc(100% - 370rpx);
	}

	.theme-text {
		height: 10vh;
		text-align: center;
		line-height: 11vh;

		.textImage {
			height: 80rpx;
			width: 400rpx;
		}
	}

	.intro-card {
		margin: 0 32rpx;
		padding: 32rpx 24rpx 24rpx 24rpx;
		background: rgba(131, 100, 71, 0.5);
		border-radius: 10rpx;


		.intro-view {
			border: 1px solid #341B10;
			padding: 10px;
			margin: 10px;
			position: relative;


			.intro-label {
				background-image:
					url("https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/guzhenganzi/label.png");
				/* 使用绝对路径 */
				background-size: contain;
				background-repeat: no-repeat;
				width: 220rpx;
				height: 120rpx;
				position: absolute;
				margin-top: -70rpx;
				align-content: center;

				.label-title {
					font-weight: bold;
					font-size: 30rpx;
					color: #341B10;
					text-align: center;
					margin-left: 10px;
					height: 120rpx;
					line-height: 110rpx;
				}
			}

			.intro-content {
				font-size: 28rpx;
				color: #5c4322;
				line-height: 1.8;
				margin: 20rpx 0px;
				text-align: justify;
				height: 38vh;
			}

		}

	}

	.textImage {
		height: 80rpx;
		width: 400rpx;
	}

	.content {
		height: 68vh;
		border-radius: 10rpx;
		margin: 0rpx 40rpx;
		padding: 10rpx 24rpx;
		overflow: auto;
		align-items: center;
		justify-content: center;
		background-image:
			url("https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/cardBgi.png");
		background-size: cover;
		background-position: center;
		background-repeat: no-repeat;

	}

	.company-img {
		width: 160rpx;
		height: 160rpx;
		border-radius: 12rpx;
		object-fit: cover;
		margin-top: 10rpx;
		background: #eee;
		border-radius: 80rpx;
	}

	.touxiang {
		height: 120px;
		align-content: center;
		justify-content: center;
		text-align: center;
	}

	.tubiao {
		background-size: cover;
		/* 确保背景图片自适应填充整个容器 */
		background-position: center;
		/* 背景图片居中显示 */
		background-repeat: no-repeat;
		/* 防止背景图重复 */
		height: 120rpx;
		width: 100%;
	}

	.text-class {
		color: #fff;
	}

	.jf_phone {
		font-weight: bold;
		font-size: 30rpx;
		color: #F5F5F5;
		color: #fff;
		margin-bottom: 10rpx;
	}

	.point {
		font-weight: bold;
		font-size: 30rpx;
		color: #E22ADD;
	}
</style>