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

7987

@@ -253,6 +253,35 @@ class IndexController extends WeChatBaseController @@ -253,6 +253,35 @@ class IndexController extends WeChatBaseController
253 253
254 } 254 }
255 255
  256 + /**
  257 + * 搜索跳转详情页
  258 + */
  259 + public function search_goods_details(){
  260 +
  261 + $goods_id = $this -> request -> param();
  262 + $data = Db::name('goods') -> alias('a') -> join('classification b','a.classify_id = b.id','LEFT') -> where('a.id',$goods_id['goods_id']) -> find();
  263 + $price = explode('.',$data['price']);
  264 + $pricing = explode('.',$data['pricing']);
  265 + $data['price0'] = $price[0];
  266 + $data['price1'] = $price[1];
  267 + $data['pricing0'] = $pricing[0];
  268 + $data['pricing1'] = $pricing[1];
  269 + $data['det_img'] = json_decode($data['det_img'],true);
  270 + $this -> assign('det_img',$data['det_img']);
  271 + $this -> assign('data',$data);
  272 + $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();
  273 + $this -> assign('data_label',$data_label);
  274 + if($data['type'] == 1){
  275 + //相关推荐
  276 + $data_recomm = Db::name('goods') -> where("classify_id =".$data['classify_id']." and type = 1") -> limit(3) -> select();
  277 + $this -> assign('data_recomm',$data_recomm);
  278 + $this -> assign('is_recomm',1);
  279 + }else{
  280 + $this -> assign('is_recomm',2);
  281 + }
  282 + return $this -> fetch();
  283 +
  284 + }
256 285
257 286
258 287
  1 +<!DOCTYPE html>
  2 +<html lang="en">
  3 +
  4 +<head>
  5 + <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
  6 + <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
  7 + <meta http-equiv="X-UA-Compatible" content="ie=edge">
  8 + <title>学考无忧-详情页</title>
  9 + <link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css">
  10 + <link rel="stylesheet" href="__TMPL__/public/assets/css/base.css">
  11 +</head>
  12 +
  13 +<body>
  14 +<div class="detail_box">
  15 + <!-- 顶部 -->
  16 + <div class="detail_top order_top">
  17 + <a href="{:url('Index/search_salesman_goods')}">
  18 + <img src="__TMPL__/public/assets/images/left2.png" alt="">
  19 + </a>
  20 + <p style="color:white">商品详情</p>
  21 + </div>
  22 + <!-- banner 顶部 -->
  23 + <div class="de_top">
  24 + <!-- 图片 -->
  25 + <div class="de_topImg">
  26 + <img src="{:cmf_get_image_url($data.show_img)}" alt="">
  27 + </div>
  28 + <!-- 文字 -->
  29 + <div class="de_topTxt">
  30 + <!-- 价格 -->
  31 + <div class="de_topTxt1">
  32 + <p class="de_topTxt1_1"><span>{$data.price0}</span>.{$data.price1}</p>
  33 + <p class="de_topTxt1_2"><span>{$data.pricing0}</span>.{$data.pricing1}</p>
  34 + </div>
  35 + <!-- 名字 -->
  36 + <div class="de_topTxt2 txt-cut">{$data.book_name}</div>
  37 + <!-- 其他 -->
  38 + <div class="de_topTxt3">
  39 + <span>作者:{$data.author}</span>
  40 + <span>适合年级:{$data.grade}</span>
  41 + <span>销量:{$data.sales}</span>
  42 + </div>
  43 + </div>
  44 + </div>
  45 + <!-- 出版 -->
  46 + <div class="de_main2">
  47 + <ul class="de_main2_1">
  48 + <li>
  49 + <p class="de_main2Txt1">出版社</p>
  50 + <span class="de_main2Txt2">{$data.press}</span>
  51 + <img class="de_main2Img" src="__TMPL__/public/assets/images/29.png" alt="">
  52 + </li>
  53 + <li>
  54 + <p class="de_main2Txt1">出版时间</p>
  55 + <span class="de_main2Txt2">{$data.press_time}</span>
  56 + <img class="de_main2Img" src="__TMPL__/public/assets/images/29.png" alt="">
  57 + </li>
  58 + </ul>
  59 + <!-- 提示 -->
  60 + <div class="de_main2_2">
  61 + <ul>
  62 + <volist name="data_label" id="vo">
  63 + <li>{$vo.name}</li>
  64 + </volist>
  65 + </ul>
  66 + </div>
  67 + </div>
  68 + <!-- 相关推荐 -->
  69 + <if condition="$is_recomm eq 1">
  70 + <div class="de_main3">
  71 + <div class="de_main3Tiele"><span>相关推荐</span></div>
  72 + <ul class="de_main3_list">
  73 + <volist name="data_recomm" id="vo">
  74 + <a href="{:url('Goodsdetails/Goods_details',array('goods_id'=>$vo.id))}">
  75 + <li>
  76 + <div class="de_main3Img">
  77 + <img src="{:cmf_get_image_url($vo.show_img)}" alt="">
  78 + </div>
  79 + <p class="one-txt-cut">{$vo.book_name}</p>
  80 + </li>
  81 + </a>
  82 + </volist>
  83 + </ul>
  84 + </div>
  85 + </if>
  86 + <!-- 商品详情 -->
  87 + <div class="de_main4">
  88 + <div class="de_main3Tiele"><span>相关推荐</span></div>
  89 + <!-- 参数 -->
  90 + <div class="de_main4Parameter">
  91 + <h1>基本信息:</h1>
  92 + <ul class="de_main4ParaCon">
  93 + <li>
  94 + <p>书号:{$data.book_number}</p>
  95 + <p>开本:{$data.book_size}</p>
  96 + </li>
  97 + <li>
  98 + <p>纸张:{$data.paper}</p>
  99 + <p>印刷:{$data.printing}</p>
  100 + </li>
  101 + <li>
  102 + <p>装订:{$data.binding}</p>
  103 + <p>套装:{$data.suit}</p>
  104 + </li>
  105 + </ul>
  106 + </div>
  107 + <!-- 图片 -->
  108 + <div class="de_main4Img">
  109 + <volist name="det_img" id="vo">
  110 + <img src="{:cmf_get_image_url($vo)}" alt="">
  111 + </volist>
  112 + </div>
  113 + </div>
  114 + <!-- 精彩推荐 -->
  115 + <div class="de_main5">
  116 + <div class="de_main5Tit">商品说明</div>
  117 + <div class="de_main5Con">{$data.instr}</div>
  118 + </div>
  119 +
  120 + <!-- 底部 -->
  121 + <div class="de_footer">
  122 + <div class="de_footerLeft">
  123 + <div class="de_footerLeftLi">
  124 + <div class="de_footerLeftImg">
  125 + <img src="__TMPL__/public/assets/images/26.png" alt="">
  126 + </div>
  127 + <p>收藏</p>
  128 + </div>
  129 + </div>
  130 + <div class="de_footerRight">
  131 + <div class="de_footerRight1">加入购物车</div>
  132 + <a href="order_confirm.html">
  133 + <div class="de_footerRight2">立即购买</div>
  134 + </a>
  135 + </div>
  136 + </div>
  137 +</div>
  138 +<script src="__TMPL__/public/assets/js/base.js"></script>
  139 +</body>
  140 +
  141 +</html>