Authored by Lixiaodi

用户货号审核页面

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Yoho!Buy运营平台</title>
<script src="/ufoPlatform/js/include.js"></script>
<style>
.sub-info th{
font-size: 16px;
text-align: right;
width: 30%;
}
.sub-info td{
font-size: 16px;
width: 70%;
}
</style>
</head>
<body class="easyui-layout">
<div region="north" style="height:90px;">
<script>
document.write(addHead('商品管理', '卖家自主货号申请'));
</script>
</div>
<div id="businessDiv" region="center">
<table id="businessTable" class="sub-info" frame="void" width="80%" cellpadding="16" align="center">
<tr>
<th>品牌<font color="red">*</font></th>
<td id="brandValue"></td>
</tr>
<tr>
<th>商品名称<font color="red">*</font></th>
<td id="productNameValue"></td>
</tr>
<tr>
<th>发售价</th>
<td id="priceValue"></td>
</tr>
<tr>
<th>发售时间</th>
<td id="saleTimeValue"></td>
</tr>
<tr>
<th>货号<font color="red">*</font></th>
<td id="productCodeValue"></td>
</tr>
<tr>
<th>单品封面图<font color="red">*</font></th>
<td id="imageListTd"></td>
</tr>
</table>
<div id="btnList" style="text-align:center;">
<a id="rejectBtn" class="btn-long" style="background-color: rgba(217, 0, 27, 1);">不通过</a>
<a id="passBtn" class="btn-long" style="background-color: rgba(2, 125, 180, 1);">通过</a>
</div>
<br>
<br>
</div>
<div style="display: none">
<div id="dlg" class="datagrid-toolbar" style="padding:5px;">
<img id="simg" src="" alt="" width="800">
</div>
</div>
<script>
$(function() {
var param=window.location.search;
var id = getQueryString(param, "id");
getDetailInfo(id);
//放大图片预览
$(".pimg").click(function(){
var _this = $(this);//将当前的pimg元素作为_this传入函数
var src = _this.attr("src");
//var index = src.indexOf("?");
//src = src.substring(0, index);
//window.open(src);
download(src);
});
$("#rejectBtn").linkbutton({
text: "不通过",
iconCls: "icon-ok",
onClick: function () {
updateAudit(id, 2);
}
});
$("#passBtn").linkbutton({
text: "通过",
iconCls: "icon-ok",
onClick: function () {
updateAudit(id, 1,);
}
});
});
function updateAudit(id, status){
$.post(contextPath + "/selfShelves/updateAuditInfoById", {
id : id,
status : status
}, function(data) {
if (data.code == 200) {
window.self.$.messager.show({
title : "提示",
msg : "审核成功!"
});
}else {
window.self.$.messager.alert("失败", "失败!", "error");
}
});
}
function download(url) {
$('#dlg').dialog({
title: '预览',
width: 800,
height: 600,
resizable: false,
closed: false,
cache: false,
modal: true
});
$("#simg").attr("src", url);
}
function getDetailInfo(id){
var form = new FormData();
form.append("id", id);
//发送请求
$.ajax({
type: "POST",
url: contextPath + '/selfShelves/getDetailById',
data: form,
async: false,
cache: false,
contentType: false,
processData: false,
dataType: 'json',
success: function (result) {
if(result.code == 200) {
$("#brandValue").html(result.data.brand);
$("#productNameValue").html(result.data.productName);
$("#priceValue").html(result.data.price);
$("#saleTimeValue").html(result.data.saleTime);
$("#productCodeValue").html(result.data.productCode);
var imageStr = "";
for (var i=0;i<result.data.imageList.length;i++){
imageStr += "<img height='132px;' width='211px;' class='pimg' src='"+result.data.imageList[i]+"'/>";
if(i%3==0 && i!=0) {
imageStr += "<br/>"
}
}
$("#imageListTd").html(imageStr);
$.parser.parse($("#imageListTd").parent());
}
else {
$.messager.alert("失败", result.message, "error");
}
}
});
}
function getQueryString(paraPart,name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = paraPart.substr(1).match(reg);
if (r != null) return unescape(r[2]);
return null;
}
</script>
</body>
</html>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Yoho!Buy运营平台</title>
<script src="/ufoPlatform/js/include.js"></script>
</head>
<body class="easyui-layout">
<div region="north" style="height:230px;">
<script>
document.write(addHead('商品管理', '卖家自主货号申请'));
</script>
<div style="margin-left: 10px;margin-top: 30px">
<div style="border:1px solid #ddd;border-radius:5px 5px 5px 5px;">
<div style="margin-left: 10px;margin-top: 20px;margin-bottom: 20px">
<input id="productName" name="productName" />
<input id="productCode" name="productCode" />
<input id="status" name="status" />
<a id="searchBtn" class="btn-info">筛选</a>
<a id="allBtn" class="btn-success">全部</a>
</div>
</div>
</div>
</div>
<div id="businessList" region="center">
<table id="mainListTable"></table>
</div>
<script>
var listUrl = contextPath + "/selfShelves/queryList";
var viewUrl = contextPath + "/html/sellerProductCode/view.html";
var auditUrl = contextPath + "/html/sellerProductCode/audit.html";
$(function() {
$("#productName").textbox({
prompt: "名称",
width: 200
});
$("#productCode").textbox({
prompt: "货号",
width: 200
});
$("#status").combobox({
prompt: "审核状态",
width: 150,
editable : false,
data: [
{"text" : "全部", "value" : -1}
,{"text" : "待审核", "value" : 0}
,{"text" : "已通过", "value" : 1}
,{"text" : "不通过", "value" : 2}
]
});
$("#searchBtn").linkbutton({
iconCls : "icon-search",
onClick : function() {
$("#mainListTable").datagrid("load", {
productName : $("#productName").val(),
productCode : $("#productCode").val(),
status : $("#status").myCombobox("getValue") ==-1?null:$("#status").myCombobox("getValue")
});
}
});
//全部按钮
$("#allBtn").linkbutton({
iconCls: "icon-import",
onClick: function () {
$("#mainListTable").datagrid("load", {});
}
});
loadMainList();
});
function loadMainList(){
$("#mainListTable").myDatagrid({
fit: true,
fitColumns: true,
striped: true,
url: listUrl,
method: 'POST',
loadFilter: function (data) {
var temp = defaultLoadFilter(data);
temp=null==temp?[]:temp;
temp.rows = temp.list;
return temp;
},
columns: [[{
title: "发布人UID",
field: "uid",
width: 20,
align: "center"
}, {
title: "品牌*",
field: "brand",
width: 20,
align: "center"
}, {
title: "商品名称*",
field: "productName",
width: 20,
align: "center"
}, {
title: "发售价",
field: "price",
width: 30,
align: "center"
}, {
title: "发售时间",
field: "saleTime",
width: 30,
align: "center"
}, {
title: "货号*",
field: "productCode",
width: 20,
align: "center"
}, {
title: "状态",
field: "statusStr",
width: 30,
align: "center"
}, {
title: "操作",
field: "asdf",
width: 30,
align: "center",
formatter: function (value, rowData, rowIndex) {
var str = "";
if(rowData.status==0){
str = "<a role='audit' dataId='"+ rowData.id +"' style='margin-left:10px;background-color: #5cb85c !important;'>审核</a>" + str;
}else{
str = "<a role='detail' dataId='"+ rowData.id +"' style='margin-left:10px;background-color: #428bca !important;'>查看</a>";
}
return str;
}
}]],
cache: false,
pagination: true,
pageSize: 10,
idField: "id",
singleSelect: true,
onLoadSuccess: function (data) {
$(this).datagrid("getPanel").find("a[role='detail']").linkbutton({
onClick: function () {
var id = $(this).attr("dataId");
window.open(viewUrl + "?id=" + id + "&ver=" + new Date().getTime())
}
});
$(this).datagrid("getPanel").find("a[role='audit']").linkbutton({
onClick: function () {
var id = $(this).attr("dataId");
window.open(auditUrl + "?id=" + id + "&ver=" + new Date().getTime()); }
});
}
});
}
</script>
</body>
</html>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Yoho!Buy运营平台</title>
<script src="/ufoPlatform/js/include.js"></script>
<style>
.sub-info th{
font-size: 16px;
text-align: right;
width: 30%;
}
.sub-info td{
font-size: 16px;
width: 70%;
}
</style>
</head>
<body class="easyui-layout">
<div region="north" style="height:90px;">
<script>
document.write(addHead('商品管理', '卖家自主货号申请'));
</script>
</div>
<div id="businessDiv" region="center">
<table id="businessTable" class="sub-info" frame="void" width="80%" cellpadding="16" align="center">
<tr>
<th>品牌<font color="red">*</font></th>
<td id="brandValue"></td>
</tr>
<tr>
<th>商品名称<font color="red">*</font></th>
<td id="productNameValue"></td>
</tr>
<tr>
<th>发售价</th>
<td id="priceValue"></td>
</tr>
<tr>
<th>发售时间</th>
<td id="saleTimeValue"></td>
</tr>
<tr>
<th>货号<font color="red">*</font></th>
<td id="productCodeValue"></td>
</tr>
<tr>
<th>单品封面图<font color="red">*</font></th>
<td id="imageListTd"></td>
</tr>
</table>
<br>
<br>
</div>
<div style="display: none">
<div id="dlg" class="datagrid-toolbar" style="padding:5px;">
<img id="simg" src="" alt="" width="800">
</div>
</div>
<script>
$(function() {
var param=window.location.search;
var id = getQueryString(param, "id");
getDetailInfo(id);
//放大图片预览
$(".pimg").click(function(){
var _this = $(this);//将当前的pimg元素作为_this传入函数
var src = _this.attr("src");
//var index = src.indexOf("?");
//src = src.substring(0, index);
//window.open(src);
download(src);
});
});
function download(url) {
$('#dlg').dialog({
title: '预览',
width: 800,
height: 600,
resizable: false,
closed: false,
cache: false,
modal: true
});
$("#simg").attr("src", url);
}
function getDetailInfo(id){
var form = new FormData();
form.append("id", id);
//发送请求
$.ajax({
type: "POST",
url: contextPath + '/selfShelves/getDetailById',
data: form,
async: false,
cache: false,
contentType: false,
processData: false,
dataType: 'json',
success: function (result) {
if(result.code == 200) {
$("#brandValue").html(result.data.brand);
$("#productNameValue").html(result.data.productName);
$("#priceValue").html(result.data.price);
$("#saleTimeValue").html(result.data.saleTime);
$("#productCodeValue").html(result.data.productCode);
var imageStr = "";
for (var i=0;i<result.data.imageList.length;i++){
imageStr += "<img height='132px;' width='211px;' class='pimg' src='"+result.data.imageList[i]+"'/>";
if(i%3==0 && i!=0) {
imageStr += "<br/>"
}
}
$("#imageListTd").html(imageStr);
$.parser.parse($("#imageListTd").parent());
}
else {
$.messager.alert("失败", result.message, "error");
}
}
});
}
function getQueryString(paraPart,name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = paraPart.substr(1).match(reg);
if (r != null) return unescape(r[2]);
return null;
}
</script>
</body>
</html>
\ No newline at end of file
... ...