<?php defined('ByFeiWa') or exit('Access Invalid!');?>
<?php if(!empty($_SESSION['member_id'])) { ?>
<script type="text/javascript">
$(document).ready(function(){
    //分享
    $("#btn_sns_share").click(function(){
        $("#div_sns_share").shareshow_form_show({width:480});
    });
    $("#div_sns_share").shareshow_form({title:'<?php echo $lang['shareshow_text_share'];?>'});
    $("#commend_message").shareshow_publish({
        button_item:'#btn_publish',
        allow_null:'true'
    },function(){
        $("#div_sns_share").hide();
        ajaxpost('share_form', '', '', 'onerror'); 
    });
});
</script>
<!-- 弹出层开始 -->
<div id="div_sns_share" style="display:none;">
    <form action="<?php echo SHARESHOW_SITE_URL;?>/index.php?app=share&feiwa=share_save&type=<?php echo $_GET['app'];?>" method="post" id="share_form" class="feededitor">
        <?php if($_GET['app'] == 'goods') { ?>
        <input type="hidden" value="<?php echo $output['detail']['commend_id'];?>" name="share_id" id="share_id"></input>
        <div class="command-goods">
            <div class="pic">
                <span class="thumb size100">
                    <i></i>
                <?php $image_url = cthumb($output['detail']['commend_goods_image'], 60,$output['detail']['commend_goods_store_id']);?>
                <img src="<?php echo $image_url;?>" title="<?php echo $output['detail']['commend_goods_name'];?>" alt="<?php echo $output['detail']['commend_goods_name'];?>" /> </a>
                </span>
            </div>
            <div><?php echo $output['detail']['commend_goods_name'];?></div>
        </div>
        <?php } ?>
        <?php if($_GET['app'] == 'personal') { ?>
        <input type="hidden" value="<?php echo $output['detail']['personal_id'];?>" name="share_id" id="share_id"></input>
        <div class="command-goods">
            <div class="pic">
                <span class="thumb size100">
                    <i></i>
                    <?php $personal_image_array = getShareShowPersonalImageUrl($output['detail'],'tiny');?>
                    <img src="<?php echo $personal_image_array[0];?>" /> 
                </span>
            </div>
            <div><?php echo $output['detail']['store_name'];?></div>
        </div>
        <?php } ?>
        <?php if($_GET['app'] == 'store') { ?>
        <input type="hidden" value="<?php echo $output['detail']['shareshow_store_id'];?>" name="share_id" id="share_id"></input>
        <div class="command-goods">
            <div class="pic">
                <span class="thumb size100">
                    <i></i>
                        <img src="<?php echo getStoreLogo($output['detail']['store_avatar']);?>" alt="<?php echo $output['detail']['store_name'];?>" />
                </span>
            </div>
            <div><?php echo $output['detail']['store_name'];?></div>
        </div>
        <?php } ?>

        <dl class="share">
            <dt><?php echo $lang['shareshow_sns_share_title'];?></dt>
            <dd></dd>
            <textarea name="commend_message" id="commend_message" ></textarea>
        </dl>
        <div class="handle"><input id="btn_publish" type="button" value="<?php echo $lang['shareshow_text_share'];?>" /> <!-- 站外分享 -->
            <?php require('widget_share.php');?>
        </div>
    </form>
</div>
<!-- 弹出层结束 -->
<?php } else { ?>
<script type="text/javascript">
$(document).ready(function(){
    //分享
    $("#btn_sns_share").click(function(){
        var tooltips = $(this).parent().parent().find(".like_tooltips");
        tooltips.html('<?php echo $lang['no_login'];?>').show();
        setTimeout(function(){tooltips.hide()},2000);
    });
});
</script>
<?php } ?>


