<template>
	<view class="container home clearfix" v-if="hasLogin">
		<!-- <view class="coupon-title" v-if="userIdentity == 4">优惠券仅限{{userName}}（机构）使用 </view> -->
		<view class="coupon-title" v-if="userIdentity == 4 || userIdentity == 2">优惠券仅限采美机构会员使用</view>
		<!-- <view class="coupon-title" v-if="userIdentity == 2">优惠券仅限{{userName}}使用 </view> -->
		<image class="coupon-image" src="http://static.caimei365.com/app/meibohui/app/activity-detail.jpg" mode=""></image>
	</view>
</template>

<script>
	import { mapState,mapMutations} from 'vuex';
	export default {
		components:{
			
		},
		data() {
			return {
				userName:'',
				userIdentity:0
			}
		},
		onLoad() {
			if(!this.hasLogin){
				uni.redirectTo({
					url:'../../login/login'
				})
			}
		},
		computed: {
			...mapState(['hasLogin','userInfo','identity','isActivity'])
		},
		methods: {

		},
		onShow(){
			this.$api.getComStorage('userInfo').then((resolve) =>{
				this.userName = resolve.name;
				this.userIdentity = resolve.userIdentity
			}).catch(error =>{
				
			})
		}
	}
</script>

<style lang="scss">
	page{
		
	}
	.container{
		width: 100%;
		height: auto;
		background-color: #ff2e4c;
		.coupon-title{
			position: absolute;
			width: 100%;
			height: 110rpx;
			line-height: 110rpx;
			font-size: $font-size-28;
			font-weight: bold;
			background-image: linear-gradient(0deg, #fffaec 0%, #fff7d6 50%, #fff4b9 100%), linear-gradient(#fffaef, #fffaef);
			box-sizing: border-box;
			padding: 0 24rpx;
			white-space: nowrap;
			text-overflow: ellipsis;
			overflow: hidden;
			color: #fd3c5b;
			text-align: center;
		}
		.coupon-image{
			width: 100%;
			height: 1860rpx;
			display: block;
			
		}
	}
</style>
