一个数据格式是这样的:
a:[
[{id: "12", lottery_id: "1", type_id: "37", type: "commodity", image: "XX.png"}],
[{id: "11", lottery_id: "1", type_id: "37", type: "commodity", image: "XX.png"}],
]
把他转换成这样
b:[
{ fonts: [{ text: '0', top: '10%', id: "12", lottery_id: "1",}],image: "XX.png" },
{ fonts: [{ text: '1', top: '10%', id: "11", lottery_id: "2",}],image: "XX.png" },
]
用JS需要怎么做?