How can I use get_permalink() outside the loop?

Since you are calling get_permalink() outside of the loop, you need to define the post $id parameter.

You can access the post ID outside of the loop by invoking the global $post object and then referencing it’s ID value.

So your code would now look like this:

<?php if ( ICL_LANGUAGE_CODE=='zh-hans' ) : 

    global $post;
    $postid = $post->ID;

    ?>

    <script type="text/javascript" charset="utf-8" >
        var bShareOpt = {url: "<?php echo get_permalink( $postid ); ?>"};
    </script>
    <div class="social-content">
        <div class="bshare-custom">
            <div class="bsPromo bsPromo2"></div>
            <a title="分享到微信" class="bshare-weixin" href="https://wordpress.stackexchange.com/questions/176647/javascript:void(0);"></a>
            <a title="分享到新浪微博" class="bshare-sinaminiblog" href="https://wordpress.stackexchange.com/questions/176647/javascript:void(0);"></a>
            <a title="分享到QQ空间" class="bshare-qzone"></a>
            <a title="更多平台" class="bshare-more bshare-more-icon more-style-addthis"></a>
            <span class="BSHARE_COUNT bshare-share-count" style="float: none;">19.5K</span>
        </div>
    </div>
<?php endif; ?>