<?php
    $down_info_arr=get_post_meta( get_the_ID(), 'down_info', true );
    $ceoshop_3_zz_sz = _ceo('ceoshop_3_zz_sz'); 
?>

<div class="ceo_app_shop">
    <div class="app_shop_mk" <?php if(_ceo('ceoshop_3_bg') == true): ?>style="background: url(<?php echo _ceo('ceoshop_3_bg_img'); ?>) no-repeat center top;background-size: 100% 100%;"<?php endif; ?>>
        <?php if(_ceo('ceo_app_shop_img') == true): ?>
        <div class="app_shop_img">
            <img src="<?php echo post_thumbnail_src(); ?>" data-src="<?php echo post_thumbnail_src(); ?>" alt="<?php the_title(); ?>">
        </div>
        <?php endif; ?>
        <div class="app_shop_title">
            <h1 class="app_shop_title_h1" title="<?php the_title(); ?>">
                <?php get_template_part( 'template-parts/single/single', 'biaoqian' ); ?>
                <?php the_title(); ?>
            </h1>
            <div class="p2">
                <div class="ceo-text-small ceo-text-muted ceo-flex ceo-text-truncate ceo-overflow-auto">
				    <div class="avatar ceo-flex-middle">
					    <?php if(_ceo('ceoshop_single_rq_zz') == true): ?>
					    <span class="ceo-text-small ceo-display-block ceo-single-right"><i class="iconfont icon-bussiness-man"></i> <?php the_author_posts_link(); ?></span>
					    <?php endif; ?>
				    </div>
				    <?php if(_ceo('ceoshop_single_rq_fabu') == true): ?>
					<span class="ceo-flex-1 ceo-display-inline-block ceo-single-right ceo-flex ceo-flex-middle"><i class="iconfont icon-rili"></i> <?php the_time('Y-m-d') ?></span>
					<?php endif; ?>
					<?php if(_ceo('ceoshop_single_ll_liulan') == true): ?>
					<span class="ceo-display-inline-block ceo-flex ceo-flex-middle"><i class="iconfont icon-yanjing"></i> <?php post_views('', ''); ?></span>
					<?php endif; ?>
					
					<?php if(_ceo('ceoshop_single_bj_bianji') == true): ?>
					<span class="ceo-display-inline-block ceo-single-left ceo-flex ceo-flex-middle"><?php edit_post_link('<i class="iconfont icon-edit"></i> 编辑'); ?>
					</span>
					<?php endif; ?>
				</div>
            </div>
        </div>
    </div>
    
    <div class="app_shop_jg ceo-flex">
        <span class="app_shop_jg_se ceo-flex-1">
            <em style="font-size: 12px;">¥</em>
            <span id="priceinfo"><?php echo $price=get_post_meta(get_the_ID(), 'down_price', true); ?></span>
            <em style="font-size: 12px;"><?php echo get_option('ice_name_alipay')?get_option('ice_name_alipay'):'C币'; ?> </em>
        </span>
        
        <!--点赞收藏按钮-->
        <?php if(_ceo('ceoshop_3_anniu_dzsc') == true): ?>
        <div class="p4">
            <a href="javascript:;" data-action="topTop" data-id="<?php the_ID(); ?>" class="ceo-display-inline-block btn change-color dotGood <?php echo isset($_COOKIE['dotGood_' . $post->ID]) ? '' : ''; ?>">
    		<i class="iconfont icon-dianzan"></i> 点赞 (<span class="count"><?php echo ($dot_good=get_post_meta($post->ID, 'dotGood', true)) ? $dot_good : '0'; ?></span>)
        	</a>
            <?php echo zongcai_post_collection_button( get_the_ID() );?>
        </div>
        <?php endif; ?>
    </div>
    
    <!--VIP权限-->
    <div class="app_shop_vip">
        <span class="app_shop_vip_title">
            <?php
            $content='';
            $memberDown=get_post_meta(get_the_ID(), 'member_down',TRUE);
            $indexMemberDown = $memberDown;
            $userType=getUsreMemberType();
    
            $erphp_url_front_vip = get_bloginfo('wpurl').'/users?pd=money';
            if(get_option('erphp_url_front_vip')){
                $erphp_url_front_vip = get_option('erphp_url_front_vip');
            }
            $erphp_url_front_login = wp_login_url();
            if(get_option('erphp_url_front_login')){
                $erphp_url_front_login = get_option('erphp_url_front_login');
            }
            if(is_user_logged_in()){
                $erphp_url_front_vip2 = $erphp_url_front_vip;
            }else{
                $erphp_url_front_vip2 = $erphp_url_front_login;
            }
    
            if($indexMemberDown > 1){
                $vipText = '';
                if($userType){
                    $vipText = '';
                }
                if($indexMemberDown==3 && $down_info==null){
                    $content.='<i class="iconfont icon-sketch"></i>VIP免费'.$vipText.'';
                }elseif ($indexMemberDown==2 && $down_info==null){
                    $content.='<i class="iconfont icon-sketch"></i>VIP 5折'.$vipText.'';
                }elseif ($indexMemberDown==5 && $down_info==null){
                    $content.='<i class="iconfont icon-sketch"></i>VIP 8折'.$vipText.'';
                }elseif ($indexMemberDown==6 && $down_info==null){
                    if($userType < 9){
                        $vipText = '';
                    }
                    $content.='<i class="iconfont icon-sketch"></i>年费VIP免费'.$vipText.'';
                }elseif ($indexMemberDown==7 && $down_info==null){
                    if($userType < 10){
                        $vipText = '';
                    }
                    $content.='<i class="iconfont icon-sketch"></i>终身VIP免费'.$vipText.'';
                }elseif ($indexMemberDown==4){
                    if($userType){
                        $content.='<i class="iconfont icon-sketch"></i>此资源为VIP专享资源';
                    }
                }elseif ($indexMemberDown==8){
                    if($userType >= 9){
                        $content.='<i class="iconfont icon-sketch"></i>此资源为年费VIP专享资源';
                    }
                }elseif ($indexMemberDown==9){
                    if($userType >= 10){
                        $content.='<i class="iconfont icon-sketch"></i>此资源为终身VIP专享资源';
                    }
                }
            }
            if($indexMemberDown==4 && $userType==FALSE){
                $content.='<i class="iconfont icon-sketch"></i>此资源仅限VIP下载';
            }elseif($indexMemberDown==8 && $userType < 9){
                $content.='<i class="iconfont icon-sketch"></i>此资源仅限年费VIP下载';
            }elseif($indexMemberDown==9 && $userType < 10){
                $content.='<i class="iconfont icon-sketch"></i>此资源仅限终身VIP下载';
            }
    
            echo $content;
            ?>
        </span>
    </div>
    <script>
        $('.pricelt li').click(function () { !$(this).hasClass('disabled') && $(this).addClass("on").siblings().removeClass("on"); });
    </script>
    <div class="app_shop_an">
        <div class="xz">
            <!--下载按钮-->
            <div class="xz1">
                <a class="makeFunc" href="javascript:void(0)" onclick="ceoshop_download('<?php echo $post_id; ?>')"><i class="iconfont icon-download"></i>
                <?php if(_ceo('ceoshop_single_an'))echo _ceo('ceoshop_single_an')['ceoshop_single_an_xz']; ?>
                </a>
            </div>
            
            <!--升级会员-->
            <div class="xz1">
                <a class="shop3-vip" href="<?php if(_ceo('ceoshop_single_an'))echo _ceo('ceoshop_single_an')['ceoshop_single_an_hyl']; ?>" target="_blank" >
                    <i class="iconfont icon-vip"></i> <?php if(_ceo('ceoshop_single_an'))echo _ceo('ceoshop_single_an')['ceoshop_single_an_hy']; ?>
                </a>
            </div>
        </div>
        
        <!--演示按钮-->
        <?php if(get_post_meta( get_the_ID(), 'down_demourl', true )){?>
        <span class="ceo-shop3-demo">
            <a href="<?php echo get_post_meta( get_the_ID(), 'down_demourl', true );?>" target="_blank" rel="noreferrer nofollow" >
            <i class="iconfont icon-phone"></i> <?php if(_ceo('ceoshop_single_an'))echo _ceo('ceoshop_single_an')['ceoshop_single_an_ys']; ?>
            </a>
        </span>
        <?php }?>
        
        <!--提示语-->
        <?php if(_ceo('ceoshop_3_y') == true): ?>
        <div class="hont"><i class="iconfont icon-info-circle"></i><?php echo _ceo('ceoshop_3_ys'); ?></div>
        <?php endif; ?>
        
    </div>
    <?php if(_ceo('ceoshop_3_zz') == true): ?>
    <div class="app_mother ceo-text-truncate ceo-overflow-auto"><i class="iconfont icon-cart-Empty"></i><?php echo _ceo('ceoshop_3_zz_title'); ?>：
        <?php 
    	if ($ceoshop_3_zz_sz) { 
    		foreach ( $ceoshop_3_zz_sz as $key => $value) {
    	?>
    	<span><?php echo $value['title']; ?><em></em></span>
        <?php } } ?>
    </div>
    <?php endif; ?>
</div>