当前位置:网站首页>Web page H5 wechat sharing

Web page H5 wechat sharing

2022-06-13 08:45:00 variation8

<!DOCTYPE html>
<html lang="zh-CN">
<head>

    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0"/>
    <link rel="dns-prefetch" href="//www.cdpll.cn"/>
    <link href=”http://www.cdpll.cn/" rel=”prefetch” />
    <title>{$content.title}</title>
    <meta name="description" content=" Chengdu fislock Electronic Technology Co., Ltd ">
    <link rel="stylesheet" href="__JS__/layui/css/layui.css">
    <script src="__JS__/jquery.min.js"></script>
    <script>
        var _hmt = _hmt || [];
        (function() {
            var hm = document.createElement("script");
            hm.src = "https://hm.baidu.com/hm.js?b96deb050e9a6b89ae554e77cf2331c3";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
    </script>
    <style>
        @media screen and (min-width: 320px) and (max-width: 500px) {
            .content{
                -webkit-touch-callout:none;
                -webkit-user-select:none;
                -khtml-user-select:none;
                -moz-user-select:none;
                -ms-user-select:none;
                user-select:none;
                pointer-events:none;
            }

            img {
                width: 100%;
                height: auto;
            }

            video {
                width: 100%;
                height: auto;
            }

            .bg {
                position: relative
            }

            .tel {
                width: 100%;
                height: 50px;
                background: #006dcc;
                color: white;
                line-height: 50px;
                font-size: 1.6rem;
                text-align: center;
            }

            .tel a {
                color: white;
            }

            .content {
                margin-top: 30px;
                padding: 0 15px;
            }
      .con{


}
            #go_top {
                cursor: pointer;
                position: fixed;
                _position: absolute;
                right: 23px;
                bottom: 60px;
                width: 30px;
                height: 30px;
                z-index: 60;
                display: none;
            }
        }
        @media only screen and (min-width: 500px){
            body{
                text-align:center;
            }
            .header{
                width: 750px;
                margin:  0 auto;
                text-align: center;
            }
            img {
                width: 750px;
                height: auto;
            }

            video {
                width: 750px;
                height: auto;
            }

            .bg {
                position: relative
            }

            .tel {
                position: relative;
                width: 750px;
                height: 50px;
                background: #006dcc;
                color: white;
                line-height: 50px;
                font-size: 2rem;
                text-align: center;
                left: 50%;
                margin-left: -375px;
            }

            .tel a {
                color: white;
            }

            .content {
                position: relative;
                text-align: center;
                width: 750px;
                display: block;
                left: 50%;
                margin-left: -375px;
            }
        }
    </style>

</head>
<body>
<if  class="header">
    <div class="bg" οncοntextmenu='return false' οndragstart='return false' onselectstart ='return false' οnselect='document.selection.empty()' οncοpy='document.selection.empty()' onbeforecopy='return false' οnmοuseup='document.selection.empty()'>
        <img src="__STATIC__/images/top.jpg">
    </div>
{if $content.type eq 1}
    <div class="con">
        <script>
            $(document).
            window.open('https://view.officeapps.live.com/op/view.aspx?src='+encodeURI(/public{$content.file}));
        </script>
        <iframe src='https://view.officeapps.live.com/op/view.aspx?src=+encodeURI(/public{$content.file}'  >
        </iframe>
    </div>

    {elseif $content.type eq 2 /}
    <div class="con">
        <iframe style="width: 100%;height:1500px;" src="__JS__/web/viewer.html?file=/public{$content.file}"></iframe>

    </div>

{else/}
    <div class="content" οncοntextmenu='return false' οndragstart='return false' onselectstart ='return false' οnselect='document.selection.empty()' οncοpy='document.selection.empty()' onbeforecopy='return false' οnmοuseup='document.selection.empty()'>
        {$content.content}
    </div>
{/if}

    <div class="tel">
        <a href="tel:xxx"> Customer consultation <span style="font-size: small">( Yang Xue )</span></a>
    </div>

    <a id="go_top" href="javascript:void(0);"><img style="width: 30px;" src="__STATIC__/images/gotop1.png"></a>
</div>
<script src="__JS__/layui/layui.all.js"></script>
    <script type="text/javascript" src="__JS__/jquery.media.js"></script>

<!-- Introducing WeChat SDK-->
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>

<script>

    function init_gotop()
    {
        $(document).scroll(function() {
            var y = $(this).scrollTop();
            if (y > 600) {
                $('#go_top').fadeIn();
            } else {
                $('#go_top').fadeOut();
            }
        });

        $('#go_top').click(function(){$('html,body').animate({scrollTop: '0px'}, 800);return false;});

    }
    $(document).ready(function(){
        init_gotop();
    });
    var url=encodeURIComponent(window.location.href.split('#')[0]);// Share again after successful sharing , Wechat will again url Secondary sharing signature error caused by additional parameters , Deal with it here to avoid config:invalid signature Invalid signature 
    $.ajax({
        type : "get",
        url : "http://www.cdpll.cn/jssdk.php?url="+url,// Replace URL ,xxx According to oneself jssdk File location modification 
        dataType : "jsonp",
        jsonp: "callback",
        jsonpCallback:"success_jsonpCallback",
        success : function(data){
            wx.config({
                debug: false, //  Turn on debugging mode , Call all api The return value of will be on the client side alert come out , To see the parameters passed in , Can be in pc End open , The parameter information will go through log play , Only in pc Only when the end is printed 
                appId: data.appId,
                timestamp: data.timestamp,
                nonceStr: data.nonceStr,
                signature: data.signature,
                jsApiList: [
                    "onMenuShareTimeline", // Share with friends 
                    "onMenuShareAppMessage", // Share with friends 
                    "onMenuShareQQ",  // Share the QQ
                    "onMenuShareWeibo" // Share to Weibo 
                ]
            });
        },
        error:function(data){
            alert(JSON.stringify(data));
            //alert(" The connection fails !");
        }
    });
    wx.ready(function (){
        var shareData = {
            title: '{$content.title}',
            desc: "{$content.introduction}",// Please pay special attention to the removal of html
            link: window.location.href,
            imgUrl: 'http://www.cdpll.cn/public{$content.thumb}'// Change to your own domain name 
        };
        wx.onMenuShareAppMessage(shareData);
        wx.onMenuShareTimeline(shareData);
        wx.onMenuShareQQ(shareData);
        wx.onMenuShareWeibo(shareData);
    });

</script>
</body>
</html>
<noscript>
    <iframe scr="*.htm"></iframe>
</noscript>
原网站

版权声明
本文为[variation8]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202270538126327.html