EasyShop/Content/images2/mkl/LastView.js
(开头部分) 7KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/// <summary>
/// 本方法通过异步程序来处理单品页最近浏览商品的展示和对cookie的操作
/// </summary>
function ShowLastestViewedItems() {
//0、清除以前的cookie
if (typeof ($.cookie("LatestViewedItem")) != undefined && $.cookie("LatestViewedItem") != null) {
$.cookie("LatestViewedItem", "", { expires: -1, path: "/", domain: "m18.com", secure: true });
}
//1、异步读取cookie并展示
if (typeof ($.cookie("LastView")) != undefined && $.cookie("LastView") != null) {
//获取cookie
var viewedItemArray = $.cookie("LastView").split("$");
//1. 读取Cookie
//获取每次浏览记录的数组
var viewedItemRetunArray = new Array();
//使用Ajax方式
//构建Ajax请求的参数
var params = "'styleIds':'";
for (var i in viewedItemArray) {
//若当前浏览记录为空,则跳过进行下次循环
if (viewedItemArray[i] == null) {
continue;
}
params += viewedItemArray[i];
if (i != viewedItemArray.length - 1) {
params += ",";
}
}
params += "'";
$.ajax(
{
type: "POST",
contentType: "application/json",
url: ajaxServiceAddress.GetLastView,
data: "{" + params + "}",
dataType: 'json', //返回的类型为Json
success: function(result) {
var styleList = eval("(" + result.d + ")");
//构建来自服务端的List<LastViewStyleBizeEntity>数据
for (var i in styleList) {
styleList[i].ImgPath = "http://img.m18.com/GOODS/LARGEMAP/" + styleList[i].ImgPath;
var href = "http://product.m18.com";
switch (styleList[i].StyleType) {
case "Sku":
href += "/p-" + styleList[i].StyleId + ".htm";
break;
case "Kit":
href += "/k-" + styleList[i].StyleId + ".htm";
break;
case "Fix":
href += "/f-" + styleList[i].StyleId + ".htm";
break;
default:
href += "/#";
后面还有 137 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。