list.html 2.8 KB
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link rel="stylesheet" href="https://at.alicdn.com/t/font_834805_0ml90wdq5hzm.css">
    <link rel="stylesheet" href="__INDEX__/css/base.css">
    <link rel="stylesheet" href="__INDEX__/css/dinnerpart.css">
    <link rel="stylesheet" href="__INDEX__/css/swiper.min.css">
    <script type="text/javascript" src="__INDEX__/js/base.js" charset="utf-8"></script>
    <title>套餐专区</title>
    <style>
        a{text-decoration: none}
    </style>
</head>
<body>
<div class="container">
    <div class="navigation">
        <ul class="goodlist">
            <volist name="category" id="vo" key="k">
                <li data-id="{$vo.id}" <if condition="$k eq '1'">class="left active"<else/>class="left"</if>>
                    <em></em>
                    {$vo.name}
                </li>
            </volist>
        </ul>
    </div>
    <div class="goodinfo">
        <volist name="goodsList" id="vo">
            <a href="{:url('goods/Goods/detail',['id'=>$vo['id']])}">
                <div class="container_list">
                    <div class="text_img">
                        <img src="{$vo.thumb}" alt="">
                    </div>
                    <div class="container_info">
                        <p class="info_name">
                            {$vo.name}
                        </p>
                        <p class="info_num">
                            {$vo.intro}
                        </p>
                        <div class="people">
                            <p class="people_weight">
                                <if condition="$vo.caid eq 2">
                                    购买可获得{$vo.price*1.5}积分
                                    <else/>
                                    该商品无积分奖励
                                </if>
                            </p>
                            <p class="people_money"><span class="money">{$vo.price}</span></p>
                        </div>
                    </div>
                </div>
            </a>
        </volist>
    </div>
</div>
<script src="__INDEX__/js/jquery.min.js"></script>
<script>
    $(".goodlist li").click(function(){
        $(this).addClass("active");
        $(this).siblings("li").removeClass("active");
        var cid=$(this).attr('data-id');
        $.ajax({
            url:"{:url('goods/Goods/goodsList')}",
            data:{
                cid:cid
            },
            type:"POST",
            dataType:"JSON",

            success: function (data) {
                $(".goodinfo").html(data.data);
            }
        })
    })
</script>
</body>
</html>