ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
1. 将更改根目录下在Shop/Controller文件夹下的IndexController.class.php为 ~~~ <?php namespace Shop\Controller; use Think\Controller; use Com\Wechat; use Com\WechatAuth; class IndexController extends Controller { public function index(){ $m=M('goods'); $data=$m->select(); $this->assign('data',$data); $this->display(); } public function detail(){ $m=M('goods'); $data=$m->find($_GET['id']); $this->assign('data',$data); $this->display(); } public function order(){ $this->assign('data',$_POST); $this->display(); } public function addOrder(){ header('Content-type:text/html;charset=utf-8'); $data['gid']=$_POST['id']; $data['name']=$_POST['name']; $data['pirce']=$_POST['pirce']*$_POST['num']; $data['num']=$_POST['num']; $data['email']=$_POST['email']; $data['mobile']=$_POST['mobile']; $data['city']=$_POST['city']; $data['detail']=$_POST['detail']; $m=M('orders'); $res=$m->add($data); if($res){ echo '<script>alert("生成订单成功");history.go(-2)</script>'; }else{ echo '<script>alert("生成订单失败");history.go(-1)</script>'; } } } ~~~ 2. 在根目录下在Shop/View文件夹下创建Index文件夹,放入index.html文件,detail.html文件,order.html文件分别为: ~~~ <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="author" content="m.ehaier.com"> <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" name="viewport" /> <meta name="format-detection" content="telephone=no" /> <meta content="yes" name="apple-mobile-web-app-capable" /> <meta content="black" name="apple-mobile-web-app-status-bar-style" /> <meta content="telephone=no" name="format-detection" /> <meta content="false" id="twcClient" name="twcClient" /> <link type="text/css" rel="stylesheet" href="__PUBLIC__/css/style.css"> <link rel="apple-touch-icon-precomposed" href="__PUBLIC__//images/ehaier-icon.png"/> <link rel="shortcut icon" type="image/x-icon" href="__PUBLIC__//images/ehaier-icon.png"/> <script type="text/javascript" src="__PUBLIC__/js/zepto.js"></script> <script type="text/javascript" src="__PUBLIC__/js/gs.js"></script> <script type="text/javascript" src="__PUBLIC__/js/mediav.js"></script> <script type="text/javascript" name="baidu-tc-cerfication" data-appid="4746793" src="__PUBLIC__/js/lightapp.js"></script> <script type="text/javascript" src="__PUBLIC__/js/criteo.js"></script> <script type="text/javascript" src="__PUBLIC__/js/ld.js" async></script> <meta name="keywords" content="冰箱,海尔冰箱,手机网购" /> <meta name="description" content="买冰箱,到海尔商城。海尔商城为您提供冰箱的最新报价、促销、评价、导购、图片等相关信息 。" /> <title>冰箱 - 海尔商城触屏版</title> <link type="text/css" rel="stylesheet" href="__PUBLIC__/css/list.css"> <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/panel.css" /> <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/panel.default.css" /> <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/loading.default.css" /> <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/refresh.default.css" /> <link type="text/css" rel="stylesheet" href="__PUBLIC__/css/member.css"> <script type="text/javascript" src="__PUBLIC__/js/touch.js"></script> <script type="text/javascript" src="__PUBLIC__/js/throttle.js"></script> <script type="text/javascript" src="__PUBLIC__/js/event.scrollstop.js"></script> <script type="text/javascript" src="__PUBLIC__/js/event.ortchange.js"></script> <script type="text/javascript" src="__PUBLIC__/js/matchmedia.js"></script> <script type="text/javascript" src="__PUBLIC__/js/gmu.js"></script> <script type="text/javascript" src="__PUBLIC__/js/event.js"></script> <script type="text/javascript" src="__PUBLIC__/js/widget.js"></script> <script type="text/javascript" src="__PUBLIC__/js/panel.js"></script> <script type="text/javascript" src="__PUBLIC__/js/refresh.js"></script> <script type="text/javascript" src="__PUBLIC__/js/util.js"></script> <script type="text/javascript" src="__PUBLIC__/js/pz.js"></script> <script type="text/javascript"> var provinceId = '16'; var provinceName = '山东'; var cityId = '173'; var cityName = '青岛'; //criteo广告投放 //遍历商品列表前三条数据数据转成js对象 var pl = []; pl[1-1]= 6038 pl[2-1]= 6169 pl[3-1]= 10781 criteo_productList(pl); </script> </head> <body > <div id="page"> <div id="cont"> <!--======main=====--> <div class="main"> <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/suggestion.css" /> <script type="text/javascript" src="__PUBLIC__/js/highlight.js"></script> <script type="text/javascript" src="__PUBLIC__/js/suggestion.js"></script> <script type="text/javascript"> (function () { $('#sousuo_index').suggestion({ autoClose: true, sendrequest: function (e, query, render, cacheData) { var listArr = []; $.getJSON("/mobile/search/smart_json.html?searchKey="+query,function(result,status){ if (result.success && result.data.length) { $.each(result.data, function(i, item) { if(i>4){return;}//取前5个搜索词 listArr.push(item.mobileWord); // 渲染数据列表,render(query, data), query为用户输入的query, data为Array类型,为渲染的数据数组 render( query, listArr ); }); } }); }, renderlist: function (e, data, query, callback) { // renderList的回调函数callback(listHtml), listHtml为sug列表内容 callback.call( this, data.map(function (item) { var html = ''; html += '<a href="__PUBLIC__//mobile/search/templist.html?searchKey='+item+'">'+item+'</a>'; return html; }).join( ' ' ) ); } }); //搜索跳转 $(document).on('click',"#search_button", function (event) { var searchKey = $("#sousuo_index").val(); location.href = "/mobile/search/templist.html?searchKey="+encodeURI(searchKey); }); //打开搜索 // $("#sousuo_index").focus(function(){ // $("#sou_default").show(); // }); //关闭搜索 // $(".fanhui_bt").click(function(){ // $("#sou_default").hide(); // }); // $("#sousuo_index").change(function(){ // if($(this).val() == ''){ // $("#sou_default").show(); // }else{ // $("#sou_default").hide(); // } // }) })(); </script> <div id="list_pic" class="list_pic"> <ul id="sortColumn"> <li><a href="__PUBLIC__/javascript:void(0);" value="saleDesc" class="on">热销</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="priceDesc" id="jiage"><span>价格</span><b class=""></b></a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="commentDesc">热评</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="newDesc">新品</a></li> <li><a href="__PUBLIC__/javascript:void(0);" id="filterBtn" value="filterBtn">筛选</a></li> </ul> </div> <!--======加载商品中=====--> <div class="list_jiazai" style="display:none"> <span><img src="__PUBLIC__/img/loading.gif"></span> <p>亲,稍等一下下</p> </div> <!--======加载商品结束=====--> <div id="list_div"> <!-- 列表页 商品列表 --> <foreach name="data" item="vo"> <div class="lists_items"> <p class="pic"> <a href="{:U('Index/detail',array('id'=>$vo['id']))}"> <img src="__PUBLIC__/Uploads/{$vo['img']}"> </a> </p> <p class="list_tex"> <a href="{:U('Index/detail',array('id'=>$vo['id']))}"> <span><font>¥{$vo.pirce}</font></span> <strong>{$vo.name}</strong></br> {$vo.pex} </a> </p> <p class="list_tex"> <a class="activemsg" href="__PUBLIC__/"></a> </p> <p class="list_tex" > <span class="txt_blue">青岛有货</span> 5262人评价,99%好评 </p> </div> </foreach> <script src="__PUBLIC__/js/jquery.lazyload.js" charset="utf-8"></script> <script type="text/javascript"> $(document).ready(function(){ $("img.lazyimg").lazyload(); }); </script> </div> </div> <div class="ui-refresh"> <input id="pageIndex" type="hidden" value="1"> <input id="pageSize" type="hidden" value="10"> <div class="ui-refresh-down"></div> </div> <footer class="footer"> <div id="footer" class="ft_top"> <a href="__PUBLIC__//mobile/member/toMemberLogin.html">登录</a>|<a href="__PUBLIC__//mobile/member/toMemberRegist.html">注册</a> </div> <p><a href="__PUBLIC__/javascript:scroll(0,0)">返回顶部</a>|<a href="__PUBLIC__//">返回首页</a>|<a href="__PUBLIC__//mobile/common/suggestInfos.html">意见反馈</a> </p> <p>Copyright©2000-2015 m.ehaier.com<br />鲁ICP备09096283号 </p> </footer> <script type="text/javascript" src="__PUBLIC__/js/ehaier.js"></script> <script type="text/javascript" src="__PUBLIC__/js/baidu.js"></script> <script type="text/javascript" src="__PUBLIC__/js/ga.js"></script> <!--联系客服--> <div class="tc2" style="display:none;"> <div class="kf_top"> <p style="font-size:18px;color:#4c4c4c;height:40px;padding-left:60px;line-height:40px;overflow:hidden;">工作时间</p> <p class="tc_cg">早8:30 - 晚24:00</p> </div> <div class="tc_button"> <ul> <li><span onclick="javascript:NTKF.im_openInPageChat('kf_9949_1358748431343');" title="在线客服"><a href="__PUBLIC__/javascript:void(0)">在线客服</a></span></li> <li><a href="__PUBLIC__/javascript:void(0)" class="lxkf_close">取消</a></li> </ul> </div> </div> <script type="text/javascript"> //ntalk NTKF_PARAM = { siteid:"kf_9949", settingid: "kf_9949_1358748431343" } //联系客服打开 $(".lxkf").click(function(){ if ($('#load_mask').length) {} else{ var h = $(document.body).height()+"px"; $("<div id='load_mask' class='tc_zz' style='height:"+h+"' />").appendTo("body"); } $("#load_mask").show(); var t = $(window).scrollTop(), h = $(window).height(), iTop = 0; iTop = ((h - $(".tc2").height()) / 2 + t) + "px"; $(".tc2").css("top", iTop).show(); }) //联系客服关闭 $(".lxkf_close").click(function(){ $(".tc2").hide(); $("#load_mask").hide(); }) </script> <script type="text/javascript" src="__PUBLIC__/js/ntkfstat.js" charset="utf-8"></script> </div> <!-- 列表页 筛选 --> <div id="panel"> <!--======筛选弹窗=====--> <div class="sxtc"> <div class="sxtc_title"> <ul> <li class="cur"><a href="__PUBLIC__/javascript:void(0)">筛选</a></li> <li><a href="__PUBLIC__/javascript:void(0)">配送至</a></li> </ul> </div> <div class="sxtc_content"> <div class="sxtc_bottom xx_tab" > <div class="sxtc_list" id="zong_num"> <ul> <li> <a href="__PUBLIC__/javascript:void(0);" class="bgtu categ">库存状态</a> <ul class="lb_nr" style="display:block" id="pro_stock"> <li><a href="__PUBLIC__/javascript:void(0);" class="xz" value="-1">显示全部</a></li> <li><a href="__PUBLIC__/javascript:void(0);" class="" value="true">仅显示有货</a></li> </ul> </li> <li> <a href="__PUBLIC__/javascript:void(0);" class="categ" >商品类型</a> <ul class="lb_nr" style="display:none" id="pro_lei"> <li><a href="__PUBLIC__/javascript:void(0);" class="xz" value="-1">全部品牌</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="297">海尔</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="298">卡萨帝</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="299">统帅</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="301">海尔施特劳斯</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="302">Zettom</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="303">新宝</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="305">MOOKA</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="307">小超人</a></li> </ul> </li> <li> <a href="__PUBLIC__/javascript:void(0);" class="categ">价格区间</a> <ul class="lb_nr" id="pro_pre"> <li><a href="__PUBLIC__/javascript:void(0);" class="xz" value="-1">全部</a></li> <li><a href="__PUBLIC__/#" value="0 ~ 1000">0 ~ 1000</a></li> <li><a href="__PUBLIC__/#" value="1001 ~ 2000">1001 ~ 2000</a></li> <li><a href="__PUBLIC__/#" value="2001 ~ 3000">2001 ~ 3000</a></li> <li><a href="__PUBLIC__/#" value="3001 ~ 4000">3001 ~ 4000</a></li> <li><a href="__PUBLIC__/#" value="4001 ~ 5000">4001 ~ 5000</a></li> <li><a href="__PUBLIC__/#" value="5001 ~ 1000000">5001以上</a></li> </ul> </li> <li> <a href="__PUBLIC__/javascript:void(0);" class="categ">耗电量(kwh/24h)</a> <ul class="lb_nr" id="pro_76" value="76"> <li><a href="__PUBLIC__/javascript:void(0);" class="xz" value="-1">全部</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="1553">0.5以下</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="1554">0.51-1</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="1555">1以上</a></li> </ul> </li> <li> <a href="__PUBLIC__/javascript:void(0);" class="categ">总容积(升)</a> <ul class="lb_nr" id="pro_66" value="66"> <li><a href="__PUBLIC__/javascript:void(0);" class="xz" value="-1">全部</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="1546">600以上</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="1547">501-600</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="1548">401-500</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="1549">301-400</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="1550">201-300</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="1551">101-200</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="1552">100以下</a></li> </ul> </li> <li> <a href="__PUBLIC__/javascript:void(0);" class="categ">类别</a> <ul class="lb_nr" id="pro_64" value="64"> <li><a href="__PUBLIC__/javascript:void(0);" class="xz" value="-1">全部</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="1698">BM风冷</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="1683">意式三门</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="1682">法式对开门</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="1681">法式六门</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="44">两门</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="43">三门</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="46">嵌入式</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="42">对开</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="41">多门</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="45">单门</a></li> </ul> </li> <li> <a href="__PUBLIC__/javascript:void(0);" class="categ">能耗等级</a> <ul class="lb_nr" id="pro_69" value="69"> <li><a href="__PUBLIC__/javascript:void(0);" class="xz" value="-1">全部</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="50">一级</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="51">二级</a></li> <li><a href="__PUBLIC__/javascript:void(0);" value="52">三级</a></li> </ul> </li> </ul> </div> </div> <div class="xzdq xx_tab"> <div class="xzdq_title"> 请选择地区 </div> <div class="xzdq_bottom"> <ul id="dizhi_xz"> </ul> </div> </div> </div> </div> </div> <script> $.ajax({ type : 'get', dataType : 'jsonp', url : 'http://www.ehaier.com/region.php?a=outRegionJson&pid=5949&acid=0&m=1', success : function (data) { parsePrcJson(data); } }); //解析prcJson function parsePrcJson(data){ var province_da = []; var city_da = []; for( var i=0;i<data.length;i++ ){ var cur_province = data[i]; $("#dizhi_xz").append("<li id='li_province_"+cur_province.id+"'></li>"); $("#li_province_"+cur_province.id).append("<a href='javascript:void(0);' class='area' value='"+cur_province.id+"'>"+cur_province.name+"</a>"); $("#li_province_"+cur_province.id).append("<ul class='lb_nr' id='ul_province_"+cur_province.id+"'></ul>"); for( var j=0;j<cur_province.childs.length;j++ ){ var cur_city = cur_province.childs[j]; $("#ul_province_"+cur_province.id).append("<li ><a href='javascript:void(0);' id='li_city_"+cur_city.id+"'"+ " value='"+cur_city.id+"'>"+cur_city.name+"</a></li>") } } //省市回显或设置默认值 $("#li_province_"+provinceId).children("a").attr("class","bgtu area"); $("#ul_province_"+provinceId).attr("style","display: block"); $("#li_city_"+cityId).addClass("xz"); } </script></div> <script type="text/javascript" src="__PUBLIC__/js/prduct_list.js"></script> <script type="text/javascript"> $(document).ready(function(){ //TAB 标题点击 $(".list_pic ul li").on("click",function(){ if( $(this).find('a span').html() == '价格'){ if($(this).find('a b').hasClass('ticon') ){ $("#jiage b").removeClass('ticon').addClass('micon bicon'); $("#jiage").attr('value','priceAsc'); }else{ $("#jiage b").removeClass('bicon').addClass('micon ticon'); $("#jiage").attr('value','priceDesc'); } }else{ $("#jiage b").removeClass('micon ticon'); $("#jiage").attr('value','priceAsc'); } if($(this).find('a').attr("value") != 'filterBtn'){ if(!$(this).find('a').hasClass('on') || $(this).find('a span').html() == '价格'){ $(".list_pic ul li a").removeClass('on'); $(this).find('a').addClass("on"); LoadProduct(); } } }); //详细选项 $(".sxtc_bottom .lb_nr li").on(DOEVENT, function (event) { event.preventDefault(); $(this).parent().find("a").removeClass("xz"); $(this).children("a").addClass("xz"); //关闭面板 LoadProduct(); setTimeout(function(){ $('#panel').panel('close'); },500); }); //省选择 $(document).on('click',"#dizhi_xz .area", function (event) { event.preventDefault(); provinceId = $(this).attr("value"); provinceName = $(this).text(); }); //市选择 $(document).on('click',"#dizhi_xz .lb_nr li", function (event) { event.preventDefault(); $("#dizhi_xz").find("a").removeClass("xz"); $(this).children("a").addClass("xz"); cityId = $(this).children("a").attr("value"); cityName = $(this).children("a").text(); LoadProduct(); //关闭面板 setTimeout(function(){ $('#panel').panel('close'); },500); }); $(document).on('click',"#search_button", function (event) { var searchKey = $("#sousuo_index").val(); location.href = "/mobile/search/templist.html?searchKey="+encodeURI(searchKey);//跳到错误页面 }); $('.ui-refresh').refresh({ load: function (dir, type) { var me = this; //LoadProduct(); var sortColumn = getSortColumn(); var stockState = getStockState(); var brandId = getBrandId(); var price = getPrice(); var otherFilter = getOtherFilter(); var pageIndex=parseInt($("#pageIndex").val())+1; var pageSize=$("#pageSize").val(); $.ajax({ url: "/mobile/itemlist/2723_item.html", data: { sortColumn : sortColumn, provinceName : provinceName, provinceId : provinceId, cityName : cityName, cityId : cityId, stockState: stockState, brandId : brandId, price : price, otherFilter : otherFilter, pageIndex : pageIndex, pageSize : pageSize }, type: "POST", success: function(data) { $("#list_div").append(data); $("#pageIndex").val(pageIndex); me.afterDataLoading(); //数据加载完成后改变状态 } }); } }); }) //获取当前选中的排序方式 function getSortColumn(){ for(var i = 1; i<=$("#sortColumn li").length; i++){ if($("#sortColumn li:nth-child( " + i + ")").children("a").hasClass("on")){ return value = $("#sortColumn li:nth-child( " + i + ")").children("a").attr("value"); } } } //获取当前选中的库存状态 function getStockState(){ for(var i = 1; i<=$("#pro_stock li").length; i++){ if($("#pro_stock li:nth-child(" + i + ")").children("a").hasClass("xz")){ return value = $("#pro_stock li:nth-child(" + i + ")").children("a").attr("value"); } } } //获取当前选中的品牌 function getBrandId(){ for(var i = 1; i<=$("#pro_lei li").length; i++){ if($("#pro_lei li:nth-child(" + i + ")").children("a").hasClass("xz")){ return value = $("#pro_lei li:nth-child(" + i + ")").children("a").attr("value"); } } } //获取当前选中的价格区间 function getPrice(){ for(var i = 1; i<=$("#pro_pre li").length; i++){ if($("#pro_pre li:nth-child(" + i + ")").children("a").hasClass("xz")){ return value = $("#pro_pre li:nth-child(" + i + ")").children("a").attr("value"); } } } //获取品牌其它筛选项 function getOtherFilter(){ var id = []; var otherFilter = ""; id.push("76"); id.push("66"); id.push("64"); id.push("69"); for(var i = 0; i<id.length; i++){ var tempId = "pro_" + id[i]; for(var j = 1; j<=$("#" + tempId +" li").length; j++){ if($("#"+tempId+" li:nth-child("+j+")").children("a").hasClass("xz")){ otherFilter += id[i] + ":" +$("#"+tempId+" li:nth-child("+j+")").children("a").attr("value") + ";"; } } } return otherFilter; } //加载商品 function LoadProduct(){ var sortColumn = getSortColumn(); var stockState = getStockState(); var brandId = getBrandId(); var price = getPrice(); var otherFilter = getOtherFilter(); var pageIndex = 1; var pageSize = 10; $("#pageIndex").val(1);//页码初始化 $.ajax({ url: "/mobile/itemlist/2723_item.html", data: { sortColumn : sortColumn, provinceName : provinceName, provinceId : provinceId, cityName : cityName, cityId : cityId, stockState: stockState, brandId : brandId, price : price, otherFilter : otherFilter, pageIndex : pageIndex, pageSize : pageSize }, type: "POST", success: function(data) { $("#list_div").html(data); $('.ui-refresh').show(); } }); return false; } //设置content高度 function setHeight() { var headerH = document.getElementById('list_pic').offsetHeight; var footerH = document.getElementById('footer').offsetHeight; var contentH = 0; var tUserAgent = navigator.userAgent; //由於Windows Phone不支援windows.innerHeight語法,改用screen代替 if (tUserAgent.indexOf("Windows Phone") != -1) { contentH = screen.availHeight - headerH - footerH-footerH+20; } else { contentH = window.innerHeight - headerH - footerH-footerH+20; } document.getElementById("product_no").style.height = contentH + "px"; } </script> </body> </html> ~~~ ~~~ <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="author" content="m.ehaier.com"> <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" name="viewport" /> <meta name="format-detection" content="telephone=no" /> <meta content="yes" name="apple-mobile-web-app-capable" /> <meta content="black" name="apple-mobile-web-app-status-bar-style" /> <meta content="telephone=no" name="format-detection" /> <meta content="false" id="twcClient" name="twcClient" /> <link type="text/css" rel="stylesheet" href="__PUBLIC__/css/style.css"> <link rel="apple-touch-icon-precomposed" href="__PUBLIC__//images/ehaier-icon.png"/> <link rel="shortcut icon" type="image/x-icon" href="__PUBLIC__//images/ehaier-icon.png"/> <script type="text/javascript" src="__PUBLIC__/js/zepto.js"></script> <script type="text/javascript" src="__PUBLIC__/js/gs.js"></script> <script type="text/javascript" src="__PUBLIC__/js/mediav.js"></script> <script type="text/javascript" name="baidu-tc-cerfication" data-appid="4746793" src="__PUBLIC__/js/lightapp.js"></script> <script type="text/javascript" src="__PUBLIC__/js/criteo.js"></script> <script type="text/javascript" src="__PUBLIC__/js/ld.js" async></script> <meta name="keywords" content="" /> <meta name="description" content="覆膜高光面板,耐磨性好不退色,不沾油烟不积灰;三门三温区,独立制冷不串味;中门007软冷冻技术,0解冻时间,0时差保鲜,0~-7℃软冷冻存储,肉食不用化冻即时切。" /> <title>{$data['name']}</title> <link type="text/css" rel="stylesheet" href="__PUBLIC__/css/details.css"/> <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/swiper.css"/> <script type="text/javascript" src="__PUBLIC__/js/pz.js"></script> <script type="text/javascript" src="__PUBLIC__/js/cig.js"></script> </head> <body> <header class="header"> <span class="fh left"><a href="__PUBLIC__/">&nbsp;</a></span> 商品详情 <span class="hd_right right"> <a class="gwc" href="__PUBLIC__//mobile/cart/myCart.html"><span id="count">0 </span>&nbsp;</a> <a class="right_but" href="__PUBLIC__//mobile/common/navigate.html">&nbsp;</a> </span> </header> <div id="page"> <!--======main=====--> <div class="main"> <div class="m_banner"> <div class="swiper-container"> <div class="pagination"></div> <div class="swiper-wrapper"> <div class="swiper-slide"><a href="__PUBLIC__/javascript:void(0);"><img src="__PUBLIC__/Uploads/{$data['img']}" /></a></div> </div> </div> </div> <form action="{:U('Index/order')}" method="post"> <div class="details_text"> <div class="details_title">{$data['name']} {$data['pex']}</div> <div class="details_nr">覆膜高光面板,耐磨性好不退色,不沾油烟不积灰;三门三温区,独立制冷不串味;中门007软冷冻技术,0解冻时间,0时差保鲜,0~-7℃软冷冻存储,肉食不用化冻即时切。</div> <div class="details_jg">商城价格:<span>¥{$data['pirce']}</span> </div> <input type="hidden" name="pirce" value="{$data['pirce']}"> <input type="hidden" name="id" value="{$data['id']}"> <input type="hidden" name="name" value="{$data['name']}"> <input type="hidden" name="pex" value="{$data['pex']}"> <a class="activemsg" href="__PUBLIC__/"></a> <div class="details_nr">服务承诺:<span id="isSupportCOD"></span><span>送货上门,按约送达</span></div> <div class="details_nr"> 购买数量:<span class="count_num"> <a href="javascript:void(0)" id="btnMinus" class="inputcheckbox">-</a> <div class="count-input"> <input type="text" maxlength="2" name="num" value="1" id="proCount" readonly> </div> <a href="javascript:void(0)" id="btnAdd" class="inputcheckbox">+</a> </span> <span class="count-msg" id="stockStatus"></span> <span style="display:none;" id="stockType"></span></div> </div> <div class="details_but" id="you"> <input type="submit" value="立即下单"> <!--订金尾款、限时抢购、二维码、套装走快捷购物流程--> <!-- <a href="__PUBLIC__/javascript:void(0);" class="gwc" id="addCart">加入购物车</a> --> </div> <div class="details_qh" style="display:none" id="tongzhi"><a href="__PUBLIC__/javascript:void(0);" class="dhtz">到货通知</a></div> <div class="details_qh" style="display:none" id="wu"><a href="__PUBLIC__/javascript:void(0)">无货</a></div> <!--======到货通知=====--> <div class="dhtz_tc" id="tongZhiCeng"> <header class="header"><span class="fh left"><a href="__PUBLIC__/javascript:history.go(-1);">&nbsp;</a></span>到货通知</header> <div class="dhtz_bottom"> <!-- <table width="100%" border="0" cellspacing="0" cellpadding="0"> <input type="hidden" id="tzpid" name="tzpid" value="6038" /> <tr> <td height="45" align="right" valign="middle" width="20%">姓 名:</td> <td height="45" align="left" valign="middle" width="80%"><input type="text" id="name" name="name" value="" class="tz_wbk"></td> </tr> <tr> <td height="45" align="right" valign="middle">邮 箱:</td> <td height="45" align="left" valign="middle"><input type="text" id="email" name="email" value="" class="tz_wbk"></td> </tr> <tr> <td height="45" align="right" valign="middle">手机号:</td> <td height="45" align="left" valign="middle"><input type="text" id="mobile" name="mobile" value="" class="tz_wbk"></td> </tr> <tr> <td height="45" colspan="2" align="center" valign="middle"><a href="__PUBLIC__/javascript:void(0);" id="tj" class="tz_but">提交</a></td> </tr> </table> --> </div> </div> </div> </form> <!--======footer=====--> <footer class="footer"> <div id="footer" class="ft_top"> <a href="__PUBLIC__//mobile/member/toMemberLogin.html">登录</a>|<a href="__PUBLIC__//mobile/member/toMemberRegist.html">注册</a> </div> <p><a href="__PUBLIC__/javascript:scroll(0,0)">返回顶部</a>|<a href="__PUBLIC__//">返回首页</a>|<a href="__PUBLIC__//mobile/common/suggestInfos.html">意见反馈</a> </p> <p>Copyright©2000-2015 m.ehaier.com<br />鲁ICP备09096283号 </p> </footer> <script type="text/javascript" src="__PUBLIC__/js/ehaier.js"></script> <script type="text/javascript" src="__PUBLIC__/js/baidu.js"></script> <script type="text/javascript" src="__PUBLIC__/js/ga.js"></script> <!--联系客服--> <div class="tc2" style="display:none;"> <div class="kf_top"> <p style="font-size:18px;color:#4c4c4c;height:40px;padding-left:60px;line-height:40px;overflow:hidden;">工作时间</p> <p class="tc_cg">早8:30 - 晚24:00</p> </div> <div class="tc_button"> <ul> <li><span onclick="javascript:NTKF.im_openInPageChat('kf_9949_1358748431343');" title="在线客服"><a href="__PUBLIC__/javascript:void(0)">在线客服</a></span></li> <li><a href="__PUBLIC__/javascript:void(0)" class="lxkf_close">取消</a></li> </ul> </div> </div> <script type="text/javascript"> //ntalk NTKF_PARAM = { siteid:"kf_9949", settingid: "kf_9949_1358748431343" ,itemid:"6038" } //联系客服打开 $(".lxkf").click(function(){ if ($('#load_mask').length) {} else{ var h = $(document.body).height()+"px"; $("<div id='load_mask' class='tc_zz' style='height:"+h+"' />").appendTo("body"); } $("#load_mask").show(); var t = $(window).scrollTop(), h = $(window).height(), iTop = 0; iTop = ((h - $(".tc2").height()) / 2 + t) + "px"; $(".tc2").css("top", iTop).show(); }) //联系客服关闭 $(".lxkf_close").click(function(){ $(".tc2").hide(); $("#load_mask").hide(); }) </script> <script type="text/javascript" src="__PUBLIC__/js/ntkfstat.js" charset="utf-8"></script> </div> <!--zepto and extend--> <script type="text/javascript" src="__PUBLIC__/js/touch.js"></script> <script type="text/javascript" src="__PUBLIC__/js/selector.js"></script> <script type="text/javascript" src="__PUBLIC__/js/swiper-2.4.js"></script> <script type="text/javascript" src="__PUBLIC__/js/util.js"></script> <script type="text/javascript"> $(document).ready(function (e) { //商品图片展示 var gallery = $('.swiper-container').swiper({ slidesPerView: 'auto', centeredSlides: true, pagination: '.pagination', paginationClickable: true, /*resizeReInit: true,*/ keyboardControl: true, grabCursor: true, /*loop: true,*/ //slidesPerView为auto时不支持loop模式 autoplay:4000//自动播放的开关及延时 }) //购买数量增加或减少 var doEvent = document.hasOwnProperty("ontouchstart") ? "tap" : "click"; //减少 $("#btnMinus").on(doEvent, function () { var count = parseInt($("#proCount").val()); if (count > 1) { $("#proCount").val(--count); } }); //增加,最多99个 $("#btnAdd").on(doEvent, function () { var count = parseInt($("#proCount").val()); if (count < 100) { $("#proCount").val(++count); } }); //通知层显示 $("#tongzhi").click(function(){ $("#tongzhi").hide(); //通知按钮隐藏 $("#tongZhiCeng").show(); //通知层显示 }); //通知层提交 $("#tj").click(function(){ var name=$("#name").val(); var productId=$("#tzpid").val(); var emall=$("#email").val(); var mobile=$("#mobile").val(); if(Zepto.trim(name) == ""){ alert("姓名不能为空"); return false; } if(emall=="" && mobile==""){ alert("请填写邮箱或手机,不能都为空"); return false; } if(emall != ""){ if(!isEamll(emall)){ return false; } } if(mobile != ""){ if(!isMobileNO(mobile)){ return false; } } var regionId = $("#regionId").val(); var provinceName = $("#provincetip").text(); var cityName = $("#citytip").text(); var regionName = $("#regiontip").text(); $.post("/mobile/item/inform.html" ,{ name:name, productId:productId, emall:emall, mobile:mobile, regionId:regionId, provinceName:provinceName, cityName:cityName, regionName:regionName }, function(data) { if(data.success){ alert("设置到货通知成功") $("#tongZhiCeng").hide(); //通知层显示 $("#tongzhi").show(); } else{ alert("设置到货通知失败"); $("#tongZhiCeng").hide(); //通知层显示 $("#tongzhi").show(); } }, "json") }); //手机号校验 function isMobileNO(mobileNum){ var pattern = new RegExp("^((13[0-9])|(14[57])|(15[^4,\\D])|(18[0-9]))\\d{8}$"); if(!pattern.test(mobileNum)){ alert("手机号不正确!"); return false; } return true; } //邮箱校验 function isEamll(emall){ var pattern = new RegExp("^([a-zA-Z0-9]*[-_]?[a-zA-Z0-9]+)*@([a-zA-Z0-9]*[-_]?[a-zA-Z0-9]+)+[\\.][A-Za-z]{2,3}([\\.][A-Za-z]{2})?$"); if(!pattern.test(emall)){ alert("邮箱不正确!"); return false; } return true; } }); </script> <script type="text/javascript"> $(document).ready(function(){ var provinceId = ''; var cityId = ''; var regionId = ''; var provinceName = ''; var cityName = ''; var regionName = ''; if( provinceId == '') { provinceId='16';} if( cityId == '') { cityId='173';} if( provinceName == '') { provinceName='山东';} if( cityName == '') { cityName='青岛';} //所有省市区json var prcJson = {}; var province_da = []; var city_da = []; var region_da = []; //加载省市区 $.ajax({ type: 'POST', url: '/mobile/item/getRegion.html', data:'', dataType: 'json', success: function(data){ parsePrcJson(data.data); }, /* type : 'get', dataType : 'jsonp', url : 'http://www.ehaier.com/region.php?a=outRegionJson&pid=5949&acid=0&m=1', success : function (data) { alert(data); parsePrcJson(data); } */ }); //解析prcJson function parsePrcJson(data){ for( var i=0;i<data.length;i++ ){ var cur_province = data[i]; province_da.push({ 'id':cur_province.id, 'name':cur_province.regionName }); for( var j=0;j<cur_province.childs.length;j++ ){ var cur_city = cur_province.childs[j]; city_da.push({ 'id':cur_city.id, 'name':cur_city.regionName, 'fid':cur_province.id }); for( var k=0;k<cur_city.childs.length;k++ ){ var cur_region = cur_city.childs[k]; region_da.push({ 'id':cur_region.id, 'name':cur_region.regionName, 'fid':cur_city.id }); } } } //初始化省 for(var i=0; i<province_da.length;i++){ $("#provinceId").append("<option value='"+province_da[i].id+"'>"+province_da[i].name+"</option>"); } //初始化市 for(var i=0; i<city_da.length;i++){ if( city_da[i].fid == provinceId ){ $("#cityId").append('<option value="'+city_da[i].id+'">'+city_da[i].name+'</option>'); } } //初始化区 for(var i=0; i<region_da.length;i++){ if( region_da[i].fid == cityId ){ $("#regionId").append('<option value="'+region_da[i].id+'">'+region_da[i].name+'</option>'); } } //省市区回显或设置默认值 //省 $("#provinceId option[value='"+provinceId+"']").attr("selected","selected"); $("#provincetip").text(provinceName); //市 $("#cityId option[value='"+cityId+"']").attr("selected","selected"); $("#citytip").text(cityName); //区 if(regionId == '') { var count = 0; for(var i=0; i<region_da.length;i++){ if( region_da[i].fid == cityId ){ count++; if(count == 1){ regionId = region_da[i].id; regionName = region_da[i].name; $("#regionId option[value='"+region_da[i].id+"']").attr("selected","selected"); $("#regiontip").text(region_da[i].name); break; } } } Zepto.post("/mobile/item/storeRegion.html", { province : provinceId, city : cityId, region : regionId, regionName : provinceName + " " + cityName + " " + regionName }, function(json,status){ if(!json.success){ //console.log("省市区存储失败!"); } } ); }else{ $("#regionId option[value='"+regionId+"']").attr("selected","selected"); $("#regiontip").text(regionName); } $("#estore").hide(); //校验库存 checkStock(regionId); } (function(){ if(false){ //已收藏 $("#collectIcon").removeClass("icon-collect"); $("#collectIcon").addClass("icon-nav-fav"); } if(false){ //已点过赞 $("#praiseIcon").removeClass("icon-praise"); $("#praiseIcon").addClass("icon-praised"); } })(); //省选择事件 $("#provinceId").change(function(){ var $provinceSel = $("#provinceId option:selected"); var parentId = $provinceSel.val(); $("#stockStatus").empty(); $("#provincetip").text($provinceSel.text()); $("#cityId option").remove(); $("#cityId").append('<option value="">选择市</option>'); $("#citytip").text("选择市"); $("#regionId option").remove(); $("#regionId").append('<option value="">选择区</option>'); $("#regiontip").text("选择区"); if(parentId == null || parentId == "" || parentId == 0){ return; } for( var i=0;i<city_da.length;i++ ){ if( city_da[i].fid == parentId ){ $("#cityId").append('<option value="'+city_da[i].id+'">'+city_da[i].name+'</option>'); } } hasStock(); }); //市选择事件 $("#cityId").change(function(){ var $citySel = $("#cityId option:selected"); var parentId = $citySel.val(); $("#stockStatus").empty(); $("#citytip").text($citySel.text()); $("#regionId option").remove(); $("#regionId").append('<option value="">选择区</option>'); $("#regiontip").text("选择区"); if(parentId == null || parentId == "" || parentId == 0){ return; } for( var i=0;i<region_da.length;i++ ){ if( region_da[i].fid == parentId ){ $("#regionId").append('<option value="'+region_da[i].id+'">'+region_da[i].name+'</option>'); } } hasStock(); }); //区选择事件 $("#regionId").change(function(){ var $provinceSel = $("#provinceId option:selected"); var $citySel = $("#cityId option:selected"); var $regionSel = $("#regionId option:selected"); var province = $provinceSel.val(); var city = $citySel.val(); var region = $regionSel.val(); var provinceName = $provinceSel.text(); var cityName = $citySel.text(); var districtName = $regionSel.text(); var regionName = provinceName + " " + cityName + " " + districtName; $("#regiontip").text($regionSel.text()); if(region == null || region == "" || region == 0){ $("#stockStatus").empty(); return; } checkStock(region); ($).post("/mobile/item/storeRegion.html", { province : province, city : city, region : region, regionName : regionName }, function(json,status){ if(!json.success){ //console.log("省市区存储失败!"); } } ); }); //库存校验 function checkStock(regionId){ var sku = 'BA09X0B8F'; var productId = '6038'; $.getJSON("/mobile/item/checkStock.html?sku="+sku+"&regionId="+regionId+"&prodId="+productId,function(data,status){ var json = data; if(json.success){ if(json.data.hasStock){ if(json.data.expectTime != null){ hasStock(); $("#buyImmediately").text("立即购买"); $("#addCart").show(); $("#stockStatus").text(json.data.expectTime); $("#stockType").text(json.data.stockType); $("#tongzhi").hide(); $("#you").css('display','block'); } if(json.data.isSupportCOD){ $("#isSupportCOD").text("货到付款,"); }else{ $("#isSupportCOD").text(""); } }else if(json.data.bookable){ if(json.data.expectTime != null){ hasStock(); $("#stockStatus").text(json.data.expectTime); $("#stockType").text(json.data.stockType); $("#tongzhi").hide(); $("#you").css('display','block'); } if(json.data.bookable){ $("#buyImmediately").text("立即预定"); $("#addCart").hide(); $("#isSupportCOD").text(""); } }else{ noStock(); $("#you").hide(); $("#tongzhi").show(); } }else{ noStock(); $("#you").hide(); $("#tongzhi").show(); } checkStore(regionId); }); } function checkStore(regionId){ var stockType = $("#stockType").text(); if(stockType=="WA" || stockType == "" || stockType == null) return; $.ajax({ url:"/mobile/productmain/storeregion.html", type:"POST", dataType:"json", data:{regionId:regionId}, success:function(result){ if(result.success){ $("#estore").show(); $("#estore a").attr("href","/mobile/o2omini/"+ result.data.storeCode+".html?storeId="+result.data.storeId); }else{ $("#estore").hide(); } } }); /*var regions = [2444,2445,2446,2447,2448,2449,2450,2451,2452,2453,2454]; for(var index = 0;index < regions.length;index++) { if(regionId==2452){ $("#estore").show(); $("#estore a").attr("href","http://www.ehaier.com/tpl/pddf/m/index.html"); break; }else if(regionId == regions[index]){ $("#estore").show(); $("#estore a").attr("href","http://www.ehaier.com/tpl/hcyt/m/index.html"); break; }else{ $("#estore").hide(); } }*/ } //有货 function hasStock(){ $("#stockStatus").text(""); } //无货 function noStock(){ $("#stockStatus").text("无货"); } //收藏 $("#collect").click(function(){ if($("#collectIcon").hasClass("icon-nav-fav")){return false;} url = "/mobile/item/productCollect.html"; ($).getJSON(url,{ productId : 6038, productName : '海尔 冰箱 BCD-206STPA', imageUrl : 'http://cdn21.ehaier.com/file/566ef238b702af925d2b8d50.png' }, function(data, status) { var json = data; if(json.success){ var redirect = json.data.redirect; if(redirect == null){ //收藏成功 var count = 1240 + 1 $("#collectIcon").removeClass("icon-collect"); $("#collectIcon").addClass("icon-nav-fav"); $("#collectCount").text(count); }else{ window.location.href=redirect; } }else{ } }); }); //加入购物车 $("#addCart").click(function(){ var regionId = $("#regionId").val(); var number = $("#proCount").val(); var productId = 6038; /*var ckPrice = 0;*/ var ckCode = 0; var isCK = 0; if(regionId == "" || number == "" || productId == ""){ alert("请选择配送区域!"); return; } if(ckCode > 0 || isCK > 0){ $.getJSON("/mobile/ckcart/addProduct.html?number="+number+"&productId="+productId, function(data, status) { var json = data; if(json.success){ location.href ="/mobile/ckcart/myCart.html"; }else{ alert("购物车添加失败"); } }); }else{ $.getJSON("/mobile/cart/addToCart.html?number="+number+"&productId="+productId, function(data, status) { var json = data; if(json.success){ location.href ="/mobile/cart/myCart.html"; }else{ alert("购物车添加失败"); } }); } }); //立即购买 $("#buyImmediately").click(function(){ var number = $("#proCount").val(); var productId = 6038; var ckPrice = 0; var productActivitiesPrice = 0; var flashsalesPrice = 0; var packageId = 0; var bcQrcodePrice = 0; /*var ckPrice = 0;*/ var ckCode = 0; var isCK = 0; if(regionId == "" || number == "" || productId == ""){ alert("请选择配送区域!"); return; } if(bcQrcodePrice > 0){ location.href = "/mobile/order/toQuickOrderSubmit.html?productId="+productId+"&bcQrcodeId=${bcQrcodeId}"; }else if((ckCode > 0 || isCK >0) && packageId == 0){ location.href = "/mobile/ckcart/buyImmediately.html?number="+number+"&productId="+productId; }else if(productActivitiesPrice > 0 || flashsalesPrice > 0 || packageId > 0){ location.href = "/mobile/order/toQuickOrderSubmit.html?productId="+productId; }else{ location.href = "/mobile/item/buyImmediately.html?number="+number+"&productId="+productId; } }); }); //点赞 $("#praise").click(function(){ if($("#praiseIcon").hasClass("icon-praised")){return false;} url = "/mobile/item/productPraise.html"; ($).getJSON(url,{ productId : 6038 }, function(data, status) { var json = data; if(json.success){ var redirect = json.data.redirect; if(redirect == null){ var count = 3893 + 1 //点赞成功 $("#praiseIcon").removeClass("icon-praise"); $("#praiseIcon").addClass("icon-praised"); $("#praiseCount").text(count); }else{ window.location.href=redirect; } }else{ } }); }); _cigPvUv();//CIG pv/uv单品监测 criteo_productMain("6038");//criteo广告投放 </script> </body> </html> ~~~ ~~~ <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="author" content="m.ehaier.com"> <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" name="viewport" /> <meta name="format-detection" content="telephone=no" /> <meta content="yes" name="apple-mobile-web-app-capable" /> <meta content="black" name="apple-mobile-web-app-status-bar-style" /> <meta content="telephone=no" name="format-detection" /> <meta content="false" id="twcClient" name="twcClient" /> <link type="text/css" rel="stylesheet" href="__PUBLIC__/css/style.css"> <link type="text/css" rel="stylesheet" href="__PUBLIC__/css/area.css"> <link rel="apple-touch-icon-precomposed" href="__PUBLIC__//images/ehaier-icon.png"/> <link rel="shortcut icon" type="image/x-icon" href="__PUBLIC__//images/ehaier-icon.png"/><script type="text/javascript" src="__PUBLIC__/js/jquery-1.9.1.js"></script> <script type="text/javascript" src="__PUBLIC__/js/area.js"></script> <script type="text/javascript" src="__PUBLIC__/js/zepto.js"></script> <script type="text/javascript" src="__PUBLIC__/js/gs.js"></script> <script type="text/javascript" src="__PUBLIC__/js/mediav.js"></script> <script type="text/javascript" name="baidu-tc-cerfication" data-appid="4746793" src="__PUBLIC__/js/lightapp.js"></script> <script type="text/javascript" src="__PUBLIC__/js/criteo.js"></script> <script type="text/javascript" src="__PUBLIC__/js/ld.js" async></script> <meta name="keywords" content="" /> <meta name="description" content="覆膜高光面板,耐磨性好不退色,不沾油烟不积灰;三门三温区,独立制冷不串味;中门007软冷冻技术,0解冻时间,0时差保鲜,0~-7℃软冷冻存储,肉食不用化冻即时切。" /> <title>{$data['name']}</title> <link type="text/css" rel="stylesheet" href="__PUBLIC__/css/details.css"/> <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/swiper.css"/> <script type="text/javascript" src="__PUBLIC__/js/pz.js"></script> <script type="text/javascript" src="__PUBLIC__/js/cig.js"></script> </head> <body> <header class="header"> <span class="fh left"><a href="__PUBLIC__/">&nbsp;</a></span> 商品详情 <span class="hd_right right"> <a class="gwc" href="__PUBLIC__//mobile/cart/myCart.html"><span id="count">0 </span>&nbsp;</a> <a class="right_but" href="__PUBLIC__//mobile/common/navigate.html">&nbsp;</a> </span> </header> <div id="page"> <!--======main=====--> <div class="main"> <form action="{:U('Index/addOrder')}" method="post"> <div class="details_text"> <div class="details_title">{$data['name']} {$data['pex']}</div> <div class="details_nr">覆膜高光面板,耐磨性好不退色,不沾油烟不积灰;三门三温区,独立制冷不串味;中门007软冷冻技术,0解冻时间,0时差保鲜,0~-7℃软冷冻存储,肉食不用化冻即时切。</div> <div class="details_jg">商城价格:<span>¥{$data['pirce']}</span> </div> <input type="hidden" name="pirce" value="{$data['pirce']}"> <input type="hidden" name="id" value="{$data['id']}"> <input type="hidden" name="name" value="{$data['name']}"> <input type="hidden" name="pex" value="{$data['pex']}"> <a class="activemsg" href="__PUBLIC__/"></a> <div class="details_nr">服务承诺:<span id="isSupportCOD"></span><span>送货上门,按约送达</span></div> <div class="details_nr"> 购买数量:<span class="count_num"> <a href="javascript:void(0)" id="btnMinus" class="inputcheckbox">-</a> <div class="count-input"> <input type="text" maxlength="2" name="num" value="{$data['num']}" id="proCount" readonly> </div> <a href="javascript:void(0)" id="btnAdd" class="inputcheckbox">+</a> </span> <span class="count-msg" id="stockStatus"></span> <span style="display:none;" id="stockType"></span></div> </div> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <input type="hidden" id="tzpid" name="tzpid" value="6038" /> <tr> <td height="45" align="right" valign="middle" width="20%">姓 名:</td> <td height="45" align="left" valign="middle" width="80%"><input type="text" id="name" name="name" value="" class="tz_wbk"></td> </tr> <tr> <td height="45" align="right" valign="middle">邮 箱:</td> <td height="45" align="left" valign="middle"><input type="text" id="email" name="email" value="" class="tz_wbk"></td> </tr> <tr> <td height="45" align="right" valign="middle">手机号:</td> <td height="45" align="left" valign="middle"><input type="text" id="mobile" name="mobile" value="" class="tz_wbk"></td> </tr> <tr> <tr> <td height="45" align="right" valign="middle">配送区域:</td> <td height="45" align="left" valign="middle"><input class="address_input1" type="text" placeholder="省市区" name="city" id="shengshi" onClick="getProvinceBuy()" readonly></td> </tr> <tr> <td height="45" align="right" valign="middle">详细地址:</td> <td height="45" align="left" valign="middle"><input type="text" name="detail"></td> </tr> </table> <div class="details_but" id="you"> <input type="submit" value="微信支付"> <!--订金尾款、限时抢购、二维码、套装走快捷购物流程--> <!-- <a href="__PUBLIC__/javascript:void(0);" class="gwc" id="addCart">加入购物车</a> --> </div> <div class="details_qh" style="display:none" id="tongzhi"><a href="__PUBLIC__/javascript:void(0);" class="dhtz">到货通知</a></div> <div class="details_qh" style="display:none" id="wu"><a href="__PUBLIC__/javascript:void(0)">无货</a></div> <!--======到货通知=====--> <div class="dhtz_tc" id="tongZhiCeng"> <header class="header"><span class="fh left"><a href="__PUBLIC__/javascript:history.go(-1);">&nbsp;</a></span>到货通知</header> <div class="dhtz_bottom"> </div> </div> </div> </form> <script type="text/javascript" src="__PUBLIC__/js/ehaier.js"></script> <script type="text/javascript" src="__PUBLIC__/js/baidu.js"></script> <script type="text/javascript" src="__PUBLIC__/js/ga.js"></script> <script type="text/javascript"> //ntalk NTKF_PARAM = { siteid:"kf_9949", settingid: "kf_9949_1358748431343" ,itemid:"6038" } //联系客服打开 $(".lxkf").click(function(){ if ($('#load_mask').length) {} else{ var h = $(document.body).height()+"px"; $("<div id='load_mask' class='tc_zz' style='height:"+h+"' />").appendTo("body"); } $("#load_mask").show(); var t = $(window).scrollTop(), h = $(window).height(), iTop = 0; iTop = ((h - $(".tc2").height()) / 2 + t) + "px"; $(".tc2").css("top", iTop).show(); }) //联系客服关闭 $(".lxkf_close").click(function(){ $(".tc2").hide(); $("#load_mask").hide(); }) </script> <script type="text/javascript" src="__PUBLIC__/js/ntkfstat.js" charset="utf-8"></script> </div> <!--zepto and extend--> <script type="text/javascript" src="__PUBLIC__/js/touch.js"></script> <script type="text/javascript" src="__PUBLIC__/js/selector.js"></script> <script type="text/javascript" src="__PUBLIC__/js/swiper-2.4.js"></script> <script type="text/javascript" src="__PUBLIC__/js/util.js"></script> <script type="text/javascript"> $(document).ready(function (e) { //商品图片展示 var gallery = $('.swiper-container').swiper({ slidesPerView: 'auto', centeredSlides: true, pagination: '.pagination', paginationClickable: true, /*resizeReInit: true,*/ keyboardControl: true, grabCursor: true, /*loop: true,*/ //slidesPerView为auto时不支持loop模式 autoplay:4000//自动播放的开关及延时 }) //购买数量增加或减少 var doEvent = document.hasOwnProperty("ontouchstart") ? "tap" : "click"; //减少 $("#btnMinus").on(doEvent, function () { var count = parseInt($("#proCount").val()); if (count > 1) { $("#proCount").val(--count); } }); //增加,最多99个 $("#btnAdd").on(doEvent, function () { var count = parseInt($("#proCount").val()); if (count < 100) { $("#proCount").val(++count); } }); //通知层显示 $("#tongzhi").click(function(){ $("#tongzhi").hide(); //通知按钮隐藏 $("#tongZhiCeng").show(); //通知层显示 }); //通知层提交 $("#tj").click(function(){ var name=$("#name").val(); var productId=$("#tzpid").val(); var emall=$("#email").val(); var mobile=$("#mobile").val(); if(Zepto.trim(name) == ""){ alert("姓名不能为空"); return false; } if(emall=="" && mobile==""){ alert("请填写邮箱或手机,不能都为空"); return false; } if(emall != ""){ if(!isEamll(emall)){ return false; } } if(mobile != ""){ if(!isMobileNO(mobile)){ return false; } } var regionId = $("#regionId").val(); var provinceName = $("#provincetip").text(); var cityName = $("#citytip").text(); var regionName = $("#regiontip").text(); $.post("/mobile/item/inform.html" ,{ name:name, productId:productId, emall:emall, mobile:mobile, regionId:regionId, provinceName:provinceName, cityName:cityName, regionName:regionName }, function(data) { if(data.success){ alert("设置到货通知成功") $("#tongZhiCeng").hide(); //通知层显示 $("#tongzhi").show(); } else{ alert("设置到货通知失败"); $("#tongZhiCeng").hide(); //通知层显示 $("#tongzhi").show(); } }, "json") }); //手机号校验 function isMobileNO(mobileNum){ var pattern = new RegExp("^((13[0-9])|(14[57])|(15[^4,\\D])|(18[0-9]))\\d{8}$"); if(!pattern.test(mobileNum)){ alert("手机号不正确!"); return false; } return true; } //邮箱校验 function isEamll(emall){ var pattern = new RegExp("^([a-zA-Z0-9]*[-_]?[a-zA-Z0-9]+)*@([a-zA-Z0-9]*[-_]?[a-zA-Z0-9]+)+[\\.][A-Za-z]{2,3}([\\.][A-Za-z]{2})?$"); if(!pattern.test(emall)){ alert("邮箱不正确!"); return false; } return true; } }); </script> <script type="text/javascript"> $(document).ready(function(){ var provinceId = ''; var cityId = ''; var regionId = ''; var provinceName = ''; var cityName = ''; var regionName = ''; if( provinceId == '') { provinceId='16';} if( cityId == '') { cityId='173';} if( provinceName == '') { provinceName='山东';} if( cityName == '') { cityName='青岛';} //所有省市区json var prcJson = {}; var province_da = []; var city_da = []; var region_da = []; //加载省市区 $.ajax({ type: 'POST', url: '/mobile/item/getRegion.html', data:'', dataType: 'json', success: function(data){ parsePrcJson(data.data); }, /* type : 'get', dataType : 'jsonp', url : 'http://www.ehaier.com/region.php?a=outRegionJson&pid=5949&acid=0&m=1', success : function (data) { alert(data); parsePrcJson(data); } */ }); //解析prcJson function parsePrcJson(data){ for( var i=0;i<data.length;i++ ){ var cur_province = data[i]; province_da.push({ 'id':cur_province.id, 'name':cur_province.regionName }); for( var j=0;j<cur_province.childs.length;j++ ){ var cur_city = cur_province.childs[j]; city_da.push({ 'id':cur_city.id, 'name':cur_city.regionName, 'fid':cur_province.id }); for( var k=0;k<cur_city.childs.length;k++ ){ var cur_region = cur_city.childs[k]; region_da.push({ 'id':cur_region.id, 'name':cur_region.regionName, 'fid':cur_city.id }); } } } //初始化省 for(var i=0; i<province_da.length;i++){ $("#provinceId").append("<option value='"+province_da[i].id+"'>"+province_da[i].name+"</option>"); } //初始化市 for(var i=0; i<city_da.length;i++){ if( city_da[i].fid == provinceId ){ $("#cityId").append('<option value="'+city_da[i].id+'">'+city_da[i].name+'</option>'); } } //初始化区 for(var i=0; i<region_da.length;i++){ if( region_da[i].fid == cityId ){ $("#regionId").append('<option value="'+region_da[i].id+'">'+region_da[i].name+'</option>'); } } //省市区回显或设置默认值 //省 $("#provinceId option[value='"+provinceId+"']").attr("selected","selected"); $("#provincetip").text(provinceName); //市 $("#cityId option[value='"+cityId+"']").attr("selected","selected"); $("#citytip").text(cityName); //区 if(regionId == '') { var count = 0; for(var i=0; i<region_da.length;i++){ if( region_da[i].fid == cityId ){ count++; if(count == 1){ regionId = region_da[i].id; regionName = region_da[i].name; $("#regionId option[value='"+region_da[i].id+"']").attr("selected","selected"); $("#regiontip").text(region_da[i].name); break; } } } Zepto.post("/mobile/item/storeRegion.html", { province : provinceId, city : cityId, region : regionId, regionName : provinceName + " " + cityName + " " + regionName }, function(json,status){ if(!json.success){ //console.log("省市区存储失败!"); } } ); }else{ $("#regionId option[value='"+regionId+"']").attr("selected","selected"); $("#regiontip").text(regionName); } $("#estore").hide(); //校验库存 checkStock(regionId); } (function(){ if(false){ //已收藏 $("#collectIcon").removeClass("icon-collect"); $("#collectIcon").addClass("icon-nav-fav"); } if(false){ //已点过赞 $("#praiseIcon").removeClass("icon-praise"); $("#praiseIcon").addClass("icon-praised"); } })(); //省选择事件 $("#provinceId").change(function(){ var $provinceSel = $("#provinceId option:selected"); var parentId = $provinceSel.val(); $("#stockStatus").empty(); $("#provincetip").text($provinceSel.text()); $("#cityId option").remove(); $("#cityId").append('<option value="">选择市</option>'); $("#citytip").text("选择市"); $("#regionId option").remove(); $("#regionId").append('<option value="">选择区</option>'); $("#regiontip").text("选择区"); if(parentId == null || parentId == "" || parentId == 0){ return; } for( var i=0;i<city_da.length;i++ ){ if( city_da[i].fid == parentId ){ $("#cityId").append('<option value="'+city_da[i].id+'">'+city_da[i].name+'</option>'); } } hasStock(); }); //市选择事件 $("#cityId").change(function(){ var $citySel = $("#cityId option:selected"); var parentId = $citySel.val(); $("#stockStatus").empty(); $("#citytip").text($citySel.text()); $("#regionId option").remove(); $("#regionId").append('<option value="">选择区</option>'); $("#regiontip").text("选择区"); if(parentId == null || parentId == "" || parentId == 0){ return; } for( var i=0;i<region_da.length;i++ ){ if( region_da[i].fid == parentId ){ $("#regionId").append('<option value="'+region_da[i].id+'">'+region_da[i].name+'</option>'); } } hasStock(); }); //区选择事件 $("#regionId").change(function(){ var $provinceSel = $("#provinceId option:selected"); var $citySel = $("#cityId option:selected"); var $regionSel = $("#regionId option:selected"); var province = $provinceSel.val(); var city = $citySel.val(); var region = $regionSel.val(); var provinceName = $provinceSel.text(); var cityName = $citySel.text(); var districtName = $regionSel.text(); var regionName = provinceName + " " + cityName + " " + districtName; $("#regiontip").text($regionSel.text()); if(region == null || region == "" || region == 0){ $("#stockStatus").empty(); return; } checkStock(region); ($).post("/mobile/item/storeRegion.html", { province : province, city : city, region : region, regionName : regionName }, function(json,status){ if(!json.success){ //console.log("省市区存储失败!"); } } ); }); //库存校验 function checkStock(regionId){ var sku = 'BA09X0B8F'; var productId = '6038'; $.getJSON("/mobile/item/checkStock.html?sku="+sku+"&regionId="+regionId+"&prodId="+productId,function(data,status){ var json = data; if(json.success){ if(json.data.hasStock){ if(json.data.expectTime != null){ hasStock(); $("#buyImmediately").text("立即购买"); $("#addCart").show(); $("#stockStatus").text(json.data.expectTime); $("#stockType").text(json.data.stockType); $("#tongzhi").hide(); $("#you").css('display','block'); } if(json.data.isSupportCOD){ $("#isSupportCOD").text("货到付款,"); }else{ $("#isSupportCOD").text(""); } }else if(json.data.bookable){ if(json.data.expectTime != null){ hasStock(); $("#stockStatus").text(json.data.expectTime); $("#stockType").text(json.data.stockType); $("#tongzhi").hide(); $("#you").css('display','block'); } if(json.data.bookable){ $("#buyImmediately").text("立即预定"); $("#addCart").hide(); $("#isSupportCOD").text(""); } }else{ noStock(); $("#you").hide(); $("#tongzhi").show(); } }else{ noStock(); $("#you").hide(); $("#tongzhi").show(); } checkStore(regionId); }); } function checkStore(regionId){ var stockType = $("#stockType").text(); if(stockType=="WA" || stockType == "" || stockType == null) return; $.ajax({ url:"/mobile/productmain/storeregion.html", type:"POST", dataType:"json", data:{regionId:regionId}, success:function(result){ if(result.success){ $("#estore").show(); $("#estore a").attr("href","/mobile/o2omini/"+ result.data.storeCode+".html?storeId="+result.data.storeId); }else{ $("#estore").hide(); } } }); /*var regions = [2444,2445,2446,2447,2448,2449,2450,2451,2452,2453,2454]; for(var index = 0;index < regions.length;index++) { if(regionId==2452){ $("#estore").show(); $("#estore a").attr("href","http://www.ehaier.com/tpl/pddf/m/index.html"); break; }else if(regionId == regions[index]){ $("#estore").show(); $("#estore a").attr("href","http://www.ehaier.com/tpl/hcyt/m/index.html"); break; }else{ $("#estore").hide(); } }*/ } //有货 function hasStock(){ $("#stockStatus").text(""); } //无货 function noStock(){ $("#stockStatus").text("无货"); } //收藏 $("#collect").click(function(){ if($("#collectIcon").hasClass("icon-nav-fav")){return false;} url = "/mobile/item/productCollect.html"; ($).getJSON(url,{ productId : 6038, productName : '海尔 冰箱 BCD-206STPA', imageUrl : 'http://cdn21.ehaier.com/file/566ef238b702af925d2b8d50.png' }, function(data, status) { var json = data; if(json.success){ var redirect = json.data.redirect; if(redirect == null){ //收藏成功 var count = 1240 + 1 $("#collectIcon").removeClass("icon-collect"); $("#collectIcon").addClass("icon-nav-fav"); $("#collectCount").text(count); }else{ window.location.href=redirect; } }else{ } }); }); //加入购物车 $("#addCart").click(function(){ var regionId = $("#regionId").val(); var number = $("#proCount").val(); var productId = 6038; /*var ckPrice = 0;*/ var ckCode = 0; var isCK = 0; if(regionId == "" || number == "" || productId == ""){ alert("请选择配送区域!"); return; } if(ckCode > 0 || isCK > 0){ $.getJSON("/mobile/ckcart/addProduct.html?number="+number+"&productId="+productId, function(data, status) { var json = data; if(json.success){ location.href ="/mobile/ckcart/myCart.html"; }else{ alert("购物车添加失败"); } }); }else{ $.getJSON("/mobile/cart/addToCart.html?number="+number+"&productId="+productId, function(data, status) { var json = data; if(json.success){ location.href ="/mobile/cart/myCart.html"; }else{ alert("购物车添加失败"); } }); } }); //立即购买 $("#buyImmediately").click(function(){ var number = $("#proCount").val(); var productId = 6038; var ckPrice = 0; var productActivitiesPrice = 0; var flashsalesPrice = 0; var packageId = 0; var bcQrcodePrice = 0; /*var ckPrice = 0;*/ var ckCode = 0; var isCK = 0; if(regionId == "" || number == "" || productId == ""){ alert("请选择配送区域!"); return; } if(bcQrcodePrice > 0){ location.href = "/mobile/order/toQuickOrderSubmit.html?productId="+productId+"&bcQrcodeId=${bcQrcodeId}"; }else if((ckCode > 0 || isCK >0) && packageId == 0){ location.href = "/mobile/ckcart/buyImmediately.html?number="+number+"&productId="+productId; }else if(productActivitiesPrice > 0 || flashsalesPrice > 0 || packageId > 0){ location.href = "/mobile/order/toQuickOrderSubmit.html?productId="+productId; }else{ location.href = "/mobile/item/buyImmediately.html?number="+number+"&productId="+productId; } }); }); //点赞 $("#praise").click(function(){ if($("#praiseIcon").hasClass("icon-praised")){return false;} url = "/mobile/item/productPraise.html"; ($).getJSON(url,{ productId : 6038 }, function(data, status) { var json = data; if(json.success){ var redirect = json.data.redirect; if(redirect == null){ var count = 3893 + 1 //点赞成功 $("#praiseIcon").removeClass("icon-praise"); $("#praiseIcon").addClass("icon-praised"); $("#praiseCount").text(count); }else{ window.location.href=redirect; } }else{ } }); }); _cigPvUv();//CIG pv/uv单品监测 criteo_productMain("6038");//criteo广告投放 </script> </body> </html> ~~~ 3. 在浏览器输入:域名/index.php/Shop/Index ![](https://box.kancloud.cn/6042031f5fe0ea39374eecc7b4aab06e_603x273.png) 4. 点击产品列表中的产品可以进入详情页面 ![](https://box.kancloud.cn/da7fdc7cece45f068e2c7ea215d2baf9_642x488.png) 5. 点击立即下单可以进入订单页面 ![](https://box.kancloud.cn/4a41736807bea30a094e94fe37c830ac_429x685.png) 6. 填写表格,点击微信支付 ![](https://box.kancloud.cn/ef7aad0f42cdd504f624685ad322e756_785x739.png) 7. 本节源码下载(下载密码:gg3m)点击[下载](https://pan.baidu.com/s/15R3SaxqkhfkGJAldZF5xyQ)