775 lines
35 KiB
Plaintext
775 lines
35 KiB
Plaintext
@{
|
||
ViewBag.Title = "AppletChat";
|
||
Layout = null;
|
||
}
|
||
@{
|
||
Layout = null;
|
||
}
|
||
|
||
<!DOCTYPE html>
|
||
|
||
<html>
|
||
<head>
|
||
<meta name="viewport" content="width=device-width" />
|
||
<title>[@Html.Raw(Request.QueryString["accountName"])]聊天程序</title>
|
||
<link href="~/Content/xx/ChatCore.css" rel="stylesheet" />
|
||
</head>
|
||
<body>
|
||
@*<script src="~/Scripts/jquery-1.8.2.js"></script>*@
|
||
<link href="~/Scripts/layer/css/layui.css" rel="stylesheet" />
|
||
<script type="text/javascript" src="~/Scripts/jquery-1.10.2.min.js"></script>
|
||
<script src="~/Scripts/jquery.easyui.min.js"></script>
|
||
@*<script src="~/Scripts/jquery.easyui.plus.js"></script>*@
|
||
<script src="http://@Html.Raw(System.Configuration.ConfigurationManager.AppSettings["SignalRService"] == null ? "192.168.1.132:709" : System.Configuration.ConfigurationManager.AppSettings["SignalRService"])/Scripts/jquery.signalR-2.2.2.min.js"></script>
|
||
<script src="http://@Html.Raw(System.Configuration.ConfigurationManager.AppSettings["SignalRService"] == null ? "192.168.1.132:709" : System.Configuration.ConfigurationManager.AppSettings["SignalRService"])/signalr/hubs"></script>
|
||
<script src="~/Scripts/layer/layer.min.js"></script>
|
||
<script src="~/Scripts/layer/layui.js"></script>
|
||
<script src="~/Scripts/common.js"></script>
|
||
<link href="~/Content/themes/blue/easyui.css" rel="stylesheet" />
|
||
<link href="~/Content/Site.css" rel="stylesheet" />
|
||
<script src="/Scripts/op/jquery.rewrite.js"></script>
|
||
@*<script src="~/Scripts/cookie.js"></script>*@
|
||
|
||
<script type="text/javascript">
|
||
|
||
var signalrService = "http://@Html.Raw(System.Configuration.ConfigurationManager.AppSettings["SignalRService"] == null ? "192.168.1.132:709" : System.Configuration.ConfigurationManager.AppSettings["SignalRService"])";
|
||
//用户编号
|
||
var userid = "@Html.Raw(ViewBag.eid)";
|
||
//用户名
|
||
var username = "@Html.Raw(ViewBag.name)";
|
||
//所属部门
|
||
var deptname = "@Html.Raw(ViewBag.deptName)";
|
||
//所属部门编号
|
||
var deptid = "@Html.Raw(ViewBag.deptid)";
|
||
//对应的公众号
|
||
var accountnum = "@Html.Raw(Request.QueryString["accountnum"])";
|
||
//var allfriends = new Dictionary();//存储数据
|
||
//setCookie("accountnum", accountnum, "d20");//将公众号存入cookie中
|
||
var imgshowCount = 10;
|
||
//var yueFen = "@Html.Raw(DateTime.Now.ToString("yyyyM"))";
|
||
var sortBy = function (filed, rev, primer) {
|
||
rev = (rev) ? -1 : 1;
|
||
return function (a, b) {
|
||
a = a[filed];
|
||
b = b[filed];
|
||
if (typeof (primer) != 'undefined') {
|
||
a = primer(a);
|
||
b = primer(b);
|
||
}
|
||
if (a < b) { return rev * -1; }
|
||
if (a > b) { return rev * 1; }
|
||
return 1;
|
||
}
|
||
};
|
||
//linux时间格式化
|
||
function getNowFormatDate(date) {
|
||
//var date = new Date();
|
||
var seperator1 = "-";
|
||
var seperator2 = ":";
|
||
var month = date.getMonth() + 1;
|
||
var strDate = date.getDate();
|
||
if (month >= 1 && month <= 9) {
|
||
month = "0" + month;
|
||
}
|
||
if (strDate >= 0 && strDate <= 9) {
|
||
strDate = "0" + strDate;
|
||
}
|
||
var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
|
||
+ " " + date.getHours() + seperator2 + date.getMinutes()
|
||
+ seperator2 + date.getSeconds();
|
||
return currentdate;
|
||
}
|
||
</script>
|
||
<script src="~/Scripts/ChatCore.js"></script>
|
||
|
||
<style type="text/css">
|
||
.WoCao td {
|
||
padding: 3px;
|
||
}
|
||
|
||
.layim-face-list {
|
||
position: relative;
|
||
width: 372px;
|
||
padding: 10px;
|
||
border: 1px solid #D9D9D9;
|
||
background-color: #fff;
|
||
box-shadow: 0 0 20px rgba(0,0,0,.2);
|
||
}
|
||
|
||
.layim-face-list li {
|
||
cursor: pointer;
|
||
float: left;
|
||
border: 1px solid #e8e8e8;
|
||
height: 22px;
|
||
width: 26px;
|
||
overflow: hidden;
|
||
/*margin: -1px 0 0 -1px;*/
|
||
padding: 4px 2px;
|
||
text-align: center;
|
||
}
|
||
|
||
.face_onMouseOver {
|
||
border: 1px solid red;
|
||
}
|
||
|
||
.MsgCount {
|
||
width: 14px;
|
||
background-color: red;
|
||
color: white;
|
||
line-height: 14px;
|
||
margin-top: 5px;
|
||
text-align: center;
|
||
height: 14px;
|
||
border-radius: 14px;
|
||
border: red solid 2px;
|
||
}
|
||
|
||
.Imggray {
|
||
-webkit-filter: grayscale(100%);
|
||
}
|
||
|
||
.nEmpty {
|
||
}
|
||
|
||
.msgCountCs {
|
||
display: block;
|
||
height: 25px;
|
||
padding: 0px;
|
||
margin: 0px;
|
||
}
|
||
|
||
.msgIsGuoQi {
|
||
display: block;
|
||
height: 25px;
|
||
width: 40px;
|
||
line- height:14px;
|
||
padding: 2px 0px 0px 0px;
|
||
margin: 0px;
|
||
color: gray;
|
||
}
|
||
|
||
body .demo-class .layui-layer-title {
|
||
background: #c00;
|
||
color: #fff;
|
||
border: none;
|
||
}
|
||
|
||
body .demo-class .layui-layer-btn {
|
||
border-top: 1px solid #E9E7E7;
|
||
}
|
||
|
||
body .demo-class .layui-layer-btn a {
|
||
background: #333;
|
||
}
|
||
|
||
body .demo-class .layui-layer-btn .layui-layer-btn1 {
|
||
background: #999;
|
||
}
|
||
#ChatCore_chatmore .ChatCore_chatlist li {
|
||
padding: 0 20px 0 5px;
|
||
}
|
||
.Hidden {
|
||
display:none;
|
||
}
|
||
</style>
|
||
<form id="form1" method="post" enctype="multipart/form-data">
|
||
<input type="file" name="uploadFile" id="uploadFile" onchange="getFilePath()" @*accept="image/*"*@ style="filter:alpha(opacity=0);opacity:0;width: 0;height: 0;" />
|
||
<input type="hidden" id="nbtouser" name="toUser" />
|
||
<input type="hidden" id="eid" name="eid" value="@Html.Raw(ViewBag.eid)" />
|
||
<input type="hidden" id="accountnum" name="accountnum" value="@Html.Raw(Request.QueryString["accountnum"])" />
|
||
<a href=""></a>
|
||
</form>
|
||
<input type="hidden" id="imgmsg" value="" />
|
||
<input type="hidden" id="nbname" name="nbname" />
|
||
<input type="hidden" id="media_id" value="" />
|
||
<input type="hidden" id="sucaitype" value="" />
|
||
<input type="hidden" id="sucaiContent" value="" />
|
||
<div id="tab_menu" class="easyui-menu" style="width: 150px;">
|
||
<div id="tab_menu-sendmsg" data-options="iconCls:'icon-details'">
|
||
发送消息
|
||
</div>
|
||
<div id="tab_menu-upremarks" data-options="iconCls:'icon-lookup'">
|
||
修改备注
|
||
</div>
|
||
<div id="tab_menu-upgroup" data-options="iconCls:'icon-add'">
|
||
添加到分组
|
||
</div>
|
||
<div id="tab_menu-zhuanjie" data-options="">
|
||
转接
|
||
</div>
|
||
<div id="tab_menu-phonebind" data-options="">
|
||
绑定手机号
|
||
</div>
|
||
<div id="menu" class="easyui-menu" style="width: 150px;">
|
||
</div>
|
||
</div>
|
||
<script>
|
||
var sendType = "plain";//plain:普通,batch:批量
|
||
function getFilePath() {
|
||
var data = new FormData($('#form1')[0]);
|
||
$.ajax({
|
||
url: signalrService + '/WxMessageSvr/UploadImage',
|
||
type: 'POST',
|
||
data: data,
|
||
dataType: 'JSON',
|
||
cache: false,
|
||
processData: false,
|
||
contentType: false,
|
||
error: function () {
|
||
alert("出现错误!");
|
||
}
|
||
}).done(function (ret) {
|
||
if (ret.result == 0) {
|
||
alert(ret.erro);//错误提示
|
||
} else {
|
||
$("#imgmsg").val(ret.fileName);
|
||
if (sendType == "plain") {
|
||
$("#ChatCore_sendbtn").click();
|
||
} else {
|
||
$("#QFChatCore_sendbtn").click();
|
||
}
|
||
}
|
||
});
|
||
return false;
|
||
}
|
||
function SendSucai(name, suCaiType, media_id, url) {
|
||
$("#sucaitype").val(suCaiType);
|
||
$.ajax({
|
||
url: signalrService + '/WxMessageSvr/SendSuCai',
|
||
type: 'POST',
|
||
data: { toUserId: $("#nbtouser").val(), name: name, media_id: media_id, sucaitype: suCaiType, url: url, accountnum: accountnum, eid: userid },
|
||
dataType: 'JSON',
|
||
cache: false,
|
||
}).done(function (ret) {
|
||
if (ret.result == 0) {
|
||
alert(ret.erro);//错误提示
|
||
} else {
|
||
$("#imgmsg").val(ret.fileName);
|
||
if (ret.content != null) {
|
||
$("#sucaiContent").val(ret.content);
|
||
}
|
||
if (sendType == "plain") {
|
||
$("#ChatCore_sendbtn").click();
|
||
} else {
|
||
$("#QFChatCore_sendbtn").click();
|
||
}
|
||
var indexs = $("#sucaitab").parent().parent().attr("times");
|
||
layer.close(indexs);
|
||
//$.connection.chatHub.client.receivePrivateMessage(userid, username, "[imagepath]:" + ret.fileName);
|
||
}
|
||
});
|
||
}
|
||
function ImgPreview(media_id, url, imgeName) {
|
||
$.ajax({
|
||
url: signalrService + '/WxMessageSvr/ImgPreview?i=' + GetGuid(),
|
||
type: 'POST',
|
||
data: { media_id: media_id, url: url },
|
||
dataType: 'JSON',
|
||
cache: false,
|
||
}).done(function (ret) {
|
||
if (ret.result == 0) {
|
||
alert(ret.erro);//错误提示
|
||
} else {
|
||
var nhtml = "<img style=\"max-width:700px;\" src='http://192.168.1.132/weappfile" + ret.fileName + "'>";
|
||
layer.open({
|
||
title: '图片素材预览--' + imgeName,
|
||
type: 1,
|
||
skin: 'layui-layer-rim',
|
||
area: ['700px', '700px'],
|
||
content: nhtml
|
||
});
|
||
}
|
||
});
|
||
}
|
||
function GetUserInfo(openid) {
|
||
$.ajax({
|
||
url: '/Weapp/WeappChatCont',
|
||
type: 'POST',
|
||
data: { "openid": openid },
|
||
dataType: 'JSON',
|
||
cache: false,
|
||
processData: false,
|
||
contentType: false
|
||
}).done(function (ret) {
|
||
alert(ret);
|
||
});
|
||
}
|
||
function ShowErroMsg(errmsg) {
|
||
layer.open({
|
||
title: '错误提示',
|
||
type: 1,
|
||
skin: 'demo-class',
|
||
area: ['250px', '150px'],
|
||
btn: ["确定"],
|
||
btnAlign: 'c', //按钮居中
|
||
content: '<div style="padding: 5px 5px;">' + errmsg + '</div>'
|
||
});
|
||
}
|
||
function ShowSuccMsg(msg) {
|
||
layer.open({
|
||
title: '成功提示',
|
||
type: 1,
|
||
//skin: 'demo-class',
|
||
area: ['250px', '150px'],
|
||
btn: ["确定"],
|
||
btnAlign: 'c', //按钮居中
|
||
content: '<div style="padding: 5px 5px;">' + msg + '</div>'
|
||
});
|
||
}
|
||
function ShowWXMsg(msg) {
|
||
layer.open({
|
||
title: '操作提示',
|
||
type: 1,
|
||
//skin: 'demo-class',
|
||
area: ['250px', '150px'],
|
||
btn: ["确定"],
|
||
btnAlign: 'c', //按钮居中
|
||
content: '<div style="padding: 5px 5px;">' + msg + '</div>'
|
||
});
|
||
}
|
||
var menuChooseId = "";//被选中的客户openId
|
||
$(function () {
|
||
$(window).resize(function () {//自动适应大小
|
||
SetWidth();
|
||
});
|
||
SetWidth();
|
||
//发送消息
|
||
$("#tab_menu-sendmsg").click(function () {
|
||
$("#ChatCore_friend_list li[data-id='" + menuChooseId + "']").click();
|
||
});
|
||
//修改备注
|
||
$("#tab_menu-upremarks").click(function () {
|
||
if (menuChooseId == null | menuChooseId == "")
|
||
return;
|
||
var memarks = $("#ChatCore_friend_list li[data-id='" + menuChooseId + "']").attr("remarks");
|
||
var nickname = $("#ChatCore_friend_list li[data-id='" + menuChooseId + "']").attr("nickname");
|
||
layer.open({
|
||
title: '修改备注 [ ' + nickname + "]",
|
||
type: 1,
|
||
skin: 'layui-layer-rim',
|
||
area: ['410px', '200px'],
|
||
btn: ['保存', '关闭'],
|
||
//btnAlign: 'c', //按钮居中
|
||
content: '<div style="padding: 20px 100px;"><input name="title" id="txt_remark" style="height:30px;" lay-verify="title" autocomplete="off" placeholder="请输入备注" class="layui-input" type="text" value="' + memarks + '"></div>',
|
||
yes: function () {
|
||
$.ajax({
|
||
url: signalrService + '/WxGroupSvr/UpdateRemark',
|
||
type: 'POST',
|
||
data: { OPENID: menuChooseId, REMARKS: $("#txt_remark").val(), ACCOUNTNUM: accountnum, EID: parseInt(userid) },
|
||
dataType: 'JSON'
|
||
//cache: false
|
||
}).done(function (ret) {
|
||
if (ret.type == 1) {
|
||
var lishow = $("li[data-id='" + menuChooseId + "']");
|
||
var cunickname = lishow.attr("nickname");
|
||
var crmarks = $("#txt_remark").val();
|
||
if (cunickname == null || cunickname == "") {
|
||
cunickname = "未知";
|
||
}
|
||
if (crmarks != null && crmarks != "" && cunickname != crmarks) {
|
||
cunickname = crmarks + "(" + cunickname + ")";
|
||
}
|
||
lishow.attr("remarks", crmarks);//修改名称
|
||
lishow.find(".ChatCore_onename").html(cunickname);
|
||
var indexs = $("#txt_remark").parent().parent().parent().attr('times');
|
||
layer.close(indexs);
|
||
} else {
|
||
return false;
|
||
}
|
||
});
|
||
//return false;
|
||
},
|
||
btn2: function () {
|
||
return true;
|
||
}
|
||
});
|
||
|
||
});
|
||
$("#tab_menu-upgroup").click(function () {
|
||
if (menuChooseId == null | menuChooseId == "")
|
||
return;
|
||
var updateName = $("#ChatCore_friend_list li[data-id='" + menuChooseId + "']").find(".ChatCore_onename").text();
|
||
|
||
$.r_ajax({
|
||
url: signalrService + '/WxGroupSvr/GetUserInGroupByOpenId',
|
||
type: "Post",
|
||
data: { accountNum: accountnum, eId: parseInt(userid), openid: menuChooseId },
|
||
dataType: "json",
|
||
loading: true,
|
||
success: function (ret) {
|
||
if (ret.type == 0) {
|
||
ShowErroMsg(ret.message);
|
||
return;
|
||
}
|
||
|
||
var html = '<table id="checktab">';
|
||
//<input name="like1[write]" lay-skin="primary" title="写作" checked="" type="checkbox">
|
||
//<input name="like1[read]" lay-skin="primary" title="阅读" type="checkbox">
|
||
//<input name="like1[game]" lay-skin="primary" title="游戏" disabled="" type="checkbox">
|
||
|
||
$(ret.data2).each(function (x, n) {
|
||
html += '<tr><td><input id="ck_' + x + '" name="gid" ckgid="' + n.PKID + '" type="checkbox" value="' + n.PKID + '"> <label for="ck_' + x + '">' + n.GROUPNAME + '</label></td></tr>';
|
||
//html += getRowHtml(n.PKID, n.GROUPNAME);
|
||
});
|
||
|
||
html += "</table>";
|
||
layer.open({
|
||
title: '添加到分组 [ ' + updateName + ']',
|
||
type: 1,
|
||
skin: 'layui-layer-rim',
|
||
area: ['450px', '400px'],
|
||
btn: ["保存", "关闭"],
|
||
content: '<div style="padding: 5px 5px;">' + html + '</div>',
|
||
yes: function () {
|
||
var groupIds = "";
|
||
$("#checktab input:checked").each(function () {
|
||
groupIds += $(this).val() + ",";
|
||
});
|
||
if (groupIds.length > 0)
|
||
groupIds = groupIds.substring(0, groupIds.length - 1);
|
||
$.r_ajax({
|
||
url: signalrService + '/WxGroupSvr/UpdateUserGroup',
|
||
type: "Post",
|
||
data: { accountNum: accountnum, eId: userid, openId: menuChooseId, groups: groupIds },
|
||
dataType: "json",
|
||
loading: true,
|
||
success: function (ret) {
|
||
if (ret.type == 0) {
|
||
ShowErroMsg(ret.message);
|
||
return;
|
||
}
|
||
$("[NotSysGroup=\"true\"] .ChatCore_childnode[data-id='" + menuChooseId + "']").remove();//全部移除 新增html
|
||
var html = $("#ChatCore_friend_list [data-id='" + menuChooseId + "']").prop("outerHTML");
|
||
$("#checktab input:checked").each(function () {
|
||
var groupUL = $("[wxxGid='" + $(this).val() + "'] .ChatCore_chatlist");
|
||
//alert(groupUL.html());
|
||
//alert(groupUL.length);
|
||
//alert($("#ChatCore_friend_list [data-id='" + menuChooseId + "']").prop("outerHTML"));
|
||
groupUL.append(html);
|
||
groupUL.find("[data-id='" + menuChooseId + "']").on('contextmenu', function (e) {
|
||
menuChooseId = $(this).attr("data-id");
|
||
$('#tab_menu').menu('show', {
|
||
left: e.pageX,
|
||
top: e.pageY
|
||
});
|
||
return false;
|
||
});
|
||
|
||
});
|
||
$("[NotSysGroup=\"true\"]").each(function () {
|
||
$(this).find(".ChatCore_nums").html("(" + $(this).find(".ChatCore_chatlist").children().length + ")");
|
||
});
|
||
|
||
ShowSuccMsg("保存成功!");
|
||
}
|
||
});
|
||
}
|
||
});
|
||
$(ret.data).each(function (x, n) {
|
||
$("[ckgid='" + n.gid + "']").attr("checked", "checked");
|
||
});
|
||
}
|
||
});
|
||
});
|
||
$("#tab_menu-zhuanjie").click(function () {
|
||
if (menuChooseId == null | menuChooseId == "")
|
||
return;
|
||
var updateName = $("#ChatCore_friend_list li[data-id='" + menuChooseId + "']").find(".ChatCore_onename").text();
|
||
Transfer(menuChooseId, updateName);
|
||
});
|
||
$("#tab_menu-phonebind").click(function () {
|
||
if (menuChooseId == null | menuChooseId == "")
|
||
return;
|
||
var updateName = $("#ChatCore_friend_list li[data-id='" + menuChooseId + "']").find(".ChatCore_onename").text();
|
||
BindPhone(menuChooseId, updateName);
|
||
});
|
||
|
||
});
|
||
function SetWidth() {
|
||
var height = $(window).height() * 0.7;
|
||
height = height < 500 ? 500 : height;
|
||
//alert(height);
|
||
$('.ChatCore_list').height(height);
|
||
$('.ChatCore_searchmain').height(height + 50);
|
||
}
|
||
layui.use(['layer'], function () {
|
||
var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
|
||
//var form = layui.form();
|
||
});
|
||
layui.use('element', function () {
|
||
var $ = layui.jquery
|
||
, element = layui.element(); //Tab的切换功能,切换事件监听等,需要依赖element模块
|
||
|
||
});
|
||
//layui.use('form', function () {
|
||
|
||
// ////监听提交
|
||
// //form.on('submit(formDemo)', function (data) {
|
||
// // layer.msg(JSON.stringify(data.field));
|
||
// // return false;
|
||
// //});
|
||
//});
|
||
var fenzuid = 0;
|
||
function RemoveRow(fenzid) {
|
||
var xx = $("[fenzuid='" + fenzid + "']");
|
||
var ngid = xx.attr("wx_gid");
|
||
if (ngid == "0")
|
||
xx.remove();
|
||
else {
|
||
layer.open({
|
||
title: '提示',
|
||
type: 1,
|
||
skin: 'layui-layer-rim',
|
||
area: ['250px', '150px'],
|
||
btnAlign: 'c', //按钮居中
|
||
btn: ["确定", "取消"],
|
||
content: '<div id="fengxiantishi" style="padding: 5px 5px;">删除本组,组里面的成员也会被移除!确定要删除吗?</div>',
|
||
yes: function () {
|
||
var indexs = $("#fengxiantishi").parent().parent().attr("times");
|
||
$.r_ajax({
|
||
url: signalrService + '/WxGroupSvr/DeleteGroup',
|
||
type: "Post",
|
||
data: { groupId: xx.attr("wx_gid") },
|
||
dataType: "json",
|
||
loading: true,
|
||
success: function (ret) {
|
||
if (ret.type == 1) {
|
||
$("[wxxgid='" + ngid + "']").remove();
|
||
xx.remove();
|
||
} else {
|
||
ShowErroMsg(ret.message);
|
||
}
|
||
layer.close(indexs);
|
||
}
|
||
});
|
||
}
|
||
});
|
||
}
|
||
}
|
||
function SaveGroup(fenzid) {
|
||
var xx = $("[fenzuid='" + fenzid + "']");
|
||
var groupName = xx.find(".layui-input").val();
|
||
var jiaGid = xx.attr("wx_gid");
|
||
$.r_ajax({
|
||
url: signalrService + '/WxGroupSvr/UpdateGroup',
|
||
type: "Post",
|
||
data: { groupId: jiaGid, accountNum: accountnum, eid: userid, groupName: groupName },
|
||
dataType: "json",
|
||
loading: true,
|
||
success: function (ret) {
|
||
if (ret.type == 1) {
|
||
if (ret.pkid != null) {
|
||
xx.attr("wx_gid", ret.pkid);
|
||
}
|
||
if (jiaGid == "0") {//新增一个组
|
||
var xhtml = '<li class="ChatCore_parentnode" NotSysGroup="true"wxxgid="' + ret.pkid + '"><h5><i></i><span class="ChatCore_parentname" ngid="' + ret.pkid + '">' + groupName + '</span><em class="ChatCore_nums">(0)</em></h5><ul id="ChatCore_friend_list_' + ret.pkid + '" class="ChatCore_chatlist" >';
|
||
xhtml += "</ul></li>";
|
||
$("#Chat_FriendList").append(xhtml);
|
||
}
|
||
$("[ngid='" + xx.attr("wx_gid") + "']").html(groupName);//修改组名称
|
||
ShowSuccMsg("保存成功!");
|
||
} else {
|
||
ShowErroMsg(ret.message);
|
||
}
|
||
}
|
||
});
|
||
|
||
}
|
||
function OpenWindResId(resid) {
|
||
//window.opener.ChildAddTab('客户详细', '/Csvr/CustomerInfo/CustomerDetail?resid=' + resid, '');
|
||
window.open('/Csvr/CustomerInfo/CustomerDetail?resid=' + resid);
|
||
//parent.ChildAddTab('客户详细', '/Csvr/CustomerInfo/CustomerDetail?resid=440967598470886797', '')"
|
||
//$("#min").click();
|
||
}
|
||
function ShowVoice(MediaId) {
|
||
$.r_ajax({
|
||
url: signalrService + '/WxMessageSvr/GetVoice',
|
||
type: "Post",
|
||
data: { MediaId: MediaId, accountNum: accountnum },
|
||
dataType: "json",
|
||
loading: true,
|
||
success: function (result) {
|
||
if (result.result === true) {
|
||
|
||
var data = "http://192.168.1.132/weappfile/" + result.voicePath;
|
||
//$('#recordPlayerWin').window({ title: '播放录音', width: 330, height: 180, iconCls: 'icon-add', shadow: true, modal: true, closed: true, minimizable: false, maximizable: false, collapsible: false }).window('open');
|
||
var isIE = window.navigator.userAgent.indexOf("MSIE") !== -1;
|
||
//var isFirFox=window
|
||
var Html = "";
|
||
if (!isIE) {
|
||
Html = "<video controls=\"\" src=\"" + data + "\" style=\"width:300px; height:50px;\" autoplay=\"autoplay\" />";
|
||
} else {
|
||
Html = '<object id="Player" width="300" height="50" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject"hspace="5"><param name="AutoRewind" value="1"><param name="FileName" value="' + data + '"><param name="ShowControls" value="1"><param name="ShowPositionControls" value="0"><param name="ShowAudioControls" value="1"><param name="ShowTracker" value="1"><param name="ShowDisplay" value="0"><param name="ShowStatusBar" value="0"><param name="ShowGotoBar" value="0"><param name="ShowCaptioning" value="0"><param name="AutoStart" value="1"><param name="Volume" value="5000"><param name="AnimationAtStart" value="0"><param name="TransparentAtStart" value="0"><param name="AllowChangeDisplaySize" value="0"><param name="AllowScan" value="0"><param name="EnableContextMenu" value="0"><param name="ClickToPlay" value="1"> </object>';
|
||
}
|
||
layer.open({
|
||
title: '播放语音',
|
||
type: 1,
|
||
//skin: 'layui-layer-rim',
|
||
area: ['330px', '180px'],
|
||
btnAlign: 'c', //按钮居中
|
||
content: '<div id="fengxiantishi" style="padding: 5px 5px;">' + Html + '</div>'
|
||
});
|
||
|
||
} else {
|
||
ShowErroMsg("转换失败,请稍后重试!");
|
||
}
|
||
}
|
||
});
|
||
}
|
||
function Transfer(openId, nickname) {
|
||
|
||
layer.open({
|
||
title: '转接 [ ' + nickname + "]",
|
||
type: 1,
|
||
skin: 'layui-layer-rim',
|
||
area: ['410px', '200px'],
|
||
btn: ['保存', '关闭'],
|
||
//btnAlign: 'c', //按钮居中
|
||
content: '<div style="padding: 20px 100px;"><input name="title" id="txt_zjEid" style="height:30px;" lay-verify="title" autocomplete="off" placeholder="请输入工号" class="layui-input" type="text" value=""></div>',
|
||
yes: function () {
|
||
var zjeid = $.trim($("#txt_zjEid").val());
|
||
if (userid == zjeid) {
|
||
layer.tips('不能输入自己工号!', '#txt_zjEid', 2);
|
||
return false;
|
||
//ShowErroMsg("不能输入自己工号!");
|
||
}
|
||
if (isNaN(zjeid) || zjeid == '') {
|
||
layer.tips('工号必须是数字!', '#txt_zjEid', 2);
|
||
return false;
|
||
}
|
||
$.ajax({
|
||
url: signalrService + '/WxMessageSvr/TransferEid',
|
||
type: 'POST',
|
||
data: { fromEid: userid, toEid: zjeid, openId: openId, accountNum: accountnum },
|
||
dataType: 'JSON'
|
||
//cache: false
|
||
}).done(function (ret) {
|
||
if (ret.result == 1) {
|
||
if ($("#ChatCore_chatmore > .ChatCore_chatlist >li").length > 1) {
|
||
$("#ChatCore_chatmore > .ChatCore_chatlist >li[data-id='" + openId + "']>em").click();//关闭聊天窗口
|
||
} else {
|
||
$(".ChatCore_close").click();
|
||
}
|
||
$(".ChatCore_parentnode").find("li[data-id='" + openId + "']").remove();//移除数据
|
||
$("#ChooseFriendUL").find("li[data-id='" + openId + "']").remove();//移除数据
|
||
$(".ChatCore_parentnode").each(function () {
|
||
$(this).find(".ChatCore_nums").html("(" + $(this).find(".ChatCore_chatlist").children().length + ")");
|
||
});
|
||
var indexs = $("#txt_zjEid").parent().parent().parent().attr("times");
|
||
layer.close(indexs);
|
||
|
||
} else {
|
||
ShowErroMsg(ret.msg);
|
||
return false;
|
||
}
|
||
});
|
||
//return false;
|
||
},
|
||
btn2: function () {
|
||
return true;
|
||
}
|
||
});
|
||
}
|
||
function BindPhone(openId, nickname) {
|
||
layer.open({
|
||
title: '绑定手机号码 [ ' + nickname + "]",
|
||
type: 1,
|
||
skin: 'layui-layer-rim',
|
||
area: ['410px', '200px'],
|
||
btn: ['保存', '关闭'],
|
||
//btnAlign: 'c', //按钮居中
|
||
content: '<div style="padding: 20px 100px;"><input name="title" id="txt_BPhone" style="height:30px;" lay-verify="title" autocomplete="off" placeholder="请输入手机号码或者客户ID" class="layui-input" type="text" value=""></div>',
|
||
yes: function () {
|
||
var zjeid = $.trim($("#txt_BPhone").val());
|
||
if (zjeid == '') {
|
||
layer.tips('请输入正确的手机号码或者客户ID!', '#txt_BPhone', 2);
|
||
return false;
|
||
}
|
||
$.ajax({
|
||
url: signalrService + '/WxUserInfoSvr/BindResId',
|
||
type: 'POST',
|
||
data: { resId: zjeid, openId: openId, resIdVerify: 0 },
|
||
dataType: 'JSON'
|
||
//cache: false
|
||
}).done(function (ret) {
|
||
if (ret.result == true) {
|
||
if (ret.msg != null && ret.msg != "") {
|
||
ShowWXMsg(ret.msg);
|
||
} else {
|
||
$("[data-id='" + openId + "']").attr("resid", ret.resid);
|
||
if ($("#BindPhone").attr("n_openid") == openId) {
|
||
$("#ChatCore_chatbox").find(".ChatResId").remove();
|
||
$("#ChatCore_chatbox .ChatCore_names").after("<a class='ChatResId' href='javascript:OpenWindResId(\"" + ret.resid + "\")'>" + ret.resid + "</a>");
|
||
|
||
}
|
||
var indexs = $("#txt_BPhone").parent().parent().parent().attr("times");
|
||
layer.close(indexs);
|
||
}
|
||
|
||
} else {
|
||
ShowErroMsg(ret.msg);
|
||
return false;
|
||
}
|
||
});
|
||
//return false;
|
||
},
|
||
btn2: function () {
|
||
return true;
|
||
}
|
||
});
|
||
}
|
||
</script>
|
||
|
||
<script type="text/javascript">
|
||
(function ($) {
|
||
$.extend({
|
||
/**
|
||
* 调用方法: var timerArr = $.blinkTitle.show();
|
||
* $.blinkTitle.clear(timerArr);
|
||
*/
|
||
blinkTitle: {
|
||
show: function () { //有新消息时在title处闪烁提示
|
||
var step = 0, _title = document.title;
|
||
var timer = setInterval(function () {
|
||
step++;
|
||
if (step == 3) {
|
||
step = 1
|
||
}
|
||
|
||
if (step == 1) {
|
||
document.title = '【 】' + _title
|
||
}
|
||
|
||
if (step == 2) {
|
||
document.title = '【新消息】' + _title
|
||
}
|
||
|
||
}, 500);
|
||
return [timer, _title];
|
||
},
|
||
/**
|
||
* param timerArr[0], timer标记
|
||
* param timerArr[1], 初始的title文本内容
|
||
*/
|
||
clear: function (timerArr) { //去除闪烁提示,恢复初始title文本
|
||
if (timerArr) {
|
||
clearInterval(timerArr[0]);
|
||
document.title = timerArr[1];
|
||
}
|
||
|
||
}
|
||
}
|
||
});
|
||
})(jQuery);
|
||
//jQuery(function ($) {
|
||
// var timerArr = $.blinkTitle.show();
|
||
// setTimeout(function () { //此处是过一定时间后自动消失
|
||
// $.blinkTitle.clear(timerArr);
|
||
// }, 10000);
|
||
// //若认为操作消失,只需如此调用: $.blinkTitle.clear(timerArr);
|
||
//});
|
||
</script>
|
||
@*<div id="recordPlayerWin"></div>*@
|
||
</body>
|
||
</html>
|