首页 > 代码库 > 5、购物车页详细
5、购物车页详细
在cartContent里添加2个panel(bootstrap)组件
Model.prototype.subBtnClick = function(event) { var row = event.bindingContext.$object; if (row.val("fCount") > 0) row.val("fCount", row.val("fCount") - 1); };
Model.prototype.addBtnClick = function(event) { var row = event.bindingContext.$object; row.val("fCount", row.val("fCount") + 1); };
Model.prototype.orderBtnClick = function(event) { var orderData = http://www.mamicode.com/this.comp("orderData"); var userData = http://www.mamicode.com/this.comp("userData"); var cartData = http://www.mamicode.com/this.comp("cartData"); var me = this; var content = ""; cartData.each(function(options) { content = content + options.row.val("fMenuName") + "(" + options.row.val("fCount") + ")"; }); orderData.newData({ index : 0, defaultValues : [ { "fID" : justep.UUID.createUUID(), "fCreateTime" : justep.Date.toString(new Date(), justep.Date.STANDART_FORMAT), "fContent" : content, "fUserID" : userData.val("fID"), "fUserName" : userData.val("fName"), "fPhoneNumber" : userData.val("fPhoneNumber"), "fAddress" : userData.val("fAddress"), "fSum" : this.comp("calcData").val("fSumMoney") } ] }) orderData.saveData({ onSuccess : function() { justep.Util.hint("下单成功"); cartData.clear(); me.comp("contents").to("orderContent"); } }) }; Model.prototype.orderDataSaveCreateParam = function(event) { event.param.tables.push(this.comp("userData").toJson(true)); }; Model.prototype.orderDataSaveCommit = function(event) { this.comp("userData").applyUpdates(); };
5、购物车页详细
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。