NutzCN Logo
问答 JS数组 组合方式 在线求写法!!
发布于 3185天前 作者 大鲨鱼 2015 次浏览 复制 上一个帖子 下一个帖子
标签:

var arr=[["颜色:白色","颜色:黑色"],["尺码:10","尺码:20"],["材质:钻石","材质:水晶","材质:玛瑙"]];

js 写12组 组合怎么写?在线求,困扰我2天了

升级版:

var spec=[[{"spec_name":"颜色","spec_type":"1","spec_id":"5","spec_value_id":"11","spec_value_name":"白色"},{"spec_name":"颜色","spec_type":"1","spec_id":"5","spec_value_id":"12","spec_value_name":"黑色"}],[{"spec_name":"尺码","spec_type":"0","spec_id":"6","spec_value_id":"9","spec_value_name":"10"},{"spec_name":"尺码","spec_type":"0","spec_id":"6","spec_value_id":"10","spec_value_name":"20"}],[{"spec_name":"材质","spec_type":"0","spec_id":"7","spec_value_id":"13","spec_value_name":"钻石"},{"spec_name":"材质","spec_type":"0","spec_id":"7","spec_value_id":"14","spec_value_name":"水晶"},{"spec_name":"材质","spec_type":"0","spec_id":"7","spec_value_id":"15","spec_value_name":"玛瑙"}]]

最终结果就是输出12种商品组合。。。。

添加回复
请先登陆
回到顶部