|
楼主 |
发表于 2019-7-29 14:26:09
|
显示全部楼层
Model.prototype.CreamPic = function(event){
var url = common.apiPath + '/api/upic/upbase64AllSize', self = this;
function onSuccess(imageURI) {
$.post(url, {data : imageURI}, function(s) {
common.showPop2("请稍等,图片上传中.......",1000);
if (s.s) {
var src =common.apiPath+"/"+s.pic_url;
self.userIcon = src;
$(self.getElementByXid("u_icon")).css("display","block");
$(self.getElementByXid("u_icon")).attr('src',src);
} else {
common.showPop2("上传失败",1000);
}
$(".pic_flexmain").css("display","none");
});
}
function onFail(message) {
common.showPop2("取消拍照",1000);
}
navigator.camera.getPicture(onSuccess, onFail, {
quality : 50,
destinationType : Camera.DestinationType.DATA_URL,
sourceType : Camera.PictureSourceType.CAMERA,
mediaType : Camera.MediaType.PICTURE,
EncodingType : Camera.EncodingType.JPEG,
saveToPhotoAlbum : true
});
}; |
|