類目屬性度量衡


 為了規範標準單位參數,如重量、容積、長度等屬性,淘寶啟動了度量衡項目。

1 後續taobao.itemcats.get

#taobao.itemcats.get 和taobao.itemprops.get  會增加字段,來取得度量衡資訊。 1、

類別目介面:taobao.itemcats.get,增加一個欄位:1.1 

taosir_cat:是否測量衡類目, true:是;false:否。

案例:

#
{
    "itemcats_get_response": {
        "item_cats": {
            "item_cat": [
                {
                    "cid": 134852557,
                    "is_parent": false,
                    "name": "度量衡测试类目1",
                    "parent_cid": 134846593,
                    "taosir_cat": false
                },
                {
                    "cid": 134846594,
                    "is_parent": false,
                    "name": "度量衡测试子类目2",
                    "parent_cid": 134846593,
                    "taosir_cat": true
                }
            ]
        }
    }
}

 2、

#######類別目屬性介面###:taobao.itemprops.get,增加兩個字段。 ######

2.1  is_taosir是否測量衡屬性,true 是;false 否。

2.2  #taosir_do##:度量衡資訊;

#2.2.1      #precision:數值小數點精確度。

2.2.2      #type:時間類型:0表示非時間,1表示時間點,2表示時間範圍。

2.2.3      std_unit_list:單位列表,attr_key為單位ID,attr_value為單位名稱。

2.2.4      expr_el_list:表達式元素列表,若不是表達式度量衡,則沒有該字段;

2.2.4.1   type:元素型別

##2.2.4.2   text:顯示文字

2.2.4.3   isShowLabel:是否只用於顯示的label元素#

2.2.4.4   isLabel:即用於顯示又用於組裝value_data的label元素

#2.2.4.5   isInput:一般輸入方塊是否使用

##2.2.4.6   案例說明:表達式為,賣家分別輸入4、5、6之後,需組裝成4X5X6,再加上賣家選擇的單位(例如:cm) ,組裝成4X5X6cm進行商品發布。那麼「長」這個元素的型別就是isShowLabel;輸入框的型別就是isInput;「X」的型別就是isLabel。

案例:

{
    "itemprops_get_response": {
        "item_props": {
            "item_prop": [
                {
                    "is_taosir": true,
                    "is_enum_prop": false,
                    "must": false,
                    "name": "净含量",
                    "pid": 145998403,
                    "taosir_do": {
                        "precision": 2,
                        "std_unit_list": {
                            "std_unit": [
                                {
                                    "attr_key": "34",
                                    "attr_value": "g"
                                },
                                {
                                    "attr_key": "35",
                                    "attr_value": "mg"
                                }
                            ]
                        },
                        "type": 0
                    }
                },
                {
                    "is_taosir": true,
                    "is_enum_prop": false,
                    "must": false,
                    "name": "尺寸",
                    "pid": 145994486,
                    "taosir_do": {
                        "expr_el_list": {
                           "expr_el": [
                                {
                                    "is_input": false,
                                    "is_label": false,
                                    "is_show_label": true,
                                    "text": "长",
                                    "type": 0
                                },
                                {
                                    "is_input": true,
                                    "is_label": false,
                                    "is_show_label": false,
                                    "type": 2
                                },
                                {
                                    "is_input": false,
                                    "is_label": true,
                                    "is_show_label": false,
                                    "text": "X",
                                    "type": 1
                                },
                                {
                                    "is_input": false,
                                    "is_label": false,
                                    "is_show_label": true,
                                    "text": "高",
                                    "type": 0
                                },
                                {
                                    "is_input": true,
                                    "is_label": false,
                                    "is_show_label": false,
                                    "type": 2
                                },
                                {
                                    "is_input": false,
                                    "is_label": true,
                                    "is_show_label": false,
                                    "text": "X",
                                    "type": 1
                                },
                                {
                                    "is_input": false,
                                    "is_label": false,
                                    "is_show_label": true,
                                    "text": "宽",
                                    "type": 0
                                },
                                {
                                    "is_input": true,
                                    "is_label": false,
                                    "is_show_label": false,
                                    "type": 2
                                }
                            ]
                        },
                        "precision": 2,
                        "std_unit_list": {
                            "std_unit": [
                                {
                                    "attr_key": "1",
                                    "attr_value": "m"
                                }
                            ]
                        },
                        "type": 0
                    }
                },
                {
                    "is_taosir": true,
                    "is_enum_prop": false,
                    "must": false,
                    "name": "有效期",
                    "pid": 146000464,
                    "taosir_do": {
                        "expr_el_list": {
                            "expr_el": [
                                {
                                    "is_input": true,
                                    "is_label": false,
                                    "is_show_label": false,
                                    "type": 2
                                },
                                {
                                    "is_input": false,
                                    "is_label": true,
                                    "is_show_label": false,
                                    "text": "至",
                                    "type": 1
                                },
                                {
                                    "is_input": true,
                                    "is_label": false,
                                    "is_show_label": false,
                                    "type": 2
                                }
                            ]
                        },
                        "precision": 0,
                        "std_unit_list": {
                            "std_unit": [
                                {
                                    "attr_key": "10001",
                                    "attr_value": "年"
                                }
                            ]
                        },
                        "type": 2
                    }
                },
                {
                    "is_taosir": true,
                    "is_enum_prop": true,
                    "must": false,
                    "name": "规格",
                    "pid": 145998404,
                    "prop_values": {
                        "prop_value": [
                            {
                                "name": "2X500克",
                                "vid": 144646466
                            },
                            {
                                "name": "3X1.5千克",
                                "vid": 144648454
                            }
                        ]
                    },
                    "taosir_do": {
                        "expr_el_list": {
                            "expr_el": [
                                {
                                    "is_input": false,
                                    "is_label": false,
                                    "is_show_label": true,
                                    "text": "盒",
                                    "type": 0
                                },
                                {
                                    "is_input": true,
                                    "is_label": false,
                                    "is_show_label": false,
                                    "type": 2
                                },
                                {
                                    "is_input": false,
                                    "is_label": true,
                                    "is_show_label": false,
                                    "text": "X",
                                    "type": 1
                                },
                                {
                                    "is_input": false,
                                    "is_label": false,
                                    "is_show_label": true,
                                    "text": "克",
                                    "type": 0
                                }
                            ]
                        },
                        "precision": 2,
                        "std_unit_list": {
                            "std_unit": [
                                {
                                    "attr_key": "35",
                                    "attr_value": "毫克"
                                }
                            ]
                        },
                        "type": 0
                    }
                },
                {
                    "is_taosir": false,
                    "is_enum_prop": true,
                    "must": false,
                    "name": "品牌",
                    "pid": 22370001,
                    "prop_values": {
                        "prop_value": [
                            {
                                "name": "安耐晒",
                                "vid": 3327418
                            },
                            {
                                "name": "欧碧泉",
                                "vid": 142280368
                            },
                            {
                                "name": "美宝莲",
                                "vid": 3316230
                            }
                        ]
                    },
                    "taosir_do": {}
                }
            ]
        }
    }
}


3、 案例說明,枚舉類型的度量衡屬性項與普通屬性項一樣,沒有任何特殊邏輯。主要針對非枚舉類型的屬性項目(is_enum_prop==false或is_input_prop==true),賣家輸入的文字做格式校驗。

#3.1 普通度量衡屬性項,即一個輸入框,一個單位選擇下拉框

        3.1.1 taobao.itemcats.get介面傳回結果中taosir_cat欄位值為true;

        3.1.2 taobao.itemprops.get介面回傳結果如下:

        TB11w_9GFXXXXciaXXXwu0bFXXX.png

#        TB1.gxCHXXXXXXxXFXXwu0bFXXX.png#== ##        3.1.3 頁面互動效果如圖:,賣家輸入數值200,選擇單位g後,則組裝成

200g 作為賣家輸入的文字傳給商品發布接口,即入參。

###############

3.2 表達式度量衡,即多個輸入框,一個單位選擇下拉框

3.2.1 taobao .itemcats.get介面傳回結果中taosir_cat欄位值為true;

         3.2.2 taobao.itemprops.get#介面結果如下所示:

TB171NGHXXXXXcNXXXXwu0bFXXX.png

3.2.3 頁面互動效果如圖:TB1Y24uHXXXXXb2aXXXwu0bFXXX.png,賣家分別輸入數值3、4、5,選擇單位m,則組裝成3X4X5m作為賣家輸入的文字傳給商品發布接口,即入參。

#  3.3 時間點度量衡,分為6種,分別為:年、年月、年月日、年月日時、年月日時分、年月日時分秒。

      3.3.1 taobao.itemcats.get介面回傳結果中taosir_cat欄位值為true;

      3.3. 2 taobao.itemprops.get介面回傳結果如下:

TB1t7dFHXXXXXXVXpXXwu0bFXXX.png

      3.3.3 #頁面互動效果如圖:,賣家分別輸入數值#2014 #、1219# 300,則組裝成2014-12-01 9:30:00 作為賣家輸入的文字傳給商品發布接口,即入參。

# 3.4 時間區間度量衡,分為6種,分別為:年、年月、年月日、年月日時、年月日時分、年月日時分秒。

     3.4.1 taobao.itemcats.get介面回傳結果中taosir_cat欄位值為true;

     3.4.2 taobao.itemprops.get介面回傳結果如下:

TB1cNFHHXXXXXa7XXXXwu0bFXXX.png

     3.4.3#頁互動效果如圖:,賣家分別輸入數值2014、12、2015、2,則組裝成2014-12至2015-02#作為賣家輸入的文字傳給商品發布接口,即入參。

 

FAQ

  • #關於此文件暫時還沒有FAQ