4、淘书页详细
在menuContent里添加一个scrollView组件
Model.prototype.transUrl = function(row) { var src = null; if (row.val('Bookimage') != null && row.val('Bookimage') != "" && row.val('Bookimage') != "[]") { var imageJson = eval("(" + row.val('Bookimage') + ")"); var realFileName = imageJson[0]["realFileName"]; var storeFileName = imageJson[0]["storeFileName"]; var ownerID = row.val('Bookid'); var operateType = "browse"; var url = this.actionUrl + '?realFileName=' + realFileName + '&storeFileName=' + storeFileName + '&ownerID=' + ownerID + '&operateType=' + operateType; src = require.toUrl(url); } return src; }
Model.prototype.addCartBtnClick = function(event) { var row = event.bindingContext.$object; var rows = this.comp("cartData").find([ "fMenuID" ], [ row.getID() ]); if (rows.length == 0) { this.comp("cartData").newData({ defaultValues : [ { "fMenuID" : row.getID(), "fMenuName" : row.val("Bookname"), "fpostage" : row.val("Postage"), "fPrice" : row.val("Bookprice"), "fCount" : 1 } ] }); } else { rows[0].val("fCount", rows[0].val("fCount") + 1); } };