Created
June 14, 2019 10:59
-
-
Save limichange/b38145cbc9b9fea105abd281cd7884ac to your computer and use it in GitHub Desktop.
处理淘宝价格数据
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const skuBase = _DATA_Detail.skuBase | |
const sku2info = a.sku2info | |
let result = '' | |
skuBase.props[0].values.forEach(type => { | |
const vid = type.vid | |
const { skuId } = skuBase.skus.find(item => { | |
return item.propPath.split(':')[1] === vid.toString() | |
}) | |
result += (type.name + '\t' + sku2info[skuId].price.priceText + '\n') | |
}) | |
console.log(result) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment