ENH: all fix about OnlineModels

Change-Id: I9ae1a9fdb364c28f3c9de2827ca1bbb9a2f750fa
This commit is contained in:
zorro.zhang 2023-04-19 10:42:28 +08:00 committed by Lane.Wei
parent 7cc59dab27
commit 28750e10ac
7 changed files with 186 additions and 44 deletions

View File

@ -98,7 +98,7 @@ var LangText={
"t104":"Profile name", "t104":"Profile name",
"t105":"Profile Author", "t105":"Profile Author",
"t106":"Profile description", "t106":"Profile description",
"t107":"Staff Pick" "t107":"Online Models"
}, },
"zh_CN": { "zh_CN": {
"t1": "欢迎使用Bambu Studio", "t1": "欢迎使用Bambu Studio",
@ -199,7 +199,7 @@ var LangText={
"t104":"配置名称", "t104":"配置名称",
"t105":"配置作者", "t105":"配置作者",
"t106":"配置介绍", "t106":"配置介绍",
"t107":"人工精选", "t107":"在线模型",
"wk1": "快速入门指南", "wk1": "快速入门指南",
"wk2": "本文介绍了Bambu Studio的最基本用法。它指导用户配置软件创建项目并逐步完成第一个打印任务。", "wk2": "本文介绍了Bambu Studio的最基本用法。它指导用户配置软件创建项目并逐步完成第一个打印任务。",
"wk3": "基于项目的工作流", "wk3": "基于项目的工作流",

View File

@ -14,6 +14,11 @@ body
color:#efeff0; color:#efeff0;
} }
.TextS2
{
color:#B3B3B5;
}
.ZScrol::-webkit-scrollbar-thumb {/*滚动条里面小方块*/ .ZScrol::-webkit-scrollbar-thumb {/*滚动条里面小方块*/
background-color: #939594; background-color: #939594;
} }
@ -88,10 +93,39 @@ body
/*---Staff PIck----*/ /*---Staff PIck----*/
#HotModel_Swiper #HotModel_Swiper
{ {
background-color: #323238;
} }
.HotModel_NameText .HotModel_NameText
{ {
background-color: #636368; height: 32px;
}
.HotModelPiece
{
border: 1px solid #4C4C55;
box-shadow: 0px 2px 12px rgba(0, 0, 0, 0.04);
background-color: #4C4C55;
}
#HotModel_RIGHT_Title
{
color: #818183;
}
.swiper
{
--swiper-navigation-color: #EFEFF0;/* 单独设置按钮颜色 */
}
.swiper-button-prev
{
background: rgba(54, 54, 60, 0.88);
border: 1px solid rgba(129, 129, 131, 0.64);
}
.swiper-button-next
{
background: rgba(54, 54, 60, 0.88);
border: 1px solid rgba(129, 129, 131, 0.64);
} }

View File

@ -313,15 +313,28 @@ body
{ {
display:flex; display:flex;
align-items: center; align-items: center;
padding: 6px 2px; justify-content: space-between;
border-bottom-width: 0px; padding: 0px;
border-bottom-style: solid;
} }
#HotModel_LEFT_Title
{
display:flex;
align-items: center;
padding: 6px 0px;
}
#HotModel_RIGHT_Title
{
font-size:16px;
}
.HotModel_PrevImg .HotModel_PrevImg
{ {
width: 200px; width: 200px;
height: 148px; height: 148px;
object-fit: cover;
} }
@ -337,9 +350,7 @@ body
{ {
display:flex; display:flex;
align-items: center; align-items: center;
padding: 6px 2px; padding: 6px 0px;
border-bottom-width: 1px;
border-bottom-style: solid;
} }
#RecentClearAllBtn #RecentClearAllBtn
@ -658,8 +669,37 @@ body
#HotModel_Swiper #HotModel_Swiper
{ {
background-color: #EEEEEE; padding: 0px;
padding: 20px 16px 20px 16px; }
.HotModel_Designer_Info
{
display:flex;
align-items: center;
height: 28px;
padding: 0px 8px;
}
.HotModel_Designer_Info img
{
width: 16px;
height: 16px;
border-radius: 8px;
}
.HotModel_Designer_Info span
{
margin-left: 6px;
font-size: 12px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
#HotModel_RIGHT_Title:hover
{
cursor: pointer;
color:#00AE42;
} }
.HotModelPiece .HotModelPiece
@ -668,28 +708,31 @@ body
display:flex; display:flex;
flex-direction: column; flex-direction: column;
cursor: pointer; cursor: pointer;
border: 1px solid #EEEEEE;
box-shadow: 0px 2px 12px rgba(0, 0, 0, 0.04);
border-radius: 8px;
} }
.HotModel_PrevBlock .HotModel_PrevBlock
{ {
border:2px solid #656568; height: 150px;
height: 148px;
} }
.HotModel_PrevImg .HotModel_PrevImg
{ {
width: 100%; width: 200px;
height: 150px;
} }
.HotModel_NameText .HotModel_NameText
{ {
height: 28px; height: 32px;
line-height: 28px; line-height: 32px;
padding: 0px 8px; padding: 0px 8px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
background-color: #cecece; font-size: 14px;
} }
@ -698,5 +741,32 @@ body
height: 10px!important; height: 10px!important;
} }
.swiper-button-prev
{
width: 40px!important;
height: 40px!important;
border-radius: 20px!important;
background: rgba(244, 244, 244, 0.88);
} }
.swiper-button-next
{
width: 40px!important;
height: 40px!important;
border-radius: 20px!important;
background: rgba(244, 244, 244, 0.88);
}
.swiper
{
--swiper-theme-color: #ff6600;/* 设置Swiper风格 */
--swiper-navigation-color: #676767;/* 单独设置按钮颜色 */
--swiper-navigation-size: 12px;/* 设置按钮大小 */
}
.swiper-button-disabled
{
opacity: 1!important;
cursor: pointer!important;
pointer-events: auto!important;
}

View File

@ -83,56 +83,67 @@
<div id="HotModelArea"> <div id="HotModelArea">
<div id="HotModelBlock"> <div id="HotModelBlock">
<div id="HotModel_LEFT_Title">
<img class="TitleSmallIcon" src="./img/t1.svg" /> <img class="TitleSmallIcon" src="./img/t1.svg" />
<div id="HotModelTitle" class="Content-Title trans TextS1" tid="t107">Staff pick</div> <div id="HotModelTitle" class="Content-Title trans TextS1" tid="t107">Online Models</div>
</div>
<div id="HotModel_RIGHT_Title" onClick="OpenUrlInLocalBrowser('https://makerworld.com')">MORE ></div>
</div> </div>
<div id="HotModel_Swiper" class="swiper"> <div id="HotModel_Swiper" class="swiper">
<div id="HotModelList" class="swiper-wrapper"> <div id="HotModelList" class="swiper-wrapper">
<!-- <div class="HotModelPiece swiper-slide"> <div class="HotModelPiece swiper-slide" onClick="OpenOneStaffPickModel(1)">
<div class="HotModel_Designer_Info"><img src="https://public-dev-cdn.bambu-lab.com/portal/u/userinfo-415112594-avatar-f89b3a6b03673" /><span class="TextS2">WuYiFan</span></div>
<div class="HotModel_PrevBlock"><img class="HotModel_PrevImg" src="img/wiki.png" /></div> <div class="HotModel_PrevBlock"><img class="HotModel_PrevImg" src="img/wiki.png" /></div>
<div class="HotModel_NameText TextS1">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div> <div class="HotModel_NameText TextS1">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>
</div> </div>
<div class="HotModelPiece swiper-slide"> <div class="HotModelPiece swiper-slide" onClick="OpenOneStaffPickModel(1)">
<div class="HotModel_PrevBlock"><img class="HotModel_PrevImg" src="img/wiki2.png" /></div> <div class="HotModel_Designer_Info"><img src="https://public-dev-cdn.bambu-lab.com/portal/u/userinfo-415112594-avatar-f89b3a6b03673" /><span class="TextS2">WuYiFan</span></div>
<div class="HotModel_PrevBlock"><img class="HotModel_PrevImg" src="img/a.jpg" /></div>
<div class="HotModel_NameText TextS1">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div> <div class="HotModel_NameText TextS1">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>
</div> </div>
<div class="HotModelPiece swiper-slide"> <div class="HotModelPiece swiper-slide" onClick="OpenOneStaffPickModel(1)">
<div class="HotModel_Designer_Info"><img src="https://public-dev-cdn.bambu-lab.com/portal/u/userinfo-415112594-avatar-f89b3a6b03673" /><span class="TextS2">WuYiFan</span></div>
<div class="HotModel_PrevBlock"><img class="HotModel_PrevImg" src="img/wiki3.png" /></div> <div class="HotModel_PrevBlock"><img class="HotModel_PrevImg" src="img/wiki3.png" /></div>
<div class="HotModel_NameText TextS1">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div> <div class="HotModel_NameText TextS1">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>
</div> </div>
<div class="HotModelPiece swiper-slide"> <div class="HotModelPiece swiper-slide" onClick="OpenOneStaffPickModel(1)">
<div class="HotModel_Designer_Info"><img src="https://public-dev-cdn.bambu-lab.com/portal/u/userinfo-415112594-avatar-f89b3a6b03673" /><span class="TextS2">WuYiFan</span></div>
<div class="HotModel_PrevBlock"><img class="HotModel_PrevImg" src="img/wiki2.png" /></div> <div class="HotModel_PrevBlock"><img class="HotModel_PrevImg" src="img/wiki2.png" /></div>
<div class="HotModel_NameText TextS1">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div> <div class="HotModel_NameText TextS1">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>
</div> </div>
<div class="HotModelPiece swiper-slide"> <div class="HotModelPiece swiper-slide" onClick="OpenOneStaffPickModel(1)">
<div class="HotModel_Designer_Info"><img src="https://public-dev-cdn.bambu-lab.com/portal/u/userinfo-415112594-avatar-f89b3a6b03673" /><span class="TextS2">WuYiFan</span></div>
<div class="HotModel_PrevBlock"><img class="HotModel_PrevImg" src="img/wiki.png" /></div> <div class="HotModel_PrevBlock"><img class="HotModel_PrevImg" src="img/wiki.png" /></div>
<div class="HotModel_NameText TextS1">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div> <div class="HotModel_NameText TextS1">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>
</div> </div>
<div class="HotModelPiece swiper-slide"> <div class="HotModelPiece swiper-slide" onClick="OpenOneStaffPickModel(1)">
<div class="HotModel_Designer_Info"><img src="https://public-dev-cdn.bambu-lab.com/portal/u/userinfo-415112594-avatar-f89b3a6b03673" /><span class="TextS2">WuYiFan</span></div>
<div class="HotModel_PrevBlock"><img class="HotModel_PrevImg" src="img/wiki3.png" /></div> <div class="HotModel_PrevBlock"><img class="HotModel_PrevImg" src="img/wiki3.png" /></div>
<div class="HotModel_NameText TextS1">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div> <div class="HotModel_NameText TextS1">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>
</div> </div>
<div class="HotModelPiece swiper-slide"> <div class="HotModelPiece swiper-slide" onClick="OpenOneStaffPickModel(1)">
<div class="HotModel_Designer_Info"><img src="https://public-dev-cdn.bambu-lab.com/portal/u/userinfo-415112594-avatar-f89b3a6b03673" /><span class="TextS2">WuYiFan</span></div>
<div class="HotModel_PrevBlock"><img class="HotModel_PrevImg" src="img/wiki2.png" /></div> <div class="HotModel_PrevBlock"><img class="HotModel_PrevImg" src="img/wiki2.png" /></div>
<div class="HotModel_NameText TextS1">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div> <div class="HotModel_NameText TextS1">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>
</div> </div>
<div class="HotModelPiece swiper-slide"> <div class="HotModelPiece swiper-slide" onClick="OpenOneStaffPickModel(1)">
<div class="HotModel_Designer_Info"><img src="https://public-dev-cdn.bambu-lab.com/portal/u/userinfo-415112594-avatar-f89b3a6b03673" /><span class="TextS2">WuYiFan</span></div>
<div class="HotModel_PrevBlock"><img class="HotModel_PrevImg" src="img/wiki.png" /></div> <div class="HotModel_PrevBlock"><img class="HotModel_PrevImg" src="img/wiki.png" /></div>
<div class="HotModel_NameText TextS1">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div> <div class="HotModel_NameText TextS1">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>
</div> --> </div>
</div> </div>
<div class="swiper-button-prev"></div> <div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div> <div class="swiper-button-next"></div>
<div class="swiper-scrollbar"></div> <!-- <div class="swiper-scrollbar"></div>-->
</div> </div>
</div> </div>
<div id="RecentFileArea"> <div id="RecentFileArea">
<div id="HotModelBlock"> <div id="RecentTitleBlock">
<img class="TitleSmallIcon" src="./img/t2.svg" /> <img class="TitleSmallIcon" src="./img/t2.svg" />
<div id="RecentTitle" class="Content-Title trans TextS1" tid="t35">recent open</div> <div id="RecentTitle" class="Content-Title trans TextS1" tid="t35">Recently opened</div>
<div id="RecentClearAllBtn" class="trans TextS1" tid="t12" onClick="OnDeleteAllRecentFiles()">Clear all</div> <div id="RecentClearAllBtn" class="trans TextS1" tid="t12" onClick="OnDeleteAllRecentFiles()">Clear all</div>
</div> </div>
<div id="FileList"> <div id="FileList">

View File

@ -6,7 +6,6 @@ function OnInit()
//-----Test----- //-----Test-----
//Set_RecentFile_MouseRightBtn_Event(); //Set_RecentFile_MouseRightBtn_Event();
//-----Official----- //-----Official-----
TranslatePage(); TranslatePage();
@ -25,7 +24,7 @@ var MousePosY=0;
function Set_RecentFile_MouseRightBtn_Event() function Set_RecentFile_MouseRightBtn_Event()
{ {
$("#FileList .FileItem").mousedown( $(".FileItem").mousedown(
function(e) function(e)
{ {
//FilePath //FilePath
@ -83,7 +82,6 @@ function Set_RecentFile_MouseRightBtn_Event()
function HandleStudio( pVal ) function HandleStudio( pVal )
{ {
let strCmd = pVal['command']; let strCmd = pVal['command'];
//alert(strCmd);
if(strCmd=='get_recent_projects') if(strCmd=='get_recent_projects')
{ {
@ -123,6 +121,7 @@ function HandleStudio( pVal )
} }
else if( strCmd=="modelmall_model_advise_get") else if( strCmd=="modelmall_model_advise_get")
{ {
//alert('hot');
ShowStaffPick( pVal['hits'] ); ShowStaffPick( pVal['hits'] );
} }
} }
@ -422,6 +421,8 @@ function InitStaffPick()
nextEl: '.swiper-button-next', nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev', prevEl: '.swiper-button-prev',
}, },
slidesPerView : 'auto',
slidesPerGroup : 3
// autoplay: { // autoplay: {
// delay: 3000, // delay: 3000,
// stopOnLastSlide: false, // stopOnLastSlide: false,
@ -431,10 +432,10 @@ function InitStaffPick()
// pagination: { // pagination: {
// el: '.swiper-pagination', // el: '.swiper-pagination',
// }, // },
scrollbar: { // scrollbar: {
el: '.swiper-scrollbar', // el: '.swiper-scrollbar',
draggable: true // draggable: true
} // }
}); });
} }
@ -444,7 +445,9 @@ function SendMsg_GetStaffPick()
tSend['sequence_id']=Math.round(new Date() / 1000); tSend['sequence_id']=Math.round(new Date() / 1000);
tSend['command']="modelmall_model_advise_get"; tSend['command']="modelmall_model_advise_get";
SendWXMessage( JSON.stringify(tSend) ); SendWXMessage( JSON.stringify(tSend) );
setTimeout("SendMsg_GetStaffPick()",3600*1000*1);
} }
function ShowStaffPick( ModelList ) function ShowStaffPick( ModelList )
@ -467,9 +470,13 @@ function ShowStaffPick( ModelList )
let ModelName=OnePickModel['design']['title']; let ModelName=OnePickModel['design']['title'];
let ModelCover=OnePickModel['design']['cover']; let ModelCover=OnePickModel['design']['cover'];
let DesignerName=OnePickModel['design']['designCreator']['name'];
let DesignerAvatar=OnePickModel['design']['designCreator']['avatar'];
strPickHtml+='<div class="HotModelPiece swiper-slide" onClick="OpenOneStaffPickModel('+ModelID+')" >'+ strPickHtml+='<div class="HotModelPiece swiper-slide" onClick="OpenOneStaffPickModel('+ModelID+')" >'+
'<div class="HotModel_Designer_Info"><img src="'+DesignerAvatar+'" /><span class="TextS2">'+DesignerName+'</span></div>'+
' <div class="HotModel_PrevBlock"><img class="HotModel_PrevImg" src="'+ModelCover+'" /></div>'+ ' <div class="HotModel_PrevBlock"><img class="HotModel_PrevImg" src="'+ModelCover+'" /></div>'+
' <div class="HotModel_NameText">'+ModelName+'</div>'+ ' <div class="HotModel_NameText TextS1">'+ModelName+'</div>'+
'</div>'; '</div>';
} }
@ -480,6 +487,7 @@ function ShowStaffPick( ModelList )
function OpenOneStaffPickModel( ModelID ) function OpenOneStaffPickModel( ModelID )
{ {
//alert(ModelID);
var tSend={}; var tSend={};
tSend['sequence_id']=Math.round(new Date() / 1000); tSend['sequence_id']=Math.round(new Date() / 1000);
tSend['command']="modelmall_model_open"; tSend['command']="modelmall_model_open";
@ -492,4 +500,3 @@ function OpenOneStaffPickModel( ModelID )
//---------------Global----------------- //---------------Global-----------------
window.postMessage = HandleStudio; window.postMessage = HandleStudio;

View File

@ -244,6 +244,16 @@ function IsJson( strJson )
return tJson; return tJson;
} }
function DecodeJsonObject( pJson )
{
let tmpJson=JSON.stringify(pJson);
tmpJson=decodeURIComponent(tmpJson);
pJson=JSON.parse(tmpJson);
return pJson;
}
/*-----------------------Ajax Function--------------------*/ /*-----------------------Ajax Function--------------------*/
/*JQueryAjax /*JQueryAjax
参数说明 参数说明
@ -344,6 +354,16 @@ function SendWXDebugInfo( strMsg )
SendWXMessage( JSON.stringify(tSend) ); SendWXMessage( JSON.stringify(tSend) );
} }
function OpenUrlInLocalBrowser( strUrl )
{
var tSend={};
tSend['sequence_id']=Math.round(new Date() / 1000);
tSend['command']="common_openurl";
tSend['url']=strUrl;
SendWXMessage( JSON.stringify(tSend) );
}
/*------CSS Link Control----*/ /*------CSS Link Control----*/
function RemoveCssLink( LinkPath ) function RemoveCssLink( LinkPath )

View File

@ -436,7 +436,7 @@ void WebViewPanel::SendDesignStaffpick(NetworkAgent *agent)
return; return;
} }
CallAfter([this, body] { CallAfter([this, body] {
auto body2 = body; auto body2 = from_u8(body);
body2.insert(1, "\"command\": \"modelmall_model_advise_get\", "); body2.insert(1, "\"command\": \"modelmall_model_advise_get\", ");
RunScript(wxString::Format("window.postMessage(%s)", body2)); RunScript(wxString::Format("window.postMessage(%s)", body2));
}); });