mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-07-15 10:02:21 +08:00
commit
58b31f182a
@ -751,38 +751,49 @@ void Widget::searchApp(QString text)
|
||||
}
|
||||
|
||||
//加载动画
|
||||
spinner->show();
|
||||
spinner->start();
|
||||
// spinner->show();
|
||||
// spinner->start();
|
||||
|
||||
// // 关键字搜索处理
|
||||
// httpClient->get("https://search.deepinos.org.cn/appinfo/search")
|
||||
// .header("content-type", "application/json")
|
||||
// .queryParam("keyword", text)
|
||||
// .onResponse([this](QByteArray result)
|
||||
// {
|
||||
// auto json = QJsonDocument::fromJson(result).array();
|
||||
// if (json.empty())
|
||||
// {
|
||||
// qDebug() << "相关应用未找到!";
|
||||
// sendNotification(tr("Relative apps Not Found!"));
|
||||
// mutex.unlock();
|
||||
// clearSearchApp();
|
||||
// spinner->stop();
|
||||
// spinner->hide();
|
||||
// ui->stackedWidget->setCurrentIndex(0);
|
||||
// ui->webEngineView->setUrl(QUrl("https://wayou.github.io/t-rex-runner"));
|
||||
// return;
|
||||
// }
|
||||
// clearSearchApp();
|
||||
// displaySearchApp(json); })
|
||||
// .onError([this](QString errorStr)
|
||||
// {
|
||||
// qDebug() << "请求出错:" << errorStr;
|
||||
// sendNotification(QString(tr("Request Error: %1")).arg(errorStr));
|
||||
// mutex.unlock();
|
||||
// return; })
|
||||
// .timeout(10 * 1000)
|
||||
// .exec();
|
||||
|
||||
if (!themeIsDark){
|
||||
ui->webEngineView->setUrl(serverUrl + "store/#/search?keywords=" + text);
|
||||
}else{
|
||||
ui->webEngineView->setUrl(serverUrl + "store/#/darksearch?keywords=" + text);
|
||||
}
|
||||
// spinner->stop();
|
||||
// spinner->hide();
|
||||
mutex.unlock();
|
||||
|
||||
|
||||
// 关键字搜索处理
|
||||
httpClient->get("https://search.deepinos.org.cn/appinfo/search")
|
||||
.header("content-type", "application/json")
|
||||
.queryParam("keyword", text)
|
||||
.onResponse([this](QByteArray result)
|
||||
{
|
||||
auto json = QJsonDocument::fromJson(result).array();
|
||||
if (json.empty())
|
||||
{
|
||||
qDebug() << "相关应用未找到!";
|
||||
sendNotification(tr("Relative apps Not Found!"));
|
||||
mutex.unlock();
|
||||
clearSearchApp();
|
||||
spinner->stop();
|
||||
spinner->hide();
|
||||
ui->stackedWidget->setCurrentIndex(0);
|
||||
ui->webEngineView->setUrl(QUrl("https://wayou.github.io/t-rex-runner"));
|
||||
return;
|
||||
}
|
||||
clearSearchApp();
|
||||
displaySearchApp(json); })
|
||||
.onError([this](QString errorStr)
|
||||
{
|
||||
qDebug() << "请求出错:" << errorStr;
|
||||
sendNotification(QString(tr("Request Error: %1")).arg(errorStr));
|
||||
mutex.unlock();
|
||||
return; })
|
||||
.timeout(10 * 1000)
|
||||
.exec();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user