| 1 | | 车市、文章页商城入口优化,自动定位网友城市。 |
| | 1 | 车市、文章页商城入口优化,自动根据IP定位网友城市。 |
| | 2 | |
| | 3 | 具体需求: |
| | 4 | |
| | 5 | 1、全国首页、车市页顶部导航经销商、搜索商家,无ip识别,需要2次点击城市。不利于网友查询,建议添加ip识别功能: |
| | 6 | |
| | 7 | [[Image(010.bmp)]] |
| | 8 | |
| | 9 | 2、车市首页:http://gz.pcauto.com.cn/ |
| | 10 | |
| | 11 | [[Image(020.bmp)]] |
| | 12 | |
| | 13 | 3、文章页:http://gz.pcauto.com.cn/yhxx/zjjc/1112/1766263.html (报价库接口) |
| | 14 | |
| | 15 | [[Image(030.bmp)]] |
| | 16 | |
| | 17 | 处理: |
| | 18 | |
| | 19 | 1)首页和车市等页面所有下拉框,如过是JS提交请求的,将请求提交到IP定位城市的跳转接口来处理,跳转接口如下: |
| | 20 | http://4s.pcauto.com.cn/index_djump.jsp?fip=1&bid=2 搜品牌下的商家 |
| | 21 | http://4s.pcauto.com.cn/index_djump.jsp?fip=1&mid=104 搜厂商下的商家 |
| | 22 | http://4s.pcauto.com.cn/index_djump.jsp?fip=1&sid=3544 搜车系下的商家 |
| | 23 | |
| | 24 | 2)其他超链接方式直接在页面用js代码获取网友城市ID,替换原链接即可,如下: |
| | 25 | {{{ |
| | 26 | <body> |
| | 27 | <script>if(!window._addIvyID) document.write("<scr"+"ipt src='http://www.pconline.com.cn/js/ivy.js'><\/scr"+"ipt>");</script> |
| | 28 | <div class="dialog"> |
| | 29 | <div class="tb"> |
| | 30 | <table border="0" cellspacing="0" cellpadding="0" class="tableA"> |
| | 31 | <tr> |
| | 32 | <th scope="row"><span>*</span> <a href="http://chen.pcauto.com.cn/shangjia/nb601/" id="dllink">经销商</a></th> |
| | 33 | </tr> |
| | 34 | </table> |
| | 35 | </div> |
| | 36 | </div> |
| | 37 | <script src="http://js.3conline.com/pcauto/price2010/js/auto_dealers_area.js"></script> |
| | 38 | <script> |
| | 39 | var areaArry=getPCautoArea(); |
| | 40 | var aId=areaArry[0]; |
| | 41 | var lk=document.getElementById("dllink"); |
| | 42 | lk.href="http://4s.pcauto.com.cn/shangjia/c"+aId+"/nb2/"; |
| | 43 | </script> |
| | 44 | </body> |
| | 45 | }}} |
| | 46 | |
| | 47 | 3)文章页比较特殊暂不处理 |