function product(){ //这里写属性 } product.prototype={ //这里写方法json格式 buy:function(){}, addcart:function(){} }