|
按照开发外卖教程,在触发 下单 按钮时出现这个Cannot read property 'val' of null 错误,
Model.prototype.orderBtnClick = function(event){
var orderData =this.comp("orderData");
var userData =this.comp("userData");
var cartData =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),
"fCount":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({
onSunccess:function(){
justep.Util.hint("下单成功");
cartData.clear();
me.comp("contents").to("orderContent");
}
})
};
[img]file:///C:\Users\Administrator\AppData\Roaming\Tencent\Users\531148362\QQ\WinTemp\RichOle\O%U)FW6UX6BI)D7[Q@Z9WOV.png[/img]
[img]file:///C:\Users\Administrator\AppData\Roaming\Tencent\Users\531148362\QQ\WinTemp\RichOle\O%U)FW6UX6BI)D7[Q@Z9WOV.png[/img]
|
|