mirror of
https://gitlab.52pay.top/go/easygoadmin.git
synced 2025-09-26 19:33:29 +08:00
修复多图片组件出错问题
This commit is contained in:
@@ -60,7 +60,7 @@ layui.extend({
|
||||
" </div>\n" +
|
||||
" </div>\n" +
|
||||
" <div class=\"layui-col-xs3\">\n" +
|
||||
" <button class=\"layui-btn layui-btn-fluid\" cropper-event=\"confirmSave\" type=\"button\"> 保存修改</button>\n" +
|
||||
" <button class=\"layui-btn layui-btn-fluid\" cropper-event=\"confirmSave\" b-name=\"" + name + "\" type=\"button\"> 保存修改</button>\n" +
|
||||
" </div>\n" +
|
||||
" </div>\n" +
|
||||
"\n" +
|
||||
@@ -91,8 +91,12 @@ layui.extend({
|
||||
});
|
||||
$(".layui-btn").on('click', function () {
|
||||
var event = $(this).attr("cropper-event");
|
||||
var bName = $(this).attr("b-name")
|
||||
//监听确认保存图像
|
||||
if (event === 'confirmSave') {
|
||||
if (bName !== name) {
|
||||
return false
|
||||
}
|
||||
image.cropper("getCroppedCanvas", {
|
||||
width: saveW,
|
||||
height: saveH
|
||||
@@ -109,7 +113,7 @@ layui.extend({
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function (result) {
|
||||
if (result.code == 0) {
|
||||
if (result.code === 0) {
|
||||
//关闭提示层
|
||||
layer.close(index);
|
||||
layer.msg(result.msg, {icon: 1});
|
||||
|
Reference in New Issue
Block a user