Commit 937d315d by 施宇

111

parent 0ff33df4
...@@ -81,11 +81,11 @@ ...@@ -81,11 +81,11 @@
</div> </div>
<include file="public/foot" /> <include file="public/foot" />
<script src="__PUBLIC__/js/chat/webim.config.js"></script> <script src="__PUBLIC__/js/chat/webim.config.js"></script>
<script src="__PUBLIC__/js/chat/strophe-1.2.8.js"></script> <!-- <script src="__PUBLIC__/js/chat/strophe-1.2.8.js"></script> -->
<script src="__PUBLIC__/js/chat/websdk-1.4.8.js"></script> <script src="__PUBLIC__/js/chat/websdk-1.4.8.js"></script>
<script src="__PUBLIC__/js/chat/swfupload.js"></script> <!-- <script src="__PUBLIC__/js/chat/swfupload.js"></script> -->
<script src="__PUBLIC__/js/chat/swfupload.cookie.js"></script> <!-- <script src="__PUBLIC__/js/chat/swfupload.cookie.js"></script> -->
<script src="__PUBLIC__/js/chat/uploadShim.js"></script> <!-- <script src="__PUBLIC__/js/chat/uploadShim.js"></script> -->
<script src="__PUBLIC__/js/chat/index.js"></script> <script src="__PUBLIC__/js/chat/index.js"></script>
</body> </body>
......
...@@ -67,7 +67,6 @@ ...@@ -67,7 +67,6 @@
</div> </div>
<include file="public/foot" /> <include file="public/foot" />
<script src="https://cdn.bootcss.com/jquery.form/3.45.0/jquery.form.min.js"></script>
<script src="__PUBLIC__/js/goodmanage/bulkupload.js"></script> <script src="__PUBLIC__/js/goodmanage/bulkupload.js"></script>
</body> </body>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<body> <body>
<!-- pc下的页面 --> <!-- pc下的页面 -->
<div class="index_wrapper"> <div class="index_wrapper pc_wrapper">
<include file="public/indexheader" /> <include file="public/indexheader" />
<div class="content index_content"> <div class="content index_content">
<div class="top_section"> <div class="top_section">
......
...@@ -55,8 +55,8 @@ ...@@ -55,8 +55,8 @@
</div> </div>
<include file="public/foot" /> <include file="public/foot" />
<script src="__PUBLIC__/js/index/search.js"></script> <script src="__PUBLIC__/js/index/search.js"></script>
<!-- 页面模板 --> <!-- 商品模板 -->
<script type="text/html" id="htmlTp"> <script type="text/html" id="sphtml">
<div class="my_xj_list clr "> <div class="my_xj_list clr ">
{{# layui.each(d, function(index, item){ }} {{# layui.each(d, function(index, item){ }}
<div class="my_xj_item fl boxsiz"> <div class="my_xj_item fl boxsiz">
...@@ -89,6 +89,44 @@ ...@@ -89,6 +89,44 @@
<a class="btn" href="passporticsales/login">登录,查看更多结果</a> <a class="btn" href="passporticsales/login">登录,查看更多结果</a>
</div> </div>
</script> </script>
<!-- 询价模板 -->
<script type="text/html" id="xjhtml">
<div class="my_xj_list clr ">
{{# layui.each(d, function(index, item){ }}
<div class="my_xj_item fl boxsiz">
<div class="item_top clr">
<div class="fl num ellipsis">{{item.goods_name}}</div>
</div>
<div class="item_middle clr">
{{# if(item.source !== 0){ }}
<div class="fl xjNum">{{item.source}}个报价</div>
{{# } else { }}
<div class="fl xj0">等待报价</div>
{{# } }}
<div class="fr time">{{layui.util.toDateString(item.update_time * 1000,'yyyy-MM-dd HH:mm')}}</div>
</div>
<div class="item_bottom">
<div class="brand">品牌:<span>{{item.brand_name}}</span></div>
<div class="total">数量:<span class="bold">{{item.number}} PCS</span></div>
<div class="date">货期:<span class="bold">现货</span></div>
</div>
<div class="item_user">
<span class="fl type mystype lineBlock">贸易商</span>
<div class="fl name ellipsis">{{item.company_name||''}}</div>
</div>
</div>
{{# }); }}
</div>
{{# if(d.length === 0){ }}
<div class="no_data" style="padding:60px 0 60px">
<img src="__PUBLIC__/images/nosearchdata.png" alt="">
<p class="bold">未搜索到相关信息</p>
</div>
{{# } }}
<div class="btn_div">
<a class="btn" href="passporticsales/login">登录,查看更多结果</a>
</div>
</script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -13,78 +13,80 @@ ...@@ -13,78 +13,80 @@
<include file="public/top" /> <include file="public/top" />
<div class="right_content release_inquiry_content"> <div class="right_content release_inquiry_content">
<div class="content"> <div class="content">
<div class="nav_title">询报价 > 发布询价</div> <div class="nav_title">商品管理 > 发布商品 > 上传商品</div>
<div class="inquiry_form"> <div class="inquiry_form">
<div class="top_title clr"> <div class="top_title clr">
<h3 class="bold fl">发布询价</h3> <h3 class="bold fl">发布询价</h3>
<div class="plsc_btn fr">
<span class="icon iconfont iconjuxing16"></span>
批量上传
</div>
</div> </div>
<div class="gb"> <div class="gb">
<span class="icon iconfont iconjuxing19 va-m"></span> <span class="icon iconfont iconjuxing19 va-m"></span>
<span>填写完整信息,有利于提高回复报价效率</span> <span>上传的商品有图片,搜索排名会优先排前</span>
</div> </div>
<div class="form_content clr"> <div class="form_content clr">
<div class="form_left fl layui-form"> <form id="xj_form">
<div class="form_left fl layui-form" >
<div class="xh input_div "> <div class="xh input_div ">
<span class="input_title lineBlock">*型号:</span> <span class="input_title lineBlock">*型号:</span>
<div class="input_parent"> <div class="input_parent">
<input type="text" placeholder="请输入商品型号" class="input boxsiz"> <input type="text" name="goods_name" placeholder="请输入商品型号" class="input boxsiz" lay-verify="required">
</div> </div>
</div> </div>
<div class="brand input_div "> <div class="brand input_div ">
<span class="input_title lineBlock">*品牌:</span> <span class="input_title lineBlock">*品牌:</span>
<div class="input_parent"> <div class="input_parent">
<input type="text" placeholder="请输入品牌(必填)" class="input boxsiz"> <input type="text" name="brand_name" placeholder="请输入品牌" class="input boxsiz" lay-verify="required">
</div> </div>
</div> </div>
<div class="fz input_div "> <div class="fz input_div ">
<span class="input_title lineBlock">封装:</span> <span class="input_title lineBlock">封装:</span>
<div class="input_parent"> <div class="input_parent">
<input type="text" placeholder="请输入封装" class="input boxsiz"> <input type="text" name="encap" placeholder="请输入封装" class="input boxsiz">
</div> </div>
</div> </div>
<div class="num input_div "> <div class="num input_div ">
<span class="input_title lineBlock">*需求数量:</span> <span class="input_title lineBlock">*库存:</span>
<div class="input_parent"> <div class="input_parent">
<input type="text" placeholder="请输入需求数量(必填)" class="input boxsiz"> <input type="text" name="number" placeholder="请输入需求数量" class="input boxsiz" lay-verify="required|number">
</div> </div>
</div> </div>
<div class="price input_div "> <div class="price input_div ">
<span class="input_title lineBlock">接受价:</span> <span class="input_title lineBlock">*单价:</span>
<div class="input_parent"> <div class="input_parent">
<input type="text" placeholder="请输入接受价格" class="input boxsiz price_input"> <input type="text" name="price" placeholder="请输入接受价格" class="input boxsiz price_input" lay-verify="required|number">
<div class="rmb layui-form"> <div class="rmb layui-form">
<select name="city" lay-verify="required"> <select name="currency" lay-verify="required">
<option value=""></option> <option value="1">CNY</option>
<option value="0">北京</option> <option value="2">USD</option>
<option value="1">上海</option> </select>
<option value="2">广州</option>
<option value="3">深圳</option>
<option value="4">杭州</option>
</select>
</div> </div>
</div> </div>
</div> </div>
<div class="hq input_div "> <div class="hq input_div">
<span class="input_title lineBlock">*货期:</span> <span class="input_title lineBlock">*货期:</span>
<div class="input_parent"> <div class="input_parent" id="delivery">
<input type="radio" name="sex" value="现货" title="现货"> <input type="radio" name="delivery_time" lay-filter="delivery" value="现货" title="现货">
<input type="radio" name="sex" value="期货" title="期货" checked> <input type="radio" name="delivery_time" lay-filter="delivery" value="期货" title="期货" checked id="daytext">
<input type="text" placeholder="输入时间" class="boxsiz day_input input"> <div class="lineBlock" id="day">
<i class="day"></i> <input type="text" placeholder="输入时间" class="boxsiz day_input input" lay-verify="required|number" name="day">
<i class="day"></i>
</div>
</div> </div>
</div> </div>
<div class="input_div textarea_div"> <div class="input_div textarea_div">
<span class="input_title lineBlock fl">备注:</span> <span class="input_title lineBlock fl">备注:</span>
<div class="layui-input-block"> <div class="layui-input-block">
<textarea name="desc" placeholder="请输入内容" class="layui-textarea "></textarea> <textarea name="remark" placeholder="请输入内容" class="layui-textarea"></textarea>
</div> </div>
</div> </div>
<div class="btn_div"> <div class="btn_div">
<span class="lineBlock fb btn">发布</span> <span class="lineBlock fb btn" lay-submit lay-filter="add">发布</span>
<span class="lineBlock cz btn btn_border">重置</span> <span class="lineBlock cz btn btn_border" type="reset">重置</span>
</div> </div>
</div> </div></form>
<div class="form_right fl "> <div class="form_right fl ">
<div class="sc"> <div class="sc">
<div class="icon iconfont iconjuxing16"></div> <div class="icon iconfont iconjuxing16"></div>
...@@ -99,6 +101,13 @@ ...@@ -99,6 +101,13 @@
</div> </div>
</div> </div>
<include file="public/foot" /> <include file="public/foot" />
<script src="__PUBLIC__/js/quoteprice/releaseinquiry.js"></script>
<script type="text/html" id="deliveryHtml">
{{# if (d=='期货') { }}
<input type="text" placeholder="输入时间" class="boxsiz day_input input" lay-verify="required|number" name="day">
<i class="day"></i>
{{# } }}
</script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -51,7 +51,8 @@ ...@@ -51,7 +51,8 @@
</div> </div>
<div class="goods_data_list"> <div class="goods_data_list">
</div> </div>
<div class="pagination-with" id="pagination" style="text-align: right;margin: 25px 20px 0 0 ;display:none" ></div> <div class="pagination-with" id="pagination"
style="text-align: right;margin: 25px 20px 0 0 ;display:none"></div>
</div> </div>
</div> </div>
</div> </div>
...@@ -59,7 +60,7 @@ ...@@ -59,7 +60,7 @@
<include file="public/foot" /> <include file="public/foot" />
<script src="__PUBLIC__/js/search/index.js"></script> <script src="__PUBLIC__/js/search/index.js"></script>
<!-- 页面模板 --> <!-- 页面模板 -->
<script type="text/html" id="htmlTp"> <script type="text/html" id="sphtml">
<div class="my_xj_list clr "> <div class="my_xj_list clr ">
{{# layui.each(d, function(index, item){ }} {{# layui.each(d, function(index, item){ }}
<div class="my_xj_item fl boxsiz"> <div class="my_xj_item fl boxsiz">
...@@ -93,6 +94,41 @@ ...@@ -93,6 +94,41 @@
</div> </div>
{{# } }} {{# } }}
</script> </script>
<!-- 询价模板 -->
<script type="text/html" id="xjhtml">
<div class="my_xj_list clr ">
{{# layui.each(d, function(index, item){ }}
<div class="my_xj_item fl boxsiz">
<div class="item_top clr">
<div class="fl num ellipsis">{{item.goods_name}}</div>
</div>
<div class="item_middle clr">
{{# if(item.source !== 0){ }}
<div class="fl xjNum">{{item.source}}个报价</div>
{{# } else { }}
<div class="fl xj0">等待报价</div>
{{# } }}
<div class="fr time">{{layui.util.toDateString(item.update_time * 1000,'yyyy-MM-dd HH:mm')}}</div>
</div>
<div class="item_bottom">
<div class="brand">品牌:<span>{{item.brand_name}}</span></div>
<div class="total">数量:<span class="bold">{{item.number}} PCS</span></div>
<div class="date">货期:<span class="bold">现货</span></div>
</div>
<div class="item_user">
<span class="fl type mystype lineBlock">贸易商</span>
<div class="fl name ellipsis">{{item.company_name||''}}</div>
</div>
</div>
{{# }); }}
</div>
{{# if(d.length === 0){ }}
<div class="no_data" style="padding:60px 0 60px">
<img src="__PUBLIC__/images/nosearchdata.png" alt="">
<p class="bold">未搜索到相关信息</p>
</div>
{{# } }}
</script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -239,7 +239,7 @@ body { ...@@ -239,7 +239,7 @@ body {
border-radius: 50% 50%; border-radius: 50% 50%;
background: rgba(234, 173, 55, 0.9); background: rgba(234, 173, 55, 0.9);
box-shadow: 0px 2px 9px 0px rgba(242, 191, 97, 0.5); box-shadow: 0px 2px 9px 0px rgba(242, 191, 97, 0.5);
position: absolute; position: fixed;
bottom: 92px; bottom: 92px;
right: 20px; right: 20px;
cursor: pointer; cursor: pointer;
...@@ -316,6 +316,16 @@ body { ...@@ -316,6 +316,16 @@ body {
font-size: 14px; font-size: 14px;
font-weight: 600; font-weight: 600;
} }
.goods_data_list .my_xj_list .my_xj_item .item_middle .xjNum {
color: #EAA217;
font-size: 14px;
font-weight: 600;
}
.goods_data_list .my_xj_list .my_xj_item .item_middle .xj0 {
color: #61A0F2;
font-size: 14px;
font-weight: 600;
}
.goods_data_list .my_xj_list .my_xj_item .item_middle .time { .goods_data_list .my_xj_list .my_xj_item .item_middle .time {
color: #ADB6BF; color: #ADB6BF;
font-size: 12px; font-size: 12px;
...@@ -520,7 +530,7 @@ body { ...@@ -520,7 +530,7 @@ body {
margin-top: 5px; margin-top: 5px;
} }
@media screen and (max-width: 768px) { @media screen and (max-width: 768px) {
.index_wrapper { .pc_wrapper {
display: none; display: none;
} }
.mobile_wrapper { .mobile_wrapper {
...@@ -528,7 +538,7 @@ body { ...@@ -528,7 +538,7 @@ body {
} }
} }
@media screen and (min-width: 769px) { @media screen and (min-width: 769px) {
.index_wrapper { .pc_wrapper {
display: block; display: block;
} }
.mobile_wrapper { .mobile_wrapper {
...@@ -825,4 +835,3 @@ body { ...@@ -825,4 +835,3 @@ body {
color: #ADB6BF; color: #ADB6BF;
cursor: pointer; cursor: pointer;
} }
/*# sourceMappingURL=base.css.map */
\ No newline at end of file
...@@ -282,7 +282,7 @@ body { ...@@ -282,7 +282,7 @@ body {
border-radius: 50% 50%; border-radius: 50% 50%;
background: rgba(234, 173, 55, 0.9); background: rgba(234, 173, 55, 0.9);
box-shadow: 0px 2px 9px 0px rgba(242, 191, 97, 0.5); box-shadow: 0px 2px 9px 0px rgba(242, 191, 97, 0.5);
position: absolute; position: fixed;
bottom: 92px; bottom: 92px;
right: 20px; right: 20px;
cursor: pointer; cursor: pointer;
...@@ -376,6 +376,16 @@ body { ...@@ -376,6 +376,16 @@ body {
font-size: 14px; font-size: 14px;
font-weight: 600; font-weight: 600;
} }
.xjNum{
color: #EAA217;
font-size: 14px;
font-weight: 600;
}
.xj0{
color: #61A0F2;
font-size: 14px;
font-weight: 600;
}
.time { .time {
color: #ADB6BF; color: #ADB6BF;
...@@ -653,7 +663,7 @@ body { ...@@ -653,7 +663,7 @@ body {
@media screen and (max-width: 768px) { @media screen and (max-width: 768px) {
.index_wrapper { .pc_wrapper {
display: none; display: none;
} }
...@@ -663,7 +673,7 @@ body { ...@@ -663,7 +673,7 @@ body {
} }
@media screen and (min-width:769px) { @media screen and (min-width:769px) {
.index_wrapper { .pc_wrapper {
display: block; display: block;
} }
......
...@@ -18,23 +18,26 @@ $(function () { ...@@ -18,23 +18,26 @@ $(function () {
} else { } else {
console.log('获取用户名失败') console.log('获取用户名失败')
} }
},undefined,true) }, undefined, true)
}, },
registerUser:function(user,password){//给用户注册环信账号 getHistoryData: function () {
console.log(this.conn.prototype)
},
registerUser: function (user, password) { //给用户注册环信账号
var self = this; var self = this;
var options = { var options = {
username: user, username: user,
password: password, password: password,
appKey: WebIM.config.appkey, appKey: WebIM.config.appkey,
success: function () { success: function () {
self.login(user,password) self.login(user, password)
}, },
error: function () { error: function () {
console.log('注册失败') console.log('注册失败')
}, },
apiUrl: WebIM.config.apiURL apiUrl: WebIM.config.apiURL
}; };
self.conn.registerUser(options); self.conn.registerUser(options);
}, },
testUser: function (user, password) { //检测用户是否登入 testUser: function (user, password) { //检测用户是否登入
var self = this; var self = this;
...@@ -45,23 +48,23 @@ $(function () { ...@@ -45,23 +48,23 @@ $(function () {
}, ) }, )
$.ajax({ $.ajax({
type: 'post', type: 'post',
url: 'http://a1.easemob.com/'+self.orgName+'/'+self.appName+'/token', url: 'http://a1.easemob.com/' + self.orgName + '/' + self.appName + '/token',
data: data, data: data,
contentType: "application/json", contentType: "application/json",
success: function (data) { success: function (data) {
var token = data.access_token; var token = data.access_token;
$.ajax({ $.ajax({
type: 'get', type: 'get',
url: 'http://a1.easemob.com/'+self.orgName+'/'+self.appName+'/users/' + user, url: 'http://a1.easemob.com/' + self.orgName + '/' + self.appName + '/users/' + user,
headers: { headers: {
Authorization: 'Bearer ' + token Authorization: 'Bearer ' + token
}, },
success: function (data) {//用户已注册,主动帮用户登入 success: function (data) { //用户已注册,主动帮用户登入
self.login(user,password) self.login(user, password)
}, },
error: function (err) { error: function (err) {
if (err.status == '404') {//主动帮用户注册 if (err.status == '404') { //主动帮用户注册
self.registerUser(user,password); self.registerUser(user, password);
} else { } else {
layer.msg('网络出现问题,请重试!'); layer.msg('网络出现问题,请重试!');
} }
...@@ -85,7 +88,7 @@ $(function () { ...@@ -85,7 +88,7 @@ $(function () {
if (JSON.stringify(templateObj) !== '{}') { if (JSON.stringify(templateObj) !== '{}') {
this.addUser(templateObj.userId, false) this.addUser(templateObj.userId, false)
this.sendCmd(templateObj); this.sendCmd(templateObj);
Util.delCookie('template',cookieHostname); Util.delCookie('template', cookieHostname);
} }
}, },
...@@ -121,8 +124,9 @@ $(function () { ...@@ -121,8 +124,9 @@ $(function () {
} }
}, },
connection: function () { connection: function () {
WebIM.config = config;
//建立聊天链接 //建立聊天链接
this.conn = new WebIM.connection({ this.conn = WebIM.conn = new WebIM.default.connection({
isMultiLoginSessions: WebIM.config.isMultiLoginSessions, isMultiLoginSessions: WebIM.config.isMultiLoginSessions,
https: typeof WebIM.config.https === 'boolean' ? WebIM.config.https : location.protocol === https: typeof WebIM.config.https === 'boolean' ? WebIM.config.https : location.protocol ===
'https:', 'https:',
...@@ -133,9 +137,9 @@ $(function () { ...@@ -133,9 +137,9 @@ $(function () {
autoReconnectInterval: WebIM.config.autoReconnectInterval autoReconnectInterval: WebIM.config.autoReconnectInterval
}); });
// 初始化上传组件 fileInputId对应页面上的file组件id // 初始化上传组件 fileInputId对应页面上的file组件id
WebIM.flashUpload = UploadShim({ // WebIM.flashUpload = UploadShim({
fileInputId: 'image' // fileInputId: 'image'
}, this.conn).flashUpload; // }, this.conn).flashUpload;
//增加表情 //增加表情
WebIM.Emoji = { WebIM.Emoji = {
path: dist + '/faces/', path: dist + '/faces/',
...@@ -386,6 +390,7 @@ $(function () { ...@@ -386,6 +390,7 @@ $(function () {
console.log('登入成功') console.log('登入成功')
self.defaultUser(); self.defaultUser();
self.singleChat(); self.singleChat();
self.getHistoryData()
}, },
onTextMessage: function (message) { onTextMessage: function (message) {
self.receiveData(1, message, false) self.receiveData(1, message, false)
...@@ -424,11 +429,11 @@ $(function () { ...@@ -424,11 +429,11 @@ $(function () {
}, //本机网络掉线; }, //本机网络掉线;
onError: function (message) { onError: function (message) {
// console.log('Error', WebIM.utils.stringify(message)); // console.log('Error', WebIM.utils.stringify(message));
console.log("Error: " + WebIM.utils.stringify(message)); console.log('onError: ', message);
}, //失败回调; }, //失败回调;
}); });
}, },
login: function (user,password) { login: function (user, password) {
// open,登录; // open,登录;
var options = { var options = {
apiUrl: WebIM.config.apiURL, apiUrl: WebIM.config.apiURL,
...@@ -440,8 +445,7 @@ $(function () { ...@@ -440,8 +445,7 @@ $(function () {
this.conn.open(options); this.conn.open(options);
} catch (e) { } catch (e) {
console.log(WebIM.config.apiURL) console.log('登入失败')
// alert('open fail' + e.message)
} }
}, },
...@@ -450,8 +454,9 @@ $(function () { ...@@ -450,8 +454,9 @@ $(function () {
// 私聊发送文本消息,发送表情同发送文本消息,只是会在对方客户端将表情文本进行解析成图片; // 私聊发送文本消息,发送表情同发送文本消息,只是会在对方客户端将表情文本进行解析成图片;
var userId = $('.notice_left ').find('.active').attr('userid'); var userId = $('.notice_left ').find('.active').attr('userid');
var id = this.conn.getUniqueId(); var id = this.conn.getUniqueId();
var msg = new WebIM.message('txt', id); var msg = new WebIM.default.message('txt', id);
var emojiMessage = WebIM.utils.parseEmoji(content); //表情解析工具 var emojiMessage = WebIM.default.utils.parseEmoji(content); //表情解析工具
console.log(msg)
msg.set({ msg.set({
msg: content, // 消息内容; msg: content, // 消息内容;
to: userId, // 接收消息对象; to: userId, // 接收消息对象;
...@@ -465,8 +470,8 @@ $(function () { ...@@ -465,8 +470,8 @@ $(function () {
$('#chat_textarea').val(''); $('#chat_textarea').val('');
}, },
fail: function () { fail: function (e) {
console.log("Send private text failed"); console.log("Send private text failed",e);
} }
}); });
this.conn.send(msg.body); this.conn.send(msg.body);
...@@ -500,22 +505,22 @@ $(function () { ...@@ -500,22 +505,22 @@ $(function () {
// 私聊发送图片消息; // 私聊发送图片消息;
var self = this; var self = this;
var id = this.conn.getUniqueId(); var id = this.conn.getUniqueId();
var msg = new WebIM.message('img', id); var msg = new WebIM.default.message('img', id);
var input = $('#img_upload')[0]; // 选择图片的input; var input = $('#img_upload')[0]; // 选择图片的input;
var file = WebIM.utils.getFileUrl(input); // 将图片转化为二进制文件; var file = WebIM.default.utils.getFileUrl(input); // 将图片转化为二进制文件;
var userId = $('.notice_left').find('.active').attr('userid'); var userId = $('.notice_left').find('.active').attr('userid');
var option = { var option = {
apiUrl: WebIM.config.apiURL, apiUrl: WebIM.config.apiURL,
file: file, file: file,
to: '18664936975', to: userId,
roomType: false, roomType: false,
// chatType: 'singleChat',
flashUpload: WebIM.flashUpload, flashUpload: WebIM.flashUpload,
onFileUploadError: function () { onFileUploadError: function () {
console.log(file);
console.log('失败') console.log('失败')
}, },
onFileUploadComplete: function () {}, onFileUploadComplete: function () {
console.log('消息上传成功')
},
success: function () { success: function () {
var htmlStr = '<img src ="' + file.url + '" class="edit_img"/>'; var htmlStr = '<img src ="' + file.url + '" class="edit_img"/>';
$('#' + userId).find('.notice_item_content').append(self.messageHtml(1, $('#' + userId).find('.notice_item_content').append(self.messageHtml(1,
......
// /**
// * 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 * git do not control webim.config.js
* everyone should copy webim.config.js.demo to webim.config.js * everyone should copy webim.config.js.demo to webim.config.js
...@@ -5,35 +76,47 @@ ...@@ -5,35 +76,47 @@
* In this way , others won't be influenced by this config while git pull. * In this way , others won't be influenced by this config while git pull.
* *
*/ */
var WebIM = {};
WebIM.config = { // for react native
// var location = {
// protocol: "https"
// }
var config = {
/* /*
* XMPP server * XMPP server
*/ */
xmppURL: 'im-api.easemob.com', xmppURL: (window.location.protocol === "https:" ? "https:" : "http:") + "//im-api-v2.easemob.com/ws",
// xmppURL: "im-api.easemob.com",
// xmppURL: '172.17.2.139:5280',
/* /*
* Backend REST API URL * Backend REST API URL
*/ */
apiURL: (location.protocol === 'https:' ? 'https:' : 'http:') + '//a1.easemob.com', // apiURL: (location.protocol === 'https:' ? 'https:' : 'http:') + '//a1.easemob.com',
// ios must be https!!! by lwz
// apiURL: "https://a1.easemob.com",
apiURL: (window.location.protocol === "https:" ? "https:" : "http:") + "//a1.easemob.com",
// apiURL: (location.protocol === 'https:' ? 'https:' : 'http:') + '//172.17.3.155:8080',
/* /*
* Application AppKey * Application AppKey
*/ */
appkey: '1113190618181018#icsales', appkey: "1113190618181018#icsales",
/* /*
* Whether to use wss * Application Host
*/
Host: "easemob.com",
/*
* Whether to use HTTPS
* @parameter {Boolean} true or false * @parameter {Boolean} true or false
*/ */
https: false, https: true,
isHttpDNS: false,
/* /*
* isMultiLoginSessions * isMultiLoginSessions
* true: A visitor can sign in to multiple webpages and receive messages at all the webpages. * 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. * false: A visitor can sign in to only one webpage and receive messages at the webpage.
*/ */
isMultiLoginSessions: false, isMultiLoginSessions: true,
/*
* Set to auto sign-in
*/
isAutoLogin: false,
/** /**
* Whether to use window.doQuery() * Whether to use window.doQuery()
* @parameter {Boolean} true or false * @parameter {Boolean} true or false
...@@ -49,12 +132,17 @@ WebIM.config = { ...@@ -49,12 +132,17 @@ WebIM.config = {
* Whether to console.log in strophe.log() * Whether to console.log in strophe.log()
* @parameter {Boolean} true or false * @parameter {Boolean} true or false
*/ */
isDebug: false, isDebug: true,
/**
* Whether to show logs in strophe
* @parameter {Boolean} true or false
*/
isStropheLog: false,
/** /**
* will auto connect the xmpp server autoReconnectNumMax times in background when client is offline. * will auto connect the xmpp server autoReconnectNumMax times in background when client is offline.
* won't auto connect if autoReconnectNumMax=0. * won't auto connect if autoReconnectNumMax=0.
*/ */
autoReconnectNumMax: 2, autoReconnectNumMax: 5,
/** /**
* the interval secons between each atuo reconnectting. * the interval secons between each atuo reconnectting.
* works only if autoReconnectMaxNum >= 2. * works only if autoReconnectMaxNum >= 2.
...@@ -63,9 +151,40 @@ WebIM.config = { ...@@ -63,9 +151,40 @@ WebIM.config = {
/** /**
* webrtc supports WebKit and https only * webrtc supports WebKit and https only
*/ */
isWebRTC: /WebKit/.test(navigator.userAgent) && /^https\:$/.test(window.location.protocol), isWebRTC: window.RTCPeerConnection && /^https\:$/.test(window.location.protocol),
/**
* cn: chinese
* us: english
*/
i18n: "cn",
/*
* Set to auto sign-in
*/
isAutoLogin: true,
/**
* Size of message cache for person to person
*/
p2pMessageCacheSize: 500,
/**
* When a message arrived, the receiver send an ack message to the
* sender, in order to tell the sender the message has delivered.
* See call back function onReceivedMessage
*/
delivery: false,
/**
* Size of message cache for group chating like group, chatroom etc
*/
groupMessageCacheSize: 200,
/**
* 5 actual logging methods, ordered and available:
* 'TRACE', 'DEBUG', 'INFO', 'WARN', 'ERROR'
*/
loglevel: "ERROR",
/** /**
* while http access,use ip directly,instead of ServerName,avoiding DNS problem. * enable localstorage for history messages
*/ */
isHttpDNS: false enableLocalStorage: true
}; }
This diff could not be displayed because it is too large.
...@@ -73,7 +73,11 @@ ...@@ -73,7 +73,11 @@
/*** /***
* 会员中心询价列表 需要token * 会员中心询价列表 需要token
*/ */
inquiryInfo:offer_url+"/inquiry/info" inquiryInfo:offer_url+"/inquiry/info",
/***
* 询价添加 需要token
*/
inquiryadd:offer_url+"/inquiry/add"
}; };
if (typeof define === "function" && define.amd) { if (typeof define === "function" && define.amd) {
return apis; return apis;
......
...@@ -74,7 +74,7 @@ $(function () { ...@@ -74,7 +74,7 @@ $(function () {
$('#fileLoad').submit(function () { $('#fileLoad').submit(function () {
var uploadFileForm = document.getElementById("fileLoad"); var uploadFileForm = document.getElementById("fileLoad");
uploadFileForm.action = apis.bulkupload; uploadFileForm.action = apis.bulkupload;
$('#token').val('eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vYXV0aGFwaS5pY3NhbGVzLmNjL2F1dGgvbG9naW4iLCJpYXQiOjE1NjIxMTYzNTAsImV4cCI6MTU2MjEyNzE1MCwibmJmIjoxNTYyMTE2MzUwLCJqdGkiOiJ4WVY1MU5WZlByUFR0Q3U5Iiwic3ViIjoyOSwicHJ2IjoiODdlMGFmMWVmOWZkMTU4MTJmZGVjOTcxNTNhMTRlMGIwNDc1NDZhYSJ9.8GKnyJ5gBS9fdiPGnIVpJ9NIsn0Dd0t5lb12giDMhaA'); $('#token').val(Util.getCookie('token'));
$('#ie').val(cookieHostname); $('#ie').val(cookieHostname);
}) })
}, },
......
...@@ -10,10 +10,21 @@ $(function () { ...@@ -10,10 +10,21 @@ $(function () {
"offset": 8, "offset": 8,
"p": 1, "p": 1,
}, function (res) { }, function (res) {
var getTpl = htmlTp.innerHTML; var getTpl = "";
if(type == 1){
getTpl = sphtml.innerHTML
}else{
getTpl = xjhtml.innerHTML
}
if (res.errcode == 0) { if (res.errcode == 0) {
$('.nav_title').find('span').text(res.total) $('.nav_title').find('span').text(res.total);
layui.laytpl(getTpl).render(res.goods_list, function (html) { var list = [];
if(type == 1){
list = res.goods_list
}else{
list = res.inquiry_list
}
layui.laytpl(getTpl).render(list, function (html) {
$(".search_data_list").html(html); $(".search_data_list").html(html);
}); });
} else if (res.errcode == 110001) { } else if (res.errcode == 110001) {
......
...@@ -44,7 +44,6 @@ $(function () { ...@@ -44,7 +44,6 @@ $(function () {
}); });
}); });
} else if (res.errcode == 105001) { } else if (res.errcode == 105001) {
console.log('hahahah')
layui.laytpl(getTpl).render([], function (html) { layui.laytpl(getTpl).render([], function (html) {
$(".inquiry_data").empty().html(html); $(".inquiry_data").empty().html(html);
$('#pagination').hide(); $('#pagination').hide();
...@@ -69,7 +68,7 @@ $(function () { ...@@ -69,7 +68,7 @@ $(function () {
} }
}) })
$('.inquiry_data').on('click','.data_item',function () { $('.inquiry_data').on('click', '.data_item', function () {
window.location.href = "/inquirydetail" window.location.href = "/inquirydetail"
}); });
$('.cx').on('click', function () { $('.cx').on('click', function () {
......
!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) {
var str = '期货';
data.value == '期货' ? str='期货':str='现货';
var getTpl = deliveryHtml.innerHTML;
layui.laytpl(getTpl).render(str, function (html) {
$("#day").empty().html(html);
});
});
//天数同步期货
$(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
...@@ -11,11 +11,22 @@ $(function () { ...@@ -11,11 +11,22 @@ $(function () {
"offset": 10, "offset": 10,
"p": p, "p": p,
}, function (res) { }, function (res) {
var getTpl = htmlTp.innerHTML; var getTpl = "";
if(type == 1){
getTpl = sphtml.innerHTML
}else{
getTpl = xjhtml.innerHTML
}
if (res.errcode == 0) { if (res.errcode == 0) {
$('#pagination').show(); $('#pagination').show();
$('.nav_title').find('span').text(res.total) $('.nav_title').find('span').text(res.total)
layui.laytpl(getTpl).render(res.goods_list, function (html) { var list = [];
if(type == 1){
list = res.goods_list
}else{
list = res.inquiry_list
}
layui.laytpl(getTpl).render(list, function (html) {
$(".goods_data_list").html(html); $(".goods_data_list").html(html);
layui.laypage.render({ layui.laypage.render({
elem: 'pagination', elem: 'pagination',
......
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