改为使用全新Web接口

This commit is contained in:
柚子 2022-12-16 14:01:12 +08:00
parent 48fd79e9be
commit e2f6d97f94
2 changed files with 19 additions and 9 deletions

@ -271,14 +271,14 @@ void MainWindow::updateUi(int now)
QStringList itemlist;
itemlist << ""
<< "network"
<< "relations"
<< "musicandsound"
<< "videos"
<< "photos"
<< "chat"
<< "music"
<< "video"
<< "image_graphics"
<< "games"
<< "office"
<< "reading"
<< "programming"
<< "development"
<< "tools"
<< "themes"
<< "others";

@ -31,12 +31,20 @@ void AppListPage::getAppList(QString type)
nowType=type;
SparkAPI *api=new SparkAPI(this);
QString url;
QString theme;
if(isDark)
{
url=api->getServerUrl()+"store/#/dark"+type;
theme="theme=dark";
}else{
url=api->getServerUrl()+"store/#/"+type;
theme="theme=light";
}
if(type=="")
{
url=api->getServerUrl()+"store/#/new/?"+theme;
}else{
url=api->getServerUrl()+"store/#/new/applist?type="+type+"&"+theme;
}
ui->webEngineView->setUrl(url);
}
@ -46,12 +54,14 @@ void AppListPage::getSearchList(QString keyword)
nowType=keyword;
SparkAPI *api=new SparkAPI(this);
QString url;
QString theme;
if(isDark)
{
url=api->getServerUrl()+"store/#/darksearch?keywords="+keyword;
theme="theme=dark";
}else{
url=api->getServerUrl()+"store/#/search?keywords="+keyword;
theme="theme=light";
}
url=api->getServerUrl()+"store/#/new/search?keywords="+keyword+"&"+theme;
ui->webEngineView->setUrl(url);
}