@gt6/sdk 1.0.40 → 1.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/gt6-sdk.cjs.js
CHANGED
|
@@ -649,7 +649,7 @@ class ArticlesAPI {
|
|
|
649
649
|
const offset = (page - 1) * limit;
|
|
650
650
|
const paginatedArticleIds = categoryData.articleIds.slice(offset, offset + limit);
|
|
651
651
|
// 获取文章详情 - 修复:提取 articleId 字段
|
|
652
|
-
const articles = await Promise.all(paginatedArticleIds.map(
|
|
652
|
+
const articles = await Promise.all(paginatedArticleIds.map(articleId => this.getArticle_all(articleId)));
|
|
653
653
|
// 应用状态过滤
|
|
654
654
|
let filteredArticles = articles;
|
|
655
655
|
if (options?.status) {
|
|
@@ -695,7 +695,20 @@ class ArticlesAPI {
|
|
|
695
695
|
return false;
|
|
696
696
|
}
|
|
697
697
|
}
|
|
698
|
-
// 3.
|
|
698
|
+
// 3. mileage 范围过滤
|
|
699
|
+
if (searchOptions?.mileageRange) {
|
|
700
|
+
// 处理里程数格式,如 "26000 km" -> 26000
|
|
701
|
+
const mileageStr = articleObj.Mileage || '0';
|
|
702
|
+
const mileageMatch = mileageStr.match(/(\d+(?:\.\d+)?)/);
|
|
703
|
+
const mileage = mileageMatch ? parseFloat(mileageMatch[1]) : 0;
|
|
704
|
+
if (searchOptions.mileageRange.min !== undefined && mileage < searchOptions.mileageRange.min) {
|
|
705
|
+
return false;
|
|
706
|
+
}
|
|
707
|
+
if (searchOptions.mileageRange.max !== undefined && mileage > searchOptions.mileageRange.max) {
|
|
708
|
+
return false;
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
// 4. propertyArea 范围过滤
|
|
699
712
|
if (searchOptions?.propertyAreaRange) {
|
|
700
713
|
const propertyArea = parseFloat(articleObj.propertyArea || '0');
|
|
701
714
|
if (searchOptions.propertyAreaRange.min !== undefined && propertyArea < searchOptions.propertyAreaRange.min) {
|
|
@@ -705,7 +718,7 @@ class ArticlesAPI {
|
|
|
705
718
|
return false;
|
|
706
719
|
}
|
|
707
720
|
}
|
|
708
|
-
//
|
|
721
|
+
// 5. plotArea 范围过滤
|
|
709
722
|
if (searchOptions?.plotAreaRange) {
|
|
710
723
|
const plotArea = parseFloat(articleObj.plotArea || '0');
|
|
711
724
|
if (searchOptions.plotAreaRange.min !== undefined && plotArea < searchOptions.plotAreaRange.min) {
|
|
@@ -715,7 +728,7 @@ class ArticlesAPI {
|
|
|
715
728
|
return false;
|
|
716
729
|
}
|
|
717
730
|
}
|
|
718
|
-
//
|
|
731
|
+
// 6. tagIds 过滤
|
|
719
732
|
if (searchOptions?.tagIds && searchOptions.tagIds.length > 0) {
|
|
720
733
|
if (!articleObj.tagIds || articleObj.tagIds.length === 0) {
|
|
721
734
|
return false;
|