|
define(function(require) {
var $ = require("jquery");
var justep = require("$UI/system/lib/justep");
var wx = require("http://res.wx.qq.com/open/js/jweixin-1.0.0.js");
var baas = require("$UI/dbank/common/js/baas");
// 图像信息数据
var imgStr;
var imgId;
var certContrary = certContrary;
var certFront = certFront;
var filePath;
var Model = function() {
this.callParent();
};
Model.prototype.backBtnClick = function(event) {
};
Model.prototype.registerBtnClick = function(event) {
debugger;
baas.sendRequest({
"type" : "post",
"url" : baas.URL.register,
"async" : true,
"params" : {
certType : this.comp('certType').val(),
certNo : this.comp('certNo').val(),
realName : this.comp('realName').val(),
mobileNo : this.comp('mobileNo').val(),
certValidity : this.comp('certValidity').val(),
// 取不到值
certFront :filePath,
// 取不到值
certContrary : certContrary,
veriCode : 1
// veriCode :this.comp("veriCode").val()
},
"success" : function(data) {
debugger;
var append = event.options && event.options.append;
dataModel.setTotal(data.amount);
dataModel.loadData(data.result, append);
// alert("ok");
}
});
};
Model.prototype.modelLoad = function(event) {
};
Model.prototype.photoInputChange = function(event) {
imgId = 1;
this.comp("picCutDialog").open({
"src" : "$UI/dbank/common/picCut/picCut.w",
data : {
file : event.target.files[0],
width : 120,
height : 120
}
});
};
Model.prototype.photoInputChange1 = function(event) {
imgId = 2;
this.comp("picCutDialog").open({
"src" : "$UI/dbank/common/picCut/picCut.w",
data : {
file : event.target.files[0],
width : 120,
height : 120
}
});
};
Model.prototype.picCutDialogReceive = function(event,filePath) {
debugger;
var filePath;
if (imgId == 1) {
$(this.getElementByXid("certFront")).attr("src", event.data.data);
this.upImage(event.data.data,filePath);
} else {
$(this.getElementByXid("certContrary")).attr("src", event.data.data);
this.upImage2(event.data.data,filePath);
}
};
Model.prototype.upImage = function(imgStr) {
debugger;
baas.sendRequest({
"type" : "post",
"url" : baas.URL.upImage,
"async" : true,
"params" : {
imgStr : imgStr,
},
"success" : function(data) {
// attachData.setValue("filePath", data.result.filePath);
}
});
};
Model.prototype.upImage2 = function(imgStr,attachData) {
debugger;
baas.sendRequest({
"type" : "post",
"url" : baas.URL.upImage,
"async" : true,
"params" : {
imgStr : imgStr,
},
"success" : function(data) {
// attachData.setValue("filePath", data.result.filePath);
}
});
};
return Model;
});
|
|