<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta name="viewport"
        content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" />
    <link rel="stylesheet" href="https://res.wx.qq.com/open/libs/weui/2.4.0/weui.min.css">
    <script src="/static/js/public/reset.js"></script>
    <link href="/static/css/public/reset.css" rel="stylesheet" />
    <link href="/static/css/public/public.css?v=4" rel="stylesheet" />
    <link href="/static/css/public/swiper.css" rel="stylesheet" />
    <link href="/static/css/107196/main.css" rel="stylesheet" />
    <title>广东众茶国际供应链管理有限公司</title>
    <style>
        .canvas {
            display: none;
        }
    </style>
</head>

<body>
    <div class="page__bd">
        <div class="weui-tab">
            <div class="weui-tab__panel" id="p2">
                <img src="/static/images/107196/bg2.png" class="bg">
                <div class="cpxx page">
                    <img src="/static/images/107196/logo.png" style="width: 14%;margin-bottom: .5rem;">
                    <div class="div2">
                        <img src="" id="labelImg" style="width: 40%;" />
                        <!-- 三维码 -->
                        <div class="p p-3">
                            <p>请用手触摸实物标签上的结构三维码，是否有明显凹感，并认真核对是否与上图信息一致，相符则为真品，否则谨防假冒！</p>
                        </div>
                        <div class="info">
                            <p>标签序号：<span id="cpidSpan" style="color: #2f63ac;"></span></p>
                            <p>供应单位：<span id="companyName">广东众茶国际供应链管理有限公司</span></p>
                            <p>查询次数：<span id="queryNum" style="color: #2f63ac;">1</span> 次</p>
                            <p>首查时间：<span id="firstTime"></span></p>
                        </div>
                        <div class="tips">
                            <div class="div3">
                                恭喜您验证通过！您所查询的是广东众茶国际供应链管理有限公司的<span>正牌产品标识！</span>
                            </div>
                            <div class="aibtn btn2 shop">点击按钮进入店铺</div>
                        </div>
                        <div class="aidiv">
                            <p style="font-size: .7rem;color: #2f63ac;">
                                您还可以点击下方按钮进行AI身份验证
                            </p>
                            <div id="ai" class="aibtn">AI匹配验证</div>
                        </div>
                        <hr style="margin: 1rem 0;">
                        <div class="syxx bg-white" style="background: #fcfefb;">
                            <h1 style="text-align: center;">[ 溯源信息 ]</h1>
                            <p>【品名】<span id="pm"></span></p>
                            <p>【类别】<span id="lb"></span></p>
                            <p>【规格】<span id="gg"></span></p>
                            <p style="display:none">【采摘时间】<span id="czsj"></span></p>
                            <p style="display:none">【加工流程】<span id="jglc"></span></p>
                            <div class="div3">
                                识别下方二维码，进入店铺购买
                            </div>
                        </div>
                        <div class="bg-white" id="proContent" style="text-align:left;font-weight:normal">
                            <!--<p>毛茶</p>
                            <img src="/static/images/107196/mc.jpg">-->
                        </div>
                        <!--<div class="bg-white bg-white2">
                            <p>封箱</p>
                            <img src="/static/images/107196/fx.jpg">
                        </div>
                        <div class="bg-white bg-white2">
                            <p>茶仓</p>
                            <img src="/static/images/107196/cc.jpg">
                        </div>-->
                    </div>
                </div>
                <div class="spjc page">
                    <div class="canvas" style="margin-bottom: 1rem;display:block">
                        <div class="h1">【审评检测】</div>
                        <div class="bg-white">
                            <div id="spjcImages" style="margin-top:20px"></div>
                        </div>
                    </div>
                    <div class="canvas">
                        <div class="h1">【检测报告】</div>
                        <div class="bg-white">
                            <img src="/static/images/107196/ls/jc1.jpg" style="width: 100%;">
                            <img src="/static/images/107196/ls/jc2.jpg" style="width: 100%;">
                            <img src="/static/images/107196/ls/jc3.jpg" style="width: 100%;">
                        </div>
                    </div>
                </div>
                <div class="gys page">
                    <div class="canvas" style="display:block">
                        <div class="h1">【商户介绍】</div>
                        <div class="bg-white">
                            <p id="gysName" style="text-align: center;"></p>
                            <div id="gysContents"></div>
                            <div id="gysImages" style="margin-top:20px"></div>
                            <!--<img src="/static/images/107196/ls/shjs.jpg" style="width: 100%;">-->
                        </div>
                    </div>
                </div>
                <div class="zcpt page">
                    <div class="contact">
                        <img src="/static/images/107196/logo.png" style="width: 14%;">
                        <div style="width: 100%;margin: .5rem 0 1.5rem;text-align: center;">
                            <img src="/static/images/107196/wx.jpg" style="width: 45%;">
                        </div>
                        <div style="padding: 0 .5rem;">
                            <p><span>广东众茶国际供应链管理有限公司</span></p>
                            <p><span>联系电话：</span>4000629666</p>
                            <p><span>邮箱：</span>Service@utea88.com</p>
                            <p><span>官网：</span>www.utea88.com</p>
                            <p><span>地址：</span>广东省东莞市南城街道绿色路29号3栋20楼</p>
                        </div>
                    </div>
                    <img src="/static/images/107196/pt5.jpg" style="width: 100%;">
                    <img src="/static/images/107196/pt6.jpg" style="width: 100%;">
                </div>
                <div class="cpjs page">
                </div>
                <!--<div class="xcx" style="display: none">
                    <img src="/static/images/107196/xcx.jpg?v=1" style="width:100%;" class="shop" id="shop">
                    <div class="close" id="close">×</div>
                </div>-->
                <div class="xcx2" style="display: none;">
                    <div class="xcx2" id="xcxcover"></div>
                    <div class="xcx3">
                        <img src="/static/images/107196/xcx.jpg?v=1" style="width:100%;">
                        <p>长按识别二维码 进入店铺</p>
                    </div>
                </div>
            </div>
            <div class="tabbar">
                <div class="weui-tabbar">
                    <div id="cp" class="weui-tabbar__item weui-bar__item_on">
                        <div class="weui-tabbar__icon">
                            <img src="/static/images/107196/1.png" class="hide" />
                            <img src="/static/images/107196/2.png" class="show" />
                        </div>
                        <p class="weui-tabbar__label">产品信息</p>
                    </div>
                    <div id="sp" class="weui-tabbar__item">
                        <div class="weui-tabbar__icon">
                            <img src="/static/images/107196/3.png" class="hide" />
                            <img src="/static/images/107196/4.png" class="show" />
                        </div>
                        <p class="weui-tabbar__label">审评检测</p>
                    </div>
                    <div id="gys" class="weui-tabbar__item">
                        <div class="weui-tabbar__icon">
                            <img src="/static/images/107196/5.png" class="hide" />
                            <img src="/static/images/107196/6.png" class="show" />
                        </div>
                        <p class="weui-tabbar__label">供应商</p>
                    </div>
                    <div id="pt" class="weui-tabbar__item">
                        <div class="weui-tabbar__icon">
                            <img src="/static/images/107196/7.png" class="hide" />
                            <img src="/static/images/107196/8.png" class="show" />
                        </div>
                        <p class="weui-tabbar__label">众茶平台</p>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- <script src="https://res.wx.qq.com/open/libs/weuijs/1.2.1/weui.min.js"></script> -->
    <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
    <script src="/static/js/jquery-2.1.0.min.js"></script>
    <script src="/static/js/public/public.js?v=6"></script>
    <script src="/static/js/public/swiper.js"></script>
    <script>

        var mySwiper = new Swiper('#case', {
            loop: true,
            autoplay: true,
            pagination: {
                el: '.swiper-pagination',
            },
        });

        tj_public.showLoading();
        tj_public.wxInit({
            wx_officail_account_id: 6,
            url: window.location.href
        })

        $(function () {

            //wx.ready(function () {
            //    tj_public.getAddress(function (lat, lng) {
            //        getInfo(lat, lng)
            //    })
            //})
            //wx.error(function (res) {
            //    getInfo(0, 0)
            //});

            let author = tj_public.getQueryString('access');
            if (author === '1') {
                access();
            }
            function access() {
                $('.aidiv').hide();
                $('.tips').show();
            }

            //var uid = tj_public.getCookie('TJWX_consumer_id');
            var label_code = tj_public.getCookie('label_code');
            getInfo(0, 0)
            function getInfo(lat, lng) {
                $.ajax({
                    url: '/wx/label/scan_record/',
                    data: { lat: lat, lng: lng, compid: 107196, fwcode: label_code, contents: 1 },
                    success: function (res) {
                        if (res.e === '') {
                            tj_public.hideLoading();
                            $("#labelImg").attr("src", res.img);
                            $("#cpidSpan").text(res.bcode);
                            $("#queryNum").text(res.cnt);
                            if (res.tm_1st) {
                                $("#firstTime").text(res.tm_1st);
                            }
                            else {
                                var myDate = new Date();
                                $("#firstTime").text(myDate.toLocaleString());
                            }
                            var contents = '';
                            if (res.product_contents) {
                                contents = decodeURIComponent(res.product_contents);
                            }
                            $("#pm").text(res.product_name);
                            $("#czsj").text(res.product_aging);
                            if (res.vendor_id) {
                                findVendor(res.vendor_id)
                            }

                            var product_id = res.product_id
                            if (product_id) {
                                $("#proContent").html(decodeURIComponent(res.product_contents))
                                $.ajax({
                                    url: '/product/detail/',
                                    data: {
                                        id: product_id
                                    },
                                    success: function (product) {
                                        console.log(product)
                                        $("#lb").text(product.series);
                                        $("#jglc").text(product.processflow);

                                        for (var p of product.props) {
                                            if (p.desc === '规格') {
                                                $("#gg").text(p.value);
                                            }

                                        }


                                    }
                                })
                            }
                            // if (res.inventory.length > 0) {
                            //     var inv = res.inventory[0];
                            //     var shengchandate = new Date(inv.time.replace(/-/g, '/')).toLocaleDateString();

                            //     contents += `<p>生产日期：${shengchandate}</p>`;
                            //     contents += `<p>生产批次号：${inv.voucher_no}</p>`;
                            //     if (res.inventory.length > 1) {
                            //         var inv2 = res.inventory[1];
                            //         var chuchangdate = new Date(inv2.time.replace(/-/g, '/')).toLocaleDateString();
                            //         contents += `<p>出厂日期：${chuchangdate}</p>`;
                            //     }
                            // }
                            if (contents !== '') {
                                $("#syxx").html(contents);
                                $("#syxx").fadeIn();
                            }


                        } else {
                            alert('网络超时！')
                        }
                    }, error: function () {
                        alert('网络超时！')
                    }
                })
            }

            $('.weui-tabbar__item').on('click', function () {
                $(this).addClass('weui-bar__item_on').siblings('.weui-bar__item_on').removeClass('weui-bar__item_on');
                common();
                $('.xcx').show();
            });
            $('#ai').on('click', function () {
                window.location.href = 'https://tjfnew.china315net.com/tjswm/ai/route/route.ashx?compid=41708&cpid='+label_code;
            });
            $('#cp').on('click', function () {
                $('.cpxx').show();
                $('.div2').fadeIn();
            });
            $('#sp').on('click', function () {
                $('.spjc').show();
            });
            $('#gys').on('click', function () {
                $('.gys').show();
            });
            $('#pt').on('click', function () {
                $('.zcpt').show();
            });
            $('.xl').on('click', function () {
                common();
                $('.xcx').hide();
                var cp = $(this).attr('name');
                $('.cp-pages').show();
                $('.' + cp).show();
            });
            $('.back').on('click', function () {
                common();
                $('.cpjs').show();
                $('.xcx').show();
            });
            $('#shop').on('click', function () {
                $('.xcx2').show();
            });
            $('#xcxcover').on('click', function () {
                $('.xcx2').hide();
            });
            $('#close').on('click', function () {
                $('.xcx').css('visibility', 'hidden')
            });
			$('.spjcImages').on('click', function () {
				console.log($(this).attr("src"));
				tj_public.bigimg({ tckid: "bigimg", src: $(this).attr("src") });
			});
            function common() {
                $('.page').animate({ scrollTop: 0 });
                $('.page').hide();
            }

            function findVendor(id) {
                $.ajax({
                    url: '/mes/detail/',
                    data: {
                        id
                    },
                    success: function (res) {
                        console.log(res);
                        $("#gysContents").html(res.contents);
                        $("#gysName").html(res.name);
                        $("#companyName").html(res.name);
                        for (var img of res.images) {
                            if (img.photo) {
                                if (img.category_name === '审评检测图片') {
                                    $("#spjcImages").append('<img src="/media/' + img.photo + '" class="spjcImages" style="width:100%"/>');
									$('.spjcImages').on('click', function () {
										console.log($(this).attr("src"));
										tj_public.bigimg({ tckid: "bigimg", src: $(this).attr("src") });
									})
                                }
                                else {
                                    $("#gysImages").append('<img src="/media/' + img.photo + '" style="width:100%"/>')
                                }
                            }
                        }
                    }
                })

            }
        });


    </script>
</body>

</html>