@gt6/sdk 1.0.34 → 1.0.35
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.esm.js
CHANGED
@@ -749,11 +749,11 @@ class ProductsAPI {
|
|
749
749
|
async getProduct_all(productId) {
|
750
750
|
const product = await this.client.request(`/products_all/${productId}.json`);
|
751
751
|
// 检查产品是否有销售区域和税费模板
|
752
|
-
if (product.
|
752
|
+
if (product.regions_Parent && product.regions_Parent.length > 0 &&
|
753
753
|
product.taxTemplates && product.taxTemplates.length > 0) {
|
754
754
|
try {
|
755
755
|
// 获取税费信息
|
756
|
-
const taxInfo = await this.
|
756
|
+
const taxInfo = await this.getTaxInfo01(product.platformId);
|
757
757
|
// 为每个税费模板添加规则
|
758
758
|
product.taxTemplates = product.taxTemplates.map(template => {
|
759
759
|
const matchingTemplate = taxInfo.templates.find(t => t.templateId === template.templateId);
|
@@ -775,11 +775,11 @@ class ProductsAPI {
|
|
775
775
|
}
|
776
776
|
}
|
777
777
|
// 检查产品是否有销售区域和运费模板
|
778
|
-
if (product.
|
778
|
+
if (product.regions_Parent && product.regions_Parent.length > 0 &&
|
779
779
|
product.shippingTemplates && product.shippingTemplates.length > 0) {
|
780
780
|
try {
|
781
781
|
// 获取运费信息
|
782
|
-
const shippingInfo = await this.
|
782
|
+
const shippingInfo = await this.getShippingInfo01(product.platformId);
|
783
783
|
// 为每个运费模板添加规则
|
784
784
|
product.shippingTemplates = product.shippingTemplates.map(template => {
|
785
785
|
const matchingTemplate = shippingInfo.templates.find(t => t.templateId === template.templateId);
|
@@ -1414,6 +1414,9 @@ class ProductsAPI {
|
|
1414
1414
|
const config = this.client.getConfig();
|
1415
1415
|
return this.client.request(`/tax/platform-${config.platformId}.json`);
|
1416
1416
|
}
|
1417
|
+
async getTaxInfo01(platformId) {
|
1418
|
+
return this.client.request(`/tax/platform-${platformId}.json`);
|
1419
|
+
}
|
1417
1420
|
/**
|
1418
1421
|
* 9. 获取运费信息
|
1419
1422
|
* 获取平台的所有运费模板和规则
|
@@ -1422,6 +1425,9 @@ class ProductsAPI {
|
|
1422
1425
|
const config = this.client.getConfig();
|
1423
1426
|
return this.client.request(`/shipping/platform-${config.platformId}.json`);
|
1424
1427
|
}
|
1428
|
+
async getShippingInfo01(platformId) {
|
1429
|
+
return this.client.request(`/shipping/platform-${platformId}.json`);
|
1430
|
+
}
|
1425
1431
|
/**
|
1426
1432
|
* 10. 获取区域信息
|
1427
1433
|
* 获取平台的所有区域信息,包括层级结构
|