Category attribute weights and measures


In order to standardize standard unit parameters, such as weight, volume, length and other attributes, Taobao launched the weights and measures project.

Follow-up taobao.itemcats.get and taobao.itemprops.get will increase field to obtain weights and measures information.

1, Category interface : taobao.itemcats.get, add a field:

1.1 taosir_cat: Whether it is a weights and measures category, true: yes; false: no.

Case:

{
    "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, Category attribute interface: taobao.itemprops.get, add two field.

2.1 is_taosirWhether it is a measurement attribute, true is; false is no.

2.2 taosir_do:Weights and measures information;

2.2.1       precision: Numerical decimal point precision.

2.2.2         type: Time type: 0 means non-time, 1 means time point, 2 means time range.

2.2.3 std_unit_list: Unit list, attr_key is the unit ID, attr_value is the unit name.

2.2.4        expr_el_list: Expression element list, if it is not an expression weight and measure, there is no this field ;

2.2.4.1 type:Element type

2.2.4.2 text:Show text

##2.2.4.3 isShowLabel: Whether it is only used for display label elements

2.2.4.4 isLabel: The label element used to display and assemble value_data

2.2.4.5 isInput: Whether it is a normal input box

2.2.4.6 Case description: The expression is . After the seller inputs 4, 5, and 6 respectively, it needs to be assembled into 4X5X6, plus the unit selected by the seller (for example: cm) , assembled into 4X5X6cm for product release. Then the type of the "long" element is isShowLabel; the type of the input box is isInput; and the type of "X" is isLabel.

Case:

{
    "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, Case description, enumeration type weights and measures attribute items and ordinary attribute items Same, without any special logic. Mainly for non-enumeration type attribute items (is_enum_prop==false or is_input_prop==true), the text input by the seller is formatted.

##3.1 General weights and measures attribute items , that is, an input box and a unit selection drop-down box

3.1.1 The taosir_cat field value in the result returned by the taobao.itemcats.get interface is true;

3.1.2 taobao.itemprops.getThe interface returns the following results:

3.1.2 taobao.itemprops.getTB11w_9GFXXXXciaXXXwu0bFXXX.png

## 3.1.3

The page interaction effect is as shown in the figure: , the seller enters the value 200, and after selecting the unit g, it is assembled into TB1.gxCHXXXXXXxXFXXwu0bFXXX.png200g The text input by the seller is passed to the product release interface, that is, the input parameter.

3.2 Expression weights and measures, that is, multiple input boxes and a unit selection drop-down box

3.2.1 taobao The value of the taosir_cat field in the result returned by the .itemcats.get interface is true;

3.2.2 The result returned by the taobao.itemprops.get interface is as follows :

TB171NGHXXXXXcNXXXXwu0bFXXX.png

3.2.3 The page interaction effect is as shown in the figure: TB1Y24uHXXXXXb2aXXXwu0bFXXX.png, the seller enters the values ​​​​3, 4, and 5 respectively, and selects the unit m, then Assemble 3X4X5m as the text input by the seller and pass it to the product release interface, that is, enter the parameters.

# 3.3 Point-in-Time Weights and Measures, divided into 6 types: year, year, month, year, month, day, year, month, day, hour, year, month, day, hour, and year, month, day, minute, and second.

3.3.1 taobao.itemcats.getThe taosir_cat field value in the result returned by the interface is true;

3.3. 2 The taobao.itemprops.get interface returns the following results: TB1t7dFHXXXXXXVXpXXwu0bFXXX.png

3.3.3 The page interaction effect is as shown in the figure: , the seller enters the numerical value 2014, 12, 1, 9, 30, 0, then assemble into ##2014-12-01 9:30:00 The text input by the seller is passed to the product release interface, that is, it is entered as a parameter.

## 3.4

Time Interval Measurement, divided into 6 types: year, year, month, year, month, day, year, month, day, hour, year, month, day, hour, and year, month, day, minute, and second.

3.4.1 taobao.itemcats.get

The value of the taosir_cat field in the result returned by the interface is true;

3.4.2 The taobao.itemprops.get interface returns the following results:

TB1cNFHHXXXXXa7XXXXwu0bFXXX.png

## 3.4.3 page The interaction effect is as shown in the figure: , the seller inputs the values ​​​​2014, 12, 2015, 2 respectively, then it is assembled into 2014-12 to 2015-02 and is passed as the text input by the seller Product release interface, that is, input parameters.

FAQ

    There is no FAQ about this document