|
|
@ -6,26 +6,7 @@ const $ = window.$
|
|
|
|
let _url_origin = getUrl2()
|
|
|
|
let _url_origin = getUrl2()
|
|
|
|
// let _url_origin = `http://47.96.87.25:48080`;
|
|
|
|
// let _url_origin = `http://47.96.87.25:48080`;
|
|
|
|
|
|
|
|
|
|
|
|
if (!window.Cropper) {
|
|
|
|
|
|
|
|
$.ajaxSetup({
|
|
|
|
|
|
|
|
cache: true
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('head').append($('<link rel="stylesheet" type="text/css" />')
|
|
|
|
|
|
|
|
.attr('href', `${_url_origin}/react/public/js/cropper/cropper.min.css`));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.getScript(
|
|
|
|
|
|
|
|
`${_url_origin}/react/public/js/cropper/cropper.js`,
|
|
|
|
|
|
|
|
(data, textStatus, jqxhr) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
$.getScript(
|
|
|
|
|
|
|
|
`${_url_origin}/react/public/js/cropper/html2canvas.min.js`,
|
|
|
|
|
|
|
|
(data, textStatus, jqxhr) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function save_avatar(){
|
|
|
|
function save_avatar(){
|
|
|
|
|
|
|
|
|
|
|
@ -93,9 +74,30 @@ class Cropper extends Component {
|
|
|
|
// console.log(event.detail.scaleX);
|
|
|
|
// console.log(event.detail.scaleX);
|
|
|
|
// console.log(event.detail.scaleY);
|
|
|
|
// console.log(event.detail.scaleY);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
preview: this.props.previewId ? `#${this.props.previewId}` : '.img-preview',
|
|
|
|
preview: this.props.previewId ? `#${this.props.previewId}` : '.img-preview',
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!window.Cropper) {
|
|
|
|
|
|
|
|
$.ajaxSetup({
|
|
|
|
|
|
|
|
cache: true
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('head').append($('<link rel="stylesheet" type="text/css" />')
|
|
|
|
|
|
|
|
.attr('href', `${_url_origin}/react/public/js/cropper/cropper.min.css`));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.getScript(
|
|
|
|
|
|
|
|
`${_url_origin}/react/public/js/cropper/cropper.js`,
|
|
|
|
|
|
|
|
(data, textStatus, jqxhr) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
$.getScript(
|
|
|
|
|
|
|
|
`${_url_origin}/react/public/js/cropper/html2canvas.min.js`,
|
|
|
|
|
|
|
|
(data, textStatus, jqxhr) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
setTimeout(() => {
|
|
|
|
const image = document.getElementById(this.props.imageId || '__image');
|
|
|
|
const image = document.getElementById(this.props.imageId || '__image');
|
|
|
|
this.cropper = new window.Cropper(image, this.options);
|
|
|
|
this.cropper = new window.Cropper(image, this.options);
|
|
|
|