index.html 10.7 KB
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="Author" content="李靖">
    <meta name="Keywords" content="">
    <meta name="Description" content="">
    <title>收藏</title>
    <meta name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <link rel="stylesheet" type="text/css" href="css/reset.css"/>
    <link rel="stylesheet" type="text/css" href="css/style.css"/>
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="js/autoSize.js"></script>
    <style>
        .diaCover-p{
            position: fixed;
            background: black;
            top: 50px;
            font-size: 15px;
            left: 50%;
            height: 40px;
            width: 400px;
            margin-left: -200px;
            color: white;
            text-align: center;
            line-height: 40px;
            border-radius: 10px;
            opacity: 0.8;
        }
    </style>
    <script>
    var uid;//用户ID
    var setOut = "";
        $(
                function () {
                    //判定登录
                    var dataRequestUrl="http://m.yohobuy.com/passport/login/user";
                    $.getJSON(dataRequestUrl+"?callback=?",
                        function(json) {
                            if (json.code === 200) {
                                uid=json.data;
                            } else {
                                var url ='https://m.yohobuy.com/signin.html?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":'
                                        +'/activity/favoriteAct/index.html'+'","param":{"from":"app"}},"requesturl":{"url":"","param":{}},"priority":"Y"}}';
                                window.location.href=url;
                            }
                        }
                    );

                    $(".good-c .add-btn").click(
                        function () {
                            var skn = $(this).parents("li").attr("sknNum");
                            $.ajax({
                                url: '/activity/favorite/addFavorite?productSkn=' + skn +'&uid=' + uid,
                                type: "get",
                                dataType: 'json',
                                success: function (data) {
                                    if (data.code === 200) {
                                        diaCover(data.message);
                                    } else {
                                        diaCover(data.message);
                                    }
                                }
                            });
                        }
                    );
                }
        );
        function diaCover(msg) {
            clearTimeout(setOut);
            $(".diaCover-p").remove();
            $("body").append("<div class='diaCover-p'>" + msg + "</div>");
            setOut = setTimeout("$('.diaCover-p').remove();",3000);
        }

    </script>
</head>
<body>
<div class="container">
    <div class="big-pic">
        <img src="images/big-pic.jpg"/>
    </div>
    <div class="big-pic">
        <img src="images/tip-pic-1.jpg"/>
    </div>
    <ul class="good-ul clearfix">
        <li sknNum="50000061">
            <div class="good-c">
                <div class="pic-c">
                    <img src="images/good.jpg"/>
                </div>
                <div class="price-c">
                    <span>¥100.00</span>
                    <span>¥100.00</span>
                </div>
                <img class="arr" src="images/arr.jpg"/>

                <div class="name-c">
                    <p>Madness</p>
                    <a class="add-btn">马上收藏</a>
                </div>
            </div>
            <div class="big-pic">
                <img src="images/good-dot.jpg"/>
            </div>
        </li>
        <li sknNum="51130761">
            <div class="good-c">
                <div class="pic-c">
                    <img src="images/good.jpg"/>
                </div>
                <div class="price-c">
                    <span>¥100.00</span>
                    <span>¥100.00</span>
                </div>
                <img class="arr" src="images/arr.jpg"/>

                <div class="name-c">
                    <p>Madness</p>
                    <a class="add-btn">马上收藏</a>
                </div>
            </div>
            <div class="big-pic">
                <img src="images/good-dot.jpg"/>
            </div>
        </li>
        <li sknNum="003">
            <div class="good-c">
                <div class="pic-c">
                    <img src="images/good.jpg"/>
                </div>
                <div class="price-c">
                    <span>¥100.00</span>
                    <span>¥100.00</span>
                </div>
                <img class="arr" src="images/arr.jpg"/>

                <div class="name-c">
                    <p>Madness</p>
                    <a class="add-btn">马上收藏</a>
                </div>
            </div>
            <div class="big-pic">
                <img src="images/good-dot.jpg"/>
            </div>
        </li>
        <li sknNum="004">
            <div class="good-c">
                <div class="pic-c">
                    <img src="images/good.jpg"/>
                </div>
                <div class="price-c">
                    <span>¥100.00</span>
                    <span>¥100.00</span>
                </div>
                <img class="arr" src="images/arr.jpg"/>

                <div class="name-c">
                    <p>Madness</p>
                    <a class="add-btn">马上收藏</a>
                </div>
            </div>
            <div class="big-pic">
                <img src="images/good-dot.jpg"/>
            </div>
        </li>
        <li sknNum="005">
            <div class="good-c">
                <div class="pic-c">
                    <img src="images/good.jpg"/>
                </div>
                <div class="price-c">
                    <span>¥100.00</span>
                    <span>¥100.00</span>
                </div>
                <img class="arr" src="images/arr.jpg"/>

                <div class="name-c">
                    <p>Madness</p>
                    <a class="add-btn">马上收藏</a>
                </div>
            </div>
            <div class="big-pic">
                <img src="images/good-dot.jpg"/>
            </div>
        </li>
        <li sknNum="006">
            <div class="good-c">
                <div class="pic-c">
                    <img src="images/good.jpg"/>
                </div>
                <div class="price-c">
                    <span>¥100.00</span>
                    <span>¥100.00</span>
                </div>
                <img class="arr" src="images/arr.jpg"/>

                <div class="name-c">
                    <p>Madness</p>
                    <a class="add-btn">马上收藏</a>
                </div>
            </div>
            <div class="big-pic">
                <img src="images/good-dot.jpg"/>
            </div>
        </li>
        <li sknNum="007">
            <div class="good-c">
                <div class="pic-c">
                    <img src="images/good.jpg"/>
                </div>
                <div class="price-c">
                    <span>¥100.00</span>
                    <span>¥100.00</span>
                </div>
                <img class="arr" src="images/arr.jpg"/>

                <div class="name-c">
                    <p>Madness</p>
                    <a class="add-btn">马上收藏</a>
                </div>
            </div>
            <div class="big-pic">
                <img src="images/good-dot.jpg"/>
            </div>
        </li>
        <li sknNum="008">
            <div class="good-c">
                <div class="pic-c">
                    <img src="images/good.jpg"/>
                </div>
                <div class="price-c">
                    <span>¥100.00</span>
                    <span>¥100.00</span>
                </div>
                <img class="arr" src="images/arr.jpg"/>

                <div class="name-c">
                    <p>Madness</p>
                    <a class="add-btn">马上收藏</a>
                </div>
            </div>
            <div class="big-pic">
                <img src="images/good-dot.jpg"/>
            </div>
        </li>
        <li sknNum="009">
            <div class="good-c">
                <div class="pic-c">
                    <img src="images/good.jpg"/>
                </div>
                <div class="price-c">
                    <span>¥100.00</span>
                    <span>¥100.00</span>
                </div>
                <img class="arr" src="images/arr.jpg"/>

                <div class="name-c">
                    <p>Madness</p>
                    <a class="add-btn">马上收藏</a>
                </div>
            </div>
            <div class="big-pic">
                <img src="images/good-dot.jpg"/>
            </div>
        </li>
        <li sknNum="010">
            <div class="good-c">
                <div class="pic-c">
                    <img src="images/good.jpg"/>
                </div>
                <div class="price-c">
                    <span>¥100.00</span>
                    <span>¥100.00</span>
                </div>
                <img class="arr" src="images/arr.jpg"/>

                <div class="name-c">
                    <p>Madness</p>
                    <a class="add-btn">马上收藏</a>
                </div>
            </div>
            <div class="big-pic">
                <img src="images/good-dot.jpg"/>
            </div>
        </li>
        <li sknNum="011">
            <div class="good-c">
                <div class="pic-c">
                    <img src="images/good.jpg"/>
                </div>
                <div class="price-c">
                    <span>¥100.00</span>
                    <span>¥100.00</span>
                </div>
                <img class="arr" src="images/arr.jpg"/>

                <div class="name-c">
                    <p>Madness</p>
                    <a class="add-btn">马上收藏</a>
                </div>
            </div>
            <div class="big-pic">
                <img src="images/good-dot.jpg"/>
            </div>
        </li>
    </ul>
    <div class="big-pic">
        <img src="images/tip-pic-2.jpg"/>
    </div>
    <div class="big-pic">
        <img src="images/big-pic.jpg"/>
    </div>
    <div class="big-pic">
        <img src="images/foot-dot.jpg"/>
    </div>
    <div class="big-pic">
        <a href="#">
            <img src="images/download.jpg"/>
        </a>
    </div>
    <div class="big-pic">
        <img src="images/foot.jpg"/>
    </div>
</div>
</body>
</html>