作者 anyv
1 个管道 的构建 通过 耗费 0 秒

7987

... ... @@ -253,6 +253,35 @@ class IndexController extends WeChatBaseController
}
/**
* 搜索跳转详情页
*/
public function search_goods_details(){
$goods_id = $this -> request -> param();
$data = Db::name('goods') -> alias('a') -> join('classification b','a.classify_id = b.id','LEFT') -> where('a.id',$goods_id['goods_id']) -> find();
$price = explode('.',$data['price']);
$pricing = explode('.',$data['pricing']);
$data['price0'] = $price[0];
$data['price1'] = $price[1];
$data['pricing0'] = $pricing[0];
$data['pricing1'] = $pricing[1];
$data['det_img'] = json_decode($data['det_img'],true);
$this -> assign('det_img',$data['det_img']);
$this -> assign('data',$data);
$data_label = Db::name('label') -> alias('a') -> field("a.*,b.goods_id,b.label_id") -> join('goods_label b','a.id=b.label_id','LEFT') -> where("b.goods_id = ".$goods_id['goods_id']) -> select();
$this -> assign('data_label',$data_label);
if($data['type'] == 1){
//相关推荐
$data_recomm = Db::name('goods') -> where("classify_id =".$data['classify_id']." and type = 1") -> limit(3) -> select();
$this -> assign('data_recomm',$data_recomm);
$this -> assign('is_recomm',1);
}else{
$this -> assign('is_recomm',2);
}
return $this -> fetch();
}
... ...
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>学考无忧-详情页</title>
<link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css">
<link rel="stylesheet" href="__TMPL__/public/assets/css/base.css">
</head>
<body>
<div class="detail_box">
<!-- 顶部 -->
<div class="detail_top order_top">
<a href="{:url('Index/search_salesman_goods')}">
<img src="__TMPL__/public/assets/images/left2.png" alt="">
</a>
<p style="color:white">商品详情</p>
</div>
<!-- banner 顶部 -->
<div class="de_top">
<!-- 图片 -->
<div class="de_topImg">
<img src="{:cmf_get_image_url($data.show_img)}" alt="">
</div>
<!-- 文字 -->
<div class="de_topTxt">
<!-- 价格 -->
<div class="de_topTxt1">
<p class="de_topTxt1_1"><span>{$data.price0}</span>.{$data.price1}</p>
<p class="de_topTxt1_2"><span>{$data.pricing0}</span>.{$data.pricing1}</p>
</div>
<!-- 名字 -->
<div class="de_topTxt2 txt-cut">{$data.book_name}</div>
<!-- 其他 -->
<div class="de_topTxt3">
<span>作者:{$data.author}</span>
<span>适合年级:{$data.grade}</span>
<span>销量:{$data.sales}</span>
</div>
</div>
</div>
<!-- 出版 -->
<div class="de_main2">
<ul class="de_main2_1">
<li>
<p class="de_main2Txt1">出版社</p>
<span class="de_main2Txt2">{$data.press}</span>
<img class="de_main2Img" src="__TMPL__/public/assets/images/29.png" alt="">
</li>
<li>
<p class="de_main2Txt1">出版时间</p>
<span class="de_main2Txt2">{$data.press_time}</span>
<img class="de_main2Img" src="__TMPL__/public/assets/images/29.png" alt="">
</li>
</ul>
<!-- 提示 -->
<div class="de_main2_2">
<ul>
<volist name="data_label" id="vo">
<li>{$vo.name}</li>
</volist>
</ul>
</div>
</div>
<!-- 相关推荐 -->
<if condition="$is_recomm eq 1">
<div class="de_main3">
<div class="de_main3Tiele"><span>相关推荐</span></div>
<ul class="de_main3_list">
<volist name="data_recomm" id="vo">
<a href="{:url('Goodsdetails/Goods_details',array('goods_id'=>$vo.id))}">
<li>
<div class="de_main3Img">
<img src="{:cmf_get_image_url($vo.show_img)}" alt="">
</div>
<p class="one-txt-cut">{$vo.book_name}</p>
</li>
</a>
</volist>
</ul>
</div>
</if>
<!-- 商品详情 -->
<div class="de_main4">
<div class="de_main3Tiele"><span>相关推荐</span></div>
<!-- 参数 -->
<div class="de_main4Parameter">
<h1>基本信息:</h1>
<ul class="de_main4ParaCon">
<li>
<p>书号:{$data.book_number}</p>
<p>开本:{$data.book_size}</p>
</li>
<li>
<p>纸张:{$data.paper}</p>
<p>印刷:{$data.printing}</p>
</li>
<li>
<p>装订:{$data.binding}</p>
<p>套装:{$data.suit}</p>
</li>
</ul>
</div>
<!-- 图片 -->
<div class="de_main4Img">
<volist name="det_img" id="vo">
<img src="{:cmf_get_image_url($vo)}" alt="">
</volist>
</div>
</div>
<!-- 精彩推荐 -->
<div class="de_main5">
<div class="de_main5Tit">商品说明</div>
<div class="de_main5Con">{$data.instr}</div>
</div>
<!-- 底部 -->
<div class="de_footer">
<div class="de_footerLeft">
<div class="de_footerLeftLi">
<div class="de_footerLeftImg">
<img src="__TMPL__/public/assets/images/26.png" alt="">
</div>
<p>收藏</p>
</div>
</div>
<div class="de_footerRight">
<div class="de_footerRight1">加入购物车</div>
<a href="order_confirm.html">
<div class="de_footerRight2">立即购买</div>
</a>
</div>
</div>
</div>
<script src="__TMPL__/public/assets/js/base.js"></script>
</body>
</html>
\ No newline at end of file
... ...