Commit fbb0cd4b by 梁建民

Merge branch 'master' of http://119.23.72.7/shiyu/icsales

# Conflicts:
#	dist/js/global/global.min.js
js
parents 247525b7 f58258cb
......@@ -37,7 +37,7 @@ return array(
'passporticsales' => 'http://passport.icsales.cc',
//商品搜索、询价搜索
'searchicsales' => 'http://search.icsales.cc',
'searchicsales' => 'http://offerapi.icsales.cc',
//业务助手后台
'homeicsales' => 'http://home.icsales.cc',
......
......@@ -5,33 +5,6 @@
<include file="public/header" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/bulkupload.css">
<style>
.webuploader-container {
position: relative;
}
.webuploader-element-invisible {
position: absolute !important;
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
clip: rect(1px,1px,1px,1px);
}
.webuploader-pick {
position: relative;
display: inline-block;
cursor: pointer;
background: #00b7ee;
padding: 10px 15px;
color: #fff;
text-align: center;
border-radius: 3px;
overflow: hidden;
}
.webuploader-pick-hover {
background: #00a2d4;
}
.webuploader-pick-disable {
opacity: 0.6;
pointer-events:none;
}
</style>
</head>
......@@ -43,7 +16,8 @@
<div class="right_content upload_bulk_content">
<div class="content">
<div class="nav_title">商品管理 > 发布商品 > 批量上传</div>
<!-- <div class="inquiry_form">
<div class="inquiry_form">
<div class="top_title clr">
<h3 class="bold fl">批量上传</h3>
</div>
......@@ -51,10 +25,30 @@
<span class="icon iconfont iconjuxing19 va-m"></span>
<span>上传的商品有图片,搜索排名会优先排前</span>
</div>
<div class="upload_section" id="upload_section">
<div class="icon iconfont iconjuxing16"></div>
<p>将商品表格拖拽或点击到此处上传</p>
<div class="upload_jr">
<!-- 正常浏览器使用layui的上传插件上传 -->
<div class="upload_section" id="upload_section" style="display: none">
<div class="icon iconfont iconjuxing16"></div>
<p>将商品表格拖拽或点击到此处上传</p>
</div>
<!-- 低版本ie使用form+iframe上传 -->
<form enctype="multipart/form-data" id="fileLoad" method="post" target="test"
style="display: none">
<!-- token -->
<input type="text" name="token" value="" style="display: none" id="token" />
<!-- 是否是ie8 -->
<input type="text" name="ie8" value="" style="display:none" id="ie"/>
<input type="file" id="mineFiles" name="file" class="xslfile" />
<div class="form_div">
<div class="icon iconfont iconjuxing16"></div>
<p>点击到此处上传</p>
</div>
<iframe name="test" id="test" style="display: none">
</iframe>
</form>
</div>
<div class="btn_div">
<a class="btn sc lineBlock nohover">上传商品</a>
<a class="btn btn_border xz lineBlock">下载商品模板</a>
......@@ -64,24 +58,9 @@
<p>2、请下载模板,并根据模板格式上传 </p>
<p>3、为加快匹配速度,请保证每份文件型号数不超过200</p>
</div>
</div> -->
<form class="layui-form" enctype="multipart/form-data" id="fileLoad">
<div class="layui-row">
<div class="layui-form-item schedule-item width100">
<label class="layui-form-label">附件:</label>
<div class="layui-input-block ml80" id="fileUp">
//自己所需要传的值
<input type="text" name="token" value="520" style="display: none"/>
<div>
<input type="file" id="mineFiles" name="file"/>
</div>
<button type="button" class="layui-btn layui-btn-sm layui-btn-normal openFile" id="upLoad">添加附件</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
......
......@@ -174,31 +174,7 @@
</div>
<include file="public/foot" />
<script>
layui.use('laydate', function () {
var laydate = layui.laydate;
//执行一个laydate实例
laydate.render({
elem: '#start_date', //指定元素
theme: '#0D84D1'
});
laydate.render({
elem: '#end_date' ,//指定元素
theme: '#0D84D1'
});
});
$('.edit_div').click(function () {
window.location.href = "/releaseinquiry"
})
$('.iconjuxing2').click(function () {
$('.show_more').slideDown()
})
$('.data_item').click(function () {
window.location.href = "/inquirydetail"
})
</script>
<script src="__PUBLIC__/js/quoteprice/inquiry.js"></script>
</body>
......
......@@ -38,12 +38,20 @@
font-size: 15px;
margin: 0 6px 0 12px;
}
.upload_bulk_content .inquiry_form .upload_section {
.upload_bulk_content .inquiry_form .upload_jr {
margin: 31px 148px 0;
background-color: #F5F9FC;
height: 200px;
border: 1px dashed #D8DFE6;
position: relative;
text-align: center;
}
.upload_bulk_content .inquiry_form .upload_section {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
cursor: pointer;
}
.upload_bulk_content .inquiry_form .upload_section div {
......@@ -56,6 +64,31 @@
color: #8A9299;
margin-top: 35px;
}
.upload_bulk_content .inquiry_form form {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.upload_bulk_content .inquiry_form form .xslfile {
position: absolute;
display: block;
font-size: 10000px;
height: 100%;
width: 100%;
filter: alpha(opacity=0);
}
.upload_bulk_content .inquiry_form form .form_div {
color: #ADB6BF;
font-size: 60px;
padding-top: 50px;
}
.upload_bulk_content .inquiry_form form .form_div p {
font-size: 16px;
color: #8A9299;
margin-top: 35px;
}
.upload_bulk_content .inquiry_form .btn_div {
text-align: center;
margin-top: 30px;
......@@ -63,8 +96,8 @@
.upload_bulk_content .inquiry_form .btn_div a {
width: 120px;
}
.upload_bulk_content .inquiry_form .btn_div a.xz {
margin-left: 60px;
.upload_bulk_content .inquiry_form .btn_div a.sc {
margin-right: 60px;
}
.upload_bulk_content .inquiry_form .btn_div a.xz:hover {
background: none !important;
......
{"version":3,"sources":["bulkupload.less"],"names":[],"mappings":"AAAA;EACI,eAAA;;AADJ,oBAGI;EACI,eAAA;;AAJR,oBAOI;EACI,sBAAA;EACA,oBAAA;EACA,kBAAA;;AAVR,oBAOI,cAKI;EACI,oBAAA;;AAbZ,oBAOI,cAKI,WAGI;EACI,eAAA;EACA,cAAA;EACA,iBAAA;;AAlBhB,oBAOI,cAKI,WASI;EACI,eAAA;EACA,WAAA;EACA,YAAA;EACA,iBAAA;EACA,eAAA;EACA,kBAAA;EACA,yBAAA;;AA5BhB,oBAOI,cA0BI;EACI,YAAA;EACA,iBAAA;EACA,yBAAA;EACA,wBAAA;EACA,cAAA;EACA,eAAA;;AAvCZ,oBAOI,cA0BI,IAQI;EACI,eAAA;EACA,oBAAA;;AA3ChB,oBAOI,cAwCI;EACI,oBAAA;EACA,yBAAA;EACA,aAAA;EACA,0BAAA;EACA,kBAAA;EACA,eAAA;;AArDZ,oBAOI,cAwCI,gBAOI;EACI,cAAA;EACA,eAAA;EACA,iBAAA;;AAzDhB,oBAOI,cAwCI,gBAaI;EACI,eAAA;EACA,cAAA;EACA,gBAAA;;AA/DhB,oBAOI,cA2DI;EACI,kBAAA;EACA,gBAAA;;AApEZ,oBAOI,cA2DI,SAGI;EACI,YAAA;;AACA,oBAhEZ,cA2DI,SAGI,EAEK;EACG,iBAAA;;AAEJ,oBAnEZ,cA2DI,SAGI,EAKK,GAAG;EACF,2BAAA;;AA3ElB,oBAOI,cAyEI;EACI,gBAAA;EACA,cAAA;EACA,mBAAA;EACA,eAAA;;AApFZ,oBAOI,cAyEI,aAKI;EACI,gBAAA","file":"bulkupload.css"}
\ No newline at end of file
{"version":3,"sources":["bulkupload.less"],"names":[],"mappings":"AAAA;EACI,eAAA;;AADJ,oBAGI;EACI,eAAA;;AAJR,oBAOI;EACI,sBAAA;EACA,oBAAA;EACA,kBAAA;;AAVR,oBAOI,cAKI;EACI,oBAAA;;AAbZ,oBAOI,cAKI,WAGI;EACI,eAAA;EACA,cAAA;EACA,iBAAA;;AAlBhB,oBAOI,cAKI,WASI;EACI,eAAA;EACA,WAAA;EACA,YAAA;EACA,iBAAA;EACA,eAAA;EACA,kBAAA;EACA,yBAAA;;AA5BhB,oBAOI,cA0BI;EACI,YAAA;EACA,iBAAA;EACA,yBAAA;EACA,wBAAA;EACA,cAAA;EACA,eAAA;;AAvCZ,oBAOI,cA0BI,IAQI;EACI,eAAA;EACA,oBAAA;;AA3ChB,oBAOI,cAwCI;EACI,oBAAA;EACA,yBAAA;EACA,aAAA;EACA,0BAAA;EACA,kBAAA;EACA,kBAAA;;AArDZ,oBAOI,cAiDI;EACI,kBAAA;EACA,MAAA;EACA,OAAA;EACA,QAAA;EACA,SAAA;EACA,eAAA;;AA9DZ,oBAOI,cAiDI,gBAQI;EACI,cAAA;EACA,eAAA;EACA,iBAAA;;AAnEhB,oBAOI,cAiDI,gBAcI;EACI,eAAA;EACA,cAAA;EACA,gBAAA;;AAzEhB,oBAOI,cAsEI;EACI,kBAAA;EACA,MAAA;EACA,OAAA;EACA,QAAA;EACA,SAAA;;AAlFZ,oBAOI,cAsEI,KAMI;EACI,kBAAA;EACA,cAAA;EACA,kBAAA;EACA,YAAA;EACA,WAAA;EACA,wBAAA;;AAzFhB,oBAOI,cAsEI,KAeI;EACI,cAAA;EACA,eAAA;EACA,iBAAA;;AA/FhB,oBAOI,cAsEI,KAeI,UAKI;EACI,eAAA;EACA,cAAA;EACA,gBAAA;;AApGpB,oBAOI,cAkGI;EACI,kBAAA;EACA,gBAAA;;AA3GZ,oBAOI,cAkGI,SAII;EACI,YAAA;;AAEA,oBAzGZ,cAkGI,SAII,EAGK;EACG,kBAAA;;AAIJ,oBA9GZ,cAkGI,SAII,EAQK,GAAG;EACA,2BAAA;;AAtHpB,oBAOI,cAqHI;EACI,gBAAA;EACA,cAAA;EACA,mBAAA;EACA,eAAA;;AAhIZ,oBAOI,cAqHI,aAMI;EACI,gBAAA","file":"bulkupload.css"}
\ No newline at end of file
......@@ -45,13 +45,23 @@
}
}
.upload_section {
.upload_jr {
margin: 31px 148px 0;
background-color: #F5F9FC;
height: 200px;
border: 1px dashed #D8DFE6;
position: relative;
text-align: center;
}
.upload_section {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
cursor: pointer;
div {
color: #ADB6BF;
font-size: 60px;
......@@ -64,27 +74,62 @@
margin-top: 35px;
}
}
form {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
.xslfile {
position: absolute;
display: block;
font-size: 10000px;
height: 100%;
width: 100%;
filter: alpha(opacity=0);
}
.form_div {
color: #ADB6BF;
font-size: 60px;
padding-top: 50px;
p {
font-size: 16px;
color: #8A9299;
margin-top: 35px;
}
}
}
.btn_div {
text-align: center;
margin-top:30px;
margin-top: 30px;
a {
width: 120px;
&.xz{
margin-left:60px;
&.sc {
margin-right: 60px;
}
&.xz:hover{
background:none !important;
&.xz:hover {
background: none !important;
}
}
}
.upload_text{
margin-top:20px;
color:#8A9299;
padding-left:148px;
.upload_text {
margin-top: 20px;
color: #8A9299;
padding-left: 148px;
font-size: 14px;
p{
margin-top:10px;
p {
margin-top: 10px;
}
}
......
......@@ -86,7 +86,6 @@ $(function () {
this.addUser(templateObj.userId, false)
this.sendCmd(templateObj);
Util.delCookie('template',cookieHostname);
}
},
......@@ -128,7 +127,7 @@ $(function () {
https: typeof WebIM.config.https === 'boolean' ? WebIM.config.https : location.protocol ===
'https:',
url: WebIM.config.xmppURL,
isAutoLogin: false,
isAutoLogin: true,
heartBeatWait: WebIM.config.heartBeatWait,
autoReconnectNumMax: WebIM.config.autoReconnectNumMax,
autoReconnectInterval: WebIM.config.autoReconnectInterval
......
......@@ -65,8 +65,15 @@
* 商品修改
*/
bulkupload:goods_url+'/goods/upload',
goodsSave: goods_url + '/goods/save'
goodsSave: goods_url + '/goods/save',
/****
* 询价搜索 不需要token
*/
inquirySearch:search_url+'/inquiry/search',
/***
* 会员中心询价列表 需要token
*/
inquiryInfo:search_url+"/inquiry/info"
};
if (typeof define === "function" && define.amd) {
return apis;
......
$(function () {
// var bulkuploadObj = {
// init: function () {
// this.uploadFun();
// this.bindFun();
// },
// uploadFun: function () {
// layui.upload.render({
// elem: '#upload_section',
// url: apis.bulkupload,
// data: {
// token: "520"
// },
// accept: "file",
// exts: "xls|xlsx",
// before: function () {
// layer.load(1, {
// offset: ['50%', "50%"],
// shade: false
// });
// },
// done: function (res, index, upload) {
// layer.closeAll('loading');
// if (res.errcode == 0) {
// layer.msg('上传成功', {
// time: 600
// }, function () {
// window.location.href = "/uploadresult";
// });
var bulkuploadObj = {
init: function () {
this.isIe()
},
uploadFun: function () {
layui.upload.render({
elem: '#upload_section',
url: apis.bulkupload,
data: {
token: Util.getCookie('token')
},
accept: "file",
exts: "xls|xlsx",
before: function () {
layer.load(1, {
offset: ['50%', "50%"],
shade: false
});
},
done: function (res, index, upload) {
layer.closeAll('loading');
if (res.errcode == 0) {
layer.msg('上传成功', {
time: 600
}, function () {
window.location.href = "/uploadresult";
});
// } else {
// layer.msg(res.errmsg)
// }
// },
// err: function () {
// layer.closeAll('loading');
// layer.msg('上传失败');
} else {
layer.msg(res.errmsg)
}
},
err: function () {
layer.closeAll('loading');
layer.msg('上传失败');
// }
// });
}
});
// },
// bindFun: function () {
// $('.sc').on('click', function () {
// $('#upload_section').click()
// })
// }
// };
// bulkuploadObj.init();
},
isIe: function () {
var self = this;
if (navigator.appName == "Microsoft Internet Explorer" && (navigator.appVersion.split(";")[1].replace(/[ ]/g, "") == "MSIE8.0" || navigator.appVersion.split(";")[1].replace(/[ ]/g, "") == "MSIE9.0")) {
//ie版本
$('#fileLoad').show();
$('.sc').hide();
document.domain = cookieHostname;//设置domian跨域拿到iframe的内容
var iframe = document.getElementById("test");
if (iframe.attachEvent) {
iframe.attachEvent("onload", self.iframeOnload);
} else {
iframe.onload = this.iframeOnload;
};
this.formSubmit();
$('#mineFiles').on('change', function () {
layer.load(1, {
offset: ['50%', "50%"],
shade: false
});
$('#fileLoad').submit();
})
} else {
//非ie低版本
$('#upload_section').show();
this.uploadFun();
$('.sc').on('click', function () {
$('#upload_section').click()
})
$(".openFile").click(function () {
//按钮被点击,触发标签点击事件,只有在非IE8下才有效果
$("#mineFiles").click();
});
//实际的标签点击事件
$("#mineFiles").change(function (e) {
//IE8浏览器的判断
if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.split(";")[1].replace(/[ ]/g, "") == "MSIE8.0") {
//一些需要动态的赋值
$("#fileLoad").ajaxSubmit({
 url :apis.bulkupload,
type : "post",
//应该为text
dataType : 'json',
success : function(data) {
console.log(data)
//相关的处理
},
error:function(data) {
console.log(1111);}
});
}else{
//非IE8下使用formData
var formdata = new FormData();
//拿到相关的文件
var doc = document.getElementById("mineFiles");
formdata.append("file", doc.files[0]);
formdata.append('token','520')
$.ajax({
url: apis.bulkupload,
type: "post",
data: formdata,
cache: false,
processData: false,
contentType: false,
dataType : 'json',
//开始loading
beforeSend: function () {
}
},
formSubmit: function () {
$('#fileLoad').submit(function () {
var uploadFileForm = document.getElementById("fileLoad");
uploadFileForm.action = apis.bulkupload;
$('#token').val('eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vYXV0aGFwaS5pY3NhbGVzLmNjL2F1dGgvbG9naW4iLCJpYXQiOjE1NjIxMTYzNTAsImV4cCI6MTU2MjEyNzE1MCwibmJmIjoxNTYyMTE2MzUwLCJqdGkiOiJ4WVY1MU5WZlByUFR0Q3U5Iiwic3ViIjoyOSwicHJ2IjoiODdlMGFmMWVmOWZkMTU4MTJmZGVjOTcxNTNhMTRlMGIwNDc1NDZhYSJ9.8GKnyJ5gBS9fdiPGnIVpJ9NIsn0Dd0t5lb12giDMhaA');
$('#ie').val(cookieHostname);
})
},
iframeOnload: function () {
//表单上传完成后进入iframe获取返回的值
var iframe = document.getElementById("test");
var html = "",
json = null;
try {
var el = (iframe.contentWindow || iframe.contentDocument.parentWindow).document.body;
while (el && el.nodeType !== 3) {
el = el.firstChild;
}
html = el.nodeValue;
json = html ? eval("(" + html + ")") : false;
} catch (e) {
layer.closeAll('loading');
layer.msg('上传失败');
},
success: function (res) {
console.log(res)
}
});
}
})
 
}
if (json) {
layer.closeAll('loading');
if (json.errcode == 0) {
layer.msg('上传成功', {
time: 600
}, function () {
window.location.href = "/uploadresult";
});
} else {
layer.msg(json.errmsg)
}
}
}
};
bulkuploadObj.init();
})
\ No newline at end of file
$(function () {
var inquiry = {
init: function () {
layui.laydate.render({
elem: '#start_date', //指定元素
theme: '#0D84D1'
});
layui.laydate.render({
elem: '#end_date', //指定元素
theme: '#0D84D1'
});
this.bindFun();
this.getData()
},
getData: function () {
IcController.getData(apis.inquiryInfo, 'get', {
'goods_name': "",
"start_time": "",
"end_time": "",
"user_id": "",
"offset": "10",
"p": "1",
"token":Util.getCookie('token')
}, function (res) {
})
},
bindFun: function () {
$('.edit_div').click(function () {
window.location.href = "/releaseinquiry"
});
$('.iconjuxing2').click(function (e) {
e.stopPropagation();
if ($(this).siblings('.show_more').css('display') == 'none') {
$('.show_more').slideDown()
} else {
$('.show_more').slideUp()
}
})
$('.data_item').click(function () {
window.location.href = "/inquirydetail"
})
}
};
inquiry.init()
})
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment