json 数据返回解密
http://www.cnhan.com/shantui//dynamic/get/data/allCompanyInfoByCompCode.json?compCode=6SU5YCJ
<script type="text/javascript"> | |
window.platformPath = "http://www.cnhan.com/shantui/"; | |
window.cId = "3691"; | |
window.cCode= "2M02DgM"; | |
window.staticPath = "http://www.cnhan.com/shantui/"; | |
// 获取当前链接 | |
window.currentUrl = window.location.href; | |
window.moreProduction = "http://www.cnhan.com/shantui/production-3691.shtml"; | |
window.moreArticle = "http://www.cnhan.com/shantui/article-3691.shtml"; | |
</script> | |
<script> | |
(function(){ | |
var bp = document.createElement('script'); | |
var curProtocol = window.location.protocol.split(':')[0]; | |
if (curProtocol === 'https') { | |
bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; | |
} | |
else { | |
bp.src = 'http://push.zhanzhang.baidu.com/push.js'; | |
} | |
var s = document.getElementsByTagName("script")[0]; | |
s.parentNode.insertBefore(bp, s); | |
})(); | |
</script> |
http://www.cnhan.com/shantui//templates/MC530/TP001/js/template.js
function decode(data) {
var a = CryptoJS.enc.Base64.parse(data);
return a.toString(CryptoJS.enc.Utf8);
}
var qiaoContent="0";//0默认没有商桥内容 1有商桥
$.ajax({
url: window.platformPath + '/dynamic/get/data/allCompanyInfoByCompCode.json?compCode=' + window.cCode,
dataType: 'json',
success: function(data){
var str = decode(data.r);
var str2 = decode(str);
str2 = JSON.parse(str2)
var contactInfoDto = str2.contactInfoDto;
var pcNavInfoDtoList = str2.pcNavInfoDtoList;
var productInfoDtoList = str2.productInfoDtoList;
var carouselInfoDtoList = str2.carouselInfoDtoList;
var mobileNavInfoDtoList = str2.mobileNavInfoDtoList;
var qiaoMap = str2.qiaoMap;
// 1.
MC500TP001site_footer(contactInfoDto);
MC500TP001contact_us(contactInfoDto);
MC500TP001company_card(contactInfoDto);
MC500TP001mobile_footer(contactInfoDto);
// 2.
MC500TP001site_header(contactInfoDto,pcNavInfoDtoList);
// 3.
MC500TP001businesses(productInfoDtoList);
// 4.
MC500TP001carousel(carouselInfoDtoList);
// 5.
MC500TP001mobile_nav(mobileNavInfoDtoList);
// 6.
MC500TP001Qiao(qiaoMap);
},
error: function(data){
console.log(data);
}
}); function MC500TP001contact_us(contact_info) {
var contact_us = '<div class="m-box">'
+ '<p class="u-title"> 联系我们 </p>'
+ '<div class="u-session">'
+ '<ul class="u-List">'
+ '<li>企业:'+ contact_info.compName + '</li>'; var float_window = '<div class="shutdown" align="right"><i class="glyphicon glyphicon-remove"></i></div>'
+ '<div class="ask_online"><img src="'+staticPath+'templates/MC500/TP001/img/ask_online.png">在线咨询</div><div class="line"></div>'
+ '<div class="info_wrapper">'; if(contact_info.contactName){
contact_us += '<li>联系人:' + contact_info.contactName + '</li>';
} if(contact_info.mobilePhone){
contact_us += '<li>手机:<span class="tag-litghter">' + contact_info.mobilePhone + '</span></li>';
} if(contact_info.telPhone){
contact_us += '<li>电话:<span class="tag-litghter">' + contact_info.telPhone + '</span></li>';
}
if(contact_info.fax){
contact_us += '<li>传真:<span class="tag-litghter">' + contact_info.fax + '</span></li>';
}
if(contact_info.qq1){
contact_us += '<li>QQ:<span class="tag-litghter">' + contact_info.qq1 + '</span><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin='+ contact_info.qq1 +'&site=qq&menu=yes"><img class="QQ_talk" border="0" src="http://wpa.qq.com/pa?p=2:'+ contact_info.qq1 +':51" alt="QQ咨询" title="QQ咨询"/></a></li>';
float_window += '<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin='+ contact_info.qq1 +'&site=qq&menu=yes" class="QQ_wrapper"><img src="'+staticPath+'templates/MC500/TP001/img/QQ.png"'+' style="width: 22px;"><span>'+contact_info.qq1+'</span></a>';
}
if(contact_info.qq2){
float_window += '<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin='+ contact_info.qq2 +'&site=qq&menu=yes" class="QQ_wrapper"><img src="'+staticPath+'templates/MC500/TP001/img/QQ.png"'+' style="width: 22px;"><span>'+contact_info.qq2+'</span></a>';
}
if(contact_info.wangwang){
float_window += '<a target="_blank" class="QQ_wrapper" href="https://amos.alicdn.com/getcid.aw?spm=a1z10.1-c-s.0.0.1c593dd0rjUYdA&v=3&groupid=0&s=1&charset=utf-8&uid='+ contact_info.wangwang +'&site=cntaobao&fromid=cntaobaoadkdea "><img border="0" src="https://img.alicdn.com/tps/i4/T1uUG.XjtkXXcb2gzo-77-19.gif" alt="点这里给我发消息"></a>';
}
float_window += '<div class="line2"></div>';
if(contact_info.wechatUrl) {
float_window += '<div class="QRcode"><img id="QRcodeUrl" src="'+ contact_info.wechatUrl +'"></div><div class="line2"></div>';
}
if(contact_info.mobilePhone){
float_window += '<div class="phone_wrapper"><i class="icon-mobile"></i><span id="phone1">' + contact_info.mobilePhone + '</span></div>';
}
if(contact_info.telPhone){
float_window += '<div class="phone_wrapper"><i class="icon-phone"></i><span id="phone1">' + contact_info.telPhone + '</span></div>';
}
if(contact_info.email){
contact_us += '<li>邮箱:<span class="tag-litghter">' + contact_info.email + '</span></li>';
}
if(contact_info.address){
contact_us += '<li>地址:' + contact_info.address + '</li>';
}
if(contact_info.webSite){
contact_us += '<li>网址:<a class="tag-litghter" href="'+ contact_info.webSite +'">' + contact_info.webSite + '</li>';
}
contact_us += '</ul>';
if(contact_info.leftAdImgUrl){
contact_us += '<div class="u-advertisement"><h4>'+ contact_info.leftAdName +'</h4>';
contact_us += '<div class="u-advertisement-img"><a href="'+ contact_info.leftAdUrl +'"><img src="'+ contact_info.leftAdImgUrl +'" /></a></div>';
} contact_us += '</div>';
float_window += '</div></div>';
$("#side-contact").append(contact_us);
$("#float_window").append(float_window);
if (qiaoContent!="1") {
$(".float_window").show();
}
}
function MC500TP001company_card(contact_info) {
var company_card = '<div class="l-box">'
+ '<div class="title-box">'
+ '<p class="l-title">' + contact_info.compName + '</p>'
+ '</div>'
+ '<div class="l-session">'
+ '<div class="box-list">'
+ '<ul class="l-list">';
if(contact_info.contactName){
company_card += '<li>联系人:' + contact_info.contactName + '</li>';
}
if(contact_info.mobilePhone){
company_card += '<li>手机:<span class="tag-litghter">' + contact_info.mobilePhone + '</span></li>';
}
if(contact_info.telPhone){
company_card += '<li>电话:<span class="tag-litghter">' + contact_info.telPhone + '</span></li>';
}
if(contact_info.fax){
company_card += '<li>传真:<span class="tag-litghter">' + contact_info.fax + '</span></li>';
}
if(contact_info.email){
company_card += '<li>邮箱:' + contact_info.email + '</li>';
}
if(contact_info.address){
company_card += '<li>地址:' + contact_info.address + '</li>';
}
if(contact_info.webSite){
company_card += '<li>网址:' + contact_info.webSite + '</li>';
}
company_card += '</ul></div>';
if(contact_info.wechatUrl){
company_card += '<img alt="微信图片" class="weixin" src="' + contact_info.wechatUrl + '" />';
}
company_card += '</div>';
$("#company-card").append(company_card);
}
function MC500TP001businesses(product_info) {
var production = '<div class="m-box">'
+ '<p class="u-title"> 推荐阅读 </p>'
+ '<div class="u-session">'
+ '<ul class="u-List">';
for (var i = 0; i < product_info.length; i++) {
var productUrl = (product_info[i].productUrl == null || product_info[i].productUrl == undefined)?"#":product_info[i].productUrl;
var productImgUrl = product_info[i].productImgUrl;
var productName = (product_info[i].productName == null || product_info[i].productName == undefined)?"":product_info[i].productName;
if (productImgUrl) {
production += '<li><a href="' + productUrl + '">' +
'<img alt="公司产品" class="article-product-img" src="' + productImgUrl + '" />' +
'<p>' + productName + '</p>' +
'</a>' +
'</li>';
}
}
production += '</ul>';
production += '<a href="' + window.moreProduction + '" target="_blank" class="u-more" ><p>查看更多产品</p></a>';
production += '</div>';
$("#side-businesses").append(production);
}
function MC500TP001site_header(company_info, pc_nav_info) {
var compName = (company_info.compName == null || company_info.compName == undefined)?"":company_info.compName;
var logoUrl = (company_info.logoUrl == null || company_info.logoUrl == undefined)?"":company_info.logoUrl;
var mobileLogoUrl = (company_info.mobileLogoUrl == null || company_info.mobileLogoUrl == undefined)?"-":company_info.mobileLogoUrl;
var tel = (company_info.tel == null || company_info.tel == undefined)?"":company_info.tel;
var mHeader = '<div class="g-nav m-hidden"><ul class="m-navList">';
var header = '<div class="g-top m-hidden">'
+ '<div class="m-logo">'
+ '<img alt="logo" height="56" id="logo" src="' + logoUrl + '" />'
+ '</div>'
+ '<div class="m-name">'
+ '<h3>' + compName + '</h3>'
+ '</div>'
+ '<div class="m-tel">'
+ '<div class="u-telIcon">'
+ '</div>'
+ '<p> 全 国 服 务 热 线 <span>' + tel + '</span> </p>'
+ '</div>'
+ '</div>'
+ '<div class="g-nav m-show" style="background: #FFF !important;">'
+ '<div class="g-mLogo m-show">'
+ ( mobileLogoUrl=='-'?'':'<img alt="logo" height="40px" width="50px" id="logo" src="' + mobileLogoUrl + '" />')
+ '</div>'
+ '<div class="g-mName m-show">'
+ '<h3>' + compName + '</h3>'
+ '</div>'
+ '<div class="g-mNavBar m-show" onclick="toggleUl(this)">'
+ '<span class="nav_words">导航</span>'
+ '<ul>';
for (var i = 0; i < pc_nav_info.length; i++) {
var navUrl = (pc_nav_info[i].navUrl == null || pc_nav_info[i].navUrl == undefined)?"":pc_nav_info[i].navUrl;
if (!navUrl) {
navUrl=window.currentUrl;
}
var navName = (pc_nav_info[i].navName == null || pc_nav_info[i].navName == undefined)?"":pc_nav_info[i].navName;
header += '<li><a href="' + navUrl + '">' + navName + '</a></li>';
mHeader += '<li><a href="' + navUrl + '">' + navName + '</a></li>';
}
header += '</ul></div></div>';
mHeader += '</ul></div>';
$("#header").append(header);
$("#nav").append(mHeader);
}
function MC500TP001carousel(carousel_info) {
var slider = '<div class="g-carousel m-hidden">'
+ '<ul class="m-carouselList">';
for (var i = 0; i < carousel_info.length; i++) {
if (carousel_info[i].imgUrl) {
if(carousel_info[i].linkUrl){
slider += '<li><a href="'+ carousel_info[i].linkUrl +'"><img src="'+ carousel_info[i].imgUrl +'" width="100%" /></a></li>';
} else {
slider += '<li><a href=""><img src="'+ carousel_info[i].imgUrl +'" width="100%" /></a></li>';
}
}
}
slider += '</ul><a href="javascript:void(0)" class="u-prev u-point"></a><a href="javascript:void(0)" class="u-next u-point"></a>'; slider += '<div class="m-items">';
slider += '</div>';
slider += '</div>';
slider += '<div class="swiper-container g-carousel m-show">';
slider += '<div class="swiper-wrapper">';
for (var j = 0; j < carousel_info.length; j++) {
var mobileImgUrl = (carousel_info[j].mobileImgUrl == null || carousel_info[j].mobileImgUrl == undefined)?"":carousel_info[j].mobileImgUrl;
slider += '<div class="swiper-slide m-carouselList" style="background: url(' + mobileImgUrl + ') center center no-repeat"></div>';
}
slider += '</div><div class="m-itemsSwiper"></div></div>';
$("#slider").append(slider);
YwkApp.init();
}
function MC500TP001site_footer(company_info) {
// 技术支持公司名称
var serverCompName = (company_info.serverCompName == null|| company_info.serverCompName == undefined)?"":company_info.serverCompName;
// 技术支持公司电话
var serverCompTel = (company_info.serverCompTel == null|| company_info.serverCompTel == undefined)?"":company_info.serverCompTel;
// 技术支持公司官网
var serverCompWebsite = (company_info.serverCompWebsite == null|| company_info.serverCompWebsite == undefined)?"":company_info.serverCompWebsite; var footer = '';
if(serverCompWebsite!=""){
footer = '<div class="g-wrapper foot m-hidden">'
+ '<div class="m-footer">'
+ '<p>该企业由【' + serverCompName + '】服务,服务热线:' + serverCompTel + ',官网地址:<a style="color: #beb7c3" href="'+ serverCompWebsite +'">'+serverCompWebsite+'</a></p>'
+ '<p>以上消息来自互联网,本网不对以上信息真实性、准确性、合法性负责</p>'
+ '<div class="copyright">版权与免责声明:<br>'
+ '<ol>'
+ '<li>1. 本网凡注明“稿件来源:本网原创”的所有作品。转载请必须同时注明本网名称及链接。</li>'
+ '<li>2. 本页面为商业广告,内容为用户自行上传,本网不对该页面内容(包括但不限于文字、图片、视频)真实性和知识产权负责。</li>'
+ '<li>3. 本网部分内容转载自其他媒体,目的在于传递更多信息,并不代表本网赞同其观点或证实其内容的真实性。不承担此类作品侵权行为的直接责任及连带责任。</li>'
+ '</ol>'
+ '</div>'
+ '</div>'
+ '</div>';
} else {
footer = '<div class="g-wrapper foot m-hidden">'
+ '<div class="m-footer">'
+ '<p>该企业由【' + serverCompName + '】服务,服务热线:' + serverCompTel + '</p>'
+ '<p>以上消息来自互联网,本网不对以上信息真实性、准确性、合法性负责</p>'
+ '<div class="copyright">版权与免责声明:<br>'
+ '<ol>'
+ '<li>1. 本网凡注明“稿件来源:本网原创”的所有作品。转载请必须同时注明本网名称及链接。</li>'
+ '<li>2. 本页面为商业广告,内容为用户自行上传,本网不对该页面内容(包括但不限于文字、图片、视频)真实性和知识产权负责。</li>'
+ '<li>3. 本网部分内容转载自其他媒体,目的在于传递更多信息,并不代表本网赞同其观点或证实其内容的真实性。不承担此类作品侵权行为的直接责任及连带责任。</li>'
+ '</ol>'
+ '</div>'
+ '</div>'
+ '</div>';
} var position = (company_info.position == null|| company_info.position == undefined)?"":company_info.position;
if (position) {
var videoUrl = (company_info.videoUrl == null|| company_info.videoUrl == undefined)?"":company_info.videoUrl;
var str = "";
if ("1" == position) {
str += '<div class="m-hidden video_center" id="sst_video"><div class="video_wraper"><img src='+window.staticPath+'templates/MC500/TP001/img/close_btn.png alt="关闭" onclick="closeVideo()" id="sst_close_video" /><video controls="controls" autoplay="autoplay" loop="loop" preload="auto">';
str += '<source src='+videoUrl+ ' type="video/mp4" /> 1您的浏览器版本太低,请升级浏览器。</div></div><div id="sst_video_bg"></div>';
} else if ("2" == position) {
str += '<div class="m-hidden video_left" id="sst_video"><img src='+window.staticPath+'templates/MC500/TP001/img/close_btn.png alt="关闭" id="sst_close_video" onclick="closeVideo()" /><video controls="controls" autoplay="autoplay" loop="loop" preload="auto">';
str += '<source src='+videoUrl+ ' type="video/mp4" /> 您的浏览器版本太低,请升级浏览器。</div></div>';
} else if ("3" == position) {
str += '<div class="m-hidden video_right" id="sst_video"><img src='+window.staticPath+'templates/MC500/TP001/img/close_btn.png alt="关闭" id="sst_close_video" onclick="closeVideo()" /><video controls="controls" autoplay="autoplay" loop="loop" preload="auto">';
str += '<source src='+videoUrl+ ' type="video/mp4" /> 您的浏览器版本太低,请升级浏览器。</div></div>';
}
$("#footer").append(str);
$("#sst_video_bg").show();
$("#sst_video").show();
} $("#footer").append(footer);
} function closeVideo(){
$("#sst_video_bg").hide();
$("#sst_video").hide();
} function MC500TP001mobile_nav(mobile_nav) {
var nav = '<div class="g-column m-show"><ul class="m-columnList">';
var len = mobile_nav.length;
for (var i = 0; i < 5; i++) {
var navUrl = "";
var navName = "";
if (i<len) {
navUrl = (mobile_nav[i].navUrl == null || mobile_nav[i].navUrl == undefined)?"":mobile_nav[i].navUrl;
navName = (mobile_nav[i].navName == null || mobile_nav[i].navName == undefined)?"":mobile_nav[i].navName;
}
if (!navUrl){
navUrl= window.currentUrl;
}
nav += '<li><a href="' + navUrl + '" target="_blank"><img alt="Home" src="'+window.staticPath+'/templates/images/mobile_nav' + i + '.png" />' + navName + '</a></li>';
}
nav += '</ul></div>';
$("#column").append(nav);
}
function MC500TP001mobile_footer(contact_info) {
var telPhone = (contact_info.telPhone == null || contact_info.telPhone == undefined)?"":contact_info.telPhone;
var webSite = (contact_info.webSite == null || contact_info.webSite == undefined)?"":contact_info.webSite;
var qq1 = (contact_info.qq1 == null || contact_info.qq1 == undefined)?"":contact_info.qq1;
var mobile_footer = '<div class="g-MobileBottom m-show">'
+ '<a target="_blank" href="mqqwpa://im/chat?chat_type=wpa&uin='+ qq1 +'&version=1&src_type=web&web_src=oicqzone.com">'
+ '<i class="icon-QQ iconmoon"></i>'
+ '<div>QQ咨询</div>'
+ '</a>'
+ '<a href="tel:' + telPhone + '">'
+ '<i class="icon-phone iconmoon"></i>'
+ '<div>联系我们</div>'
+ '</a>'
+ '<a href="' + webSite + '">'
+ '<i class="icon-home iconmoon"></i>'
+ '<div>进入官网</div>'
+ '</a>'
+ '</div>';
$("#mobileBottom").append(mobile_footer);
} /**
* 商桥代码
* @param data
* @constructor
*/
function MC500TP001Qiao(data) {
var code = (data.code == null || data.code == undefined)?"":data.code;
if (code == "0000") { // ok
qiaoContent = "1";
var content = data.result.content;
$("#qiao_content").append(content);
$(".float_window").hide();
$(".qiao_content").show();
}
} function toggleUl() {
if($('#header .g-mNavBar ul').css("display") == 'none'){
$('#header .g-mNavBar ul').css("display", "block !important");
} else {
$('#header .g-mNavBar ul').css("display", "none !important");
}
}
json 数据返回解密的更多相关文章
- php怎么解析utf-8带BOM编码的json数据,php解析json数据返回NULL
今天遇到一个问题,json_decode解析json数据返回null,试了各种方法都不行,最后发现,原来是json文件编码的问题. 当json_decode解析utf-8带BOM格式的json数据时, ...
- 解决后台json数据返回的字段需要替换的问题
有时候后台json数据返回的字段含有“id”,也有可能是有时候为了减少代码的冗余,两页面之间只是数据模型个别属性的区别,所以这时候最好是用到模型属性的替换,用新的属性替换返回的json数据的字段.这里 ...
- Nginx下HTML页面POST请求静态JSON数据返回405状态
在浏览器访问HTML页面,发现一些静态JSON数据没有显示,F12查看,如下图所示: 可以看到请求方式为POST 将请求链接复制在浏览器地址栏访问,可以正常请求到数据 F12查看,可以看到请求方式为G ...
- servlet生成json数据返回至Ajax
一.JSON JSON是一种取代XML的数据结构,和xml相比,它更小巧但描述能力却不差,由于它的小巧所以网络传输数据将减少更多流量从而加快速度. JSON就是一串字符串 只不过元素会使用特定的符号标 ...
- 后台对象转化成json数据返回给前端
一.介绍 JSON-lib包是一个beans,collections,maps,java arrays 和XML和JSON互相转换的包,主要就是用来解析Json数据 二.下载jar依赖包:可以去这里下 ...
- Response JSON数据返回
简述: 在servlet填充Response的时候,做JSON格式的数据转换 使用的类是net.sf.json.JSONObject,传入response对象和返回的显示类,修改response,返回 ...
- MVC使用Newtonsoft无需实体类,实现JSON数据返回给前端页面使用
//引用using Newtonsoft.Json; using Newtonsoft.Json.Linq; public ActionResult JsonSample() { ResponseRe ...
- Struts2使用ModelDriven后JSON数据返回不正确
在struts.xml中加入<param name="root">action</param> <result name="exist&qu ...
- springmvc json数据返回前台,中文乱码
@ResponseBody@RequestMapping(value = "selectProvinces",produces = "text/json;charset= ...
随机推荐
- 两个本质相同的dp
1.划分数 描述:给定数字N,将其划分为不超过K组,求不同的划分的总数(比如4——1 2 1,2 1 1就算做一种划分) 2.Dollar Dayz 描述:给定数字N,将其随意划分,但是组成数字不可以 ...
- 生成唯一标识符 ,通用唯一标识符 UUID
import java.util.UUID; /** * UUID生成工具 * */ public final class UuidGenUtils { /** * 生成一个UUID串(32个字符,其 ...
- HDU 5301(Buildings-贪心构造)
Buildings Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Tota ...
- quartz 应用到 spring定时任务 执行两次
https://my.oschina.net/superkangning/blog/467487
- window.location.href重定向 不会触发webview
通过window.location.href来重定向的,安卓不会触发shouldOverrideUrlLoading.
- 又一次认识java(九) ---- 内部类
注意注意!! ! 前排提示!!.本篇文章过长,最好收藏下来慢慢看.假设你之前对内部类不是非常熟悉,一次性看完,大概你会懵逼. . . 1. 内部类概述 一个类的定义放在还有一个类的内部,这个类就叫做内 ...
- 让heigh:100%起作用
如何让 height:100%; 起作用 http://www.webhek.com/css-100-percent-height 当你设置一个页面元素的高度(height)为100%时,期望 ...
- OpenTSDB设计解读
OpenTSDB是基于HBase存储时间序列数据的一个开源数据库,确切地说,它仅仅是一个HBase的应用而已,其对于时间序列数据的处理能够供其它系统參考和借鉴.本文会针对它在数据库的设计方面展开一些探 ...
- 怎样在编译的时候,控制删除apk不用的资源?
1.改动alps/meidatek/config/xxx/ProjectConfig.mk下的MTK_PRODUCT_LOCALS,去掉不用的资源,比方屏幕密度或语言等. 2. nodpi和mipm ...
- 【ORACLE】ORA-27102: out of memory报错的处理
************************************************************************ ****原文:blog.csdn.net/clark_ ...