addOrQueryminiFault.html
4.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<!DOCTYPE html>
<style>
.sale-category-detail-page .goods-image {
display: flex;
}
.sale-category-detail-page .goods-image .img {
width: 120px;
height: 120px;
margin-right: 10px;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
position: relative;
}
.sale-category-detail-page .goods-image .img:hover:before {
content: "删除";
width: 100%;
display: block;
position: absolute;
top: 0;
background: #000;
opacity: 0.5;
color: #fff;
text-align: center;
line-height: 104px;
}
</style>
<div class="sale-category-detail-page" style="overflow-y: scroll;height: 80%" >
<h4 id="titleInfo"></h4>
<form name="categoryEditForm" id="categoryEditForm" method="post" enctype="multipart/form-data">
<div class="goods-image" style="margin-top: 5px;margin-left: 30px;height: 60%">
<div style="width:20%;margin-top:5px;" >
<span style="color:red">*</span><label id="imageLabel"></label>
</div>
<div id="imageUpload"></div>
</div>
<div style="margin-top: 5px;margin-left: 30px">
<table border="0" style="width:95%;margin-top:5px;line-height:30px;" >
<!--<tr style="height: 60px">
<td width="20%"><span style="color:red">*</span><label>跳转类型</label></td>
<td>
</td>
</tr>-->
<tr style="height: 60px">
<td width="20%"><span style="color:red">*</span><label>瑕疵备注</label></td>
<td>
<input id="checkText" class="easyui-textbox" name="checkText" data-options="validType:'length[1,500]'" style="width:600px;" required="true" prompt="请填写具体的瑕疵问题描述"/>
</td>
</tr>
</table>
</div>
</form>
</div>
<script>
$(function () {
this.dom = {
imageUpload: $('#categoryEditForm #imageUpload')
};
var data = paramObject.mkData;
debugger
$("#imageLabel").html(data.imageLabel==null ? "图片":data.imageLabel);
//查看页面
if (data.flag) {
//上传图片
this.dom.imageUpload.imageUpload({
width: 104,
height: 104,
realInputName: "imageUrl",
url: contextPath + '/fileupload/upload',
queryParams: {
bucket: "ufominifault"
},
onBeforeSubmit: function () {
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
interval: 500,
text: ""
});
},
filterFileName: function (data) {
if (!data || data.code != 200) {
$.messager.progress("close");
$.messager.alert("错误", data.message);
return "";
}
return data.data.url;
},
onLoadSuccess: function (data) {
console.log(data.data );
$.messager.progress("close");
$(document).find('.file-close').click();
$('#categoryEditForm #imageUpload').before('<div class="img" data-url="' + data.data + '" style="background-image:url(' + data.data + ');"> ');
return false;
}
});
$(document).on('click', '.goods-image .img', function() {
$(this).remove();
});
}else{//查看页面
//隐藏按钮
$('#saveBtn').linkbutton('disable');
$("#saveBtn").attr("style","display:none;");
$('#categoryEditForm #imageUpload').attr("style","display:none;");
$("#checkText").textbox("textbox").attr("readonly","readonly");
for (var i=0;i<data.imageUrlList.length;i++)
{
$('#categoryEditForm #imageUpload').before('<a target="_blank" href="'+data.imageUrlList[i]+'"><img src="' + data.imageUrlList[i] + '" style="width: 120px;height: 120px;" /></a> ');
}
$("#categoryEditForm #checkText").textbox('setValue',data.checkText);
}
});
</script>