改为使用全新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

View File

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

View File

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