src/cainiaoTracker.js
function createCainiaoEntity(id, json) {

    let section = json.data[0].section3 || json.data[0].section2;
    let msgs = section.detailList.map(m => {
        return {
            state: fixStateName(m.desc),
            date: moment.tz(m.time, "YYYY-MM-DD HH:mm:ss", zone).format()
        }
    })

    let destinyId = json.data[0].section2.mailNo || null

    return new CainiaoInfo(id, msgs, destinyId)
}
function createCainiaoEntity(id, json) {

    let section = json.data[0].section3 || json.data[0].section2;
    let msgs = section.detailList.map(m => {
        return {
            state: fixStateName(m.desc),
            date: moment.tz(m.time, "YYYY-MM-DD HH:mm:ss", zone).format()
        }
    })

    let destinyId = json.data[0].section2.mailNo || null

    return new CainiaoInfo(id, msgs, destinyId)
}
function createCainiaoEntity ( id , json ) { let section = json . data [ 0 ] . section3 || json . data [ 0 ] . section2 ; let msgs = section . detailList . map ( m => { return { state : fixStateName ( m . desc ) , date : moment . tz ( m . time , "YYYY-MM-DD HH:mm:ss" , zone ) . format ( ) } } ) let destinyId = json . data [ 0 ] . section2 . mailNo || null return new CainiaoInfo ( id , msgs , destinyId ) }
Create cainiao entity from html
@param id
@param json
Create cainiao entity from html