{"size": 2614, "ext": "js", "max_stars_repo_path": "client/js/listdatil.js", "max_stars_repo_name": "QQWYH/VPH", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "client/js/listdatil.js", "max_issues_repo_name": "QQWYH/VPH", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "client/js/listdatil.js", "max_forks_repo_name": "QQWYH/VPH", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 34.3947368421, "max_line_length": 93, "alphanum_fraction": 0.3052792655}
$(() => {
    let url = location.search.split('=')[1];
    // let goodsArr = [];
    $.ajax({
        type: "get",
        data: { url },
        url: "../server/listdatil.php",
        dataType: "json",
        success(data) {
            let html = data.map(item => {
                // goodsArr = item
                return `
                <div class="show">
                <div class="f-show">
                    <div class="showlist">
                        <img src="${item.img}" alt="">
                        <div class="boxshow"></div>
                    </div>
                    <div class="maxshow">
                        <img src="${item.img}" alt="">
                    </div>
                </div>
                <div class=" showtext">
                    <div class="pib-title">
                        <a href="#"><img src="${item.logo}"></a>
                        <p class="pib-title-data">
                           ${item.goodsname}
                        </p>
                    </div>
                    <div class="pib-priver">
                        <div class="pib-privertxt">

                            <span class="text">${item.price}</span>

                            <del>${item.del}</del>
                            <span>${item.discount}</span>
                        </div>
                    </div>
                    <div class="pib-freight">
                        <span>运费：</span>
                        <span>新会员专享首单满38元免邮（限唯品自营商品，部分商品不可用）</span>
                    </div>
                    <div class="pib-count">
                        <span>数量：</span>
                        <span class="count">
                            <button>-</button>
                            <div class="count-n"><input id="num" type="text" value="1"></div>
                            <button>+</button>
                        </span>
                    </div>
                    <button class="carbtn">加入购物车</button>

                </div>
            </div>                                                            
                `;
            }).join("");
            $("#listshow").html(html)
            $(".carbtn").on("click", function () {
                $.ajax({
                    type: "get",
                    url: "../server/addcar.php",
                    dataType: "json",
                    data: { url },
                    success(data) {
                        console.log(data)
                    }

                })
                location.href = "../client/shoppingcar.html";
            })

        }
    });

})
