作者 徐治堂

购物车bug修改,页面跳转链接未设置,商品跳转未写

... ... @@ -22,7 +22,7 @@ class ZjCartController extends HomeBaseController
// $id=session('user.id');
$id=8;
$all=Db::name('zj_cart')->alias('c')->join('zj_goods g','c.gid=g.id')->join('zj_category ca','g.cid=ca.id')
->where('c.uid',$id)->field('c.id as cartid,c.gid,c.num,g.*,ca.cid as caid')->select();
->where('c.uid',$id)->where(['g.is_sta'=>'1','g.delete_time'=>'0'])->field('c.id as cartid,c.gid,c.num,g.*,ca.cid as caid')->select();
if (empty($all[0])){
$you=1;
}else{
... ...
... ... @@ -111,7 +111,7 @@
<else>
<a href="{:url('state',array('id'=>$vo['id'],'is_sta'=>'1'))}" class="js-ajax-dialog-btn" data-msg="确定上架商品">上架</a>
</eq>
<a href="{:url('delete',array('id'=>$vo['id']))}" class="js-ajax-delete">{:lang('DELETE')}</a>
<!--<a href="{:url('delete',array('id'=>$vo['id']))}" class="js-ajax-delete">{:lang('DELETE')}</a>-->
<a href="{:url('eva',array('id'=>$vo.id))}">查看评论</a>
</td>
</tr>
... ...
... ... @@ -271,17 +271,14 @@
$(".settle").click(function(){
var one=$('.one').filter('.icon-xuanzhong');
if (one.length>0){
data=[];
var data='';
for (i=0;i<one.length;i++){
var ii=one.eq(i).attr('data-id')
var nm=one.eq(i).attr('data-num')
data.push([ii,nm])
data+=ii+',';
}
$.ajax({
url:"{:url('')}",
type:'POST',
data:{data}
})
data=data.substr(0,data.length-1)
window.location.href="/cart/zj_cart/cart/id/"+ data +".html"
}
})
$(".see").click(function(){
... ...
... ... @@ -10,11 +10,44 @@
<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>
.swiper-container{
height:7.5rem;
font-size: 0.24rem;
}
.swiper-pagination-fraction{
color:#fff;
bottom:8px;
left:3.1rem;
}
.swiper-pagination-current{
color:#fff;
font-size: 0.38rem;
}
.swiper-pagination-current{
color:#fff;
}
</style>
</head>
<body>
<div class="container">
<div class="good_head">
<img src="{$data.thumb}" alt="">
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide">
<img src="__INDEX__/img/gooddetail.png" alt="" >
</div>
<div class="swiper-slide">
<img src="__INDEX__/img/gooddetail.png" alt="" >
</div>
<div class="swiper-slide">
<img src="__INDEX__/img/gooddetail.png" alt="" >
</div>
</div>
<div class="swiper-pagination"></div>
</div>
</div>
<div class="good_info">
<p class="good_name">
... ... @@ -95,7 +128,18 @@
</div>
</div>
<script src="__INDEX__/js/jquery.min.js"></script>
<script type="text/javascript" src="__INDEX__/js/swiper.min.js"></script>
<script>
//轮播图
var mySwiper = new Swiper('.swiper-container', {
pagination: {
el: '.swiper-pagination',
type: 'fraction',
},
autoplay: true,//可选选项,自动滑动
})
$(".good_content p").click(function(){
console.log($(this).html())
$(this).addClass("active");
... ...