<template>
	<view class="container cashier">
        <tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading="true" :loadingType="5" />
        <template v-else>
            <custom :navbar-data='nvabarData' />
            <scroll-view scroll-y="true" class="container-banner" :style="{ paddingTop:CustomBar + 180 +'px',paddingBottom: isIphoneX ? '68rpx' : '34rpx'}">
                <view class="list" v-for="(shop,index) in list" :key="index">
                    <view class="list-logo">
                        <image class="list-logo-img" :src="shop.shopLogo" mode=""></image>
                    </view>
                    <view class="list-name">
                        <text class="list-name-text">{{ shop.shopName }}</text>
                    </view>
<!--                    <view class="list-area">
                        {{ shop.area }}
                    </view> -->
                    <view class="list-state acve" v-if="shop.shopSign === 1">已打卡</view>
                    <view class="list-state none" v-else>未打卡</view>
                </view>
            </scroll-view>
        </template>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				nvabarData: {		//顶部自定义导航
					haveBack:false,
					haveHome:true,
					showCapsule:1, // 是否显示左上角图标  1表示显示  0表示不显示,
					showSearch: 0,
					title: '',  // 导航栏 中间的标题
					textLeft:this.$store.state.isIphone
				},
				isIphoneX:this.$store.state.isIphoneX,
				CustomBar:this.CustomBar,// 顶部导航栏高度
				params:{
                    userId:'',
                },
                list:[
                    {
                        shopName:'华熙生物',
                        logo:'https://img.caimei365.com/group1/M00/00/00/rB-lF2AJICKAIcmFAABHg2JMCqg567.jpg',
                        area:'展区A',
                        state:0,
                    },
                    {
                        shopName:'华熙生物华熙生物华熙生物',
                        logo:'https://img.caimei365.com/group1/M00/00/00/rB-lF2AJICKAIcmFAABHg2JMCqg567.jpg',
                        area:'展区A',
                        state:1,
                    },
                    {
                        shopName:'华熙生物',
                        logo:'https://img.caimei365.com/group1/M00/00/00/rB-lF2AJICKAIcmFAABHg2JMCqg567.jpg',
                        area:'展区A',
                        state:0,
                    },
                    {
                        shopName:'华熙生物华熙生物华熙生物',
                        logo:'https://img.caimei365.com/group1/M00/00/00/rB-lF2AJICKAIcmFAABHg2JMCqg567.jpg',
                        area:'展区A',
                        state:1,
                    },
                    {
                        shopName:'华熙生物',
                        logo:'https://img.caimei365.com/group1/M00/00/00/rB-lF2AJICKAIcmFAABHg2JMCqg567.jpg',
                        area:'展区A',
                        state:1,
                    },
                    {
                        shopName:'华熙生物',
                        logo:'https://img.caimei365.com/group1/M00/00/00/rB-lF2AJICKAIcmFAABHg2JMCqg567.jpg',
                        area:'展区A',
                        state:1,
                    },
                    {
                        shopName:'华熙生物',
                        logo:'https://img.caimei365.com/group1/M00/00/00/rB-lF2AJICKAIcmFAABHg2JMCqg567.jpg',
                        area:'展区A',
                        state:0,
                    },
                    {
                        shopName:'华熙生物',
                        logo:'https://img.caimei365.com/group1/M00/00/00/rB-lF2AJICKAIcmFAABHg2JMCqg567.jpg',
                        area:'展区A',
                        state:0,
                    },
                    {
                        shopName:'华熙生物',
                        logo:'https://img.caimei365.com/group1/M00/00/00/rB-lF2AJICKAIcmFAABHg2JMCqg567.jpg',
                        area:'展区A',
                        state:0,
                    }
                ]
			}
		},
		onLoad() {
            this.initData()
		},
		methods:{
            // 初始化
            async initData() {
            	const userInfo = await this.$api.getStorage()
                this.params.userId = userInfo.userId
                this.userTicketSignList(this.params)
            },
            // 获取展台打卡列表
            async userTicketSignList(params){
            	try{
            		const res = await this.UserService.userTicketSignList(params)
                    this.list = res.data
                    this.skeletonShow = false
            	}catch(error){
            		console.log('获取展台列表信息异常~')
            	}
            }
		},
		onShow() {
			
		}
	}
</script>

<style lang="scss">
	page{
        background-color: #3d68eb;
		height: auto !important;
	}
    .container-banner{
        width: 100%;
        height: auto;
        background: url(https://admin.caimei365.com/userfiles/1/images/photo/2024/08/ziluo_bg.jpg) no-repeat;
        background-size: contain;
        box-sizing: border-box;
        padding: 0 24rpx;
        overflow: hidden;
        .list{
            width: 100%;
            height: 200rpx;
            background-color: #FFFFFF;
            border-radius: 24rpx;
            margin-bottom: 20rpx;
            box-sizing: border-box;
            padding: 20rpx;
            display: flex;
            align-items: center;
            position: relative;
            .list-logo{
                display: flex;
                width: 160rpx;
                height: 160rpx;
                border-radius: 50%;
                background-color: #F7F7F7;
                overflow: hidden;
                border: 1px solid #e1e1e1;
                .list-logo-img{
                    width: 160rpx;
                    height: 160rpx;
                    display: block;
                    border-radius: 50%;
                }
            }
            .list-name{
                display: flex;
                flex: 1;
                justify-content: center;
                font-size: $font-size-26;
                .list-name-text{
                    display: inline-block;
                    width: 180rpx;
                    -o-text-overflow: ellipsis;
                    text-overflow: ellipsis;
                    display: -webkit-box;
                    word-break: break-all;
                    -webkit-box-orient: vertical;
                    -webkit-line-clamp: 1;
                    overflow: hidden;
                }
            }
            .list-area{
                display: flex;
                flex: 1;
                justify-content: center;
                font-size: $font-size-26;
            }
            .list-state{
                position: absolute;
                height: 44rpx;
                border-radius: 22rpx;
                right: 20rpx;
                top: 20rpx;
                line-height: 44rpx;
                padding: 0 10rpx;
                font-size: $font-size-22;
                &.none{
                    background-color: #999999;
                    color: #FFFFFF;
                }
                &.acve{
                    background-color: #e10078;
                    color: #FFFFFF;
                }
            }
        }
    }
	
</style>
