Skip to content

Instantly share code, notes, and snippets.

@limichange
Created June 14, 2019 10:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save limichange/b38145cbc9b9fea105abd281cd7884ac to your computer and use it in GitHub Desktop.
Save limichange/b38145cbc9b9fea105abd281cd7884ac to your computer and use it in GitHub Desktop.
处理淘宝价格数据
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