123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0" />
- <meta name="apple-mobile-web-app-capable" content="yes" />
- <meta name="apple-mobile-web-app-status-bar-style" content="black" />
- <title>产品详情</title>
- <style>
- #head{
- width:100%;
- height: 22rem;
- background: #fff;
- }
- #head ul>li img{
- width: 100%;
- height: 15.6rem;
- }
- #head ul>li p{
- width: 23rem;
- color: #666;
- margin: 0.4rem auto 0 auto;
- display: -webkit-box;
- overflow: hidden;
- white-space: normal!important;
- text-overflow: ellipsis;
- word-wrap: break-word;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- height: 3.3rem;
- font-size: 1.1rem;
- }
- #head ul>li span{
- font-size: 1.1rem;
- color: #ef3c29;
- }
- .money{
- width: 23.5rem;
- margin: 0 auto;
- display: block;
- height: 3rem;
- line-height: 3rem;
- }
- #head{
- /*box-shadow: 0 1px 4px rgba(55, 55, 55, 0.1);*/
- padding-bottom: 0.5rem;
- }
- #detail{
- height: 23rem;
- margin-top: 0.5rem;
- /*box-shadow: 0 1px 4px rgba(55, 55, 55, 0.1);*/
- background: #fff;
- padding: 0 1rem;
- }
- .detail{
- width:100%;
- margin-top:0.8rem;
- position:relative;
- margin-bottom: 2rem;
- padding: 2.6rem 0;
- }
- #detail .bord{
- padding:0.6rem 0;
- border-bottom: 1px solid #eee;
- }
- #detail .bord span{
- font-size: 0.9rem;
- color:#666;
- }
- .detail .hode{
- padding: 0.8rem 0;
- text-align: center
- }
- .detail .hode h2{
- font-size: 1.6rem;
- color: #0079c6;
- }
- .detail .ban{
- padding:0 0.4rem;
- }
- .detail .ban img{
- width:100%;
- height:11.6rem;
- }
- .car .gine{
- width: 3rem;
- height: 3em;
- position: fixed;
- bottom: 4rem;
- right: 1.5rem;
- }
- .car .number{
- width: 1.3rem;
- height: 1.3rem;
- border-radius: 1rem;
- background: #ef3c29;
- color: #fff;
- font-size: 0.9rem;
- position: fixed;
- bottom: 6rem;
- right: 1.1rem;
- text-align: center;
- line-height: 1.3rem;
- }
- .last{
- width: 100%;
- overflow: hidden;
- position: fixed;
- bottom: 0;
- box-shadow: 0 1px 4px rgba(55, 55, 55, 0.1);
- }
- .last span{
- float: left;
- width: 50%;
- height: 3rem;
- line-height: 3rem;
- text-align: center;
- background: #525d63;
- font-size: 0.9rem;
- color: #fff;
- display: inline-block;
- }
- .last .btd{
- background:#ef3c29
- }
- .buyselect .deth em{
- font-size: 1.1rem;
- position: absolute;
- top:0.3rem;
- }
-
- .buyselect{
- width: 100%;
- position: relative;
- overflow: hidden;
- text-align: center;
- padding: 2rem 0;
- border-bottom: 1px solid #efefef;
- background: #fefefe;
- }
- .buyselect .deth{
- font-size: 1.2rem;
- color: #eb3e2d;
- margin-left: 8rem;
- margin-top: -1.4rem;
- float: left;
- }
- .buyselect s{
- font-size: 0.9rem;
- color: #a6aaa9;
- }
- .buyselect .btn{
- width: 1.5rem;
- height: 1.5rem;
- position: absolute;
- top: 0.5rem;
- left: 22.4rem;
- }
- .list{
- width: 100%;
- padding: 0.6rem;
- overflow: hidden;
- background: #fff;
- line-height: 1.8rem;
- }
- .list span{
- font-size: 0.9rem;
- color: #686868;
- float: left;
- line-height: 2.24rem;
- }
- .list .mone{
- float: right;
- }
- .list .mone input{
- width: 1.8rem;
- height: 1.8rem;
- margin: 0 0.4rem;
- border: none;
- outline: none;
- background: #efefef;
- }
- .list .mone strong{
- color:#686868;
- line-height: 1.8rem;
- }
- .buyCon,.addCon{
- width: 100%;
- position: fixed;
- bottom: -20rem;
- }
- .buyCon .btd,.addCon .btd{
- width: 6rem;
- height: 6rem;
- position: absolute;
- top: -2.4rem;
- left: 0.5rem;
- z-index: 1;
- box-shadow: 0 1px 8px rgba(55, 55, 55, 0.1);
- }
- .swiper-container{
- height: 15.6rem;
- }
- .fox{
- background: #eb3e2d;
- text-align: center;
- font-size: 0.9rem;
- height: 3rem;
- line-height: 3rem;
- color: #fff;
- width: 100%;
- display: inline-block;
- border:none;
- }
- .quantity {
- display: inline-block;
- width: 6.86rem;
- height: 2.24rem;
- background-color: #F5F5F5;
- float: right!important;
- border: 1px solid #ccc;
- text-align: center;
- line-height: 2.24rem;
- font-size: 1.09rem;
- border-radius: 0.08rem;
- }
- .quantity em:first-child {
- border-right: 1px solid #ccc;
- background: url('/static/images/minus1.svg') no-repeat center center;
- background-size: 1.51rem 1.51rem;
- background-color: #fff;
- /* background-size: contain; */
- float: left;
- cursor: pointer;
- background-size: 50% 100%;
- display: inline-block;
- width: 2.18rem;
- height: 100%;
- font-size: 1.09rem;
- letter-spacing: -0.06rem;
- color: #ff0000;
- justify-content: center;
- align-items: center;
- }
- .quantity em:last-child {
- border-left: 1px solid #ccc;
- background: url('/static/images/plus1.svg') no-repeat center center;
- background-size: 1.51rem 1.51rem;
- background-color: #fff;
- float: right;
- cursor: pointer;
- background-size: 50% 100%;
- display: inline-block;
- width: 2.18rem;
- height: 100%;
- font-size: 1.09rem;
- letter-spacing: -0.06rem;
- color: #ff0000;
- justify-content: center;
- align-items: center;
- }
- #detail .detail *{
- max-width: 100%;
- color: #666;
- }
- .weaper{
- box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
- }
- </style>
- <script src="http://lib.sinaapp.com/js/jquery/1.9.1/jquery-1.9.1.min.js"></script>
- <script src="/static/js/common.js"></script>
- <link href="/static/css/swipe.css" type="text/css" rel="stylesheet">
- <link href="/static/css/style.css" type="text/css" rel="stylesheet">
- </head>
- <body style="background:#f5f5f5">
- <div class="dialog" style="width: 25rem;height: 42rem;position: fixed;top: 0; background: rgba(0,0,0,0.2);display: none"></div>
- <!--<img src="images/1商品详情信息介绍-ok.png" style="" class="backg">-->
- <div class="a"></div>
- <div id="head">
- <ul>
- <li>
- <div class="swiper-container">
- <div class="swiper-wrapper">
- {if !empty($product['images'])}
- {foreach $product['images'] as $img}
- <div class="swiper-slide"><img src="{$host}{$img}" width="100%" height="300"/></div>
- {/foreach}
- {/if}
- </div>
- <div class="swiper-pagination"></div>
- </div>
- <script src="/static/js/swipe.js"></script>
- <script>
- var swiper = new Swiper('.swiper-container', {
- pagination: '.swiper-pagination',
- paginationClickable: true
- });
- </script>
- <input type="hidden" value="{$product.product_no}" id="product_no"/>
- <p>
- {if !empty($product.type_name)}
- 【{$product.type_name}】
- {/if}
- {$product.product_name}</p>
- <span class="money">¥<em>{$product.sales_price}</em></span>
- </li>
- </ul>
- </div>
- <div id="detail">
- <div class="bord"><span>商品详情</span></div>
- <div class="detail">
- {$product.describe}
- </div>
- </div>
- <div class="car">
- <img src="/static/images/timg22.png" alt="" class="gine"/>
- {if !empty($car_sum)}
- <span class="numbers number">{$car_sum}</span>
- {else}
- <span class="numbers"></span>
- {/if}
- </div>
- <p class="last">
- <span class="wera add addCar">加入购物车</span>
- <span class="btd wera addOrder">立即购买</span>
- </p>
-
- <div class="weaper hod buyCon">
- <img src="{$host}{$product.images.0}" alt="" class="btd"/>
- <input type="hidden" value="{$product.sales_price}" class="danjia">
- <div class="buyselect">
- <sapn class="deth">
- <em style="width: 5rem;
- display: block;
- text-align: left;">¥<span class="price">{$product.sales_price}</span></em>
- </sapn>
- <img src="/static/images/timg23.png" alt="" class="btn close"/>
- </div>
- <div class="list">
- <span style="font-size: 0.9;color:#666;">数量</span>
- <span class="quantity">
- <em class="minus"></em>
- <i class="chooseNum">1</i>
- <em class="addNum"></em>
- </span>
- </div>
- <input type="button" class="fox" id="addOrder" value="立即下单" />
- </div>
-
- <div class="weaper hod addCon">
- <img src="{$host}{$product.images.0}" alt="" class="btd"/>
- <div class="buyselect">
- <sapn class="deth">
- <em style="width: 5rem;
- display: block;
- text-align: left;">¥{$product.sales_price}</em>
- </sapn>
- <img src="/static/images/timg23.png" alt="" class="btn close"/>
- </div>
- <div class="list">
- <span>数量</span>
- <span class="quantity">
- <em class="minus"></em>
- <i class="chooseNum">1</i>
- <em class="addNum"></em>
- </span>
- </div>
- <input type="button" class=" fox" id="addCar" value="添加到购物车"/>
- </div>
- <input type="hidden" value="{$doctor_no}" class="doctor">
- <input type="hidden" value="{$product.product_id}" class="product">
- </body>
- <script src="/static/layer/layer.js"></script>
- <script>
- $(function(){
- //进入购物车
- $('.gine').click(function () {
- window.location.href="{:url('/index/order/car')}";
- });
- //加入购物车
- $(".addCar").click(function(){
- $('.dialog').show();
- $(".addCon").animate({bottom:"0rem"})
- });
- //下订单
- $(".addOrder").click(function(){
- $('.dialog').show();
- $(".buyCon").animate({bottom:"0rem"})
- });
- //减少数量
- $(".minus").click(function(){
- var num = parseInt($(this).siblings(".chooseNum").html());
- if(num>1){
- num--;
- $(this).siblings(".chooseNum").html(num);
- }
- });
- //增加数量
- $(".addNum").click(function(){
- var num = parseInt($(this).siblings(".chooseNum").html())+1;
- $(this).siblings(".chooseNum").html(num);
- });
-
- //关闭
- $(".close").click(function(){
- $('.dialog').hide();
- $(this).parent().parent().animate({bottom:"-17.5rem"})
- })
- })
- //添加到购物车
- var doctor_no = $('.doctor').val();
- $('#addCar').click(function(){
- var num = $(this).parent().find('.chooseNum').html();
- $(this).parent().animate({bottom:"-17.5rem"})
- var product_no = $('#product_no').val();
- $('.dialog').hide();
- $.ajax({
- url: '/index/index/addCar',
- type: 'post',
- async:false,
- data:{product_no:product_no,num:num,doctor_no:doctor_no},
- dataType:'json',
- success: function (res) {
- layer.msg(res.msg);
- $('.car .numbers').html(res.data.car_sum);
- $('.car .numbers').addClass('number');
- }
- });
- });
- // $('.addNum').click(function () {
- // col();
- // })
- // $('.minus').click(function () {
- // col();
- // })
- // function col(){
- // var num = $(this).parent().find('strong').html();
- // var danjia = $('.danjia').val();
- // $('.price').html(danjia*num);
- // }
- // 直接购买
- $('#addOrder').click(function () {
- var num = $(this).parent().find('.chooseNum').html();
- var id = $('.product').val();
- var price = $('.danjia').val();
- var arr = new Array();
- arr[id] = num+"/"+doctor_no+"/"+price;
- var total_price = price*num;
- $.ajax({
- url: '/index/OrderInterfaces/insertOrder',
- type: 'GET',
- async:false,
- data:{total_price:total_price,arr:arr,count:num},
- dataType:'json',
- success: function (res){
- if(res.code == 200){
- window.location.href="{:url('/index/order/orderDetail')}";//订单详情页面
- }else{
- layer.msg(res.msg);
- }
- }
- });
- })
- </script>
- </html>
|