Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
施宇
/
icsales
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f58258cb
authored
Jul 03, 2019
by
施宇
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
询价
parent
7351b98f
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
291 additions
and
191 deletions
Application/Common/Conf/config_url.php
Application/Home/View/GoodManage/bulkupload.html
Application/Home/View/QuotePrice/inquiry.html
dist/css/bulkupload.css
dist/css/bulkupload.less
dist/js/chat/index.js
dist/js/global/api.js
dist/js/global/global.min.js
dist/js/goodmanage/bulkupload.js
dist/js/quoteprice/inquiry.js
Application/Common/Conf/config_url.php
View file @
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'
,
...
...
Application/Home/View/GoodManage/bulkupload.html
View file @
f58258cb
...
...
@@ -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>
...
...
Application/Home/View/QuotePrice/inquiry.html
View file @
f58258cb
...
...
@@ -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>
...
...
dist/css/bulkupload.css
View file @
f58258cb
...
...
@@ -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-
lef
t
:
60px
;
.upload_bulk_content
.inquiry_form
.btn_div
a
.
sc
{
margin-
righ
t
:
60px
;
}
.upload_bulk_content
.inquiry_form
.btn_div
a
.xz
:hover
{
background
:
none
!important
;
...
...
@@ -78,4 +111,3 @@
.upload_bulk_content
.inquiry_form
.upload_text
p
{
margin-top
:
10px
;
}
/*# sourceMappingURL=bulkupload.css.map */
\ No newline at end of file
dist/css/bulkupload.less
View file @
f58258cb
...
...
@@ -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;
}
}
...
...
dist/js/chat/index.js
View file @
f58258cb
...
...
@@ -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
:
fals
e
,
isAutoLogin
:
tru
e
,
heartBeatWait
:
WebIM
.
config
.
heartBeatWait
,
autoReconnectNumMax
:
WebIM
.
config
.
autoReconnectNumMax
,
autoReconnectInterval
:
WebIM
.
config
.
autoReconnectInterval
...
...
dist/js/global/api.js
View file @
f58258cb
...
...
@@ -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
;
...
...
dist/js/global/global.min.js
View file @
f58258cb
...
...
@@ -23,19 +23,18 @@
if
((
navigator
.
userAgent
.
indexOf
(
'MSIE'
)
>=
0
)
&&
(
navigator
.
userAgent
.
indexOf
(
'Opera'
)
<
0
))
{
dataTypeXpx
=
"jsonp"
;
}
//
if(isheader){
if
(
isheader
){
$
.
ajaxSetup
({
headers
:
{
Authorization
:
'Bearer '
+
Util
.
getCookie
(
'token'
)
},
});
//
};
};
$
.
ajax
({
type
:
type
,
url
:
url
,
data
:
params
,
dataType
:
'json'
,
xhrFields
:
{
withCredentials
:
true
},
...
...
dist/js/goodmanage/bulkupload.js
View file @
f58258cb
$
(
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
dist/js/quoteprice/inquiry.js
0 → 100644
View file @
f58258cb
$
(
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment