NEW: Staff Pick UI WebPage
Change-Id: I85c5b5ba28144a75dc231b99d73a8f5c2ce941f4
This commit is contained in:
parent
ceea4bb7cb
commit
cc6bd668ae
|
@ -97,7 +97,8 @@ var LangText={
|
|||
"t103":"Other",
|
||||
"t104":"Profile name",
|
||||
"t105":"Profile Author",
|
||||
"t106":"Profile description"
|
||||
"t106":"Profile description",
|
||||
"t107":"Staff Pick"
|
||||
},
|
||||
"zh_CN": {
|
||||
"t1": "欢迎使用Bambu Studio",
|
||||
|
@ -197,7 +198,8 @@ var LangText={
|
|||
"t103":"其他",
|
||||
"t104":"配置名称",
|
||||
"t105":"配置作者",
|
||||
"t106":"配置介绍",
|
||||
"t106":"配置介绍",
|
||||
"t107":"人工精选",
|
||||
"wk1": "快速入门指南",
|
||||
"wk2": "本文介绍了Bambu Studio的最基本用法。它指导用户配置软件,创建项目,并逐步完成第一个打印任务。",
|
||||
"wk3": "基于项目的工作流",
|
||||
|
@ -313,7 +315,8 @@ var LangText={
|
|||
"t103":"その他",
|
||||
"t104":"構成名",
|
||||
"t105":"構成著者",
|
||||
"t106":"構成の概要",
|
||||
"t106":"構成の概要",
|
||||
"t107":"スタッフが選ぶ"
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -83,4 +83,15 @@ body
|
|||
.UG_DESC
|
||||
{
|
||||
color:#818183;
|
||||
}
|
||||
|
||||
/*---Staff PIck----*/
|
||||
#HotModel_Swiper
|
||||
{
|
||||
background-color: #323238;
|
||||
}
|
||||
|
||||
.HotModel_NameText
|
||||
{
|
||||
background-color: #636368;
|
||||
}
|
|
@ -244,6 +244,13 @@ body
|
|||
height: 100%;
|
||||
}
|
||||
|
||||
.TitleSmallIcon
|
||||
{
|
||||
width:30px;
|
||||
height: 30px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
#MenuArea
|
||||
{
|
||||
height: 140px;
|
||||
|
@ -302,6 +309,22 @@ body
|
|||
height: 420px;
|
||||
}
|
||||
|
||||
#HotModelBlock
|
||||
{
|
||||
display:flex;
|
||||
align-items: center;
|
||||
padding: 6px 2px;
|
||||
border-bottom-width: 0px;
|
||||
border-bottom-style: solid;
|
||||
}
|
||||
|
||||
.HotModel_PrevImg
|
||||
{
|
||||
width: 200px;
|
||||
height: 148px;
|
||||
}
|
||||
|
||||
|
||||
#RecentFileArea
|
||||
{
|
||||
margin-top: 10px;
|
||||
|
@ -314,7 +337,7 @@ body
|
|||
{
|
||||
display:flex;
|
||||
align-items: center;
|
||||
padding: 6px;
|
||||
padding: 6px 2px;
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
}
|
||||
|
@ -627,28 +650,53 @@ body
|
|||
font-size: 14px;
|
||||
}
|
||||
|
||||
/*------Christmas cabin---*/
|
||||
#ChristmasArea
|
||||
/*--Staff Pick--*/
|
||||
#HotModelArea
|
||||
{
|
||||
margin-top: 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#ChristmasTitleBlock
|
||||
#HotModel_Swiper
|
||||
{
|
||||
background-color: #EEEEEE;
|
||||
padding: 20px 16px 20px 16px;
|
||||
}
|
||||
|
||||
.HotModelPiece
|
||||
{
|
||||
width: 200px!important;
|
||||
display:flex;
|
||||
align-items: center;
|
||||
padding: 6px;
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
flex-direction: column;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#CabinList
|
||||
.HotModel_PrevBlock
|
||||
{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-content: flex-start;
|
||||
overflow-y: auto;
|
||||
border:2px solid #656568;
|
||||
height: 148px;
|
||||
}
|
||||
|
||||
}
|
||||
.HotModel_PrevImg
|
||||
{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.HotModel_NameText
|
||||
{
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
padding: 0px 8px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
background-color: #cecece;
|
||||
}
|
||||
|
||||
|
||||
.swiper-scrollbar
|
||||
{
|
||||
height: 10px!important;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.5 16.646V21.2895C7.5 21.3382 7.5071 21.3866 7.52109 21.4332C7.60044 21.6977 7.87918 21.8478 8.14367 21.7684L12 20.6115L15.8563 21.7684C15.9029 21.7824 15.9513 21.7895 16 21.7895C16.2761 21.7895 16.5 21.5656 16.5 21.2895V16.6462L15.7247 16.7081C15.0954 16.7583 14.498 17.0058 14.0175 17.4152L13.379 17.9594C12.5851 18.6359 11.4175 18.6359 10.6237 17.9594L9.98515 17.4152C9.50466 17.0058 8.90724 16.7583 8.27795 16.7081L7.5 16.646Z" fill="url(#paint0_linear_10080_34787)"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.2125 2.79872C11.7202 2.44222 12.4121 2.46866 12.8925 2.87803L13.531 3.42217C14.1316 3.93401 14.8784 4.24333 15.665 4.3061L16.5013 4.37284C17.1739 4.42651 17.708 4.9606 17.7616 5.63318L17.8284 6.46944C17.8912 7.25606 18.2005 8.00284 18.7123 8.60345L19.2565 9.24197C19.6941 9.75551 19.6941 10.5108 19.2565 11.0244L18.7123 11.6629C18.2005 12.2635 17.8912 13.0103 17.8284 13.7969L17.7616 14.6331C17.708 15.3057 17.1739 15.8398 16.5013 15.8935L15.665 15.9602C14.8784 16.023 14.1316 16.3323 13.531 16.8442L12.8925 17.3883C12.379 17.8259 11.6237 17.8259 11.1101 17.3883L10.4716 16.8442C9.871 16.3323 9.12423 16.023 8.33761 15.9602L7.50135 15.8935C6.82876 15.8398 6.29468 15.3057 6.241 14.6331L6.17427 13.7969C6.1115 13.0103 5.80217 12.2635 5.29033 11.6629L4.72569 12.1441L5.29033 11.6629L4.7462 11.0244C4.30856 10.5108 4.30856 9.75551 4.7462 9.24197L5.29033 8.60345C5.80217 8.00284 6.1115 7.25606 6.17427 6.46944L6.241 5.63318C6.29468 4.9606 6.82876 4.42651 7.50135 4.37284L8.33761 4.3061C9.12423 4.24333 9.871 3.93401 10.4716 3.42217L11.1101 2.87803C11.1433 2.84977 11.1775 2.82333 11.2125 2.79872ZM15 10.133C15 11.7898 13.6569 13.133 12 13.133C10.3431 13.133 9 11.7898 9 10.133C9 8.47613 10.3431 7.13298 12 7.13298C13.6569 7.13298 15 8.47613 15 10.133Z" fill="url(#paint1_linear_10080_34787)"/>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_10080_34787" x1="12.3119" y1="13.1333" x2="12.6038" y2="22.5666" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#00AE42" stop-opacity="0.24"/>
|
||||
<stop offset="1" stop-color="#00AE42" stop-opacity="0.64"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint1_linear_10080_34787" x1="12.0013" y1="1.7998" x2="12.0013" y2="18.4665" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#00AE42"/>
|
||||
<stop offset="1" stop-color="#00AE42" stop-opacity="0.64"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 2.4 KiB |
|
@ -0,0 +1,10 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.4145 8.28147C12.4145 7.82507 12.0445 7.45508 11.5881 7.45508C11.1317 7.45508 10.7617 7.82507 10.7617 8.28147V12.3419C10.7597 12.3655 10.7587 12.3893 10.7587 12.4133C10.7587 12.8604 11.1138 13.2246 11.5573 13.2392C11.5675 13.2396 11.5778 13.2398 11.5881 13.2398L11.6017 13.2397H14.0642C14.5206 13.2397 14.8906 12.8697 14.8906 12.4133C14.8906 11.9569 14.5206 11.5869 14.0642 11.5869H12.4145V8.28147ZM19 12C19 15.866 15.866 19 12 19C8.13401 19 5 15.866 5 12C5 8.13401 8.13401 5 12 5C15.866 5 19 8.13401 19 12Z" fill="url(#paint0_linear_10269_34622)"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 19C15.866 19 19 15.866 19 12C19 8.13401 15.866 5 12 5C8.13401 5 5 8.13401 5 12C5 15.866 8.13401 19 12 19ZM12 20.5C16.6944 20.5 20.5 16.6944 20.5 12C20.5 7.30558 16.6944 3.5 12 3.5C7.30558 3.5 3.5 7.30558 3.5 12C3.5 16.6944 7.30558 20.5 12 20.5Z" fill="#00AE42" fill-opacity="0.4"/>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_10269_34622" x1="17.6667" y1="5.38889" x2="17.6667" y2="18.6111" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#00AE42"/>
|
||||
<stop offset="1" stop-color="#00AE42" stop-opacity="0.64"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 1.3 KiB |
|
@ -5,12 +5,17 @@
|
|||
<meta http-equiv="Cache-Control" content="max-age=7200" />
|
||||
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
|
||||
<title>homepage</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/home.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/dark.css" />
|
||||
<script type="text/javascript" src="js/jquery-3.6.0.min.js"></script>
|
||||
<script type="text/javascript" src="../data/text.js"></script>
|
||||
<script type="text/javascript" src="js/json2.js"></script>
|
||||
<script type="text/javascript" src="js/globalapi.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="./css/home.css" />
|
||||
<link rel="stylesheet" type="text/css" href="./css/dark.css" />
|
||||
|
||||
<script type="text/javascript" src="../include/jquery-2.1.1.min.js"></script>
|
||||
<script type="text/javascript" src="../include/json2.js"></script>
|
||||
<script type="text/javascript" src="../include/globalapi.js"></script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../include/swiper/swiper-bundle.min.css" />
|
||||
<script type="text/javascript" src="../include/swiper/swiper-bundle.min.js"></script>
|
||||
<script type="text/javascript" src="../data/text.js"></script>
|
||||
|
||||
<script type="text/javascript" src="js/home.js"></script>
|
||||
</head>
|
||||
<body class="ZScrol" onLoad="OnInit()">
|
||||
|
@ -74,9 +79,59 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div id="DebugText"></div>
|
||||
<div id="DebugText"></div>
|
||||
|
||||
<div id="HotModelArea">
|
||||
<div id="HotModelBlock">
|
||||
<img class="TitleSmallIcon" src="./img/t1.svg" />
|
||||
<div id="HotModelTitle" class="Content-Title trans TextS1" tid="t107">Staff pick</div>
|
||||
</div>
|
||||
<div id="HotModel_Swiper" class="swiper">
|
||||
<div id="HotModelList" class="swiper-wrapper">
|
||||
<!-- <div class="HotModelPiece swiper-slide">
|
||||
<div class="HotModel_PrevBlock"><img class="HotModel_PrevImg" src="img/wiki.png" /></div>
|
||||
<div class="HotModel_NameText TextS1">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>
|
||||
</div>
|
||||
<div class="HotModelPiece swiper-slide">
|
||||
<div class="HotModel_PrevBlock"><img class="HotModel_PrevImg" src="img/wiki2.png" /></div>
|
||||
<div class="HotModel_NameText TextS1">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>
|
||||
</div>
|
||||
<div class="HotModelPiece swiper-slide">
|
||||
<div class="HotModel_PrevBlock"><img class="HotModel_PrevImg" src="img/wiki3.png" /></div>
|
||||
<div class="HotModel_NameText TextS1">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>
|
||||
</div>
|
||||
<div class="HotModelPiece swiper-slide">
|
||||
<div class="HotModel_PrevBlock"><img class="HotModel_PrevImg" src="img/wiki2.png" /></div>
|
||||
<div class="HotModel_NameText TextS1">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>
|
||||
</div>
|
||||
<div class="HotModelPiece swiper-slide">
|
||||
<div class="HotModel_PrevBlock"><img class="HotModel_PrevImg" src="img/wiki.png" /></div>
|
||||
<div class="HotModel_NameText TextS1">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>
|
||||
</div>
|
||||
<div class="HotModelPiece swiper-slide">
|
||||
<div class="HotModel_PrevBlock"><img class="HotModel_PrevImg" src="img/wiki3.png" /></div>
|
||||
<div class="HotModel_NameText TextS1">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>
|
||||
</div>
|
||||
<div class="HotModelPiece swiper-slide">
|
||||
<div class="HotModel_PrevBlock"><img class="HotModel_PrevImg" src="img/wiki2.png" /></div>
|
||||
<div class="HotModel_NameText TextS1">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>
|
||||
</div>
|
||||
<div class="HotModelPiece swiper-slide">
|
||||
<div class="HotModel_PrevBlock"><img class="HotModel_PrevImg" src="img/wiki.png" /></div>
|
||||
<div class="HotModel_NameText TextS1">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="swiper-button-prev"></div>
|
||||
<div class="swiper-button-next"></div>
|
||||
<div class="swiper-scrollbar"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="RecentFileArea">
|
||||
<div id="RecentTitleBlock">
|
||||
<div id="HotModelBlock">
|
||||
<img class="TitleSmallIcon" src="./img/t2.svg" />
|
||||
<div id="RecentTitle" class="Content-Title trans TextS1" tid="t35">recent open</div>
|
||||
<div id="RecentClearAllBtn" class="trans TextS1" tid="t12" onClick="OnDeleteAllRecentFiles()">Clear all</div>
|
||||
</div>
|
||||
|
|
|
@ -1,340 +0,0 @@
|
|||
|
||||
/*------------------ Date Function ------------------------*/
|
||||
function GetFullToday( )
|
||||
{
|
||||
var d=new Date();
|
||||
|
||||
var nday=d.getDate();
|
||||
var nmonth=d.getMonth()+1;
|
||||
var nyear=d.getFullYear();
|
||||
|
||||
var strM=nmonth+'';
|
||||
if( nmonth<10 )
|
||||
strM='0'+nmonth;
|
||||
|
||||
var strD=nday+'';
|
||||
if( nday<10 )
|
||||
strD='0'+nday;
|
||||
|
||||
return nyear+'-'+strM+'-'+strD;
|
||||
}
|
||||
|
||||
function GetFullDate()
|
||||
{
|
||||
var d=new Date();
|
||||
|
||||
var tDate={};
|
||||
|
||||
tDate.nyear=d.getFullYear();
|
||||
tDate.nmonth=d.getMonth()+1;
|
||||
tDate.nday=d.getDate();
|
||||
|
||||
tDate.nhour=d.getHours();
|
||||
tDate.nminute=d.getMinutes();
|
||||
tDate.nsecond=d.getSeconds();
|
||||
|
||||
tDate.nweek=d.getDay();
|
||||
tDate.ndate=d.getDate();
|
||||
|
||||
var strM=tDate.nmonth+'';
|
||||
if( tDate.nmonth<10 )
|
||||
strM='0'+tDate.nmonth;
|
||||
|
||||
var strD=tDate.nday+'';
|
||||
if( tDate.nday<10 )
|
||||
strD='0'+tDate.nday;
|
||||
|
||||
var strH=tDate.nhour+'';
|
||||
if( tDate.nhour<10 )
|
||||
strH='0'+tDate.nhour;
|
||||
|
||||
var strMin=tDate.nminute+'';
|
||||
if( tDate.nminute<10 )
|
||||
strMin='0'+tDate.nminute;
|
||||
|
||||
var strS=tDate.nsecond+'';
|
||||
if( tDate.nsecond<10 )
|
||||
strS='0'+tDate.nsecond;
|
||||
|
||||
tDate.strdate=tDate.nyear+'-'+strM+'-'+strD;
|
||||
tDate.strFulldate=tDate.strdate+' '+strH+':'+strMin+':'+strS;
|
||||
|
||||
return tDate;
|
||||
}
|
||||
|
||||
|
||||
function Unixtimestamp2Date( nSecond )
|
||||
{
|
||||
var d=new Date(nSecond*1000);
|
||||
|
||||
var tDate={};
|
||||
|
||||
tDate.nyear=d.getFullYear();
|
||||
tDate.nmonth=d.getMonth()+1;
|
||||
tDate.nday=d.getDate();
|
||||
|
||||
tDate.nhour=d.getHours();
|
||||
tDate.nminute=d.getMinutes();
|
||||
tDate.nsecond=d.getSeconds();
|
||||
|
||||
tDate.nweek=d.getDay();
|
||||
tDate.ndate=d.getDate();
|
||||
|
||||
var strM=tDate.nmonth+'';
|
||||
if( tDate.nmonth<10 )
|
||||
strM='0'+tDate.nmonth;
|
||||
|
||||
var strD=tDate.nday+'';
|
||||
if( tDate.nday<10 )
|
||||
strD='0'+tDate.nday;
|
||||
|
||||
tDate.strdate=tDate.nyear+'-'+strM+'-'+strD;
|
||||
|
||||
return tDate.strdate;
|
||||
}
|
||||
|
||||
|
||||
//------------Array Function-------------
|
||||
Array.prototype.in_array = function (e) {
|
||||
let sArray= ',' + this.join(this.S) + ',';
|
||||
let skey=','+e+',';
|
||||
|
||||
if(sArray.indexOf(skey)>=0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//------------String Function------------------
|
||||
/**
|
||||
* Delete Left/Right Side Blank
|
||||
*/
|
||||
String.prototype.trim=function()
|
||||
{
|
||||
return this.replace(/(^\s*)|(\s*$)/g, '');
|
||||
}
|
||||
/**
|
||||
* Delete Left Side Blank
|
||||
*/
|
||||
String.prototype.ltrim=function()
|
||||
{
|
||||
return this.replace(/(^\s*)/g,'');
|
||||
}
|
||||
/**
|
||||
* Delete Right Side Blank
|
||||
*/
|
||||
String.prototype.rtrim=function()
|
||||
{
|
||||
return this.replace(/(\s*$)/g,'');
|
||||
}
|
||||
|
||||
|
||||
//----------------Get Param-------------
|
||||
function GetQueryString(name)
|
||||
{
|
||||
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
|
||||
var r = window.location.search.substr(1).match(reg);
|
||||
if (r!=null)
|
||||
{
|
||||
return unescape(r[2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function GetGetStr()
|
||||
{
|
||||
let strGet="";
|
||||
|
||||
//获取当前URL
|
||||
let url = document.location.href;
|
||||
|
||||
//获取?的位置
|
||||
let index = url.indexOf("?")
|
||||
if(index != -1) {
|
||||
//截取出?后面的字符串
|
||||
strGet = url.substr(index + 1);
|
||||
}
|
||||
|
||||
return strGet;
|
||||
}
|
||||
|
||||
|
||||
/*--------------------JSON Function------------*/
|
||||
|
||||
/*
|
||||
功能:检查一个字符串是不是标准的JSON格式
|
||||
参数: strJson 被检查的字符串
|
||||
返回值: 如果字符串是一个标准的JSON格式,则返回JSON对象
|
||||
如果字符串不是标准JSON格式,则返回null
|
||||
*/
|
||||
function IsJson( strJson )
|
||||
{
|
||||
var tJson=null;
|
||||
try
|
||||
{
|
||||
tJson=JSON.parse(strJson);
|
||||
}
|
||||
catch(exception)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return tJson;
|
||||
}
|
||||
|
||||
/*-----------------------Ajax Function--------------------*/
|
||||
/*对JQuery的Ajax函数的封装,只支持异步
|
||||
参数说明:
|
||||
url 目标地址
|
||||
action post/get
|
||||
data 字符串格式的发送内容
|
||||
asyn true---异步模式;false-----同步模式;
|
||||
*/
|
||||
function HttpReq( url,action, data,callbackfunc)
|
||||
{
|
||||
var strAction=action.toLowerCase();
|
||||
|
||||
if( strAction=="post")
|
||||
{
|
||||
$.post(url,data,callbackfunc);
|
||||
}
|
||||
else if( strAction=="get")
|
||||
{
|
||||
$.get(url,callbackfunc);
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------Cookie Function-------------------*/
|
||||
function setCookie(name, value, time='',path='') {
|
||||
if(time && path){
|
||||
var strsec = time * 1000;
|
||||
var exp = new Date();
|
||||
exp.setTime(exp.getTime() + strsec * 1);
|
||||
document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString() + ";path="+path;
|
||||
}else if(time){
|
||||
var strsec = time * 1000;
|
||||
var exp = new Date();
|
||||
exp.setTime(exp.getTime() + strsec * 1);
|
||||
document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString();
|
||||
}else if(path){
|
||||
document.cookie = name + "=" + escape(value) + ";path="+path;
|
||||
}else{
|
||||
document.cookie = name + "=" + escape(value);
|
||||
}
|
||||
}
|
||||
|
||||
function getCookie(c_name)
|
||||
{
|
||||
if(document.cookie.length > 0) {
|
||||
c_start = document.cookie.indexOf(c_name + "=");//获取字符串的起点
|
||||
if(c_start != -1) {
|
||||
c_start = c_start + c_name.length + 1;//获取值的起点
|
||||
c_end = document.cookie.indexOf(";", c_start);//获取结尾处
|
||||
if(c_end == -1) c_end = document.cookie.length;//如果是最后一个,结尾就是cookie字符串的结尾
|
||||
return decodeURI(document.cookie.substring(c_start, c_end));//截取字符串返回
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
function checkCookie(c_name) {
|
||||
username = getCookie(c_name);
|
||||
console.log(username);
|
||||
if (username != null && username != "")
|
||||
{ return true; }
|
||||
else
|
||||
{ return false; }
|
||||
}
|
||||
|
||||
function clearCookie(name) {
|
||||
setCookie(name, "", -1);
|
||||
}
|
||||
|
||||
|
||||
/*--------Studio WX Message-------*/
|
||||
function IsInSlicer()
|
||||
{
|
||||
let bMatch=navigator.userAgent.match( RegExp('BBL-Slicer','i') );
|
||||
|
||||
return bMatch;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function SendWXMessage( strMsg )
|
||||
{
|
||||
let bCheck=IsInSlicer();
|
||||
|
||||
if(bCheck!=null)
|
||||
{
|
||||
window.wx.postMessage(strMsg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*------CSS Link Control----*/
|
||||
function RemoveCssLink( LinkPath )
|
||||
{
|
||||
let pNow=$("head link[href='"+LinkPath+"']");
|
||||
|
||||
let nTotal=pNow.length;
|
||||
for( let n=0;n<nTotal;n++ )
|
||||
{
|
||||
pNow[n].remove();
|
||||
}
|
||||
}
|
||||
|
||||
function AddCssLink( LinkPath )
|
||||
{
|
||||
var head = document.getElementsByTagName('head')[0];
|
||||
var link = document.createElement('link');
|
||||
link.href = LinkPath;
|
||||
link.rel = 'stylesheet';
|
||||
link.type = 'text/css';
|
||||
head.appendChild(link);
|
||||
}
|
||||
|
||||
function CheckCssLinkExist( LinkPath )
|
||||
{
|
||||
let pNow=$("head link[href='"+LinkPath+"']");
|
||||
let nTotal=pNow.length;
|
||||
|
||||
return nTotal;
|
||||
}
|
||||
|
||||
|
||||
/*------Dark Mode------*/
|
||||
|
||||
function SwitchDarkMode( DarkCssPath )
|
||||
{
|
||||
ExecuteDarkMode( DarkCssPath );
|
||||
setInterval("ExecuteDarkMode('"+DarkCssPath+"')",1000);
|
||||
}
|
||||
|
||||
function ExecuteDarkMode( DarkCssPath )
|
||||
{
|
||||
let nMode=0;
|
||||
let bDarkMode=navigator.userAgent.match( RegExp('dark','i') );
|
||||
if( bDarkMode!=null )
|
||||
nMode=1;
|
||||
|
||||
let nNow=CheckCssLinkExist(DarkCssPath);
|
||||
if( nMode==0 )
|
||||
{
|
||||
if(nNow>0)
|
||||
RemoveCssLink(DarkCssPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(nNow==0)
|
||||
AddCssLink(DarkCssPath);
|
||||
}
|
||||
}
|
||||
|
||||
SwitchDarkMode("css/dark.css");
|
|
@ -12,6 +12,9 @@ function OnInit()
|
|||
|
||||
SendMsg_GetLoginInfo();
|
||||
SendMsg_GetRecentFile();
|
||||
SendMsg_GetStaffPick();
|
||||
|
||||
//InitStaffPick();
|
||||
}
|
||||
|
||||
//------最佳打开文件的右键菜单功能----------
|
||||
|
@ -118,6 +121,10 @@ function HandleStudio( pVal )
|
|||
$("#NoPluginTip").hide();
|
||||
}
|
||||
}
|
||||
else if( strCmd=="modelmall_model_advise_get")
|
||||
{
|
||||
ShowStaffPick( pVal['hits'] );
|
||||
}
|
||||
}
|
||||
|
||||
function GotoMenu( strMenu )
|
||||
|
@ -398,6 +405,90 @@ function OpenWikiUrl( strUrl )
|
|||
SendWXMessage( JSON.stringify(tSend) );
|
||||
}
|
||||
|
||||
//--------------Staff Pick-------
|
||||
var StaffPickSwiper=null;
|
||||
function InitStaffPick()
|
||||
{
|
||||
if( StaffPickSwiper!=null )
|
||||
{
|
||||
StaffPickSwiper.destroy(true,true);
|
||||
StaffPickSwiper=null;
|
||||
}
|
||||
|
||||
StaffPickSwiper = new Swiper('#HotModel_Swiper.swiper', {
|
||||
slidesPerView : 'auto',
|
||||
spaceBetween: 16,
|
||||
navigation: {
|
||||
nextEl: '.swiper-button-next',
|
||||
prevEl: '.swiper-button-prev',
|
||||
},
|
||||
// autoplay: {
|
||||
// delay: 3000,
|
||||
// stopOnLastSlide: false,
|
||||
// disableOnInteraction: true,
|
||||
// disableOnInteraction: false
|
||||
// },
|
||||
// pagination: {
|
||||
// el: '.swiper-pagination',
|
||||
// },
|
||||
scrollbar: {
|
||||
el: '.swiper-scrollbar',
|
||||
draggable: true
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function SendMsg_GetStaffPick()
|
||||
{
|
||||
var tSend={};
|
||||
tSend['sequence_id']=Math.round(new Date() / 1000);
|
||||
tSend['command']="modelmall_model_advise_get";
|
||||
|
||||
SendWXMessage( JSON.stringify(tSend) );
|
||||
}
|
||||
|
||||
function ShowStaffPick( ModelList )
|
||||
{
|
||||
let PickTotal=ModelList.length;
|
||||
if(PickTotal==0)
|
||||
{
|
||||
$('#HotModelList').html('');
|
||||
$('#HotModelArea').hide();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
let strPickHtml='';
|
||||
for(let a=0;a<PickTotal;a++)
|
||||
{
|
||||
let OnePickModel=ModelList[a];
|
||||
|
||||
let ModelID=OnePickModel['design']['id'];
|
||||
let ModelName=OnePickModel['design']['title'];
|
||||
let ModelCover=OnePickModel['design']['cover'];
|
||||
|
||||
strPickHtml+='<div class="HotModelPiece swiper-slide" onClick="OpenOneStaffPickModel('+ModelID+')" >'+
|
||||
' <div class="HotModel_PrevBlock"><img class="HotModel_PrevImg" src="'+ModelCover+'" /></div>'+
|
||||
' <div class="HotModel_NameText">'+ModelName+'</div>'+
|
||||
'</div>';
|
||||
}
|
||||
|
||||
$('#HotModelList').html(strPickHtml);
|
||||
InitStaffPick();
|
||||
$('#HotModelArea').show();
|
||||
}
|
||||
|
||||
function OpenOneStaffPickModel( ModelID )
|
||||
{
|
||||
var tSend={};
|
||||
tSend['sequence_id']=Math.round(new Date() / 1000);
|
||||
tSend['command']="modelmall_model_open";
|
||||
tSend['data']={};
|
||||
tSend['data']['id']=ModelID;
|
||||
|
||||
SendWXMessage( JSON.stringify(tSend) );
|
||||
}
|
||||
|
||||
|
||||
//---------------Global-----------------
|
||||
window.postMessage = HandleStudio;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,185 +0,0 @@
|
|||
var JSON;
|
||||
if (!JSON) {
|
||||
JSON = {};
|
||||
}
|
||||
(function () {
|
||||
'use strict';
|
||||
function f(n) {
|
||||
// Format integers to have at least two digits.
|
||||
return n < 10 ? '0' + n : n;
|
||||
}
|
||||
if (typeof Date.prototype.toJSON !== 'function') {
|
||||
Date.prototype.toJSON = function (key) {
|
||||
|
||||
return isFinite(this.valueOf())
|
||||
? this.getUTCFullYear() + '-' +
|
||||
f(this.getUTCMonth() + 1) + '-' +
|
||||
f(this.getUTCDate()) + 'T' +
|
||||
f(this.getUTCHours()) + ':' +
|
||||
f(this.getUTCMinutes()) + ':' +
|
||||
f(this.getUTCSeconds()) + 'Z'
|
||||
: null;
|
||||
};
|
||||
|
||||
String.prototype.toJSON =
|
||||
Number.prototype.toJSON =
|
||||
Boolean.prototype.toJSON = function (key) {
|
||||
return this.valueOf();
|
||||
};
|
||||
}
|
||||
var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
|
||||
escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
|
||||
gap,
|
||||
indent,
|
||||
meta = { // table of character substitutions
|
||||
'\b': '\\b',
|
||||
'\t': '\\t',
|
||||
'\n': '\\n',
|
||||
'\f': '\\f',
|
||||
'\r': '\\r',
|
||||
'"' : '\\"',
|
||||
'\\': '\\\\'
|
||||
},
|
||||
rep;
|
||||
function quote(string) {
|
||||
escapable.lastIndex = 0;
|
||||
return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
|
||||
var c = meta[a];
|
||||
return typeof c === 'string'
|
||||
? c
|
||||
: '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
|
||||
}) + '"' : '"' + string + '"';
|
||||
}
|
||||
function str(key, holder) {
|
||||
var i, // The loop counter.
|
||||
k, // The member key.
|
||||
v, // The member value.
|
||||
length,
|
||||
mind = gap,
|
||||
partial,
|
||||
value = holder[key];
|
||||
if (value && typeof value === 'object' &&
|
||||
typeof value.toJSON === 'function') {
|
||||
value = value.toJSON(key);
|
||||
}
|
||||
if (typeof rep === 'function') {
|
||||
value = rep.call(holder, key, value);
|
||||
}
|
||||
switch (typeof value) {
|
||||
case 'string':
|
||||
return quote(value);
|
||||
case 'number':
|
||||
return isFinite(value) ? String(value) : 'null';
|
||||
case 'boolean':
|
||||
case 'null':
|
||||
return String(value);
|
||||
case 'object':
|
||||
if (!value) {
|
||||
return 'null';
|
||||
}
|
||||
gap += indent;
|
||||
partial = [];
|
||||
if (Object.prototype.toString.apply(value) === '[object Array]') {
|
||||
length = value.length;
|
||||
for (i = 0; i < length; i += 1) {
|
||||
partial[i] = str(i, value) || 'null';
|
||||
}
|
||||
v = partial.length === 0
|
||||
? '[]'
|
||||
: gap
|
||||
? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']'
|
||||
: '[' + partial.join(',') + ']';
|
||||
gap = mind;
|
||||
return v;
|
||||
}
|
||||
if (rep && typeof rep === 'object') {
|
||||
length = rep.length;
|
||||
for (i = 0; i < length; i += 1) {
|
||||
if (typeof rep[i] === 'string') {
|
||||
k = rep[i];
|
||||
v = str(k, value);
|
||||
if (v) {
|
||||
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (k in value) {
|
||||
if (Object.prototype.hasOwnProperty.call(value, k)) {
|
||||
v = str(k, value);
|
||||
if (v) {
|
||||
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
v = partial.length === 0
|
||||
? '{}'
|
||||
: gap
|
||||
? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}'
|
||||
: '{' + partial.join(',') + '}';
|
||||
gap = mind;
|
||||
return v;
|
||||
}
|
||||
}
|
||||
if (typeof JSON.stringify !== 'function') {
|
||||
JSON.stringify = function (value, replacer, space) {
|
||||
var i;
|
||||
gap = '';
|
||||
indent = '';
|
||||
if (typeof space === 'number') {
|
||||
for (i = 0; i < space; i += 1) {
|
||||
indent += ' ';
|
||||
}
|
||||
} else if (typeof space === 'string') {
|
||||
indent = space;
|
||||
}
|
||||
rep = replacer;
|
||||
if (replacer && typeof replacer !== 'function' &&
|
||||
(typeof replacer !== 'object' ||
|
||||
typeof replacer.length !== 'number')) {
|
||||
throw new Error('JSON.stringify');
|
||||
}
|
||||
return str('', {'': value});
|
||||
};
|
||||
}
|
||||
if (typeof JSON.parse !== 'function') {
|
||||
JSON.parse = function (text, reviver) {
|
||||
var j;
|
||||
function walk(holder, key) {
|
||||
var k, v, value = holder[key];
|
||||
if (value && typeof value === 'object') {
|
||||
for (k in value) {
|
||||
if (Object.prototype.hasOwnProperty.call(value, k)) {
|
||||
v = walk(value, k);
|
||||
if (v !== undefined) {
|
||||
value[k] = v;
|
||||
} else {
|
||||
delete value[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return reviver.call(holder, key, value);
|
||||
}
|
||||
text = String(text);
|
||||
cx.lastIndex = 0;
|
||||
if (cx.test(text)) {
|
||||
text = text.replace(cx, function (a) {
|
||||
return '\\u' +
|
||||
('0000' + a.charCodeAt(0).toString(16)).slice(-4);
|
||||
});
|
||||
}
|
||||
if (/^[\],:{}\s]*$/
|
||||
.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
|
||||
.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
|
||||
.replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
|
||||
j = eval('(' + text + ')');
|
||||
return typeof reviver === 'function'
|
||||
? walk({'': j}, '')
|
||||
: j;
|
||||
}
|
||||
throw new SyntaxError('JSON.parse');
|
||||
};
|
||||
}
|
||||
}());
|
Loading…
Reference in New Issue