<!DOCTYPE html>
<html class="ui-mobile">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="user-scalable=yes, width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
    <title>产品二维码追溯查询系统</title>
    <link href="/css/style.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" type="text/css" href="/css/rk1126.css"/>
    <script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
    <script type="text/JavaScript">
        var geolocation = new qq.maps.Geolocation("OB4BZ-D4W3U-B7VVO-4PJWW-6TKDJ-WPB77", "myapp");
        var options = {timeout: 0};

        function showPosition(position) {
            var jg_position = JSON.stringify(position);
            var js_jg = JSON.parse(jg_position);//转换为json对象 nation province city addr
            var dwdz = js_jg.nation + js_jg.province + js_jg.city + js_jg.addr;

            document.getElementById("dwdz").innerHTML = dwdz;
        };
    </script>
</head>
<body class="ui-mobile-viewport ui-overlay-a" style="zoom: 1;background-color: #eeeeee;">
<div class="top">
    <div class="log_btb">产品二维码追溯查询系统</div>
</div>
<img src="/uploads/banner.jpg" style="width:100%;"/>
<div class="prolisthome" style="width: 97%; margin-top:10px;margin-right:auto; margin-left:auto; ">
    <!-- 二维码信息 -->
    <div class="claname bor_4">
        <div class="cls colo_4"><a class="key-click">　二维码信息</a></div>
    </div>
    <div class="proinfo" id="sub4" style="display:block">
        <table style="font-size:16px; width: 97%; margin-top:10px;margin-right:auto; margin-left:auto;border-radius: 8px 8px 8px 8px;border: 0px; ">
            <tbody>
            <tr style="border: 0px;color: #000;">
                <td width="30%" class="td"
                    style="border-color:#cccccc; height: 30px;border-bottom: 0px;border-top: 0px;border-left: 0px;">
                    单元识别码：
                </td>
                <td width="70%" class="td" id="barcode" style="height: 30px;border: 0px;">{{ $trace->key }}</td>
            </tr>
            </tbody>
        </table>
        <table style="font-size:16px; width: 97%; margin-top:10px;margin-right:auto; margin-left:auto;border-radius: 8px 8px 8px 8px;border: 0px; ">
            <tbody>
            <tr style="border: 0px;color: #000;">
                <td width="30%" class="td"
                    style="border-color:#cccccc;  height: 30px;  border-bottom: 0px;border-top: 0px;border-left: 0px;">
                    本次扫码地址：
                </td>
                <td width="70%" class="td" id="location"
                    style="height: 30px;border: 0px;">{{$location}}</td>
            </tr>
            </tbody>
        </table>
        <table style="font-size:16px; width: 97%; margin-top:10px;margin-right:auto; margin-left:auto;border-radius: 8px 8px 8px 8px;border: 0px; ">
            <tbody>
            <tr style="border: 0px;color: #000;">
                <td width="30%" class="td"
                    style="border-color:#cccccc; height: 30px;border-bottom: 0px;border-top: 0px;border-left: 0px;">
                    浏览次数：
                </td>
                <td width="70%" class="td" id="companyname"
                    style="height: 30px;border: 0px;">{{ $trace->look_count }}</td>
            </tr>
            </tbody>
        </table>

    </div>

    <!--产品信息-->
    <div class="claname bor_1" id="cpxx">
        <div class="cls colo_1"><a class="key-click">　产品详情信息</a></div>
    </div>
    <div class="proinfo" id="sub1" style="display: block;">
        @if($good->name)
            <table style="font-size:16px; width: 97%; margin-top:10px;margin-right:auto; margin-left:auto;border-radius: 8px 8px 8px 8px;border: 0px; ">
                <tbody>
                <tr style="border: 0px;color: #000;">
                    <td width="30%" class="td"
                        style="border-color:#cccccc; height: 30px;border-bottom: 0px;border-top: 0px;border-left: 0px;">
                        商品名：
                    </td>
                    <td width="70%" class="td" id="pname" style="height: 30px;border: 0px;">{{ $good->name }}</td>
                </tr>
                </tbody>
            </table>
        @endif
        <table style="font-size:16px; width: 97%; margin-top:10px;margin-right:auto; margin-left:auto;border-radius: 8px 8px 8px 8px;border: 0px; ">
            <tbody>
            <tr style="border: 0px;color: #000;">
                <td width="30%" class="td"
                    style="border-color:#cccccc; height: 30px;border-bottom: 0px;border-top: 0px;border-left: 0px;">
                    登记名称：
                </td>
                <td width="70%" class="td" id="batchno"
                    style="height: 30px;border: 0px;">{{ $good->register_name }}</td>
            </tr>
            </tbody>
        </table>
        <table style="font-size:16px; width: 97%; margin-top:10px;margin-right:auto; margin-left:auto;border-radius: 8px 8px 8px 8px;border: 0px; ">
            <tbody>
            <tr style="border: 0px;color: #000;">
                <td width="30%" class="td"
                    style="border-color:#cccccc; height: 30px;border-bottom: 0px;border-top: 0px;border-left: 0px;">
                    农药登记证号：
                </td>
                <td width="70%" class="td" id="select1" style="height: 30px;border: 0px;">{{ $good->card_id }}</td>
            </tr>
            </tbody>
        </table>
        @if($good->duxing)
            <table style="font-size:16px; width: 97%; margin-top:10px;margin-right:auto; margin-left:auto;border-radius: 8px 8px 8px 8px;border: 0px; ">
                <tbody>
                <tr style="border: 0px;color: #000;">
                    <td width="30%" class="td"
                        style="border-color:#cccccc; height: 30px;border-bottom: 0px;border-top: 0px;border-left: 0px;">
                        毒性：
                    </td>
                    <td width="70%" class="td" id="first1" style="height: 30px;border: 0px;">{{ $good->duxing }}</td>
                </tr>
                </tbody>
            </table>
        @endif
        <table style="font-size:16px; width: 97%; margin-top:10px;margin-right:auto; margin-left:auto;border-radius: 8px 8px 8px 8px;border: 0px; ">
            <tbody>
            <tr style="border: 0px;color: #000;">
                <td width="30%" class="td"
                    style="border-color:#cccccc; height: 30px;border-bottom: 0px;border-top: 0px;border-left: 0px;">剂型：
                </td>
                <td width="70%" class="td" id="codelevel1" style="height: 30px;border: 0px;">{{ $good->jixing }}</td>
            </tr>
            </tbody>
        </table>
        @if($good->shengchan_id)
            <table style="font-size:16px; width: 97%; margin-top:10px;margin-right:auto; margin-left:auto;border-radius: 8px 8px 8px 8px;border: 0px; ">
                <tbody>
                <tr style="border: 0px;color: #000;">
                    <td width="30%" class="td"
                        style="border-color:#cccccc; height: 30px;border-bottom: 0px;border-top: 0px;border-left: 0px;">
                        生产批准证号：
                    </td>
                    <td width="70%" class="td" id="codelevel1"
                        style="height: 30px;border: 0px;">{{ $good->shengchan_id }}</td>
                </tr>
                </tbody>
            </table>
        @endif
        @if($good->changpin_id)
            <table style="font-size:16px; width: 97%; margin-top:10px;margin-right:auto; margin-left:auto;border-radius: 8px 8px 8px 8px;border: 0px; ">
                <tbody>
                <tr style="border: 0px;color: #000;">
                    <td width="30%" class="td"
                        style="border-color:#cccccc; height: 30px;border-bottom: 0px;border-top: 0px;border-left: 0px;">
                        产品标准号：
                    </td>
                    <td width="70%" class="td" id="codelevel1"
                        style="height: 30px;border: 0px;">{{ $good->changpin_id }}</td>
                </tr>
                </tbody>
            </table>
        @endif
        <table style="font-size:16px; width: 97%; margin-top:10px;margin-right:auto; margin-left:auto;border-radius: 8px 8px 8px 8px;border: 0px; ">
            <tbody>
            <tr style="border: 0px;color: #000;">
                <td width="30%" class="td"
                    style="border-color:#cccccc; height: 30px;border-bottom: 0px;border-top: 0px;border-left: 0px;">
                    产品规格：
                </td>
                <td width="70%" class="td" id="codelevel1" style="height: 30px;border: 0px;">{{ $good->guige }}</td>
            </tr>
            </tbody>
        </table>
        <table style="font-size:16px; width: 97%; margin-top:10px;margin-right:auto; margin-left:auto;border-radius: 8px 8px 8px 8px;border: 0px; ">
            <tbody>
            <tr style="border: 0px;color: #000;">
                <td width="30%" class="td"
                    style="border-color:#cccccc; height: 30px;border-bottom: 0px;border-top: 0px;border-left: 0px;">保质期：
                </td>
                <td width="70%" class="td" id="codelevel1" style="height: 30px;border: 0px;">{{ $good->baozhiqi }}</td>
            </tr>
            </tbody>
        </table>
        <table style="font-size:16px; width: 97%; margin-top:10px;margin-right:auto; margin-left:auto;border-radius: 8px 8px 8px 8px;border: 0px; ">
            <tbody>
            <tr style="border: 0px;color: #000;">
                <td width="30%" class="td"
                    style="border-color:#cccccc; height: 30px;border-bottom: 0px;border-top: 0px;border-left: 0px;">
                    产品性能：
                </td>
                <td width="70%" class="td" id="codelevel1" style="height: 30px;border: 0px;">{{ $good->yongtu }}</td>
            </tr>
            </tbody>
        </table>
        <table style="font-size:16px; width: 97%; margin-top:10px;margin-right:auto; margin-left:auto;border-radius: 8px 8px 8px 8px;border: 0px; ">
            <tbody>
            <tr style="border: 0px;color: #000;">
                <td width="30%" class="td"
                    style="border-color:#cccccc; height: 30px;border-bottom: 0px;border-top: 0px;border-left: 0px;">
                    储存方法：
                </td>
                <td width="70%" class="td" id="codelevel1" style="height: 30px;border: 0px;">{{ $good->cuncu }}</td>
            </tr>
            </tbody>
        </table>
        @if($good->zhongdu)
            <table style="font-size:16px; width: 97%; margin-top:10px;margin-right:auto; margin-left:auto;border-radius: 8px 8px 8px 8px;border: 0px; ">
                <tbody>
                <tr style="border: 0px;color: #000;">
                    <td width="30%" class="td"
                        style="border-color:#cccccc; height: 30px;border-bottom: 0px;border-top: 0px;border-left: 0px;">
                        中毒急救：
                    </td>
                    <td width="70%" class="td" id="codelevel1"
                        style="height: 30px;border: 0px;">{{ $good->zhongdu }}</td>
                </tr>
                </tbody>
            </table>
        @endif
        <table style="font-size:16px; width: 97%; margin-top:10px;margin-right:auto; margin-left:auto;border-radius: 8px 8px 8px 8px;border: 0px; ">
            <tbody>
            <tr style="border: 0px;color: #000;">
                <td width="30%" class="td"
                    style="border-color:#cccccc; height: 30px;border-bottom: 0px;border-top: 0px;border-left: 0px;">
                    注意事项：
                </td>
                <td width="70%" class="td" id="codelevel1" style="height: 30px;border: 0px;">{{ $good->zhuyi }}</td>
            </tr>
            </tbody>
        </table>

        @if($good->youxiao)
            <table style="font-size:16px; width: 97%; margin-top:10px;margin-right:auto; margin-left:auto;border-radius: 8px 8px 8px 8px;border: 0px; ">
                <tbody>
                <tr style="border: 0px;color: #000;">
                    <td width="100%" class="td"
                        style="border-color:#cccccc; height: 30px;border-bottom: 0px;border-top: 0px;border-left: 0px;">
                        <img src="{{$good->youxiao}}" alt=""/>
                    </td>
                </tr>
                </tbody>
            </table>
        @endif

        <table style="font-size:16px; width: 97%; margin-top:10px;margin-right:auto; margin-left:auto;border-radius: 8px 8px 8px 8px;border: 0px; ">
            <tbody>
            <tr style="border: 0px;color: #000;">
                <td width="30%" class="td"
                    style="border-color:#cccccc; height: 30px;border-bottom: 0px;border-top: 0px;border-left: 0px;">
                    追溯网址：
                </td>
                <td width="70%" class="td" id="address" style="height: 30px;border: 0px;"><a
                            style="text-decoration: underline;">{{$trace->url }}</a>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <!--追溯信息-->
    <div class="claname bor_3" id="zsxx">
        <div class="cls colo_3"><a class="key-click">　企业信息</a></div>
    </div>
    <div class="proinfo" id="sub3" style="display: block;">
        <table style="font-size:16px; width: 97%; margin-top:10px;margin-right:auto; margin-left:auto;border-radius: 8px 8px 8px 8px;border: 0px; ">
            <tbody>
            <tr style="border: 0px;color: #000;">
                <td width="30%" class="td"
                    style="border-color:#cccccc; height: 30px;border-bottom: 0px;border-top: 0px;border-left: 0px;">
                    企业名称：
                </td>
                <td width="70%" class="td" id="fhs" style="height: 30px;border: 0px;">{{ $good->company }}</td>
            </tr>
            </tbody>
        </table>
        @if($good->tel)
            <table style="font-size:16px; width: 97%; margin-top:10px;margin-right:auto; margin-left:auto;border-radius: 8px 8px 8px 8px;border: 0px; ">
                <tbody>
                <tr style="border: 0px;color: #000;">
                    <td width="30%" class="td"
                        style="border-color:#cccccc; height: 30px;border-bottom: 0px;border-top: 0px;border-left: 0px;">
                        技术热线：
                    </td>
                    <td width="70%" class="td" id="fhsj" style="height: 30px;border: 0px;">{{ $good->tel }}</td>
                </tr>
                </tbody>
            </table>
        @endif
        @if($good->address)
            <table style="font-size:16px; width: 97%; margin-top:10px;margin-right:auto; margin-left:auto;border-radius: 8px 8px 8px 8px;border: 0px; ">
                <tbody>
                <tr style="border: 0px;color: #000;">
                    <td width="30%" class="td"
                        style="border-color:#cccccc; height: 30px;border-bottom: 0px;border-top: 0px;border-left: 0px;">
                        公司地址：
                    </td>
                    <td width="70%" class="td" id="jxs" style="height: 30px;border: 0px;">{{ $good->address }}</td>
                </tr>
                </tbody>
            </table>
        @endif
    </div>

</div>
<table style="width: 97%;margin-right:auto; margin-left:auto;">

</table>
<p style="text-align:center">&copy;技术支持：希梦耐康网络科技</p>
<iframe id="geoPage" width=0 height=0 frameborder=0 style="display:none;" scrolling="no"
        src="https://apis.map.qq.com/tools/geolocation?key=NLWBZ-PZPKX-4S54G-TMF4X-NHJA6-PDBRP&referer=myapp">
</iframe>

<script type="text/javascript">
    $(function () {

        window.addEventListener('message', function (event) {
            var loc = event.data;
            if (loc && loc.module == 'geolocation') {
                let location = loc.nation + loc.province + loc.city;
                $('#location').text(location);
            }
        }, false);

        setTimeout(function () {
            var location = $("#location").text();
            var ip = "{{$ip}}";
            if (location == '') {
                $.get('/test?ip=' + ip, function (data) {
                    $('#location').text(data);
                });
            }
        }, 5000);

//        $('.claname').click(function(){
//            var index = $(this).index('.claname');
//            $('.proinfo').eq(index).fadeIn().siblings('.proinfo').hide();
//        });
    });
</script>

</body>
</html>
