模型
//用户登录 define([‘backbone‘, ‘common‘], function (Backbone, common) { var loginModel = Backbone.Model.extend({ url: common.apiHost + "account/login", defaults: { }, initialize: function () { }, parse: function (response) { return response.ReturnData; } }); return loginModel; });
View
define([‘backbone‘, ‘util‘], function (Backbone, util) { var loginView = Backbone.View.extend({ el: ‘#login‘, events: { ‘click #lgn_confirm‘: ‘toauctionList‘ }, data: {}, render: function () { //console.log("module:login"); }, toauctionList: function () { util.toauctionList(); }, }); return loginView; }); var parameter_msg = ‘{}‘; var dataModel = new loginModel(); dataModel.sync(‘create‘, dataModel, { success: function (data) { if (data.Code == 0) { } else { $.afui.popup({ title: "提醒", message: data.ErrorMessage, cancelText: "确定", cancelOnly: true }); } }, error: function () { console.log("register调用失败"); }, data: ‘parameter=‘ + parameter_msg });
时间: 2024-10-28 15:42:24