var Shirt=function(color,size,model) {
this._color=color || '';
this._size=size || '';
this._model=model || '';
}
Shirt.prototype={
getColor:function() {
return this._color;
},
setColor:function(color) {
this._color=color;
},
getSize:function() {
return this._size
},
setSize:function(size) {
this._size=size;
},
getModel:function() {
return this._model;
},
setModel:function(model) {
this._model=model;
},
order:function(orderer,num) {
var orderedInfo='';
orderedInfo+=orderer+' 您好!您订购此衣服:\n';
orderedInfo+='颜色:'+this._color+' 尺寸:'+this._size+' 样式:'+this._model+'\n';
orderedInfo+='一共'+num+'件。谢谢!';
alert(orderedInfo);
}
}
Shirt.prototype.constructor=Shirt;