@2890594972
2018-04-13T06:00:50.000000Z
字数 458
阅读 967
面向对象
1511
// 产品对象
function Product(id, name, price, num, shopId){
this.id = id;
this.name = name;
this.price = price;
this.num = num;
this.shopId = shopId;
}
// 购物车对象
// 用来做什么: 管理数据,实现增删改查
/*
* 管理数据,有增删改查
* add, delete, edit, get.
* isExit
**/
// 用来做什么: 管理事件,用来监听交互事件
/**
* initEvent
* 店铺单个: check
* 店铺全选: checkAll
* 全选: checkTotalAll
* 增加和减少: plus, minus
*/
// 用来做什么: 管理UI, 响应UI, 用来更新数据
/**
* 更新店铺价: uiShopTotalPrice,
* 更新所有店铺: uiAllTotalPrice
* 删除页面节点: uiDelete
**/
function Shopcar(){
// 产品列表
this.productList = [];
}