fix: 天气平板代码合入

This commit is contained in:
zhangxinxin 2023-03-13 13:42:58 +08:00
parent 226fba23a5
commit e4a5b9794a
208 changed files with 3412 additions and 1117 deletions

View File

@ -154,6 +154,42 @@ signals:
*/
void sigShowBottomList(int itemSize);
/*
* UI改变
*
*
*
*
*/
void sigDeleCollectCity();
/*
* UI改变
*
*
*
*
*/
void sigAddCollectCity();
/*
* modelUI改变
*
*
*
*
*/
void sigBottomModeGet();
/*
*
*
*
*
*
*/
void sigShowLAndRCityInfo(QList<CurrentWeather> cityList);
public:
/*
* UI层实例化接口对象
@ -257,6 +293,16 @@ public:
*
*/
virtual void loadCollectCity() = 0;
/*
*
*
*
*
*
*/
virtual void loadBottomCity() = 0;
/*
*
* show收藏城市列表时
@ -323,7 +369,14 @@ public:
* QListView
*/
virtual void changeCityFromTitleSearch(QString cityId) = 0; //获取搜索model指针
/*
*
*
*
* QListView
*/
virtual void getLAndRCityInfo(QString cityId) = 0;
private:
static Interaction *m_interaction; //单例指针
};

View File

@ -1,4 +1,5 @@
#include "core.h"
#include "global/viewvar.h"
#include "global/corevar.h"
Core::Core() {}
@ -38,6 +39,7 @@ void Core::initCore()
qRegisterMetaType<ItemData>("ItemData");
qRegisterMetaType<QList<QPersistentModelIndex>>("QList<QPersistentModelIndex>");
qRegisterMetaType<QAbstractItemModel::LayoutChangeHint>("QAbstractItemModel::LayoutChangeHint");
qRegisterMetaType<QList<CurrentWeather>>("QList<CurrentWeather>");
//初始化信号槽
initConnect();
@ -52,7 +54,13 @@ void Core::initConnect()
connect(m_network, &Network::effectiveNetwork, this, &Core::networkState); //检查网络状态
connect(m_network, &Network::haveNet, this, &Core::refreshCity); //网络从无到有,开始重新请求
connect(m_dataRequest, &DataRequest::sendData, m_dataParser, &DataParser::dataReply); //数据reply
// connect(m_dataRequest, &DataRequest::sigSendLeftData, m_dataParser, &DataParser::dataReplyL); //数据reply
// connect(m_dataRequest, &DataRequest::sigSendRightData, m_dataParser, &DataParser::dataReplyR);//数据reply
connect(m_dataRequest, &DataRequest::sigSendLAndRData, m_dataParser, &DataParser::dataReplyLAndR); //收藏城市数据reply
connect(m_dataRequest, &DataRequest::sendCollData, m_dataParser, &DataParser::dataReplyColl); //收藏城市数据reply
connect(m_dataParser, &DataParser::showLAndRCode, this, &Core::sigShowLAndRCityInfo); //发送信号,显示左右侧城市信息
// connect(m_dataParser, &DataParser::showLeftCity, this, &Core::sigShowLeftCityInfo); //发送信号,显示左侧城市信息
// connect(m_dataParser, &DataParser::showRightCity, this, &Core::sigShowRightCityInfo); //发送信号,显示右侧城市信息
connect(m_dataParser, &DataParser::showCurrent, this, &Core::showCurrent); //发送信号,显示生活指数信息
connect(m_dataParser, &DataParser::showForcast, this, &Core::showForcast); //发送信号,显示当前城市信息
connect(m_dataParser, &DataParser::showLifeStyle, this, &Core::showLifeStyle); //发送信号,显示城市预测信息
@ -66,6 +74,7 @@ void Core::initConnect()
void Core::changeCity(QString cityId)
{
CoreVar::CURRENT_CITY_ID = cityId; // 更新 全局变量 当前城市ID
m_currentCityId = cityId;
if (cityId == "") {
ErrorReact::getInstance()->collectAddError("切换城市为空");
@ -90,20 +99,40 @@ void Core::changeCityFromSearch(QModelIndex index)
return;
}
changeCity(itemda.cityId);
CoreVar::CURRENT_CITY_TYPE = CityType::Other; // 通过搜索列表切换城市 更换 全局变量 当前城市类别 : 其他类别
// 通过搜索列表切换城市 更换 全局变量 当前城市类别 : 其他类别
if (CoreVar::LOCATION_CITY_ID == itemda.cityId) {
CoreVar::CURRENT_CITY_TYPE = CityType::Location;
} else if (CoreVar::CURRENT_COLLECT_LIST.contains(itemda.cityId)) {
CoreVar::CURRENT_CITY_TYPE = CityType::Collection;
} else {
CoreVar::CURRENT_CITY_TYPE = CityType::Other;
}
}
//加载收藏城市
void Core::loadCollectCity()
{
QString collectCity = CoreVar::getSettings("collect-city").toString();
QString collectCity;
QString collectCityGsetting = CoreVar::getSettings("collect-city").toString();
// 判断当前应用是否开启定位
if ("1" == CoreVar::getSettings("allow-locate").toString()) {
collectCity = CoreVar::LOCATION_CITY_ID + "," + collectCityGsetting;
} else {
collectCity = collectCityGsetting;
}
QStringList listCollectCity = collectCity.split(",");
m_fullCityList = listCollectCity;
m_fullCityList = collectCityGsetting.split(",");
m_open = false;
//判断配置文件有内容,发信号给前端改变控件位置
if (collectCity != "") {
emit collectShow();
}
m_itemsHash.clear();
m_count = 0;
m_collectModel->clear();
// 用循环的方法将配置文件中的收藏城市添加到收藏列表中
for (int i = 0; i < listCollectCity.length(); i++) {
if (listCollectCity.at(i) != "") {
m_updateList = false; //--备用
@ -112,24 +141,61 @@ void Core::loadCollectCity()
if (m_searchResultList.length() != 0) {
LocationData m_locationdata = (LocationData)m_searchResultList.at(0);
initCollectModel(listCollectCity.at(i), m_locationdata.city);
if (m_getBottomModle == true) {
initBottomCollectModel(listCollectCity.at(i), m_locationdata.city);
}
m_count = i + 1;
} else {
collectCity.remove(m_fullCityList.at(i) + ",");
m_fullCityList.removeAt(i);
if (i != 0) {
m_fullCityList.removeAt(i-1);
}
collectCity.remove(listCollectCity.at(i) + ",");
}
}
}
addNullItemCollectModel();
// 加载收藏城市列表 更新 全局变量 当前收藏城市列表
qDebug() << " ===== INFO ===== " <<__FILE__<< "," <<__FUNCTION__<< "," <<__LINE__<< " ===== current collect list size:" << CoreVar::CURRENT_COLLECT_LIST.size();
CoreVar::CURRENT_COLLECT_LIST = m_fullCityList;
qDebug() << " ===== INFO ===== " <<__FILE__<< "," <<__FUNCTION__<< "," <<__LINE__<< " ===== current collect list size:" << CoreVar::CURRENT_COLLECT_LIST.size();
m_getBottomModle = false;
requestDataColl(collectCity);
}
void Core::loadBottomCity()
{
QString collectCity;
QString collectCityGsetting = CoreVar::getSettings("collect-city").toString();
// 判断当前应用是否开启定位
if ("1" == CoreVar::getSettings("allow-locate").toString()) {
collectCity = CoreVar::LOCATION_CITY_ID + "," + collectCityGsetting;
} else {
collectCity = collectCityGsetting;
}
QStringList listCollectCity = collectCity.split(",");
m_fullCityList = collectCityGsetting.split(",");
// 用循环的方法将配置文件中的收藏城市添加到收藏列表中
for (int i = 0; i < listCollectCity.length(); i++) {
if (listCollectCity.at(i) != "") {
m_updateList = false; //--备用
m_itemIndex = i;
m_searchResultList = m_searchMarch->exactMatchCity(listCollectCity.at(i));
if (m_searchResultList.length() != 0) {
LocationData m_locationdata = (LocationData)m_searchResultList.at(0);
// 首次打开天气应用加载底部列表model
if (m_getBottomModle) {
initBottomCollectModel(listCollectCity.at(i), m_locationdata.city);
}
} else {
if (i != 0) {
m_fullCityList.removeAt(i-1);
}
collectCity.remove(listCollectCity.at(i) + ",");
}
}
}
CoreVar::CURRENT_COLLECT_LIST = m_fullCityList;
m_getBottomModle = false;
emit sigBottomModeGet();
}
//显示在屏幕中间
void Core::showInCenter()
{
@ -147,38 +213,11 @@ void Core::addCollectCity(QModelIndex index)
ErrorReact::getInstance()->collectAddError("添加收藏城市异常,数据为空");
return;
}
//遍历收藏城市列表,不可重复添加
if (!m_fullCityList.isEmpty()) {
for (QStringList::iterator it = m_fullCityList.begin(); it != m_fullCityList.end(); ++it) {
if (*it == itemdata.cityId) { //若收藏城市列表中已有需要添加的城市,则返回
ErrorReact::getInstance()->collectAddError("收藏城市列表中已有需要添加的城市");
return;
}
}
collectCity(itemdata.cityId, itemdata.cityName);
if (CoreVar::CURRENT_CITY_ID == itemdata.cityId) {
CoreVar::CURRENT_CITY_TYPE = CityType::Collection;
}
//设置将城市加入配置文件
QString fullCityID = itemdata.cityId;
m_fullCityList.append(fullCityID);
//更新配置文件
//重新将收藏城市列表写入配置文件
setCollectGsettings();
//更改状态
m_open = true;
m_updateList = true;
//设置itemmodel--用于界面显示
// 更新列表
m_fullCityList.clear();
QString collectCity = CoreVar::getSettings("collect-city").toString();
QStringList listCollectCity = collectCity.split(",");
m_fullCityList = listCollectCity;
// 收藏城市 更新收藏列表 更新 全局变量 当前收藏列表
qDebug() << " ===== INFO ===== " <<__FILE__<< "," <<__FUNCTION__<< "," <<__LINE__<< " ===== current collect list size:" << CoreVar::CURRENT_COLLECT_LIST.size();
CoreVar::CURRENT_COLLECT_LIST = m_fullCityList;
qDebug() << " ===== INFO ===== " <<__FILE__<< "," <<__FUNCTION__<< "," <<__LINE__<< " ===== current collect list size:" << CoreVar::CURRENT_COLLECT_LIST.size();
initBottomCollectModel(itemdata.cityId, itemdata.cityName);
initCollectModel(itemdata.cityId, itemdata.cityName);
emit sigAddCollectCity();
}
// 主界面点击图标添加收藏城市
@ -189,7 +228,13 @@ void Core::addCollectCityFromWidget(QString cityId)
// 添加收藏的城市名称 = 当前城市名字
QString cityName = CoreVar::CURRENT_CITY_NAME;
collectCity(cityId, cityName);
return;
}
void Core::collectCity(QString cityId, QString cityName)
{
//遍历收藏城市列表,不可重复添加
if (!m_fullCityList.isEmpty()) {
for (QStringList::iterator it = m_fullCityList.begin(); it != m_fullCityList.end(); ++it) {
@ -208,14 +253,7 @@ void Core::addCollectCityFromWidget(QString cityId)
//更改状态
m_open = true;
m_updateList = true;
//设置itemmodel--用于界面显示
if (cityName == "" ) {
cityName = m_searchMarch->matchCityName(cityId);
}
initBottomCollectModel(cityId, cityName);
initCollectModel(cityId, cityName);
// 更新列表
m_fullCityList.clear();
QString collectCity = CoreVar::getSettings("collect-city").toString();
@ -225,7 +263,12 @@ void Core::addCollectCityFromWidget(QString cityId)
// 收藏城市 更新收藏列表 更新 全局变量 当前收藏列表
CoreVar::CURRENT_COLLECT_LIST = m_fullCityList;
return;
//设置itemmodel--用于界面显示
if (cityName == "" ) {
cityName = m_searchMarch->matchCityName(cityId);
}
initBottomCollectModel(cityId, cityName);
addItemCollectModel(cityId, cityName);
}
//从收藏城市切换城市
@ -256,35 +299,32 @@ void Core::delCollectCity(QModelIndex index)
}
//删除选中项--设置一个list存其余各项
QList<QStandardItem *> itemList;
m_hashIdItems.clear();
//遍历当前整个model
for (int i = 0; i < m_collectModel->rowCount(); i++) {
for (int j = 0; j < m_collectModel->columnCount(); j++) {
//判断为删除项,跳出此次,继续遍历
if (index.row() == i && index.column() == j) {
//判断到最后一个item的时候可以直接跳出循环。
if (m_collectModel->item(i, j)->data(Qt::UserRole).value<CollectItemData>().cityId
== m_fullCityList.at(m_fullCityList.length() - 1)) {
break;
} else {
continue;
}
}
//遍历到最后一行时对于空itemcontinue--不然会发生闪退
if (i == m_collectModel->rowCount() - 1
&& i * m_collectModel->columnCount() + (j + 1) > m_fullCityList.length() - 1) {
continue;
}
//将有效项加入qlist
itemList.append(m_collectModel->item(i, j)->clone());
for (int i = 0; i < m_collectModel->rowCount() - 1; i++) {
QString id = m_collectModel->item(i, 0)->data(Qt::UserRole).value<CollectItemData>().cityId;
QStandardItem *item = m_collectModel->item(i, 0)->clone();
//判断为删除项,跳出此次,继续遍历
if (index.row() == i) {
continue;
}
//将有效项加入qlist
itemList.append(item);
//将对应的item记录在m_hashIdItems中便于在后续添加进行操作
m_hashIdItems.insert(id, item);
}
//清空model重排整个model
m_collectModel->clear();
m_count = 0; // model 清空因此收藏城市个数为0
//遍历qlist将有效item重新排列
for (int i = 0; i < itemList.length(); i++) {
m_collectModel->setItem(i / 3, i % 3, itemList.at(i));
// m_collectModel->setItem(i / 3, i % 3, itemList.at(i));
m_collectModel->setItem(i, itemList.at(i));
m_count = i + 1;
}
delBottomCollectCity(sign);
addNullItemCollectModel();
//更新配置文件
if (!m_fullCityList.empty()) {
@ -296,10 +336,10 @@ void Core::delCollectCity(QModelIndex index)
}
setCollectGsettings();
}
delBottomCollectCity(sign);
// 收藏城市 更新收藏列表 更新 全局变量 当前收藏列表 当前城市类型
CoreVar::CURRENT_COLLECT_LIST = m_fullCityList;
emit sigDeleCollectCity();
}
//删除主界面底部收藏列表中的城市
@ -327,42 +367,45 @@ void Core::delCollectCityFromWidget(QString cityId)
// 主界面 -> 取消cityID收藏 -> 更改收藏model -> 更改配置文件 -> 更改界面底部图标model
//遍历model拿到需要删除的id对应的item值 -更新配置文件
//删除选中项--设置一个list存其余各项
QList<QStandardItem *> itemList;
itemList.clear();
m_hashIdItems.clear();
//遍历当前整个model
for (int i = 0; i < m_collectModel->rowCount(); i++) {
for (int j = 0; j < m_collectModel->columnCount(); j++) {
//遍历到最后一行时对于空itemcontinue--不然会发生闪退
if ((i == (m_collectModel->rowCount() - 1))
&& ((i * m_collectModel->columnCount() + (j + 1)) > (m_fullCityList.length() - 1))) {
for (int i = 0; i < m_collectModel->rowCount() - 1; i++) {
QString id = m_collectModel->item(i, 0)->data(Qt::UserRole).value<CollectItemData>().cityId;
QStandardItem *item = m_collectModel->item(i, 0)->clone();
if ("1" == CoreVar::getSettings("allow-locate").toString()) {
if (i == 0) {
//将有效项加入qlist
itemList.append(item);
//将对应的item记录在m_hashIdItems中便于在后续添加进行操作
m_hashIdItems.insert(id, item);
continue;
}
QString id = m_collectModel->item(i, j)->data(Qt::UserRole).value<CollectItemData>().cityId;
//判断为删除项,跳出此次,继续遍历
if (cityId == id){
//判断到最后一个item的时候可以直接跳出循环。
if (m_collectModel->item(i, j)->data(Qt::UserRole).value<CollectItemData>().cityId
== m_fullCityList.at(m_fullCityList.length() - 1)) {
break;
} else {
continue;
}
}
//将有效项加入qlist
itemList.append(m_collectModel->item(i, j)->clone());
}
//判断为删除项,跳出此次,继续遍历
if (cityId == id){
continue;
}
//将有效项加入qlist
itemList.append(item);
//将对应的item记录在m_hashIdItems中便于在后续添加进行操作
m_hashIdItems.insert(id, item);
}
//清空model重排整个model
m_collectModel->clear();
m_count = 0; // model 清空因此收藏城市个数为0
//遍历qlist将有效item重新排列
for (int i = 0; i < itemList.length(); i++) {
m_collectModel->setItem(i / 3, i % 3, itemList.at(i));
// m_collectModel->setItem(i / 3, i % 3, itemList.at(i));
m_collectModel->setItem(i, itemList.at(i));
m_count = i + 1;
}
delBottomCollectCity(cityId);
addNullItemCollectModel();
//更新配置文件
if (!m_fullCityList.empty()) {
int cityIndex = m_fullCityList.indexOf(cityId);
@ -373,7 +416,6 @@ void Core::delCollectCityFromWidget(QString cityId)
}
setCollectGsettings();
}
delBottomCollectCity(cityId);
// 收藏城市 更新收藏列表 更新 全局变量 当前收藏列表 当前城市类别
CoreVar::CURRENT_COLLECT_LIST = m_fullCityList;
@ -414,9 +456,15 @@ void Core::allowLocationNo()
}
//不允许定位时显示城市:北京
m_dataRequest->dataRequest(CoreVar::DEFAULT_CITYID);
m_currentCityId = CoreVar::DEFAULT_CITYID;
CoreVar::CURRENT_CITY_ID = m_currentCityId;
if (CoreVar::CURRENT_CITY_ID == "") {
CoreVar::CURRENT_CITY_ID = CoreVar::DEFAULT_CITYID;
m_dataRequest->dataRequest(CoreVar::DEFAULT_CITYID);
m_currentCityId = CoreVar::DEFAULT_CITYID;
CoreVar::CURRENT_CITY_ID = m_currentCityId;
} else {
m_dataRequest->dataRequest(CoreVar::CURRENT_CITY_ID);
m_currentCityId = CoreVar::CURRENT_CITY_ID;
}
CoreVar::CURRENT_CITY_NAME = m_searchMarch->matchCityName(m_currentCityId);
CoreVar::LOCATION_CITY_ID = "";
@ -570,6 +618,10 @@ void Core::refreshCity()
} else {
CoreVar::CURRENT_CITY_TYPE = CityType::Other;
}
if (CoreVar::LOCATION_CITY_ID == m_currentCityId) {
CoreVar::CURRENT_CITY_TYPE = CityType::Location;
}
}
m_dataRequest->dataRequest(m_currentCityId);
@ -636,7 +688,8 @@ void Core::setModel()
//设置悬浮提示
item->setToolTip(m_itemData.cityName);
//插入model
m_model->setItem(i / 3, i % 3, item);
m_model->setItem(i / 4, i % 4, item);
// m_model->setItem(i, item);
}
emit searchUiShow(true);
}
@ -657,7 +710,8 @@ void Core::initModel(LocationData m_locationdata, int i)
//整体存取
item->setData(QVariant::fromValue(m_itemData), Qt::UserRole);
//插入model
m_model->setItem(i / 3, i % 3, item);
m_model->setItem(i / 4, i % 4, item);
// m_model->setItem(i, item);
}
void Core::setTitleModel()
@ -671,7 +725,7 @@ void Core::setTitleModel()
emit sigTitleSearchUiShow(true);
}
//构造搜索model
//构造标题栏搜索model
void Core::initTitleModel(LocationData m_locationdata, int i)
{
QStandardItem *item = new QStandardItem;
@ -686,14 +740,13 @@ void Core::initTitleModel(LocationData m_locationdata, int i)
m_titleModel->setItem(i, 0, item);
}
//构造搜索model
//初始化构造收藏model
void Core::initCollectModel(QString cityId, QString cityName)
{
//判断是从搜索界面加入收藏城市,需要知道当前共有多少个城市
if (m_open) {
m_itemIndex = m_fullCityList.length() - 2;
}
m_hashIdItems.clear();
// model数据
CollectItemData m_collectItemData;
//城市id
@ -709,7 +762,9 @@ void Core::initCollectModel(QString cityId, QString cityName)
item->setToolTip(cityName);
//设置model的行列
m_collectModel->setItem(m_itemIndex / 3, m_itemIndex % 3, item);
// m_collectModel->setItem(m_itemIndex / 3, m_itemIndex % 3, item);
m_collectModel->setItem(m_itemIndex, item);
// m_collectModel->appendRow(item);
m_hashIdItems.insert(cityId, item);
//请求数据---获取温度和阴晴
@ -721,29 +776,110 @@ void Core::initCollectModel(QString cityId, QString cityName)
}
}
// 添加收藏城市
void Core::addItemCollectModel(QString cityId, QString cityName)
{
QStandardItem *item;
m_count += 1; // 由于当前收藏列表为空,收藏一个新的城市
if (m_hashIdItems.contains("000")) {
item = m_hashIdItems.value("000");
m_hashIdItems.remove("000");
} else {
initCollectModel(cityId, cityName);
addNullItemCollectModel();
return;
}
// model数据
CollectItemData m_collectItemData;
//城市id
m_collectItemData.cityId = cityId;
//城市名
m_collectItemData.cityName = cityName;
//设置item不可拖拽
item->setDragEnabled(false);
//整体存取
item->setData(QVariant::fromValue(m_collectItemData), Qt::UserRole);
item->setToolTip(cityName);
m_hashIdItems.insert(cityId, item);
addNullItemCollectModel();
//请求数据---获取温度和阴晴
if (m_updateList) {
if (m_collectItemData.cityId == "") {
return;
}
requestDataColl(m_collectItemData.cityId);
}
return;
}
// 添加收藏空item
void Core::addNullItemCollectModel()
{
QString cityId = "000";
QString cityName = ViewVar::COLLENTTEXT;
//判断是从搜索界面加入收藏城市,需要知道当前共有多少个城市
int num = m_count;
// model数据
CollectItemData m_collectItemData;
//城市id
m_collectItemData.cityId = cityId;
//城市名
m_collectItemData.cityName = cityName;
//设置item
QStandardItem *item = new QStandardItem;
//设置item不可拖拽
item->setDragEnabled(false);
//整体存取
item->setData(QVariant::fromValue(m_collectItemData), Qt::UserRole);
item->setToolTip(tr("Collection City"));
m_hashIdItems.insert(cityId, item);
//设置model的行列
// m_collectModel->setItem(num / 3, num % 3, item);
m_collectModel->setItem(num, item);
// m_collectModel->appendRow(item);
// m_count += 1;
return;
}
//构造搜索BottomCollectmodel
void Core::initBottomCollectModel(QString cityId, QString cityName)
{
if (m_getLocationToModel == true) {
m_getLocationToModel = false;
if ("1" == CoreVar::getSettings("allow-locate").toString()) {
m_currentCityId = CoreVar::DEFAULT_CITYID;
} else {
m_currentCityId = "";
}
//设置item
QStandardItem *item = new QStandardItem;
if (m_locationItem == nullptr) {
m_locationItem = item;
///整体存取
item->setData(m_currentCityId, TitleSearchModel::CityId);
item->setData(TitleSearchModel::CityType::Location, TitleSearchModel::CityStyle);
//设置item不可拖拽
item->setDragEnabled(false);
//插入model
m_bottomCollectModel->appendRow(item);
if ("1" == CoreVar::getSettings("allow-locate").toString()) {
m_currentCityId = CoreVar::DEFAULT_CITYID;
if (m_locationItem == nullptr) {
m_locationItem = item;
///整体存取
item->setData(m_currentCityId, TitleSearchModel::CityId);
item->setData(TitleSearchModel::CityType::Location, TitleSearchModel::CityStyle);
//设置item不可拖拽
item->setDragEnabled(false);
//插入model
m_bottomCollectModel->appendRow(item);
} else {
item = m_locationItem;
}
return;
} else {
item = m_locationItem;
m_currentCityId = "";
if (m_locationItem == nullptr) {
m_locationItem = item;
///整体存取
item->setData(m_currentCityId, TitleSearchModel::CityId);
item->setData(TitleSearchModel::CityType::Location, TitleSearchModel::CityStyle);
//设置item不可拖拽
item->setDragEnabled(false);
//插入model
m_bottomCollectModel->appendRow(item);
} else {
item = m_locationItem;
}
}
}
//设置item
@ -820,41 +956,28 @@ void Core::updateCollect(QList<CollectItemData> collectItemList)
{
if (m_updateList) {
//遍历当前整个model
for (int i = 0; i < m_collectModel->rowCount(); i++) {
for (int j = 0; j < m_collectModel->columnCount(); j++) {
//遍历到最后一行时对于空item跳出--不然会发生闪退
if (i == m_collectModel->rowCount() - 1
&& i * m_collectModel->columnCount() + (j + 1) > m_fullCityList.length() - 1) {
break;
} else {
QStandardItem *item = m_collectModel->item(i, j);
if (item->data(Qt::UserRole).value<CollectItemData>().cityId == collectItemList.at(0).cityId) {
m_collectModel->item(i, j)->setData(QVariant::fromValue(collectItemList.at(0)), Qt::UserRole);
//备用--收藏列表最后一个加载完成--以后可能会需要这个完成的信号
// if (i == m_collectModel->rowCount() - 1 && i *m_collectModel->columnCount()
// + (j+1) == m_fullCityList.length() - 1) {
// qDebug()<<"最后一个加载完成";
// emit updateFinish();
return;
}
for (int i = 0; i < m_collectModel->rowCount() - 1; i++) {
if ("1" == CoreVar::getSettings("allow-locate").toString()) {
if (i == 0) {
continue;
}
}
QStandardItem *item = m_collectModel->item(i, 0);
if (item->data(Qt::UserRole).value<CollectItemData>().cityId == collectItemList.at(0).cityId) {
m_collectModel->item(i, 0)->setData(QVariant::fromValue(collectItemList.at(0)), Qt::UserRole);
return;
}
}
return;
}
//遍历当前整个model
for (int i = 0; i < m_collectModel->rowCount(); i++) {
for (int j = 0; j < m_collectModel->columnCount(); j++) {
//遍历到最后一行时对于空item跳出--不然会发生闪退
if (i == m_collectModel->rowCount() - 1
&& i * m_collectModel->columnCount() + (j + 1) > m_fullCityList.length() - 1) {
break;
} else {
QStandardItem *item = m_collectModel->item(i, j);
for (int k = 0; k < collectItemList.length(); k++) {
if (item->data(Qt::UserRole).value<CollectItemData>().cityId == collectItemList.at(k).cityId) {
m_collectModel->item(i, j)->setData(QVariant::fromValue(collectItemList.at(k)), Qt::UserRole);
}
}
for (int i = 0; i < m_collectModel->rowCount() - 1; i++) {
//遍历到最后一行时对于空item跳出--不然会发生闪退
QStandardItem *item = m_collectModel->item(i, 0);
for (int k = 0; k < collectItemList.length(); k++) {
if (item->data(Qt::UserRole).value<CollectItemData>().cityId == collectItemList.at(k).cityId) {
m_collectModel->item(i, 0)->setData(QVariant::fromValue(collectItemList.at(k)), Qt::UserRole);
}
}
}
@ -868,3 +991,9 @@ bool Core::coreOperateTooOften()
m_canProcess->start(CoreVar::REFRESH_RATE); //刷新间隔
return false;
}
void Core::getLAndRCityInfo(QString cityIdList)
{
m_dataRequest->dataRequestLeftAndRight(cityIdList);
return;
}

View File

@ -48,6 +48,9 @@ signals:
void updateFinish(); //收藏城市最后一个加载完成
void sigShowBottomList(int itemSize); // 显示主界面底部的收藏城市列表
void sigDeleCollectCity(); // 更换界面收藏图标样式
void sigAddCollectCity(); // 更换界面收藏图标样式
void sigBottomModeGet(); // 底部model加载完成
void sigShowLAndRCityInfo(QList<CurrentWeather> cityList); // 左右侧城市信息
public:
Core();
@ -57,6 +60,7 @@ public:
void addCollectCity(QModelIndex index); //添加收藏城市
void addBottomCollectCity(QModelIndex index); //添加主界面最底部收藏城市
void addCollectCityFromWidget(QString cityId); //添加主界面收藏城市
void collectCity(QString Id, QString name); // 收藏城市
void changeCityFromCollect(QModelIndex index); //切换到目标城市
void delCollectCity(QModelIndex index); //添加收藏城市
void delBottomCollectCity(QString cityId); //删除主界面最底部收藏城市
@ -64,6 +68,7 @@ public:
void searchCity(QString inputText); //搜索本地词库表
void initCore(); //初始化核心
void loadCollectCity(); //加载收藏城市
void loadBottomCity(); //加载底部切换城市
void showInCenter(); //显示在屏幕中间
QStandardItemModel *getCityModel(); //获取搜索列表model指针
QStandardItemModel *getCityTitleModel(); //获取标题栏搜索列表model指针
@ -73,6 +78,7 @@ public:
void allowLocationNo();
void progremExit(); //结束进程
void refreshCity(); //刷新城市
void getLAndRCityInfo(QString cityIdList); //获取右侧城市
private:
Dbus *m_dbus = nullptr; // DBus模块对象
@ -98,6 +104,8 @@ private:
void initModel(LocationData m_locationdata, int i); //设置搜索model
void initTitleModel(LocationData m_locationdata, int i); //设置搜索model标题栏搜索
void initCollectModel(QString cityId, QString cityName); //设置收藏城市model
void addNullItemCollectModel(); //添加空白按钮
void addItemCollectModel(QString cityId, QString cityName); //添加收藏城市
void initBottomCollectModel(QString cityId, QString cityName); //设置收藏城市model(主界面底部)
void processingCommand(const QStringList &cmd); //处理终端命令
QString processingApi(const QStringList &cmd); //处理外部命令
@ -116,6 +124,8 @@ private:
bool m_getLocationToModel; // 定位本地数据计入Bottommodel
QHash<QString, QStandardItem *> m_hashIdItems;
QHash<int, QStandardItem *> m_itemsHash;
int m_count = 0; // 记录当前搜藏列表中的城市个数,+1代表空白item的位置
QStandardItem * m_locationItem = nullptr;
private slots:

View File

@ -61,6 +61,11 @@ void CoreInteraction::initConnect()
connect(m_core, &Core::collectNull, this, &CoreInteraction::collectNull); //收藏城市为空
connect(m_core, &Core::collectShow, this, &CoreInteraction::collectShow); //收藏城市不为空---初始打开时进行发送
connect(m_core, &Core::coreProgremExit, this, &CoreInteraction::closePro); //关闭程序
connect(m_core, &Core::sigDeleCollectCity, this, &CoreInteraction::sigDeleCollectCity); // 后端处理完成【取消收藏】前端UI改变
connect(m_core, &Core::sigAddCollectCity, this, &CoreInteraction::sigAddCollectCity); // 后端处理完成【取消收藏】前端UI改变
connect(m_core, &Core::sigBottomModeGet, this, &CoreInteraction::sigBottomModeGet); // 后端处理完成【取消收藏】前端UI改变
connect(m_core, &Core::sigShowLAndRCityInfo, this, &CoreInteraction::sigShowLAndRCityInfo);
connect(this, &CoreInteraction::coreChangeCity, m_core, &Core::changeCity); //切换城市
connect(this, &CoreInteraction::corechangeCityFromSearch, m_core, &Core::changeCityFromSearch); //从搜索界面切换城市
connect(this, &CoreInteraction::coreAddCollectCity, m_core, &Core::addCollectCity); //从搜索界面添加收藏城市
@ -77,6 +82,7 @@ void CoreInteraction::initConnect()
&Core::changeCityFromCollect); //从收藏列表切换城市
connect(this, &CoreInteraction::coreDelCollectCity, m_core, &Core::delCollectCity); //删除收藏城市列表中的城市
connect(this, &CoreInteraction::coreLoadCollect, m_core, &Core::loadCollectCity); //加载收藏城市列表
connect(this, &CoreInteraction::coreLoadBottom, m_core, &Core::loadBottomCity); //加载收藏城市列表
connect(this, &CoreInteraction::coreClosePro, m_core, &Core::progremExit); //项目退出
connect(this, &CoreInteraction::setAllowLocationYes, m_core, &Core::allowLocationYes); //允许定位-刷新
connect(this, &CoreInteraction::setAllowLocationNo, m_core, &Core::allowLocationNo); //不允许定位
@ -84,6 +90,8 @@ void CoreInteraction::initConnect()
connect(this, &CoreInteraction::sigCoreAddCollectCity, m_core, &Core::addCollectCityFromWidget); //收藏城市
connect(this, &CoreInteraction::sigCoreDelCollectCity, m_core, &Core::delCollectCityFromWidget); //取消收藏
connect(this, &CoreInteraction::sigLAndRCityInfo, m_core, &Core::getLAndRCityInfo); //获取左右侧城市
}
bool CoreInteraction::coreOperateTooOften()
@ -206,6 +214,14 @@ void CoreInteraction::loadCollectCity()
emit coreLoadCollect();
}
void CoreInteraction::loadBottomCity()
{
if (coreOperateTooOften()) {
return;
}
emit coreLoadBottom();
}
void CoreInteraction::addCollectCityFromWidget(QString cityId)
{
emit sigCoreAddCollectCity(cityId);
@ -214,4 +230,9 @@ void CoreInteraction::addCollectCityFromWidget(QString cityId)
void CoreInteraction::delCollectCityFromWidget(QString cityId)
{
emit sigCoreDelCollectCity(cityId);
}
}
void CoreInteraction::getLAndRCityInfo(QString cityIdList)
{
emit sigLAndRCityInfo(cityIdList);
}

View File

@ -22,6 +22,7 @@ signals:
void coreSearchResult(QString inputText); //根据输入,匹配本地城市
void coreInitCore(); //不能跨线程调用,线程中使用信号槽来实现调用
void coreLoadCollect(); //加载收藏城市列表
void coreLoadBottom(); //加载底部城市列表
void coreshowInCenter();
void coreClosePro();
void setAllowLocationYes();
@ -30,6 +31,7 @@ signals:
void sigCoreChangeCityFromTitleSearch(QString cityid); // 标题栏搜索城市切换城市
void sigCoreAddCollectCity(QString cityId); // 主界面点击按钮进行收藏城市
void sigCoreDelCollectCity(QString cityId); // 主界面点击按钮进行取消收藏
void sigLAndRCityInfo(QString cityIdList);
QStandardItemModel *coreGetCityModel(); //设置搜索城市列表model
QStandardItemModel *coreGetTitleModel(); //设置标题栏搜索城市列表model
QStandardItemModel *coreGetCollectModel(); //设置收藏城市列表model
@ -52,6 +54,7 @@ protected:
virtual void changeCityFromCollect(QModelIndex index); //从收藏城市切换到目标城市
virtual void delCollectCity(QModelIndex index); //删除收藏城市列表中的城市
virtual void loadCollectCity(); //加载收藏城市列表
virtual void loadBottomCity(); //加载底部城市列表
virtual void showCenterAfter();
virtual void closePrograme();
virtual void allowLocationYes();
@ -59,6 +62,7 @@ protected:
virtual void refresh();
virtual void addCollectCityFromWidget(QString cityId);
virtual void delCollectCityFromWidget(QString cityId);
virtual void getLAndRCityInfo(QString cityIdList);
private:
void initConnect(); //初始化绑定

1
debian/source/options vendored Normal file
View File

@ -0,0 +1 @@
include-binaries

View File

@ -27,13 +27,16 @@ const int ViewVar::COLLECT_BTNYR = -8;
//文字位置
const int ViewVar::COLLECT_NAMEXL = 16;
const int ViewVar::COLLECT_TMPXL = 119;
const int ViewVar::COLLECT_TMPXL1 = 150;
const int ViewVar::COLLECT_CODEXL = 65;
const int ViewVar::COLLECT_CODEXL1 = 95;
//文字位置-same
const int ViewVar::COLLECT_SAMEYL = 0;
const int ViewVar::COLLECT_SAMEXR = -4;
const int ViewVar::COLLECT_SAMEYR = -4;
//图标位置
const int ViewVar::COLLECT_ICONXL = 93;
const int ViewVar::COLLECT_ICONXL1 = 93;
const int ViewVar::COLLECT_ICONYL = 16;
const int ViewVar::COLLECT_ICONXR = -116;
const int ViewVar::COLLECT_ICONYR = -20;
@ -61,10 +64,10 @@ const qreal ViewVar::SAME_OPACITY_2 = 1;
bool ViewVar::s_themeStyle = true; //默认浅色
//收藏
const QSize ViewVar::COLLECT = QSize(608, 141);
const QSize ViewVar::COLLECT = QSize(630, 420);
const QSize ViewVar::COLLECT_PAD = QSize(724, 161);
// const QSize ViewVar::COLLECT = QSize(608, 360);
const QSize ViewVar::COLLECT_LIST = QSize(558, 111);
const QSize ViewVar::COLLECT_LIST = QSize(630, 410);
const QSize ViewVar::COLLECT_LIST_PAD = QSize(666, 131);
// const QSize ViewVar::COLLECT_LIST = QSize(558, 270);
const QPoint ViewVar::COLLECT_TITLE = QPoint(49, 0);
@ -74,6 +77,9 @@ const int ViewVar::COLLECT_ITEMH = 36;
const int ViewVar::COLLECT_ITEMW = 180;
const int ViewVar::COLLECT_ITEMH_PAD = 48;
const int ViewVar::COLLECT_ITEMW_PAD = 216;
bool ViewVar::m_editStyle = false; // 默认非编辑状态
bool ViewVar::m_existAddBtn = false; // 默认不存在
const QString ViewVar::COLLENTTEXT = "add city";
//热门
const QSize ViewVar::HOT = QSize(608, 138); //热门
const QSize ViewVar::HOT_LIST = QSize(608, 120); //热门城市列表
@ -99,12 +105,12 @@ const int ViewVar::SEARCH_ICON_X0 = 97 - 8;
const int ViewVar::SEARCH_ICON_X1 = 9;
//搜索列表-个尺寸大小
const QSize ViewVar::SEARCH_LIST = QSize(572, 287);
const QSize ViewVar::SEARCH_LIST = QSize(572, 370);
const int ViewVar::SEARCH_ITEMH = 36; //搜索城市item height值
const int ViewVar::SEARCH_ITEMW = 180; //搜索城市item weight值
const int ViewVar::SEARCH_ITEMW = 139; //搜索城市item weight值 180
const int ViewVar::SEARCH_NONEW = 500; //搜索城市无city的控件宽度值
//搜索-收藏-总界面
const QSize ViewVar::SEARCH = QSize(610, 368);
const QSize ViewVar::SEARCH = QSize(640, 450);
const QSize ViewVar::SEARCH_PAD = QSize(726, 422);
//搜索框位置-y值
const int ViewVar::SEARCH_BOXY = 8;
@ -119,7 +125,7 @@ bool ViewVar::widgetIsShow = false;
// 主界面图标尺寸
const QSize ViewVar::CITY_ICON = QSize(48, 48);
const QSize ViewVar::CITY_ICON_MAXSIZE = QSize(96, 96);
const QSize ViewVar::CITY_ICON_MAXSIZE = QSize(64, 64);
// 标题栏搜索
const QSize ViewVar::TITLESEARCHITEMSIZE = QSize(292, 48);
@ -268,4 +274,4 @@ CurrentMode ViewVar::getCurrentMode()
}
}
return m_currentMode;
}
}

View File

@ -46,13 +46,16 @@ public:
//文字位置-收藏
static const int COLLECT_NAMEXL;
static const int COLLECT_TMPXL;
static const int COLLECT_TMPXL1;
static const int COLLECT_CODEXL;
static const int COLLECT_CODEXL1;
//文字位置-same-收藏
static const int COLLECT_SAMEYL;
static const int COLLECT_SAMEXR;
static const int COLLECT_SAMEYR;
//图标位置-收藏
static const int COLLECT_ICONXL;
static const int COLLECT_ICONXL1;
static const int COLLECT_ICONYL;
static const int COLLECT_ICONXR;
static const int COLLECT_ICONYR;
@ -126,6 +129,9 @@ public:
static const int SEARCH_CHANGECITYX; //交换位置的x值
static const int DISTANCE0; //间隔0--热门和收藏的相互间距
static const int DISTANCE1; //间隔1--热门和收藏与搜索框的相互间距
static bool m_editStyle; // 收藏城市界面是否在编辑状态
static bool m_existAddBtn; // 收藏城市界面是否存在添加按钮
static const QString COLLENTTEXT; // 收藏城市按钮
static void initGsetting();
static void initFontSize();

View File

@ -118,12 +118,14 @@ SOURCES += \
view/search/searchview.cpp \
view/verscreen/verscreen.cpp \
view/horscreen/changecitywidget.cpp \
view/horscreen/picturetowhite.cpp \
view/search/titlesearchcityview.cpp \
view/search/titlesearchlistdelegate.cpp \
view/search/bottomlistview.cpp \
view/search/bottomlistdelegate.cpp \
model/titlesearchmodel.cpp \
global/rotatechangeinfo.cpp \
HEADERS += \
controller/Interaction.h \
@ -172,6 +174,7 @@ HEADERS += \
view/search/searchview.h \
view/verscreen/verscreen.h \
view/horscreen/changecitywidget.h \
view/horscreen/picturetowhite.h \
view/search/titlesearchcityview.h \
view/search/titlesearchlistdelegate.h \
view/search/bottomlistview.h \

View File

@ -62,6 +62,7 @@ int main(int argc, char *argv[])
} else {
a.installTranslator(&app_trans);
}
a.setApplicationName(QApplication::tr("Weather"));
//初始化后端前端,判断启动方式,是否带参
controlView(a, a.arguments(), !(argc == 2 && QLatin1String(argv[1]) == "showmainwindow"));

View File

@ -2,8 +2,7 @@
DataParser::DataParser() {}
//处理返回的网络数据
void DataParser::dataReply(QByteArray dataBa)
void DataParser::dataAnalysis(QByteArray dataBa)
{
qDebug() << " ##### Function Positioning ##### 处理返回的网络数据 ##### " <<__FILE__<< ","<<__FUNCTION__<<","<<__LINE__;
//数据异常
@ -36,9 +35,6 @@ void DataParser::dataReply(QByteArray dataBa)
return;
}
CurrentWeather m_currentWeather;
QList<Hourly> hourlist;
bool success = true;
//解析当前城市天气状况和一周预报天气
if (mainObj.contains("weather")) {
QJsonObject weatherObj = mainObj.value("weather").toObject();
@ -67,6 +63,11 @@ void DataParser::dataReply(QByteArray dataBa)
success = false;
}
}
//处理返回的网络数据
void DataParser::dataReply(QByteArray dataBa)
{
dataAnalysis(dataBa);
if (success){
emit showCurrent(m_currentWeather);
QVariant var;
@ -85,6 +86,110 @@ void DataParser::dataReply(QByteArray dataBa)
}
}
void DataParser::dataReplyL(QByteArray dataBa)
{
dataAnalysis(dataBa);
if (success){
emit showLeftCity(m_currentWeather);
} else {
ErrorReact::getInstance()->dataFeedBack(false, tr("Data is empty"));
}
return;
}
void DataParser::dataReplyR(QByteArray dataBa)
{
dataAnalysis(dataBa);
if (success){
emit showRightCity(m_currentWeather);
} else {
ErrorReact::getInstance()->dataFeedBack(false, tr("Data is empty"));
}
return;
}
void DataParser::dataReplyLAndR(QByteArray dataBa)
{
QJsonParseError jsonParserErr;
QJsonDocument jsonDocument = QJsonDocument::fromJson(dataBa, &jsonParserErr);
if (jsonParserErr.error != QJsonParseError::NoError) { // Json type error
ErrorReact::getInstance()->dataFeedBack(false, jsonParserErr.errorString());
return;
}
if (jsonDocument.isNull() || jsonDocument.isEmpty()) {
ErrorReact::getInstance()->dataFeedBack(false, "Json null or empty!");
return;
}
QJsonObject jsonObject = jsonDocument.object();
if (jsonObject.isEmpty() || jsonObject.size() == 0) {
ErrorReact::getInstance()->dataFeedBack(false, "Json object null or empty!");
return;
}
if (jsonObject.contains("KylinWeather")) {
QJsonObject mainObj = jsonObject.value("KylinWeather").toObject();
if (mainObj.isEmpty() || mainObj.size() == 0) {
return;
}
if (mainObj.contains("weather")) {
QString weather_msg = mainObj.value("weather").toString();
if (weather_msg != "") {
lAndRWeather(weather_msg);
}
}
}
return;
}
void DataParser::lAndRWeather(QString weatherList)
{
QList<CurrentWeather> citysWeatherList;
if (weatherList == "")
return;
QStringList strList = weatherList.split(";");
QString weatherStr = "";
for (int i = 0; i <= strList.length() - 1; i++) {
weatherStr = strList.at(i);
CurrentWeather cityWeather;
if (!weatherStr.isEmpty() && weatherStr.contains(",", Qt::CaseInsensitive)) {
QJsonObject m_json;
if (!weatherStr.isEmpty()) {
QStringList eachKeyList = weatherStr.split(",");
foreach (QString strKey, eachKeyList) {
if (!strKey.isEmpty()) {
//等号左边为键,右边为值
m_json.insert(strKey.split("=").at(0), strKey.split("=").at(1));
}
}
}
cityWeather.id = m_json.value("id").toString();
cityWeather.city = m_json.value("location").toString();
cityWeather.tmp = m_json.value("tmp").toString();
cityWeather.cond_code = m_json.value("cond_code").toString();
cityWeather.cond_txt = m_json.value("cond_txt").toString();
cityWeather.wind_dir = m_json.value("wind_dir").toString();
cityWeather.wind_sc = m_json.value("wind_sc").toString();
cityWeather.hum = m_json.value("hum").toString();
} else {
cityWeather.id = "N/A";
cityWeather.tmp = "N/A";
cityWeather.city = "N/A";
cityWeather.cond_code = "999";
cityWeather.cond_txt = "N/A";
cityWeather.wind_dir = "N/A";
cityWeather.wind_sc = "N/A";
cityWeather.hum = "N/A";
//返回的数据中带了一个空数据,所以将这一项去掉
if (i != strList.length() - 1) {
ErrorReact::getInstance()->dataFeedBack(false, tr("Data is empty"));
}
}
citysWeatherList.append(cityWeather);
}
emit showLAndRCode(citysWeatherList);
return;
}
void DataParser::dataReplyColl(QByteArray dataBa)
{
QJsonParseError jsonParserErr;

View File

@ -18,9 +18,12 @@ public:
signals:
void showLifeStyle(LifeStyle lifeStyle); //发送信号,显示生活指数信息
void showCurrent(CurrentWeather currentWeather); //发送信号,显示当前城市信息
void showLeftCity(CurrentWeather currentWeather); //发送信号,显示左侧城市信息
void showRightCity(CurrentWeather currentWeather); //发送信号,显示右侧城市信息
void showForcast(ForecastWeather forecastWeather); //发送信号,显示城市预测信息
// void showForcast(QString forecastWeather);//发送信号,显示城市预测信息
void showCollectCode(QList<CollectItemData> collectItemList); //发送信号,显示收藏城市信息
void showLAndRCode(QList<CurrentWeather> citysWeather); //发送信号,显示左右城市信息
void showHourly(QVariant varHour); //逐小时天气信息
private:
void lifeStyle(QJsonObject lifestyleObj); //解析生活指数信息
@ -32,8 +35,17 @@ private:
void tmphourlyWeather(QJsonObject hourlyObj, QList<Hourly> hourlist); //解析逐小时信息
void setCollectValue(int i, const QJsonObject &json, ForecastWeather &forecastweather,
const QString &dateTime); //给预报天气的结构体的每一天赋值
void dataAnalysis(QByteArray dataBa);
void lAndRWeather(QString weatherList); //解析左右城市信息
CurrentWeather m_currentWeather;
QList<Hourly> hourlist;
bool success = true;
public slots:
void dataReplyLAndR(QByteArray dataBa); //对左数据进行解析
void dataReplyL(QByteArray dataBa); //对左数据进行解析
void dataReply(QByteArray dataBa); //对发送来的数据进行解析
void dataReplyR(QByteArray dataBa); //对右数据进行解析
void dataReplyColl(QByteArray dataBa); //对收藏城市数据进行解析
};

View File

@ -4,6 +4,8 @@ DataRequest::DataRequest(QObject *parent) : QObject(parent)
{
m_networkManager = new QNetworkAccessManager(this);
m_timer.setSingleShot(true);
m_timerLAndR.setSingleShot(true);
// m_timerR.setSingleShot(true);
m_timerColl.setSingleShot(true);
}
DataRequest::~DataRequest()
@ -11,7 +13,58 @@ DataRequest::~DataRequest()
m_networkManager->deleteLater();
m_reply->deleteLater();
m_replyCollect->deleteLater();
m_replyLAndR->deleteLater();
}
void DataRequest::dataRequestLeftAndRight(const QString &cityIdList)
{
if (cityIdList.isEmpty()) {
return;
}
//如果是搜藏城市列表加载城市
QString forecastUrl = CoreVar::SERVICEREQUEST_COLLECT;
QStringList cityList = cityIdList.split(","); // cityList最后一项为空字符
//访问要求为 : "11111"+ "22222"形式
for (int i = 0; i < cityList.size(); i++) {
if (i == cityList.size() - 1) {
forecastUrl.append(cityList.at(i));
} else {
forecastUrl.append(cityList.at(i));
forecastUrl.append("+");
}
}
QNetworkRequest request;
request.setUrl(forecastUrl);
m_replyLAndR = m_networkManager->get(request);
QEventLoop eventLoop;
connect(&m_timerLAndR, SIGNAL(timeout()), &eventLoop, SLOT(quit())); //定时器结束,循环断开
connect(m_replyLAndR, &QNetworkReply::finished, &eventLoop, &QEventLoop::quit);
m_timerLAndR.start(CoreVar::DEFAULT_TIMEOUT); // 30s等待
eventLoop.exec();
//超时处理
if (!timeOut(&m_timerLAndR, m_replyLAndR, &eventLoop)) {
ErrorReact::getInstance()->networkTimeout("false"); //超时
return;
} else {
int statusCode = m_replyLAndR->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
//状态码不为200时异常
if (statusCode != 200) {
ErrorReact::getInstance()->serverFeedBack(false, QString::number(statusCode));
return;
}
//网络层错误[与目标服务器有关]
if (m_replyLAndR->error() != QNetworkReply::NoError) {
ErrorReact::getInstance()->networkFeedBack(false, m_replyLAndR->errorString());
return;
}
QByteArray dataBaC = m_replyLAndR->readAll();
m_replyLAndR->abort();
emit sigSendLAndRData(dataBaC);
}
return;
}
//利用连接请求网络数据
void DataRequest::dataRequest(const QString &cityId)
{
@ -60,6 +113,7 @@ void DataRequest::dataReply()
m_reply->abort();
emit sendData(dataBa);
}
//请求收藏城市数据
void DataRequest::dataRequestCollect(const QString &cityIdList)
{

View File

@ -19,6 +19,7 @@ public:
explicit DataRequest(QObject *parent = nullptr);
~DataRequest();
void dataRequest(const QString &cityId); //主界面城市数据请求
void dataRequestLeftAndRight(const QString &cityIdList);//主界面左右城市数据请求
void dataRequestCollect(const QString &cityIdList); //收藏城市数据请求
private:
QNetworkAccessManager *m_networkManager = nullptr;
@ -26,11 +27,14 @@ private:
void dataReplyCollect(); //收藏界面网络返回
bool m_requsetWay = false; //默认为false请求数据的方式true代表是从搜索列表请求false为其他
QTimer m_timer; //当前城市的定时器
QTimer m_timerLAndR; //左侧城市的定时器
QTimer m_timerColl; //收藏的定时器
QNetworkReply *m_reply = nullptr; //主界面城市网络reply
QNetworkReply *m_replyLAndR = nullptr; //主界面左边城市网络reply
QNetworkReply *m_replyCollect = nullptr; //收藏城市界面网络reply
bool timeOut(QTimer *timer, QNetworkReply *reply, QEventLoop *eventloop); //主界面超时函数
signals:
void sigSendLAndRData(QByteArray dataBa); //主界面左边城市数据
void sendData(QByteArray dataBa); //主界面城市数据
void sendCollData(QByteArray dataBa); //收藏城市数据
};

View File

@ -70,11 +70,15 @@ SearchMarch::~SearchMarch()
QList<LocationData> SearchMarch::exactMatchCity(const QString &inputText) const
{
QList<LocationData> searchedList;
if (m_locatonList.isEmpty()) {
m_workerThread->start();
}
//搜索匹配-遍历m_locatonList
for (const LocationData line : m_locatonList) {
if (line.shorthand == inputText || line.id == inputText || //拼音和ID
line.province == inputText || line.province_en == inputText || //省
line.city.contains(inputText) || line.city_en.contains(inputText) //县
// line.province == inputText || line.province_en == inputText || //省
// line.city.contains(inputText) || line.city_en.contains(inputText) //县
line.city.startsWith(inputText) || line.city_en.startsWith(inputText) //县
) {
//保证完全匹配的字符串放在显示的第一个
if (inputText == line.city_en) {

85
res.qrc
View File

@ -243,5 +243,90 @@
<file>res/image/ukui-icon-city management/click-symbolic.png</file>
<file>res/image/ukui-icon-city management/hover-symbolic.png</file>
<file>res/image/ukui-icon-city management/normal-symbolic.png</file>
<file>res/weather-icon/SVG/100.svg</file>
<file>res/weather-icon/SVG/101.svg</file>
<file>res/weather-icon/SVG/102.svg</file>
<file>res/weather-icon/SVG/103.svg</file>
<file>res/weather-icon/SVG/104.svg</file>
<file>res/weather-icon/SVG/150.svg</file>
<file>res/weather-icon/SVG/151.svg</file>
<file>res/weather-icon/SVG/152.svg</file>
<file>res/weather-icon/SVG/153.svg</file>
<file>res/weather-icon/SVG/154.svg</file>
<file>res/weather-icon/SVG/200.svg</file>
<file>res/weather-icon/SVG/201.svg</file>
<file>res/weather-icon/SVG/202.svg</file>
<file>res/weather-icon/SVG/203.svg</file>
<file>res/weather-icon/SVG/204.svg</file>
<file>res/weather-icon/SVG/205.svg</file>
<file>res/weather-icon/SVG/206.svg</file>
<file>res/weather-icon/SVG/207.svg</file>
<file>res/weather-icon/SVG/208.svg</file>
<file>res/weather-icon/SVG/209.svg</file>
<file>res/weather-icon/SVG/210.svg</file>
<file>res/weather-icon/SVG/211.svg</file>
<file>res/weather-icon/SVG/212.svg</file>
<file>res/weather-icon/SVG/213.svg</file>
<file>res/weather-icon/SVG/300.svg</file>
<file>res/weather-icon/SVG/301.svg</file>
<file>res/weather-icon/SVG/302.svg</file>
<file>res/weather-icon/SVG/303.svg</file>
<file>res/weather-icon/SVG/304.svg</file>
<file>res/weather-icon/SVG/305.svg</file>
<file>res/weather-icon/SVG/306.svg</file>
<file>res/weather-icon/SVG/307.svg</file>
<file>res/weather-icon/SVG/308.svg</file>
<file>res/weather-icon/SVG/309.svg</file>
<file>res/weather-icon/SVG/310.svg</file>
<file>res/weather-icon/SVG/311.svg</file>
<file>res/weather-icon/SVG/312.svg</file>
<file>res/weather-icon/SVG/313.svg</file>
<file>res/weather-icon/SVG/314.svg</file>
<file>res/weather-icon/SVG/315.svg</file>
<file>res/weather-icon/SVG/316.svg</file>
<file>res/weather-icon/SVG/317.svg</file>
<file>res/weather-icon/SVG/318.svg</file>
<file>res/weather-icon/SVG/350.svg</file>
<file>res/weather-icon/SVG/351.svg</file>
<file>res/weather-icon/SVG/399.svg</file>
<file>res/weather-icon/SVG/400.svg</file>
<file>res/weather-icon/SVG/401.svg</file>
<file>res/weather-icon/SVG/402.svg</file>
<file>res/weather-icon/SVG/403.svg</file>
<file>res/weather-icon/SVG/404.svg</file>
<file>res/weather-icon/SVG/405.svg</file>
<file>res/weather-icon/SVG/406.svg</file>
<file>res/weather-icon/SVG/407.svg</file>
<file>res/weather-icon/SVG/408.svg</file>
<file>res/weather-icon/SVG/409.svg</file>
<file>res/weather-icon/SVG/410.svg</file>
<file>res/weather-icon/SVG/456.svg</file>
<file>res/weather-icon/SVG/457.svg</file>
<file>res/weather-icon/SVG/499.svg</file>
<file>res/weather-icon/SVG/500.svg</file>
<file>res/weather-icon/SVG/501.svg</file>
<file>res/weather-icon/SVG/502.svg</file>
<file>res/weather-icon/SVG/503.svg</file>
<file>res/weather-icon/SVG/504.svg</file>
<file>res/weather-icon/SVG/507.svg</file>
<file>res/weather-icon/SVG/508.svg</file>
<file>res/weather-icon/SVG/509.svg</file>
<file>res/weather-icon/SVG/510.svg</file>
<file>res/weather-icon/SVG/511.svg</file>
<file>res/weather-icon/SVG/512.svg</file>
<file>res/weather-icon/SVG/513.svg</file>
<file>res/weather-icon/SVG/514.svg</file>
<file>res/weather-icon/SVG/515.svg</file>
<file>res/weather-icon/SVG/800.svg</file>
<file>res/weather-icon/SVG/801.svg</file>
<file>res/weather-icon/SVG/802.svg</file>
<file>res/weather-icon/SVG/803.svg</file>
<file>res/weather-icon/SVG/804.svg</file>
<file>res/weather-icon/SVG/805.svg</file>
<file>res/weather-icon/SVG/806.svg</file>
<file>res/weather-icon/SVG/807.svg</file>
<file>res/weather-icon/SVG/900.svg</file>
<file>res/weather-icon/SVG/901.svg</file>
<file>res/weather-icon/SVG/999.svg</file>
</qresource>
</RCC>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><defs><style>.cls-1{fill:#ffc819;}.cls-2{fill:#ffe317;}</style></defs><title>100-晴-SunnyClear</title><circle class="cls-1" cx="32" cy="32" r="13.76"/><path class="cls-2" d="M12.71,33.44H4.47a1.48,1.48,0,0,1,0-2.95h8.24a1.48,1.48,0,1,1,0,2.95Z"/><path class="cls-2" d="M59.53,33.51h-8a1.48,1.48,0,0,1,0-2.95h8a1.48,1.48,0,0,1,0,2.95Z"/><path class="cls-2" d="M32,61a1.48,1.48,0,0,1-1.48-1.47V51.41a1.48,1.48,0,1,1,2.95,0v8.12A1.47,1.47,0,0,1,32,61Z"/><path class="cls-2" d="M32,14.07a1.47,1.47,0,0,1-1.47-1.48V4.47a1.48,1.48,0,0,1,2.95,0v8.12A1.48,1.48,0,0,1,32,14.07Z"/><line class="cls-2" x1="12.56" y1="12.52" x2="18.35" y2="18.31"/><path class="cls-2" d="M18.35,19.78a1.45,1.45,0,0,1-1-.43l-5.79-5.79a1.47,1.47,0,0,1,2.08-2.09l5.79,5.79a1.47,1.47,0,0,1,0,2.09A1.44,1.44,0,0,1,18.35,19.78Z"/><line class="cls-2" x1="45.77" y1="45.81" x2="51.44" y2="51.48"/><path class="cls-2" d="M51.44,53a1.45,1.45,0,0,1-1-.43l-5.67-5.67a1.47,1.47,0,1,1,2.08-2.09l5.67,5.67a1.47,1.47,0,0,1,0,2.09A1.44,1.44,0,0,1,51.44,53Z"/><line class="cls-2" x1="12.52" y1="51.44" x2="18.25" y2="45.71"/><path class="cls-2" d="M12.51,52.92a1.48,1.48,0,0,1-1-2.52l5.73-5.73a1.47,1.47,0,0,1,2.09,2.08l-5.73,5.73A1.49,1.49,0,0,1,12.51,52.92Z"/><line class="cls-2" x1="45.69" y1="18.35" x2="51.48" y2="12.56"/><path class="cls-2" d="M45.69,19.83a1.48,1.48,0,0,1-1-.44,1.46,1.46,0,0,1,0-2.08l5.79-5.79a1.47,1.47,0,1,1,2.09,2.08l-5.79,5.79A1.49,1.49,0,0,1,45.69,19.83Z"/></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><defs><style>.cls-1{fill:#e0e0e0;}.cls-2{fill:#fff;}</style></defs><title>101-多云-Cloudy</title><path class="cls-1" d="M51,18.51h-.17A11.29,11.29,0,0,0,40.12,11a11.17,11.17,0,0,0-11.3,11c0,.23,0,.47,0,.7A7.83,7.83,0,0,0,23,30.22h0A7.9,7.9,0,0,0,31,38H51a9.91,9.91,0,0,0,10-9.75h0A9.9,9.9,0,0,0,51,18.51Z"/><g id="锁屏title_深" data-name="锁屏title/深"><g id="锁屏title"><g id="编组-2"><g id="天气图标"><g id="天气_样式1" data-name="天气/样式1"><g id="天气"><path id="路径" class="cls-2" d="M12.67,52A9.45,9.45,0,0,1,3,42.78a9.45,9.45,0,0,1,9.67-9.21h0c0-.17,0-.34,0-.52,0-8.31,7.07-15,15.79-15a15.91,15.91,0,0,1,13.9,7.91,14.75,14.75,0,0,1,1.89-.13C51.84,25.78,58,31.65,58,38.89S51.84,52,44.25,52Z"/></g></g></g></g></g></g></svg>

After

Width:  |  Height:  |  Size: 854 B

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><defs><style>.cls-1{fill:#fff;}</style></defs><title>102-少云-Few Clouds</title><g id="锁屏title_深" data-name="锁屏title/深"><g id="锁屏title"><g id="编组-2"><g id="天气图标"><g id="天气_样式1" data-name="天气/样式1"><g id="天气"><path id="路径" class="cls-1" d="M13.2,50A10,10,0,0,1,3,40.24a10,10,0,0,1,10.2-9.76h0v-.54C13.2,21.14,20.65,14,29.85,14a16.79,16.79,0,0,1,14.66,8.37,16.22,16.22,0,0,1,2-.13c8,0,14.5,6.22,14.5,13.88S54.51,50,46.5,50Z"/></g></g></g></g></g></g></svg>

After

Width:  |  Height:  |  Size: 602 B

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><defs><style>.cls-1{fill:#ffc819;}.cls-2{fill:#fff;}</style></defs><title>103-晴间多云-Partly Cloudy</title><g id="天气"><path id="路径" class="cls-1" d="M3,26A14,14,0,1,0,17,12,14,14,0,0,0,3,26Z"/><path id="路径-2" data-name="路径" class="cls-2" d="M18.14,52a8.95,8.95,0,1,1,0-17.89h0c0-.17,0-.33,0-.5A14.77,14.77,0,0,1,33.07,19a15,15,0,0,1,13.14,7.67A13.23,13.23,0,0,1,48,26.55,12.73,12.73,0,1,1,48,52Z"/></g></svg>

After

Width:  |  Height:  |  Size: 524 B

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><defs><style>.cls-1{fill:#8c8c8c;}.cls-2{opacity:0.95;}.cls-3{fill:#dbdbdb;}</style></defs><title>104-阴-Overcast</title><g id="锁屏title_深" data-name="锁屏title/深"><g id="锁屏title"><g id="编组-2"><g id="天气图标"><g id="天气_样式1" data-name="天气/样式1"><g id="天气"><path id="路径" class="cls-1" d="M19.79,51C14.93,51,11,47.36,11,42.87s3.93-8.14,8.79-8.14h0c0-.15,0-.3,0-.45C19.79,27,26.22,21,34.14,21a14.54,14.54,0,0,1,12.64,7,12.22,12.22,0,0,1,1.72-.11c6.9,0,12.5,5.18,12.5,11.56S55.4,51,48.5,51Z"/></g></g></g></g></g></g><g id="锁屏title_深-2" data-name="锁屏title/深" class="cls-2"><g id="锁屏title-2" data-name="锁屏title"><g id="编组-2-2" data-name="编组-2"><g id="天气图标-2" data-name="天气图标"><g id="天气_样式1-2" data-name="天气/样式1"><g id="天气-2" data-name="天气"><path id="路径-2" data-name="路径" class="cls-3" d="M11.79,44a8.68,8.68,0,1,1,0-17.35h0c0-.16,0-.32,0-.48a14.39,14.39,0,0,1,27-6.73,12.22,12.22,0,0,1,1.72-.11A12.34,12.34,0,1,1,40.5,44Z"/></g></g></g></g></g></g></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><defs><style>.cls-1{fill:#ffc819;}.cls-2{fill:#ffe317;}</style></defs><title>100-晴-SunnyClear</title><circle class="cls-1" cx="32" cy="32" r="13.76"/><path class="cls-2" d="M12.71,33.44H4.47a1.48,1.48,0,0,1,0-2.95h8.24a1.48,1.48,0,1,1,0,2.95Z"/><path class="cls-2" d="M59.53,33.51h-8a1.48,1.48,0,0,1,0-2.95h8a1.48,1.48,0,0,1,0,2.95Z"/><path class="cls-2" d="M32,61a1.48,1.48,0,0,1-1.48-1.47V51.41a1.48,1.48,0,1,1,2.95,0v8.12A1.47,1.47,0,0,1,32,61Z"/><path class="cls-2" d="M32,14.07a1.47,1.47,0,0,1-1.47-1.48V4.47a1.48,1.48,0,0,1,2.95,0v8.12A1.48,1.48,0,0,1,32,14.07Z"/><line class="cls-2" x1="12.56" y1="12.52" x2="18.35" y2="18.31"/><path class="cls-2" d="M18.35,19.78a1.45,1.45,0,0,1-1-.43l-5.79-5.79a1.47,1.47,0,0,1,2.08-2.09l5.79,5.79a1.47,1.47,0,0,1,0,2.09A1.44,1.44,0,0,1,18.35,19.78Z"/><line class="cls-2" x1="45.77" y1="45.81" x2="51.44" y2="51.48"/><path class="cls-2" d="M51.44,53a1.45,1.45,0,0,1-1-.43l-5.67-5.67a1.47,1.47,0,1,1,2.08-2.09l5.67,5.67a1.47,1.47,0,0,1,0,2.09A1.44,1.44,0,0,1,51.44,53Z"/><line class="cls-2" x1="12.52" y1="51.44" x2="18.25" y2="45.71"/><path class="cls-2" d="M12.51,52.92a1.48,1.48,0,0,1-1-2.52l5.73-5.73a1.47,1.47,0,0,1,2.09,2.08l-5.73,5.73A1.49,1.49,0,0,1,12.51,52.92Z"/><line class="cls-2" x1="45.69" y1="18.35" x2="51.48" y2="12.56"/><path class="cls-2" d="M45.69,19.83a1.48,1.48,0,0,1-1-.44,1.46,1.46,0,0,1,0-2.08l5.79-5.79a1.47,1.47,0,1,1,2.09,2.08l-5.79,5.79A1.49,1.49,0,0,1,45.69,19.83Z"/></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><defs><style>.cls-1{fill:#e0e0e0;}.cls-2{fill:#fff;}</style></defs><title>101-多云-Cloudy</title><path class="cls-1" d="M51,18.51h-.17A11.29,11.29,0,0,0,40.12,11a11.17,11.17,0,0,0-11.3,11c0,.23,0,.47,0,.7A7.83,7.83,0,0,0,23,30.22h0A7.9,7.9,0,0,0,31,38H51a9.91,9.91,0,0,0,10-9.75h0A9.9,9.9,0,0,0,51,18.51Z"/><g id="锁屏title_深" data-name="锁屏title/深"><g id="锁屏title"><g id="编组-2"><g id="天气图标"><g id="天气_样式1" data-name="天气/样式1"><g id="天气"><path id="路径" class="cls-2" d="M12.67,52A9.45,9.45,0,0,1,3,42.78a9.45,9.45,0,0,1,9.67-9.21h0c0-.17,0-.34,0-.52,0-8.31,7.07-15,15.79-15a15.91,15.91,0,0,1,13.9,7.91,14.75,14.75,0,0,1,1.89-.13C51.84,25.78,58,31.65,58,38.89S51.84,52,44.25,52Z"/></g></g></g></g></g></g></svg>

After

Width:  |  Height:  |  Size: 854 B

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><defs><style>.cls-1{fill:#fff;}</style></defs><title>102-少云-Few Clouds</title><g id="锁屏title_深" data-name="锁屏title/深"><g id="锁屏title"><g id="编组-2"><g id="天气图标"><g id="天气_样式1" data-name="天气/样式1"><g id="天气"><path id="路径" class="cls-1" d="M13.2,50A10,10,0,0,1,3,40.24a10,10,0,0,1,10.2-9.76h0v-.54C13.2,21.14,20.65,14,29.85,14a16.79,16.79,0,0,1,14.66,8.37,16.22,16.22,0,0,1,2-.13c8,0,14.5,6.22,14.5,13.88S54.51,50,46.5,50Z"/></g></g></g></g></g></g></svg>

After

Width:  |  Height:  |  Size: 602 B

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><defs><style>.cls-1{fill:#ffc819;}.cls-2{fill:#fff;}</style></defs><title>103-晴间多云-Partly Cloudy</title><g id="天气"><path id="路径" class="cls-1" d="M3,26A14,14,0,1,0,17,12,14,14,0,0,0,3,26Z"/><path id="路径-2" data-name="路径" class="cls-2" d="M18.14,52a8.95,8.95,0,1,1,0-17.89h0c0-.17,0-.33,0-.5A14.77,14.77,0,0,1,33.07,19a15,15,0,0,1,13.14,7.67A13.23,13.23,0,0,1,48,26.55,12.73,12.73,0,1,1,48,52Z"/></g></svg>

After

Width:  |  Height:  |  Size: 524 B

View File

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><defs><style>.cls-1{fill:#8c8c8c;}.cls-2{opacity:0.95;}.cls-3{fill:#dbdbdb;}</style></defs><title>104-阴-Overcast</title><g id="锁屏title_深" data-name="锁屏title/深"><g id="锁屏title"><g id="编组-2"><g id="天气图标"><g id="天气_样式1" data-name="天气/样式1"><g id="天气"><path id="路径" class="cls-1" d="M19.79,51C14.93,51,11,47.36,11,42.87s3.93-8.14,8.79-8.14h0c0-.15,0-.3,0-.45C19.79,27,26.22,21,34.14,21a14.54,14.54,0,0,1,12.64,7,12.22,12.22,0,0,1,1.72-.11c6.9,0,12.5,5.18,12.5,11.56S55.4,51,48.5,51Z"/></g></g></g></g></g></g><g id="锁屏title_深-2" data-name="锁屏title/深" class="cls-2"><g id="锁屏title-2" data-name="锁屏title"><g id="编组-2-2" data-name="编组-2"><g id="天气图标-2" data-name="天气图标"><g id="天气_样式1-2" data-name="天气/样式1"><g id="天气-2" data-name="天气"><path id="路径-2" data-name="路径" class="cls-3" d="M11.79,44a8.68,8.68,0,1,1,0-17.35h0c0-.16,0-.32,0-.48a14.39,14.39,0,0,1,27-6.73,12.22,12.22,0,0,1,1.72-.11A12.34,12.34,0,1,1,40.5,44Z"/></g></g></g></g></g></g></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

Some files were not shown because too many files have changed in this diff Show More