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
1729f808
authored
Jul 04, 2019
by
施宇
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
123123213
parent
fd096e79
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
221 additions
and
165 deletions
Application/Home/View/QuotePrice/releaseinquiry.html
dist/css/common/base.css
dist/css/common/base.less
dist/js/chat/index.js
dist/js/chat/webim.config.js
dist/js/global/api.js
dist/js/quoteprice/releaseinquiry.js
Application/Home/View/QuotePrice/releaseinquiry.html
View file @
1729f808
This diff is collapsed.
Click to expand it.
dist/css/common/base.css
View file @
1729f808
...
...
@@ -305,6 +305,7 @@ body {
font-weight
:
600
;
color
:
#2E3033
;
width
:
100%
;
line-height
:
22px
;
}
.goods_data_list
.my_xj_list
.my_xj_item
.item_middle
{
margin-top
:
12px
;
...
...
dist/css/common/base.less
View file @
1729f808
...
...
@@ -363,6 +363,7 @@ body {
font-weight: 600;
color: #2E3033;
width: 100%;
line-height: 22px;
}
}
...
...
dist/js/chat/index.js
View file @
1729f808
...
...
@@ -127,19 +127,20 @@ $(function () {
WebIM
.
config
=
config
;
//建立聊天链接
this
.
conn
=
WebIM
.
conn
=
new
WebIM
.
default
.
connection
({
appKey
:
WebIM
.
config
.
appkey
,
isHttpDNS
:
WebIM
.
config
.
isHttpDNS
,
isMultiLoginSessions
:
WebIM
.
config
.
isMultiLoginSessions
,
h
ttps
:
typeof
WebIM
.
config
.
https
===
'boolean'
?
WebIM
.
config
.
https
:
location
.
protocol
===
'https:'
,
h
ost
:
WebIM
.
config
.
Host
,
https
:
WebIM
.
config
.
https
,
url
:
WebIM
.
config
.
xmppURL
,
apiUrl
:
WebIM
.
config
.
apiURL
,
isAutoLogin
:
true
,
heartBeatWait
:
WebIM
.
config
.
heartBeatWait
,
autoReconnectNumMax
:
WebIM
.
config
.
autoReconnectNumMax
,
autoReconnectInterval
:
WebIM
.
config
.
autoReconnectInterval
autoReconnectInterval
:
WebIM
.
config
.
autoReconnectInterval
,
isStropheLog
:
WebIM
.
config
.
isStropheLog
,
delivery
:
WebIM
.
config
.
delivery
});
// 初始化上传组件 fileInputId对应页面上的file组件id
// WebIM.flashUpload = UploadShim({
// fileInputId: 'image'
// }, this.conn).flashUpload;
//增加表情
WebIM
.
Emoji
=
{
path
:
dist
+
'/faces/'
,
...
...
@@ -456,11 +457,9 @@ $(function () {
var
id
=
this
.
conn
.
getUniqueId
();
var
msg
=
new
WebIM
.
default
.
message
(
'txt'
,
id
);
var
emojiMessage
=
WebIM
.
default
.
utils
.
parseEmoji
(
content
);
//表情解析工具
console
.
log
(
msg
)
msg
.
set
({
msg
:
content
,
// 消息内容;
to
:
userId
,
// 接收消息对象;
roomType
:
false
,
success
:
function
(
id
,
serverMsgId
)
{
$
(
'#'
+
userId
).
find
(
'.notice_item_content'
).
append
(
self
.
messageHtml
(
1
,
emojiMessage
,
false
));
...
...
@@ -471,7 +470,7 @@ $(function () {
},
fail
:
function
(
e
)
{
console
.
log
(
"Send private text failed"
,
e
);
console
.
log
(
"Send private text failed"
,
e
);
}
});
this
.
conn
.
send
(
msg
.
body
);
...
...
@@ -480,14 +479,13 @@ $(function () {
var
self
=
this
;
var
userId
=
$
(
'.notice_left '
).
find
(
'.active'
).
attr
(
'userid'
);
var
id
=
this
.
conn
.
getUniqueId
();
var
msg
=
new
WebIM
.
message
(
'cmd'
,
id
);
var
msg
=
new
WebIM
.
default
.
message
(
'cmd'
,
id
);
msg
.
set
({
msg
:
'template'
,
to
:
userId
,
roomType
:
false
,
action
:
"template"
,
ext
:
templateObj
,
success
:
function
(
id
,
serverMsgId
)
{
success
:
function
()
{
$
(
'#'
+
userId
).
find
(
'.notice_item_content'
).
append
(
self
.
messageHtml
(
1
,
templateObj
,
true
));
var
contentHeight
=
$
(
'#'
+
userId
).
find
(
'.notice_item_content'
)
...
...
@@ -513,7 +511,6 @@ $(function () {
apiUrl
:
WebIM
.
config
.
apiURL
,
file
:
file
,
to
:
userId
,
roomType
:
false
,
flashUpload
:
WebIM
.
flashUpload
,
onFileUploadError
:
function
()
{
console
.
log
(
'失败'
)
...
...
dist/js/chat/webim.config.js
View file @
1729f808
// /**
// * git do not control webim.config.js
// * everyone should copy webim.config.js.demo to webim.config.js
// * and have their own configs.
// * In this way , others won't be influenced by this config while git pull.
// *
// */
// var config = {
// /*
// * XMPP server
// */
// xmppURL: 'im-api.easemob.com',
// /*
// * Backend REST API URL
// */
// apiURL: (location.protocol === 'https:' ? 'https:' : 'http:') + '//a1.easemob.com',
// /*
// * Application AppKey
// */
// appkey: '1113190618181018#icsales',
// /*
// * Whether to use wss
// * @parameter {Boolean} true or false
// */
// https: false,
// /*
// * isMultiLoginSessions
// * true: A visitor can sign in to multiple webpages and receive messages at all the webpages.
// * false: A visitor can sign in to only one webpage and receive messages at the webpage.
// */
// isMultiLoginSessions: false,
// /*
// * Set to auto sign-in
// */
// isAutoLogin: false,
// /**
// * Whether to use window.doQuery()
// * @parameter {Boolean} true or false
// */
// isWindowSDK: false,
// /**
// * isSandBox=true: xmppURL: 'im-api.sandbox.easemob.com', apiURL: '//a1.sdb.easemob.com',
// * isSandBox=false: xmppURL: 'im-api.easemob.com', apiURL: '//a1.easemob.com',
// * @parameter {Boolean} true or false
// */
// isSandBox: false,
// /**
// * Whether to console.log in strophe.log()
// * @parameter {Boolean} true or false
// */
// isDebug: false,
// /**
// * will auto connect the xmpp server autoReconnectNumMax times in background when client is offline.
// * won't auto connect if autoReconnectNumMax=0.
// */
// autoReconnectNumMax: 2,
// /**
// * the interval secons between each atuo reconnectting.
// * works only if autoReconnectMaxNum >= 2.
// */
// autoReconnectInterval: 2,
// /**
// * webrtc supports WebKit and https only
// */
// isWebRTC: /WebKit/.test(navigator.userAgent) && /^https\:$/.test(window.location.protocol),
// /**
// * while http access,use ip directly,instead of ServerName,avoiding DNS problem.
// */
// isHttpDNS: false
// };
/**
* git do not control webim.config.js
* everyone should copy webim.config.js.demo to webim.config.js
...
...
@@ -82,6 +11,24 @@
// protocol: "https"
// }
function
getUrl
(){
var
apiUrl
=
(
window
.
location
.
protocol
===
"https:"
?
"https:"
:
"http:"
)
+
"//a1-hsb.easemob.com"
var
xmppUrl
=
"im-api.easemob.com"
if
(
window
.
location
.
href
.
indexOf
(
"webim-h5.easemob.com"
)
!==
-
1
||
window
.
location
.
href
.
indexOf
(
"localhost"
)
!==
-
1
||
window
.
location
.
href
.
indexOf
(
"172.17.2.168"
)
!==
-
1
){
apiUrl
=
(
window
.
location
.
protocol
===
"https:"
?
"https:"
:
"http:"
)
+
"//a1-hsb-ly.easemob.com"
xmppUrl
=
"im-api.easemob.com"
}
// else if(window.location.href.indexOf("webim-hsb.easemob.com") !== -1){
// apiUrl = (window.location.protocol === "https:" ? "https:" : "http:") + "//a1-hsb.easemob.com"
// xmppUrl = "im-api-hsb.easemob.com"
// }
return
{
apiUrl
:
apiUrl
,
xmppUrl
:
xmppUrl
}
}
var
config
=
{
/*
* XMPP server
...
...
dist/js/global/api.js
View file @
1729f808
...
...
@@ -45,6 +45,10 @@
* 获取用户基本信息
*/
authme
:
auth_url
+
'/auth/me'
,
/***
* 上传文件的接口
*/
ossupload
:
goods_url
+
'/oss/upload'
,
/**
* 商品列表
*/
...
...
dist/js/quoteprice/releaseinquiry.js
View file @
1729f808
!
function
()
{
window
.
ReleaseInquiry
=
{
isClick
:
false
,
init
:
function
()
{
this
.
created
(
this
).
mounted
(
this
).
handleBind
(
this
);
},
created
:
function
(
opt
)
{
return
this
;
},
mounted
:
function
(
opt
)
{
return
this
;
},
handleBind
:
function
(
opt
)
{
//货期选择
layui
.
form
.
on
(
'radio(delivery)'
,
function
(
data
)
{
!
function
()
{
window
.
ReleaseInquiry
=
{
isClick
:
false
,
init
:
function
()
{
this
.
created
(
this
).
mounted
(
this
).
isIe
(
this
).
handleBind
(
this
);
},
created
:
function
(
opt
)
{
return
this
;
},
mounted
:
function
(
opt
)
{
return
this
;
},
uploadFun
:
function
()
{
layui
.
upload
.
render
({
elem
:
'#upload_section'
,
url
:
apis
.
ossupload
,
data
:
{
token
:
Util
.
getCookie
(
'token'
),
source
:
2
,
var
str
=
'期货'
;
data
.
value
==
'期货'
?
str
=
'期货'
:
str
=
'现货'
;
var
getTpl
=
deliveryHtml
.
innerHTML
;
layui
.
laytpl
(
getTpl
).
render
(
str
,
function
(
html
)
{
$
(
"#day"
).
empty
().
html
(
html
);
},
field
:
"upload"
,
before
:
function
()
{
layer
.
load
(
1
,
{
offset
:
[
'50%'
,
"50%"
],
shade
:
false
});
});
//天数同步期货
$
(
document
).
on
(
'input propertychange'
,
'input[name="day"]'
,
function
()
{
var
val
=
$
(
this
).
val
();
$
(
"#daytext"
).
val
(
val
+
'天'
);
});
$
(
'.cz'
).
on
(
'click'
,
function
(){
$
(
'#xj_form'
)[
0
].
reset
();
})
//上传商品发布
layui
.
form
.
on
(
'submit(add)'
,
function
(
data
)
{
$
(
data
.
elem
).
addClass
(
"layui-btn-disabled"
);
if
(
!
opt
.
isClick
)
{
opt
.
isClick
=
true
;
IcController
.
getData
(
apis
.
inquiryadd
+
'?token='
+
Util
.
getCookie
(
'token'
),
'get'
,
data
.
field
,
function
(
res
)
{
if
(
res
.
errcode
==
0
)
{
layer
.
msg
(
'发布询价成功'
,
{
time
:
2000
},
function
()
{
window
.
location
.
href
=
'/inquiry'
;
});
}
else
{
layer
.
msg
(
res
.
errmsg
);
opt
.
isClick
=
false
;
$
(
data
.
elem
).
removeClass
(
"layui-btn-disabled"
);
}
},
done
:
function
(
res
)
{
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
(
'上传失败'
);
}
});
},
isIe
:
function
(
opt
)
{
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"
,
opt
.
iframeOnload
);
}
else
{
iframe
.
onload
=
opt
.
iframeOnload
;
};
opt
.
formSubmit
();
$
(
'#mineFiles'
).
on
(
'change'
,
function
()
{
layer
.
load
(
1
,
{
offset
:
[
'50%'
,
"50%"
],
shade
:
false
});
$
(
'#fileLoad'
).
submit
();
})
}
else
{
//非ie低版本
$
(
'#upload_section'
).
show
();
opt
.
uploadFun
();
}
return
this
;
},
formSubmit
:
function
()
{
$
(
'#fileLoad'
).
submit
(
function
()
{
var
uploadFileForm
=
document
.
getElementById
(
"fileLoad"
);
uploadFileForm
.
action
=
apis
.
ossupload
;
$
(
'#token'
).
val
(
Util
.
getCookie
(
'token'
));
$
(
'#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
(
'上传失败'
);
}
if
(
json
)
{
layer
.
closeAll
(
'loading'
);
if
(
json
.
errcode
==
0
)
{
layer
.
msg
(
'上传成功'
,
{
time
:
600
},
function
()
{
window
.
location
.
href
=
"/uploadresult"
;
});
}
else
{
layer
.
msg
(
json
.
errmsg
)
}
}
},
handleBind
:
function
(
opt
)
{
//货期选择
layui
.
form
.
on
(
'radio(delivery)'
,
function
(
data
)
{
var
str
=
'期货'
;
data
.
value
==
'现货'
?
str
=
'现货'
:
str
=
'期货'
;
var
getTpl
=
deliveryHtml
.
innerHTML
;
layui
.
laytpl
(
getTpl
).
render
(
str
,
function
(
html
)
{
$
(
"#day"
).
empty
().
html
(
html
);
});
return
this
;
},
},
$
(
function
()
{
ReleaseInquiry
.
init
();
})
}();
\ No newline at end of file
});
//天数同步期货
$
(
document
).
on
(
'input propertychange'
,
'input[name="day"]'
,
function
()
{
var
val
=
$
(
this
).
val
();
$
(
"#daytext"
).
val
(
val
+
'天'
);
});
$
(
'.cz'
).
on
(
'click'
,
function
()
{
$
(
'#xj_form'
)[
0
].
reset
();
})
//上传商品发布
layui
.
form
.
on
(
'submit(add)'
,
function
(
data
)
{
$
(
data
.
elem
).
addClass
(
"layui-btn-disabled"
);
if
(
!
opt
.
isClick
)
{
opt
.
isClick
=
true
;
IcController
.
getData
(
apis
.
inquiryadd
+
'?token='
+
Util
.
getCookie
(
'token'
),
'get'
,
data
.
field
,
function
(
res
)
{
if
(
res
.
errcode
==
0
)
{
layer
.
msg
(
'发布询价成功'
,
{
time
:
2000
},
function
()
{
window
.
location
.
href
=
'/inquiry'
;
});
}
else
{
layer
.
msg
(
res
.
errmsg
);
opt
.
isClick
=
false
;
$
(
data
.
elem
).
removeClass
(
"layui-btn-disabled"
);
}
});
}
});
return
this
;
},
},
$
(
function
()
{
ReleaseInquiry
.
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