buy_detail.html 5.9 KB
<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <title>2-22-3商品详情</title>
    <meta name="viewport" content="initial-scale=1,maximum-scale=1, minimum-scale=1">
    <link rel="stylesheet" href="__TMPL__/public/assets/css/base.css">
    <link rel="stylesheet" href="__TMPL__/public/assets/css/swiper.min.css">
    <link rel="stylesheet" href="__TMPL__/public/assets/css/common/buy_goods_detail.css">
    <script src="__TMPL__/public/assets/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="__TMPL__/public/assets/js/swiper.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="__TMPL__/public/assets/js/base.js" type="text/javascript" charset="utf-8"></script>
    <style>
        .swiper-slide {
            height: 5rem;
        }

        .swiper-slide img {
            width: 7.5rem;
            height: 5.65rem;
        }
    </style>
</head>

<body>
<div class="container">
    <div class="swiper">
        <div class="swiper-container swiper-container-horizontal swiper-container-ios">
            <div class="swiper-wrapper">
                <volist name="pic" id="pic">
                    <div class="swiper-slide swiper-slide-top swiper-slide-prev"><img src="{:cmf_get_image_url($pic)}"></div>
                </volist>
            </div>
            <!-- Add Pagination -->
            <div class="swiper-pagination swiper-pagination-bullets">
            </div>
        </div>
    </div>
    <div class="goods_detail_desc">
        <p class="goods_detail_desc_money">¥{$art.money}<span>联系客服<img src="__TMPL__/public/assets/images/kefu_icon.png" alt=""></span></p>
        <p class="goods_detail_desc_title">{$art.name}</p>
        <p class="goods_detail_desc_content">{$art.intro}</p>
    </div>
    <div class="content_body">
        <div class="content_head">
            <ul class="select_card con_title">
                <li class="select_card_list con_curr">
                    <!-- <img src="images/buy_car.png" alt=""> -->
                    <em class="select_icon1"></em>
                    <span>商品详情</span>
                </li>
                <li class="select_card_list ">
                    <em class="select_icon2"></em>
                    <span>用户评价</span>
                </li>
            </ul>
        </div>
        <div class="con_all">
            <div class="con_warp">
                {$art.content}
            </div>
            <div class="con_warp" style="display: none">
                <ul class="con_list">
                    <li>
                        <div class="head_img_box">
                            <img src="__TMPL__/public/assets/images/detail_head_img.png" alt="">
                            <p class="user_name">穷艾尔雅</p>
                            <span class="release_time">2018-07-14</span>
                        </div>
                        <div class="pingjia_box">
                            <p class="pingjia_content">出行收纳更方便,体积更小轻松放入汽车后备箱,非常好的
                                一次租赁体验!期待下一次租赁!
                            </p>
                            <img  class="pingjia_image" src="__TMPL__/public/assets/images/111.png" alt="">
                            <img  class="pingjia_image" src="__TMPL__/public/assets/images/111.png" alt="">
                            <img  class="pingjia_image" src="__TMPL__/public/assets/images/111.png" alt="">
                            <img  class="pingjia_image" src="__TMPL__/public/assets/images/111.png" alt="">
                        </div>


                    </li>


                </ul>

            </div>
        </div>

    </div>
    <footer class="footer">
        <a href="{:url('Shopping/index')}">
        <div class="buycar_box">
            <span class="goods_num">{$cart}</span>
            <eq name="cart" value="0">
                <img class="footer_buycar_img" src="__TMPL__/public/assets/images/cdvcd@1x.png" alt="">
            <else/>
                <img class="footer_buycar_img" src="__TMPL__/public/assets/images/cdvcd@2x.png" alt="">
            </eq>
        </div>
        </a>
        <p class="footer_pay">前往支付</p>
        <p class="footer_buycar">加入购物车</p>
    </footer>
</div>
<script>
    $(document).ready(function() {
        get_main_content();

        var $menu_box = $('.content_body .con_title>li');
        $menu_box.click(function() {
            $(this).addClass('con_curr').siblings().removeClass('con_curr');
            var index = $menu_box.index(this);
            $('.con_all .con_warp').eq(index).show().siblings().hide();
        });

    })

    function get_main_content() {

    }
    //购物车跳转
    $('.footer_buycar_img').on('click', function() {
        window.location.href = "{:url('Shopping/index')}"
    })
    //购买商品轮播图
    var swiper = new Swiper('.swiper-container', {
        loop: true,
        speed: 2000,
        autoplay: true,
        pagination: {
            el: '.swiper-pagination',
            clickable: true,
        },
    });
    //点击添加购物车

    $('.footer_buycar').on('click', function() {
        $.ajax({
            type:"POST",
            url:"{:url('Shopping/add')}",
            data:{
                "vehicle_id":"{$Request.param.vehicle_id}",
            },
            success:function (data) {
                if(data.code == 1){
                    $('.goods_num').text(data.data)
                }else{
                    alert(data.message);
                }

            },
            error:function () {
            }
        })
    })
    //去购买
    $('.footer_pay').on('click', function() {
        window.location.href = "{:url('Rent/buySure')}"
    })
</script>
</body>

</html>