react native map函数遍历数据及其布局

分析数据

var newGoodsList=[
        { "goodCmtCount": 0, "couponConflict": true, "scenePicUrl": "https://yanxuan-item.nosdn.127.net/cb49a9c6b210f0fe4a55939e35ba92ad.jpg", "listPicUrl": "https://yanxuan-item.nosdn.127.net/a4aa937602c5ad5bd50fbc4fe825875f.png", "tagId": 0, "simpleDesc": "1秒速热,手暖不冰冷", "primarySkuPreSellPrice": 99.00, "promTag": "暖冬特惠", "limitedFlag": 203, "newItemFlag": false, "showPicUrl": "https://yanxuan-item.nosdn.127.net/12ab3d518b6b97cdf916a43d41b72bab.png", "itemTagList": [{ "itemId": 3842014, "tagId": 128113086, "freshmanExclusive": false, "name": "暖冬特惠", "subType": 203, "forbidJump": false, "type": 2 }], "primarySkuPreSellStatus": 1, "pieceNum": 0, "extra": { "resource": { "materialType": "商品id", "materialId": "54635643", "itemId": "3842014", "materialContentFrom": 1, "materialName": "高颜值萌宠暖手宝", "rcmdSort": false, "taskType": 1, "itemFrom": 0, "crmUserGroupName": "", "resourcesId": 1, "itemIdList": ["3842014"], "crmUserGroupId": "0", "taskId": "54643570" }, "modelType": 1 }, "listPromBanner": { "valid": true, "styleType": 0, "bannerContentUrl": "https://yanxuan.nosdn.127.net/73de0050620397b41099c356292b28c8.png", "promoTitle": "暖冬特惠", "promoSubTitle": "¥79起", "timeType": 0, "bannerTitleUrl": "https://yanxuan.nosdn.127.net/ce3597696f4c886d1d81a7d94f8cfe6e.png", "content": "限800件 仅剩1天" }, "id": 3842014, "sellVolume": 584, "isCouponConflict": true, "colorNum": 2, "primaryPicUrl": "https://yanxuan-item.nosdn.127.net/12ab3d518b6b97cdf916a43d41b72bab.png", "displaySkuId": 300187493, "pieceUnitDesc": "件", "resourcesId": 0, "discountFlag": false, "name": "高颜值萌宠暖手宝", "productPlace": "", "counterPrice": 99.00, "couponPrice": 0, "cutFlag": false, "retailPrice": 79, "primary": true, "status": 2 },
        { "goodCmtCount": 0, "couponConflict": true, "scenePicUrl": "https://yanxuan-item.nosdn.127.net/65bf079a56f4e0cf9aa22c0dc707a1d7.jpg", "listPicUrl": "https://yanxuan-item.nosdn.127.net/87eb4a0e4d38c000d25366ef83fe1282.png", "tagId": 0, "simpleDesc": "软滑多汁,鲜甜可口", "primarySkuPreSellPrice": 0, "promTag": "好货内部价", "limitedFlag": 204, "newItemFlag": true, "showPicUrl": "https://yanxuan-item.nosdn.127.net/93057264fb0201548f78043c0d02ddfb.png", "itemTagList": [{ "itemId": 3987527, "tagId": 0, "freshmanExclusive": false, "name": "新品", "subType": 0, "forbidJump": false, "type": 1 }, { "itemId": 3987527, "tagId": 128111314, "freshmanExclusive": false, "name": "好货内部价", "subType": 204, "forbidJump": false, "type": 2 }], "primarySkuPreSellStatus": 0, "pieceNum": 0, "extra": { "resource": { "materialType": "商品id", "materialId": "54637411", "itemId": "3987527", "materialContentFrom": 1, "materialName": "浅尝即心动,月露蜜瓜 2个", "rcmdSort": false, "taskType": 1, "itemFrom": 0, "crmUserGroupName": "", "resourcesId": 2, "itemIdList": ["3987527"], "crmUserGroupId": "0", "taskId": "54643571" }, "modelType": 1 }, "listPromBanner": { "valid": true, "styleType": 0, "bannerContentUrl": "https://yanxuan.nosdn.127.net/73de0050620397b41099c356292b28c8.png", "promoTitle": "好货内部价", "promoSubTitle": "¥75", "timeType": 0, "bannerTitleUrl": "https://yanxuan.nosdn.127.net/ce3597696f4c886d1d81a7d94f8cfe6e.png", "content": "仅剩2天" }, "id": 3987527, "sellVolume": 232, "isCouponConflict": true, "colorNum": 0, "primaryPicUrl": "https://yanxuan-item.nosdn.127.net/93057264fb0201548f78043c0d02ddfb.png", "displaySkuId": 300191788, "pieceUnitDesc": "件", "resourcesId": 0, "discountFlag": false, "name": "浅尝即心动,月露蜜瓜 2个", "productPlace": "", "counterPrice": 99.00, "couponPrice": 0, "cutFlag": false, "retailPrice": 75, "primary": true, "status": 2 },
        { "goodCmtCount": 0, "couponConflict": false, "scenePicUrl": "https://yanxuan-item.nosdn.127.net/38a6b2cec23ca66d9e695141fb5468c5.jpg", "listPicUrl": "https://yanxuan-item.nosdn.127.net/2004b5743f48f9217f28ef18dff53abf.png", "tagId": 0, "simpleDesc": "上等品质,纯粹本真", "primarySkuPreSellPrice": 0, "limitedFlag": 0, "newItemFlag": false, "showPicUrl": "https://yanxuan-item.nosdn.127.net/7f4a74c400ee527d815974432a2d7789.png", "itemTagList": [{ "itemId": 3857006, "tagId": 128113114, "freshmanExclusive": false, "name": "满折", "subType": 109, "forbidJump": false, "type": 2 }], "primarySkuPreSellStatus": 0, "pieceNum": 0, "extra": { "resource": { "materialType": "商品id", "materialId": "54637131", "itemId": "3857006", "materialContentFrom": 1, "materialName": "祺宴 坚果果干礼盒1.15千克", "rcmdSort": false, "taskType": 1, "itemFrom": 0, "crmUserGroupName": "", "resourcesId": 3, "itemIdList": ["3857006"], "crmUserGroupId": "0", "taskId": "54643572" }, "modelType": 1 }, "id": 3857006, "sellVolume": 8083, "isCouponConflict": false, "colorNum": 0, "primaryPicUrl": "https://yanxuan-item.nosdn.127.net/7f4a74c400ee527d815974432a2d7789.png", "displaySkuId": 300088010, "pieceUnitDesc": "件", "featuredSeries": { "showFeatureSeriesNameFlag": false, "seriesDesc": "2020年货系列", "name": "2020年货系列", "videoShowPicUrl": "https://yanxuan.nosdn.127.net/9f02b6f77f8a26074efb865255f74ef8.jpg", "iconUrl": "https://yanxuan.nosdn.127.net/9a2722b00af634328125c1ee6d9676bb.png", "id": 1000064, "seriesStory": "为年节送礼开发的系列产品,礼盒包装,送人彰显心意。", "detailPicUrl": "https://yanxuan.nosdn.127.net/7be0696fdc6aaf92250711b5ba033749.jpg" }, "resourcesId": 0, "discountFlag": false, "name": "祺宴 坚果果干礼盒1.15千克", "productPlace": "", "couponPrice": 0, "cutFlag": false, "retailPrice": 259.00, "primary": true, "status": 2 },
        { "goodCmtCount": 0, "couponConflict": true, "scenePicUrl": "https://yanxuan-item.nosdn.127.net/736123b4929580cf7a8a640cbbf372cc.jpg", "listPicUrl": "https://yanxuan-item.nosdn.127.net/61e62a52cc8914a6e2f99b1d9127c6de.png", "tagId": 0, "simpleDesc": "咕噜噜,一只饱满松果滚进杯子里~", "primarySkuPreSellPrice": 118.00, "promTag": "新品尝鲜价", "limitedFlag": 203, "newItemFlag": false, "showPicUrl": "https://yanxuan-item.nosdn.127.net/85950caa29fe56e586fe430bb0fc317a.png", "itemTagList": [{ "itemId": 3885045, "tagId": 128111282, "freshmanExclusive": false, "name": "新品尝鲜价", "subType": 203, "forbidJump": false, "type": 2 }], "primarySkuPreSellStatus": 1, "pieceNum": 0, "extra": { "resource": { "materialType": "商品id", "materialId": "54635951", "itemId": "3885045", "materialContentFrom": 1, "materialName": "嗨,小松塔 松果星球双层耐热玻璃杯", "rcmdSort": false, "taskType": 1, "itemFrom": 0, "crmUserGroupName": "", "resourcesId": 4, "itemIdList": ["3885045"], "crmUserGroupId": "0", "taskId": "54638197" }, "modelType": 1 }, "listPromBanner": { "valid": true, "styleType": 0, "bannerContentUrl": "https://yanxuan.nosdn.127.net/73de0050620397b41099c356292b28c8.png", "promoTitle": "新品尝鲜价", "promoSubTitle": "¥88起", "timeType": 0, "bannerTitleUrl": "https://yanxuan.nosdn.127.net/ce3597696f4c886d1d81a7d94f8cfe6e.png", "content": "限1200件 仅剩1天" }, "id": 3885045, "sellVolume": 387, "isCouponConflict": true, "colorNum": 0, "primaryPicUrl": "https://yanxuan-item.nosdn.127.net/85950caa29fe56e586fe430bb0fc317a.png", "displaySkuId": 300189199, "pieceUnitDesc": "件", "featuredSeries": { "showFeatureSeriesNameFlag": false, "seriesDesc": "原创设计圣诞系列", "name": "2019圣诞系列", "videoShowPicUrl": "https://yanxuan.nosdn.127.net/9d9acbef71b8fda0b5fa7041ae76a51e.jpg", "iconUrl": "https://yanxuan.nosdn.127.net/d8dfff90fa87aa7f56b020df7a1cf3a8.jpg", "id": 1000060, "seriesStory": "2019圣诞系列以松果宇宙为主题,守护温暖冬季。", "detailPicUrl": "https://yanxuan.nosdn.127.net/5449069431f791bd67245425f07f75e8.jpg" }, "resourcesId": 0, "discountFlag": false, "name": "嗨,小松塔 松果星球双层耐热玻璃杯", "productPlace": "", "counterPrice": 118.00, "couponPrice": 0, "cutFlag": false, "retailPrice": 88, "primary": true, "status": 2 },
        { "goodCmtCount": 0, "couponConflict": true, "scenePicUrl": "https://yanxuan-item.nosdn.127.net/81ae3998a574c79bd9e8d0ffb81b3530.png", "listPicUrl": "https://yanxuan-item.nosdn.127.net/1377e19f267b46afa79c42db9a0cb25d.png", "tagId": 1080000, "simpleDesc": "网罗全球小食 一把过足瘾", "primarySkuPreSellPrice": 0, "promTag": "新品尝鲜价", "limitedFlag": 203, "newItemFlag": true, "showPicUrl": "https://yanxuan-item.nosdn.127.net/3693368efa6dd48d59ccf9bd14939e65.png", "itemTagList": [{ "itemId": 3987832, "tagId": 0, "freshmanExclusive": false, "name": "新品", "subType": 0, "forbidJump": false, "type": 1 }, { "itemId": 3987832, "tagId": 128113059, "freshmanExclusive": false, "name": "新品尝鲜价", "subType": 203, "forbidJump": false, "type": 2 }], "primarySkuPreSellStatus": 0, "pieceNum": 0, "extra": { "resource": { "materialType": "商品id", "materialId": "54637491", "itemId": "3987832", "materialContentFrom": 1, "materialName": "开启世界美食之旅 年货零食大礼包", "rcmdSort": false, "taskType": 1, "itemFrom": 0, "crmUserGroupName": "", "resourcesId": 5, "itemIdList": ["3987832"], "crmUserGroupId": "0", "taskId": "54638198" }, "modelType": 1 }, "listPromBanner": { "valid": true, "styleType": 0, "bannerContentUrl": "https://yanxuan.nosdn.127.net/73de0050620397b41099c356292b28c8.png", "promoTitle": "新品尝鲜价", "promoSubTitle": "¥89起", "timeType": 0, "bannerTitleUrl": "https://yanxuan.nosdn.127.net/ce3597696f4c886d1d81a7d94f8cfe6e.png", "content": "限1100件 仅剩1天" }, "id": 3987832, "sellVolume": 919, "isCouponConflict": true, "colorNum": 0, "primaryPicUrl": "https://yanxuan-item.nosdn.127.net/3693368efa6dd48d59ccf9bd14939e65.png", "displaySkuId": 300193815, "tagName": "海外制造商", "pieceUnitDesc": "件", "resourcesId": 0, "discountFlag": false, "name": "开启世界美食之旅 年货零食大礼包", "productPlace": "", "counterPrice": 99.00, "couponPrice": 0, "cutFlag": false, "retailPrice": 89, "primary": true, "status": 2 },
        { "goodCmtCount": 0, "couponConflict": true, "scenePicUrl": "https://yanxuan-item.nosdn.127.net/aa195ae326985a8d4bc61b34b9bfa81f.jpg", "listPicUrl": "https://yanxuan-item.nosdn.127.net/9e6b05025d4ed71d655ea754e82e814f.png", "tagId": 0, "simpleDesc": "日本进口染发膏,2019年流行色号", "primarySkuPreSellPrice": 0, "limitedFlag": 204, "newItemFlag": true, "showPicUrl": "https://yanxuan-item.nosdn.127.net/364bb4175dd73987f11dc1a701e28a2f.png", "itemTagList": [{ "itemId": 3986552, "tagId": 0, "freshmanExclusive": false, "name": "新品", "subType": 0, "forbidJump": false, "type": 1 }, { "itemId": 3986552, "tagId": 128111261, "freshmanExclusive": false, "name": "特价", "subType": 204, "forbidJump": false, "type": 2 }], "primarySkuPreSellStatus": 0, "pieceNum": 0, "extra": { "resource": { "materialType": "商品id", "materialId": "54637295", "itemId": "3986552", "materialContentFrom": 1, "materialName": "日本制造 免调和遮白染发膏", "rcmdSort": false, "taskType": 1, "itemFrom": 0, "crmUserGroupName": "", "resourcesId": 6, "itemIdList": ["3986552"], "crmUserGroupId": "0", "taskId": "54643573" }, "modelType": 1 }, "id": 3986552, "sellVolume": 3381, "isCouponConflict": true, "colorNum": 0, "primaryPicUrl": "https://yanxuan-item.nosdn.127.net/364bb4175dd73987f11dc1a701e28a2f.png", "displaySkuId": 300189350, "pieceUnitDesc": "件", "resourcesId": 0, "discountFlag": false, "name": "日本制造 免调和遮白染发膏", "productPlace": "", "counterPrice": 79.00, "couponPrice": 0, "cutFlag": false, "retailPrice": 73, "primary": true, "status": 2 },
        { "goodCmtCount": 0, "couponConflict": true, "scenePicUrl": "https://yanxuan-item.nosdn.127.net/95a93761176364b5b946dbfb26b96a6b.jpeg", "listPicUrl": "https://yanxuan-item.nosdn.127.net/705cc62045723af3067d433a107144a7.png", "tagId": 0, "simpleDesc": "大雾量横扫室内干燥,你的冬季水润伴侣。", "primarySkuPreSellPrice": 0, "limitedFlag": 0, "newItemFlag": false, "showPicUrl": "https://yanxuan-item.nosdn.127.net/49c844a7c8d0db8fcec74b371b5f2ffb.png", "itemTagList": [], "primarySkuPreSellStatus": 0, "pieceNum": 0, "extra": { "resource": { "materialType": "商品id", "materialId": "54636754", "itemId": "3986413", "materialContentFrom": 1, "materialName": "热雾SPA日式大容量加湿器", "rcmdSort": false, "taskType": 1, "itemFrom": 0, "crmUserGroupName": "", "resourcesId": 7, "itemIdList": ["3986413"], "crmUserGroupId": "0", "taskId": "54643574" }, "modelType": 1 }, "id": 3986413, "sellVolume": 1301, "isCouponConflict": true, "colorNum": 0, "primaryPicUrl": "https://yanxuan-item.nosdn.127.net/49c844a7c8d0db8fcec74b371b5f2ffb.png", "displaySkuId": 300186770, "pieceUnitDesc": "件", "resourcesId": 0, "discountFlag": false, "name": "热雾SPA日式大容量加湿器", "productPlace": "", "couponPrice": 0, "cutFlag": false, "retailPrice": 249.00, "primary": true, "status": 2 },
        { "goodCmtCount": 0, "couponConflict": true, "scenePicUrl": "https://yanxuan-item.nosdn.127.net/7017fcf6257dff4dba4647d20851db80.png", "listPicUrl": "https://yanxuan-item.nosdn.127.net/4bef21cf6936779fb98405e9b686ddd1.png", "tagId": 0, "simpleDesc": "含春联*1、红包*10、福字*3、窗贴*2", "primarySkuPreSellPrice": 0, "promTag": "圣诞特惠", "limitedFlag": 204, "newItemFlag": true, "itemTagList": [{ "itemId": 3986327, "tagId": 0, "freshmanExclusive": false, "name": "新品", "subType": 0, "forbidJump": false, "type": 1 }, { "itemId": 3986327, "tagId": 128113021, "freshmanExclusive": false, "name": "圣诞特惠", "subType": 204, "forbidJump": false, "type": 2 }], "primarySkuPreSellStatus": 0, "pieceNum": 0, "extra": { "modelType": 3 }, "id": 3986327, "sellVolume": 2391, "isCouponConflict": true, "colorNum": 0, "primaryPicUrl": "https://yanxuan-item.nosdn.127.net/40b2a28283a29bc91dc2acaba0ad2d3e.png", "displaySkuId": 300186535, "pieceUnitDesc": "件", "featuredSeries": { "showFeatureSeriesNameFlag": false, "seriesDesc": "2020年货系列", "name": "2020年货系列", "videoShowPicUrl": "https://yanxuan.nosdn.127.net/9f02b6f77f8a26074efb865255f74ef8.jpg", "iconUrl": "https://yanxuan.nosdn.127.net/9a2722b00af634328125c1ee6d9676bb.png", "id": 1000064, "seriesStory": "为年节送礼开发的系列产品,礼盒包装,送人彰显心意。", "detailPicUrl": "https://yanxuan.nosdn.127.net/7be0696fdc6aaf92250711b5ba033749.jpg" }, "resourcesId": 0, "discountFlag": false, "name": "“万象新春”颐和园年物礼盒", "productPlace": "", "counterPrice": 58.00, "couponPrice": 49, "cutFlag": false, "retailPrice": 49, "primary": false, "status": 2 }
    ],

遍历数据

class New extends React.Component{


    render() {
        return(

                <View>
                    <View style={{flex:1,alignItems: "center",flexDirection:'row', justifyContent: "center",height: 50,backgroundColor: "#fff"}}>
                            <Text className="txt">周一周四 · 新品首发</Text>
                    </View>
                <View style={styles.aNewB}>
                    {
                        newGoodsList.map((item)=>{
                            return(
                                <View style={styles.aNewBItem} key={item.id}>
                                    <Image style={{width:"100%",height:'100%'}} source`在这里插入代码片`={{uri:item.listPicUrl}} background-size="cover"/>
                                    <Text style={styles.aNewBName}>{item.name}</Text>
                                    <Text style={styles.aNewBPrice}>¥{item.retailPrice}</Text>
                                </View>
                            )
                        })
                    }
                </View>
            </View>
        )
    }
}

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 206,126评论 6 481
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 88,254评论 2 382
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 152,445评论 0 341
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 55,185评论 1 278
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 64,178评论 5 371
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,970评论 1 284
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,276评论 3 399
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,927评论 0 259
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 43,400评论 1 300
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,883评论 2 323
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,997评论 1 333
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,646评论 4 322
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,213评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,204评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,423评论 1 260
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 45,423评论 2 352
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,722评论 2 345

推荐阅读更多精彩内容