1. 需要把价格用parseFloat转成浮点数 totalPrice +=parseFloat(v.productPrice) *v.num 2.利用toFixed 保留两位小数 totalPrice:totalPrice.toFixed(2)