Mini.Crm/Mini.Web/Areas/Admin/Views/OutHHuser/MessageDetial10.cshtml

1374 lines
67 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@{
ViewBag.Title = "MessageDetial";
Layout = "~/Areas/Admin/Views/Shared/_content.cshtml";
}
@using Mini.Web.WebHelper
<script src="~/Scripts/html5media.js"></script>
<link href="~/css/boxImg.css" rel="stylesheet" />
<script src="~/Scripts/boxImg.js"></script>
@*<script src="~/Scripts/crypto-js.min.js"></script>*@
<script src="~/Scripts/base64.min.js"></script>
<style>
.piclink {
border: #b5b2b2 1px solid;
width: 280px;
height: 150px;
padding: 20px;
}
.piclink a {
color: #757875;
text-decoration: none;
}
.piclink a:link {
color: black;
}
/* 未被访问的链接 */
.piclink a:visited {
}
/* 已被访问的链接 */
.piclink a:hover {
color: black;
}
/* 鼠标指针移动到链接上 */
.piclink a:active {
}
/* 正在被点击的链接 */
.piclink .pictitle {
font-size: 16px;
font-weight: bold;
}
.piclink .piccontent {
font-size: 12px;
margin-top: 10px;
width: 210px;
float: left;
display: -webkit-box; /* display: -webkit-box; 必须结合的属性 ,将对象作为弹性伸缩盒子模型显示 */
-webkit-box-orient: vertical; /* -webkit-box-orient 必须结合的属性 ,设置或检索伸缩盒对象的子元素的排列方式 */
-webkit-line-clamp: 4; /* -webkit-line-clamp用来限制在一个块元素显示的文本的行数 */
overflow: hidden;
}
.piclink .picimg {
width: 60px;
height: 60px;
float: right;
object-fit: cover;
}
</style>
<style>
.shipinlink {
border: #b5b2b2 1px solid;
width: 280px;
height: 150px;
padding: 20px;
}
.shipinlink a {
color: #757875;
text-decoration: none;
}
.shipinlink a:link {
color: black;
}
/* 未被访问的链接 */
.shipinlink a:visited {
}
/* 已被访问的链接 */
.shipinlink a:hover {
color: black;
}
/* 鼠标指针移动到链接上 */
.shipinlink a:active {
}
/* 正在被点击的链接 */
.shipinlink .pictitle {
font-size: 16px;
font-weight: bold;
}
.shipinlink .piccontent {
font-size: 12px;
margin-top: 10px;
width: 280px;
float: left;
display: -webkit-box; /* display: -webkit-box; 必须结合的属性 ,将对象作为弹性伸缩盒子模型显示 */
-webkit-box-orient: vertical; /* -webkit-box-orient 必须结合的属性 ,设置或检索伸缩盒对象的子元素的排列方式 */
-webkit-line-clamp: 4; /* -webkit-line-clamp用来限制在一个块元素显示的文本的行数 */
overflow: hidden;
height: 120px;
}
.shipinlink .picimg {
width: 20px;
height: 20px;
float: left;
object-fit: cover;
}
</style>
<style>
#wochalei {
height: 30px;
width: 100%;
background-color: #536484;
}
#wochalei ul {
padding: 0px;
font-size: 12px;
color: #FFF;
line-height: 26px;
white-space: nowrap;
}
#wochalei li {
list-style-type: none;
}
#wochalei li span {
text-decoration: none;
font-family: Arial, Helvetica, sans-serif;
padding: 7px 5px;
width: 100%;
}
.rcontacthover {
color: #ff0;
background-color: #7E8BA3;
}
.rcontactClick {
color: #ff0;
background-color: #8988AE;
}
.isSelf {
color: #006EFE;
padding-left: 10px;
}
.isFriend {
color: #42B475;
padding-left: 10px;
}
.message {
padding-left: 20px;
}
.redColor {
color: red;
}
.displayLi {
display: none;
}
.contentTable td {
font-size: 12px;
line-height: 26px;
max-width: 500px;
}
.imageClass {
max-width: 200px;
}
.miniimageClass {
max-width: 100px;
}
.outhertable {
border: 2px solid #757875;
}
.hgguanjianci {
background-color: #FF9800;
color: white
}
.hgguanjianci_choose {
background-color: red;
color: white
}
</style>
<script type="text/JavaScript" language="javascript">
var face = [{ name: "[微笑]", imgpath: "0.png" }, { name: "[撇嘴]", imgpath: "1.png" }, { name: "[色]", imgpath: "2.png" }, { name: "[发呆]", imgpath: "3.png" },
{ name: "[得意]", imgpath: "4.png" }, { name: "[流泪]", imgpath: "5.png" }, { name: "[害羞]", imgpath: "6.png" }, { name: "[闭嘴]", imgpath: "7.png" }, { name: "[睡]", imgpath: "8.png" },
{ name: "[大哭]", imgpath: "9.png" }, { name: "[尴尬]", imgpath: "10.png" }, { name: "[发怒]", imgpath: "11.png" }, { name: "[调皮]", imgpath: "12.png" },
{ name: "[呲牙]", imgpath: "13.png" }, { name: "[惊讶]", imgpath: "14.png" }, { name: "[难过]", imgpath: "15.png" }, { name: "[酷]", imgpath: "16.png" },
{ name: "[囧]", imgpath: "17.png" }, { name: "[抓狂]", imgpath: "18.png" }, { name: "[吐]", imgpath: "19.png" }, { name: "[偷笑]", imgpath: "20.png" },
{ name: "[愉快]", imgpath: "21.png" }, { name: "[白眼]", imgpath: "22.png" }, { name: "[傲慢]", imgpath: "23.png" },
{ name: "[饿]", imgpath: "24.png" }, { name: "[困]", imgpath: "25.png" }, { name: "[惊恐]", imgpath: "26.png" },
{ name: "[流汗]", imgpath: "27.png" }, { name: "[憨笑]", imgpath: "28.png" }, { name: "[悠闲]", imgpath: "29.png" }, { name: "[奋斗]", imgpath: "30.png" },
{ name: "[咒骂]", imgpath: "31.png" }, { name: "[疑问]", imgpath: "32.png" }, { name: "[嘘]", imgpath: "33.png" }, { name: "[晕]", imgpath: "34.png" },
{ name: "[疯]", imgpath: "35.png" }, { name: "[衰]", imgpath: "36.png" }, { name: "[骷髅]", imgpath: "37.png" },
{ name: "[敲打]", imgpath: "38.png" }, { name: "[再见]", imgpath: "39.png" }, { name: "[擦汗]", imgpath: "40.png" },
{ name: "[抠鼻]", imgpath: "41.png" }, { name: "[鼓掌]", imgpath: "42.png" }, { name: "[糟糕]", imgpath: "43.png" },
{ name: "[坏笑]", imgpath: "44.png" }, { name: "[左哼哼]", imgpath: "45.png" },
{ name: "[右哼哼]", imgpath: "46.png" }, { name: "[哈欠]", imgpath: "47.png" },
{ name: "[鄙视]", imgpath: "48.png" }, { name: "[委屈]", imgpath: "49.png" },
{ name: "[快哭了]", imgpath: "50.png" }, { name: "[阴险]", imgpath: "51.png" },
{ name: "[亲亲]", imgpath: "52.png" }, { name: "[吓]", imgpath: "53.png" },
{ name: "[可怜]", imgpath: "54.png" }, { name: "[菜刀]", imgpath: "55.png" },
{ name: "[西瓜]", imgpath: "56.png" }, { name: "[啤酒]", imgpath: "57.png" },
{ name: "[篮球]", imgpath: "58.png" }, { name: "[乒乓]", imgpath: "59.png" },
{ name: "[咖啡]", imgpath: "60.png" }, { name: "[美食]", imgpath: "61.png" },
{ name: "[猪头]", imgpath: "62.png" }, { name: "[玫瑰]", imgpath: "63.png" },
{ name: "[凋谢]", imgpath: "64.png" }, { name: "[嘴唇]", imgpath: "65.png" },
{ name: "[爱心]", imgpath: "66.png" }, { name: "[心碎]", imgpath: "67.png" },
{ name: "[蛋糕]", imgpath: "68.png" }, { name: "[电]", imgpath: "69.png" }, { name: "[炸弹]", imgpath: "70.gif" }, { name: "[便便]", imgpath: "71.gif" },
{ name: "[月亮]", imgpath: "72.gif" }, { name: "[太阳]", imgpath: "73.gif" }, { name: "[拥抱]", imgpath: "74.png" }, { name: "[强]", imgpath: "75.gif" }, { name: "[弱]", imgpath: "76.gif" },
{ name: "[握手]", imgpath: "77.gif" }, { name: "[胜利]", imgpath: "78.gif" }, { name: "[抱拳]", imgpath: "79.gif" }, { name: "[勾引]", imgpath: "80.gif" },
{ name: "[拳头]", imgpath: "81.gif" }, { name: "[OK]", imgpath: "82.gif" }, { name: "[跳跳]", imgpath: "83.gif" }, { name: "[发抖]", imgpath: "84.gif" },
{ name: "[怄火]", imgpath: "85.png" }, { name: "[转圈]", imgpath: "86.gif" }
];
</script>
<style>
.ly_toolBar {
left: 200px;
z-index: 99999;
display: block;
position: absolute;
top: 0;
z-index: 10;
width: 85px;
height: 39px;
line-height: 39px;
border-width: 0;
border-style: solid;
border-radius: 2px;
text-align: center;
background-color: #fff;
cursor: pointer;
color: black;
font-size: 14px;
border-color: #dcd9d9;
}
</style>
<div class="layui-tab" style="margin:0;height:calc(100% - 48px);background-color: white;">
<span class="layui-unselect ly_toolBar ly_toolBar_all" id="ly_scroll_all" title="点击最新记录在前">
<span id="ly_scroll_all_title">最新在前</span>
<i class="layui-icon layui-icon-down" id="ly_scroll_all_icon"></i>
</span>
@{
string customer = (string)ViewBag.customer;
bool IsCanLoadKeyWords = (bool)ViewBag.IsCanLoadKeyWords;
}
<div style="left:320px;top:0px;z-index:500;display:block;position:absolute; vertical-align:bottom; line-height:39px;">
<input type="checkbox" value="0" title="只显示客户" id="showCustomer" style="vertical-align: middle;" onchange="isShowCustomer()" /><label for="showCustomer" style="padding-left:5px;vertical-align:middle; ">只显示客户</label>
</div>
@if (IsCanLoadKeyWords)
{
<div style="left:430px;top:8px;z-index:500;display:block;position:absolute;">
<a href="javascript:NextHgWords()">下一个</a>
<a href="javascript:PrvHgWords()">上一个</a>
</div>
}
@if (!string.IsNullOrEmpty(customer))
{
@*<button id="export" type="button" class="layui-btn layui-btn-sm layui-bg-red " style="left:500px;top:5px;z-index:500;display:block;position:absolute;">打包导出</button>*@
}
@{
string showsaleline = ViewBag.ShowSaleLine;
string SaleLineHttp = ViewBag.SaleLineHttp;
}
@if (!string.IsNullOrEmpty(showsaleline) && showsaleline == "true")
{
<button id="saleline" type="button" class="layui-btn layui-btn-sm layui-bg-red " style="left:600px;top:5px;z-index:500;display:block;position:absolute;">销售线索</button>
}
<button id="export" type="button" class="layui-btn layui-btn-sm layui-bg-red " style="left:600px;top:5px;z-index:500;display:none;position:absolute;">打包导出</button>
<div style="left:700px;top:8px;z-index:500;display:block;position:absolute;" id="showDownLoad">
@{
int IsPackNow = (int)ViewBag.IsPackNow;
string NowPathName = (string)ViewBag.NowPathName;
}
<a id="a_loadding" href="javascript:void(0);" class="@Html.Raw(IsPackNow==1?"":"hiddenDis")">正在执行打包中..........</a>
<a id="a_download" href="javascript:void(0);" folderName="@Html.Raw(ViewBag.folderName)" zipName="@Html.Raw(ViewBag.NowPathName)" class="lingA @Html.Raw(IsPackNow==1?"hiddenDis":"")" title="点击下载!">
<i class="mask-prev layui-icon layui-self-zip @Html.Raw(string.IsNullOrEmpty(NowPathName)?"hiddenDis":"")" style="font-size:20px;cursor: pointer;"></i><span id="span_zipname">@Html.Raw(ViewBag.NowPathName)</span>
</a>
</div>
<button id="dowdn" type="button" class="layui-btn layui-btn-primary layui-btn-sm" style="right:70px;top:5px;z-index:500;display:block;position:absolute;"></button>
<button id="quanping" type="button" class="layui-btn layui-btn-primary layui-btn-sm" style="right:10px;top:5px;z-index:500;display:block;position:absolute;">全屏</button>
@{
List<Mini.Model.ViewModel.Wx_ExuserModel> list = (List<Mini.Model.ViewModel.Wx_ExuserModel>)ViewBag.OtherKeFu;
}
<ul class="layui-tab-title">
<li class="layui-this">聊天记录</li>
<li>语音通话</li>
@*@if (list.Count > 0)
{
<li style="float:right;right:90px">
<button class="layui-btn layui-btn-sm layui-btn-primary" id="demo422">
其他客服的聊天
<span class="layui-badge">@list.Count</span>
</button>
</li>
}*@
</ul>
<div class="layui-tab-content" style="height:calc(100% - 65px);width:100%;">
<div class="layui-tab-item layui-show" style="height:100%;width:100%;">
<div id="mycontent1" class="layui-side-scroll" style="width:calc(100% - 10px);">
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
<legend id="msg_title">聊天记录:</legend>
<legend id="msg_userid" style="font-size:14px;"></legend>
</fieldset>
<ul class="layui-timeline" id="contentBody">
<li class="layui-timeline-item">
<i class="layui-icon layui-timeline-axis"></i>
<div class="layui-timeline-content layui-text">
<h4 class="layui-timeline-title" style="color:red;">温馨提示:</h4>
<p>
请选中左边列表中的好友查看聊天记录。
</p>
</div>
</li>
</ul>
</div>
</div>
<div class="layui-tab-item" style="height:100%;width:100%;">
<div id="mycontent2" class="layui-side-scroll" style="width:calc(100% - 10px);">
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
<legend id="msg_title2">语音通话:</legend>
</fieldset>
<ul class="layui-timeline" id="recordbody">
<li class="layui-timeline-item">
<i class="layui-icon layui-timeline-axis"></i>
<div class="layui-timeline-content layui-text">
<h4 class="layui-timeline-title" style="color:red;">温馨提示:</h4>
<p>
请选中左边列表中的好友查看语音通话。
</p>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
<div style="background-color:white;border-top:1px solid #e6e6e6;height:40px;">
<div class="layui-inline" style="padding-top:5px;">时间过滤:</div>
<div class="layui-inline" style="padding-top:5px;"> <input type="text" placeholder="yyyy-MM" autocomplete="off" class="layui-input test-item" id="stime" style="height:28px;width:100px;" value="@Html.Raw(DateTime.Now.AddDays(-30).ToString("yyy-MM-dd"))"></div>
<div class="layui-inline" style="padding-top:5px;">至</div>
<div class="layui-inline" style="padding-top:5px;"> <input type="text" placeholder="yyyy-MM" autocomplete="off" class="layui-input test-item" id="etime" style="height:28px;width:100px;" value="@Html.Raw(DateTime.Now.ToString("yyy-MM-dd"))"></div>
<div class="layui-inline" style="padding-top:5px;">
<button type="button" class="layui-btn layui-btn-sm layui-btn-ok" onclick="ShowDateMsg()">确定</button>
</div>
<div id="woSDFS" class="layui-inline hiddenBtn" style="padding-top:5px;">
<button type="button" class="layui-btn layui-btn-sm layui-btn-normal" onclick="GoLocation()" title="定位目标消息">定位</button>
</div>
<div class="layui-inline " style="width:200px;vertical-align: middle;float:right;text-align:right;right:20px;top:10px;">
<span id="msgcountspanmsg">
消息数:<span id="msgcountspan">0</span>
</span>
<span id="qunfaspanmsg">通话数:<span id="qunfacountspan">0</span></span>
</div>
</div>
<script src="~/Scripts/cookie.js"></script>
<style>
.LocationContent {
background-color: aqua;
}
.hiddenBtn {
display: none;
}
</style>
<script>
var locationJson = @Html.Raw(ViewBag.locationJson);
if (locationJson["NeedLocaltion"] == 1) {
if (locationJson.stime) {
document.getElementById("stime").value = locationJson.stime;
}
if (locationJson.etime) {
document.getElementById("etime").value = locationJson.etime;
}
document.getElementById("woSDFS").setAttribute("class", "layui-inline");
}
function GoLocation() {
if (locationJson["NeedLocaltion"] == 1) {
console.log("定位开始----");
var targ = $("[msgid='" + locationJson.msgid + "']");
if (targ == null || targ.length == 0) {
return;
}
$(targ).addClass("LocationContent").attr("title", "定位的聊天记录");
console.log(targ.offset());
//$("#nurse").scrollTop() + $('#tr-three').offset().top - $("#nurse").offset().top
var needhegiht = $(window).height() / 2;
var mycontent = $("#mycontent1");
console.log(mycontent.scrollTop());
mycontent.scrollTop(targ.offset().top - needhegiht + mycontent.scrollTop());
console.log(mycontent.scrollTop());
console.log("定位介绍********");
}
}
$(window).scroll(function () {
console.log(ScollPostion());
});
function ScollPostion() { //滚动条位置
var t, l, w, h;
if (document.documentElement && document.documentElement.scrollTop) {
t = document.documentElement.scrollTop;
l = document.documentElement.scrollLeft;
w = document.documentElement.scrollWidth;
h = document.documentElement.scrollHeight;
} else if (document.body) {
t = document.body.scrollTop;
l = document.body.scrollLeft;
w = document.body.scrollWidth;
h = document.body.scrollHeight;
}
return {
top: t,
left: l,
width: w,
height: h
};
}
</script>
<script>
var isDaoXu = "0";//是否倒叙
function SetName(name) {
$("#msg_title").html("群:" + name);
}
var httpurl = "@Html.Raw(Mini.Common.Utility.GetSettingByKey("HHMessageFile"))";
var innerhttp = "@Html.Raw(Mini.Common.Utility.GetSettingByKey("InnerFile"))";//内网获取json必须使用内网地址
var nowlocation = window.location.href;
if (nowlocation.indexOf("192.168.1.") > -1 || nowlocation.indexOf("192.168.11.") > -1 || nowlocation.indexOf("localhost") > -1) {//内网无疑
httpurl = innerhttp;
}
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;
}
var layer;
layui.use(['dropdown', 'form', 'element', 'layedit', 'laydate'], function () {
var dropdown = layui.dropdown;
layer = layui.layer;
var form = layui.form
, layedit = layui.layedit
, laydate = layui.laydate;
var element = layui.element;
//执行一个laydate实例
laydate.render({
elem: '#stime' //指定元素
, trigger: 'click'
});
laydate.render({
elem: '#etime' //指定元素
, trigger: 'click'
});
var data = @Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(list));
var mydata = [];
if (data) {
$(data).each(function (a, b) {
mydata[a] = { title: b.uname + "(" + b.userid + ")", id: b.userid, href: "javascript:ShowNewLT('" + b.userid + "','" + b.uname + "')" };
});
mydata[mydata.length] = { type: "-" };
}
/*dropdown.render({
elem: '#demo422'
, trigger: 'hover'
, data: mydata
});*/
});
var IsHiddenEWM = "@Html.Raw(ViewBag.IsHiddenEWM)";
var isgroup = "@Html.Raw(ViewBag.isgroup)";
var userid = "@Html.Raw(ViewBag.userid)";
var uname = "@Html.Raw(ViewBag.uname)";
var corp = "@Html.Raw(ViewBag.corp)";
var cs_username = `@Html.Raw(ViewBag.customer)`;
var cs_nickname = `@Html.Raw((""+ViewBag.nickname).Replace("\\",""))`.replace(/\r\n/g, "").replace(/\n/g, "").replace(/\r/g, " ").replace(/\t/g, " ");
var group = @Html.Raw(ViewBag.groupuser);
var vfolderName = "@Html.Raw(ViewBag.folderName)";
var holpName = `@Html.Raw((""+ViewBag.zipPathName).Replace("\\",""))`.replace(/\r\n/g, "").replace(/\n/g, "").replace(/\r/g, " ").replace(/\t/g, " ");
var interval = null;
var IsPackNow = "@Html.Raw(IsPackNow)";
if (IsPackNow == "1") {
interval = setInterval("RefreshPackStatus()", 3000);//3秒执行一次调度
}
function ShowNewLT(nuserid, nuname) {
if (window["context"] == undefined) {
if (!window.location.origin) {
window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port : '');
}
window["context"] = location.origin + "/V6.0";
}
var url = "/Admin/OutHHuser/MessageDetial?isgroup=false&userid=" + nuserid + "&uname=" + nuname + "&corp=" + corp + "&customer=" + cs_username + "&nickname=" + cs_nickname;
//top.ChildAddTab('其他客服聊天--' + nuname + "/" + cs_nickname, url, "icon-detail");
window.top.postMessage({ name: '其他客服聊天--' + nuname + "/" + cs_nickname, url: location.origin + url, icon: "icon-detail" }, "*");
}
function RefreshPackStatus() {
$.ajax({
type: "POST",
url: `RefreshPackStatus?folderName=${vfolderName}&holpName=${encodeURI(holpName)}&i=${GetGuid()}`,
dataType: "json",
async: false,
success: function (data) {
console.log(data);
if (data.result == true) {//打包完成
if (interval != null) {//清除定时器
window.clearInterval(interval);
interval = null;
}
$("#a_loadding").addClass("hiddenDis");
$("#a_download").removeClass("hiddenDis");
$(".layui-self-zip").removeClass("hiddenDis");
$("#a_download").attr("zipName", data.retmsg);
$("#span_zipname").html(data.retmsg);
}
}, error: function () {
}
});
}
$(function () {
$("#saleline").click(function () {
var url = "@Html.Raw(SaleLineHttp)";
var saleurl = url.replace("{corp}", corp + "_1").replace("{appuserid}", cs_username);//http://sc.soft.dn8188.com/dev.html?appid={corp}&appuserid={appuserid}
layer.open({
type: 2,
content: saleurl,
area: ['320px', '520px']
});
});
$("#export").click(function () {
$("#a_loadding").removeClass("hiddenDis");
$("#a_download").addClass("hiddenDis");
$.ajax({
type: "POST",
url: `Export?isgroup=${isgroup}&userid=${userid}&uname=${uname}&corp=${corp}&cs_nickname=${cs_nickname}&cs_username=${cs_username}`,
dataType: "json",
async: false,
success: function (data) {
console.log(data);
if (data.result == true) {
layer.open({
title: '打包提醒'
, content: data.retmsg
, icon: '6'
, time: '1500'
});
interval = setInterval("RefreshPackStatus()", 3000);//3秒执行一次调度
} else {
layer.open({
title: '打包提醒'
, content: data.retmsg
, icon: '5'
, time: '1500'
});
}
}, error: function () {
}
});
//window.open(`Export?isgroup=${isgroup}&userid=${userid}&uname=${uname}&corp=${corp}&cs_nickname=${cs_nickname}&cs_username=${cs_username}`);
});
$("#quanping").click(function () {
window.open(window.location.href);
});
$("#dowdn").dblclick(function () {
$("#export").show();
$("#saleline").hide();
});
$("#showDownLoad").on("click", ".lingA", function () {
var folderName = $(this).attr('folderName');
//var zipName = encodeURI($(this).attr("zipName"));
//var zipName = encodeURIComponent($(this).attr("zipName"), "linyunwangsui");
//var zipName = encodeURIComponent(Base64.encode($(this).attr("zipName")));
var zipName = folderName + ".zip";
window.open(`DownLoad?folderName=${folderName}&zipname=${zipName}`);
});
var cookiepaixu = getCookie('messageDetial_paixu');
if (cookiepaixu != null) {
isDaoXu = cookiepaixu;
}
if (isDaoXu == "1") {
$("#ly_scroll_all_title").html("最早在前");
$("#ly_scroll_all_icon").removeClass("layui-icon-down").addClass("layui-icon-up");
$("#ly_scroll_all").attr("title", "点击最早记录在前");
} else {
$("#ly_scroll_all_title").html("最新在前");
$("#ly_scroll_all_icon").removeClass("layui-icon-up").addClass("layui-icon-down");
$("#ly_scroll_all").attr("title", "点击最新记录在前");
}
$("#ly_scroll_all").click(function () {
if (isDaoXu == "1") {
$("#ly_scroll_all_title").html("最新在前");
$("#ly_scroll_all_icon").removeClass("layui-icon-up").addClass("layui-icon-down");
$("#ly_scroll_all").attr("title", "点击最新记录在前");
isDaoXu = "0";
}
else {
$("#ly_scroll_all_title").html("最早在前");
$("#ly_scroll_all_icon").removeClass("layui-icon-down").addClass("layui-icon-up");
$("#ly_scroll_all").attr("title", "点击最早记录在前");
isDaoXu = "1";
}
console.log(isDaoXu)
setCookie("messageDetial_paixu", isDaoXu, "d300")
ShowMessage(cs_username);
});
if (cs_username != null && cs_username != '') {
$("#msg_title").html(cs_nickname);
$("#msg_title2").html(cs_nickname);
$("#msg_userid").html("客户ID&nbsp;" + cs_username);
ShowMessage(cs_username);
}
$("#dataGL").click(function () {
if (cs_username == null || cs_username == '') {
layer.msg('请选择微信好友!');
} else {
ShowMessage(cs_username);
}
});
});
var loadingindex;
function ShowDateMsg() {
ShowMessage(cs_username);
}
var messagecount = 0;
var recordcount = 0;
function ShowMessage(username) {
arrPic = new Array(); //定义一个数组
allimgindex = 0;
$("#contentBody").html("");
$("#recordbody").html("");
var nomessage = "<li class='layui-timeline-item' id='nomessage'>" +
"<i class='layui-icon layui-timeline-axis'></i >" +
"<div class='layui-timeline-content layui-text'>" +
"<h4 class='layui-timeline-title' style='color:red; '>温馨提示:</h4>" +
"<p>无聊天记录。(时间范围内无聊天记录)</p></div></li >";
//var qunfanomessage = "<li class='layui-timeline-item' id='nomessage'>" +
// "<i class='layui-icon layui-timeline-axis'></i >" +
// "<div class='layui-timeline-content layui-text'>" +
// "<h4 class='layui-timeline-title' style='color:red; '>温馨提示:</h4>" +
// "<p>无群发记录。</p></div></li >";
$("#contentBody").html(nomessage);
$("#recordbody").html(nomessage);
//$("#qunfabody").html(qunfanomessage);
var url = "";
var stime = $("#stime").val();
var etime = $("#etime").val();
if (isgroup == "false") {
url = innerhttp + "userjson?corpid=" + corp + "&user=" + userid + "&customer=" + cs_username + "&start=" + stime + "&end=" + etime + "&i=" + GetGuid();
} else {
url = innerhttp + "roomjson?corpid=" + corp + "&roomid=" + cs_username + "&start=" + stime + "&end=" + etime + "&i=" + GetGuid();
}
messagecount = 0;
recordcount = 0;
var recordurl = innerhttp + "recordjson?corpid=" + corp + "&user=" + userid + "&customer=" + cs_username + "&i=" + GetGuid();
GetMessageByUrl(url, "contentBody", userid, uname, cs_nickname, isgroup);
GetRecordByUrl(recordurl, "recordbody", userid, uname, cs_nickname, isgroup);
//ajaxLoadEnd();
}
function isShowCustomer() {
//alert("你点击我了:" + $("#showCustomer").is(':checked'));
ShowMessage(cs_username);
}
var selftemplete = "<li class='layui-timeline-item'>" +
"<i class='layui-icon layui-timeline-axis'></i>" +
"<div class='layui-timeline-content layui-text'> " +
"<h4 class='layui-timeline-title' style='color:#42B475;'>[title]</h4> " +
"<p msgid='[msgid]'>[content]</div></li>";
var outtemplete = "<li class='layui-timeline-item'>" +
"<i class='layui-icon layui-timeline-axis'></i>" +
"<div class='layui-timeline-content layui-text'> " +
"<h4 class='layui-timeline-title' style='color:#006EFE;'>[title]</h4> " +
"<p msgid='[msgid]'>[content]</p></div></li>";
function GetRecordByUrl(recordurl, tabName, userid, uname, customername) {
$.ajax({
type: "GET",
url: "GetPath?url=" + encodeURIComponent(recordurl),
dataType: "text",
async: false,
success: function (data) {
var copt = corp;
var workAccountName = uname;
var json = JSON.parse(data);
var paixu = false;
if (isDaoXu == "1") {
paixu = true;
}
json.sort(sortBy('starttime', paixu, String));
if (json.length > 0) {
$("#" + tabName).find("#nomessage").remove();
}
$(json).each(function (i, da) {
recordcount++;
var dataStr = da.starttime;//聊天时间
var html = "";
if (da.calltype == 0) {//客服打得电话
html = selftemplete.replace("[title]", workAccountName + " " + dataStr);
} else {//客户打得电话
html = outtemplete.replace("[title]", ReplaceMobile(customername) + " " + dataStr);
}
html = html.replace("[content]", "<a id='file_" + da.msgid + "' href=\"javascript:PalyRecord('" + httpurl + "playamr?corpid=" + copt + "&fname=" + da.filename + "')\" >[通话时长" + showTime(da.length) + "]<a>");
$("#" + tabName).append(html);
});
}, error: function () {
}
});
$("#qunfacountspan").html(recordcount);
}
function GetMessageByUrl(url, tabName, userid, uname, customername, isqunliao) {
$.ajax({
type: "GET",
url: "GetPath?url=" + encodeURIComponent(url),
dataType: "text",
async: false,
success: function (data) {
var copt = corp;
//var jobnickname = uname;
var workAccountName = uname;
//nowpost++;
var json = JSON.parse(data);
var paixu = false;
if (isDaoXu == "1") {
paixu = true;
}
json.sort(sortBy('msgtime', paixu, String));
if (json.length > 0) {
$("#" + tabName).find("#nomessage").remove();
}
var isshowcustomer = $("#showCustomer").is(':checked');
console.log(isshowcustomer);
$(json).each(function (i, da) {
messagecount++;//消息数
var dataStr = da.msgtime;//聊天时间
var html = "";
if (da.from.toLowerCase() == userid.toLowerCase()) {
if (isshowcustomer == true) {//只显示客户
return true;
}
html = selftemplete.replace("[title]", workAccountName + " " + dataStr);
} else {
if (isqunliao == "true") {
var groupuname = da.from;
var groupSearch = group.filter(m => m.userid == da.from);
if (groupSearch != null && groupSearch.length != 0)
groupuname = groupSearch[0].name;
//if (groupuname == "") {
// groupuname = da.from;
//}
html = outtemplete.replace("[title]", groupuname + " " + dataStr);
} else {
html = outtemplete.replace("[title]", ReplaceMobile(customername) + " " + dataStr);
//html += "<tr><td class=\"isFriend\">" + ReplaceMobile(customername) + " " + dataStr + "</td></tr>";
}
}
//console.log(da.msgtype);
html = html.replace("[msgid]", da.msgid);
if (da.msgtype == "image" || da.msgtype == "emotion") {
var imgurl = "" + httpurl + "mediafile?corpid=" + copt + "&fname=" + da.nfile + "";
if (da.msgtype == "image" && IsHiddenEWM == "1") {//需要隐藏二维码图片
imgurl = "GetNoEWMImgePath?url=" + encodeURIComponent(imgurl);
}
arrPic[allimgindex] = imgurl;
html = html.replace("[content]", "[图片]<img modal='zoomImg' imgindex='" + allimgindex + "' style='max-width:300px' id='file_" + da.seq + "' src='" + imgurl + "' src=''>");
allimgindex++;
$("#" + tabName).append(html);
//GetFilPath(da);
} else if (da.msgtype == "voice") {
//html += "<tr><td class=\"message\"><a id='file_" + da.id + "' href=\"javascript:PalyRecord('" + httpurl + "playamr?corpid=" + copt + "&fname=" + da.nfile + "')\" >[语音]<a></td></tr>";
html = html.replace("[content]", "<a id='file_" + da.id + "' href=\"javascript:PalyRecord('" + httpurl + "playamr?corpid=" + copt + "&fname=" + da.nfile + "')\" >[语音]<a>");
$("#" + tabName).append(html);
//GetFilPath(da);
} else if (da.msgtype == "video") {
//html += "<tr><td class=\"message\"><a id='file_" + da.id + "' href='" + httpurl + "mediafile?corpid=" + copt + "&fname=" + da.nfile + "' target='_blank' >[视频]<a></td></tr>";
html = html.replace("[content]", "<a id='file_" + da.id + "' href=\"javascript:PalyVideo('" + httpurl + "mediafile?corpid=" + copt + "&fname=" + da.nfile + "')\" >[视频]<a>");
$("#" + tabName).append(html);
//GetFilPath(da);
} else if (da.msgtype == "sphfeed") {
console.log(da);
if (da.sphfeed) {
var exthtml = '<div class="shipinlink"><div class="piccontent">' + da.sphfeed.feed_desc + '</div><div class="pictitle"><img class="picimg" src="/Content/Images/shipinghao.png">&nbsp;' + da.sphfeed.sph_name + '</div> </div>';
html = html.replace("[content]", exthtml);
$("#" + tabName).append(html);
} else {
var shpjson = JSON.parse(da.ext);
var exthtml = '<div class="shipinlink"><div class="piccontent">' + shpjson.sphfeed.feed_desc + '</div><div class="pictitle"><img class="picimg" src="/Content/Images/shipinghao.png">&nbsp;' + shpjson.sphfeed.sph_name + '</div> </div>';
html = html.replace("[content]", exthtml);
$("#" + tabName).append(html);
}
}
else if (da.msgtype == "file") {
//html += "<tr><td class=\"message\"><a id='file_" + da.id + "' href='" + httpurl + "mediafile?corpid=" + copt + "&fname=" + da.nfile + "' target='_blank' >[文件]<a></td></tr>";
html = html.replace("[content]", "<a id='file_" + da.id + "' href='" + httpurl + "mediafile?corpid=" + copt + "&fname=" + da.nfile + "' target='_blank' >[文件]<a>");
$("#" + tabName).append(html);
//GetFilPath(da);
} else if (da.msgtype == "meeting_voice_call") {
var contentx = JSON.parse(da.ext);
//console.log(contentx);
var videolength = "";
var endtimestr = contentx.meeting_voice_call.endtime;
var starttime = contentx.msgtime;
if (endtimestr > 5000000000) {
endtimestr = endtimestr / 1000;
}
if (starttime > 5000000000) {
starttime = starttime / 1000;
}
videolength = showTime(Math.ceil(endtimestr - starttime));
html = html.replace("[content]", "<a id='file_" + da.msgid + "' href=\"javascript:PalyRecord('" + httpurl + "playamr?corpid=" + copt + "&fname=" + contentx.voiceid + ".mp3" + "')\" >[通话时长" + videolength + "]<a>");
$("#" + tabName).append(html);
}
else if (da.msgtype == "text") {//普通文本
//html += "<tr><td class=\"message\">" + replaceFace(da.content) + "</td></tr>";
html = html.replace("[content]", ReplaceMobile(ReplaceHGKeyWords(replaceFace(da.content))));
$("#" + tabName).append(html);
} else if (da.msgtype == "link") {
var extjson = JSON.parse(da.ext);
var exthtml = '<div class="piclink"> <a href="' + extjson.link.link_url + '" target="_blank"> <div class="pictitle">' + extjson.link.title + '</div> <div class="piccontent">' + extjson.link.description + '</div><img class="picimg" src="' + extjson.link.image_url + '"></a></div>';
//html += "<tr><td class=\"message\">" + exthtml + "</td></tr>";
html = html.replace("[content]", exthtml);
$("#" + tabName).append(html);
} else if (da.msgtype == "chatrecord") {//转接聊天记录
var extjson = JSON.parse(da.ext);
var titleZF = extjson.chatrecord.title;
if (titleZF.indexOf("和") == -1 && titleZF.indexOf("与") == -1) {
titleZF = "<span style='color:#ec9a31;font-weight: bold;'>" + titleZF + "</span>";
} else {
if (titleZF.indexOf("和") > -1) {
var mutitle = titleZF.split('和');
titleZF = "<span style='color:#ec9a31;font-weight: bold;'>" + mutitle[0] + "</span> 和 <span style='color:#ec9a31;font-weight: bold;'>" + mutitle[1] + "</span>";
} else if (titleZF.indexOf("与") > -1) {
var mutitle = titleZF.split('与');
titleZF = "<span style='color:#ec9a31;font-weight: bold;'>" + mutitle[0] + "</span> 与 <span style='color:#ec9a31;font-weight: bold;'>" + mutitle[1] + "</span>";
}
}
var myhtml = "[转发聊天记录]" + titleZF;
myhtml += " <table class=\"contentTable outhertable\" ><tbody>";
$(extjson.chatrecord.item).each(function (za, qq) {
var newDate = new Date();
var newlong = parseInt(qq.msgtime.toString() + "000");
newDate.setTime(newlong);
var saildstr = getNowFormatDate(newDate);
myhtml += "<tr><td class=\"isSelf\">" + saildstr + "</td></tr>";
if (qq.type == "ChatRecordText") {//普通文本
var contentx = JSON.parse(qq.content);
myhtml += "<tr><td class=\"message\">" + ReplaceMobile(ReplaceHGKeyWords(replaceFace(contentx.content))) + "</td></tr>";
//$("#" + tabName).append(html);
} else if (qq.type == "ChatRecordImage") {
var contentx = JSON.parse(qq.content);
var imgurl = httpurl + "mediafile?corpid=" + copt + "&fname=" + contentx.md5sum + ".jpg";
if (IsHiddenEWM == "1") {//需要隐藏二维码图片
imgurl = "GetNoEWMImgePath?url=" + encodeURIComponent(imgurl);
}
arrPic[allimgindex] = imgurl;
myhtml += "<tr><td class=\"message\">[图片]<img modal='zoomImg' imgindex='" + allimgindex + "' style='max-width:300px' id='file_" + contentx.md5sum + "' src='" + imgurl + "' ></td></tr>";
allimgindex++;
} else if (qq.type == "ChatRecordVoice") {
var contentx = JSON.parse(qq.content);
myhtml += "<tr><td class=\"message\"><a id='file_" + contentx.md5sum + "' href=\"javascript:PalyRecord('" + httpurl + "playamr?corpid=" + copt + "&fname=" + contentx.md5sum + ".amr')\" >[语音]<a></td></tr>";
} else if (qq.type == "ChatRecordVideo") {
var contentx = JSON.parse(qq.content);
myhtml += "<tr><td class=\"message\"><a id='file_" + contentx.md5sum + "' href='" + httpurl + "mediafile?corpid=" + copt + "&fname=" + contentx.md5sum + ".mp4' target='_blank' >[视频]<a></td></tr>";
}
else if (qq.type == "ChatRecordFile") {
var contentx = JSON.parse(qq.content);
myhtml += "<tr><td class=\"message\"><a id='file_" + contentx.md5sum + "' href='" + httpurl + "mediafile?corpid=" + copt + "&fname=" + contentx.md5sum + "." + contentx.fileext + "' target='_blank' >文件:[" + contentx.filename + "]<a></td></tr>";
//$("#" + tabName).append(html);
} else if (qq.type == "ChatRecordLink") {
var contentx = JSON.parse(qq.content);
var exthtml = '<div class="piclink"> <a href="' + contentx.link_url + '" target="_blank"> <div class="pictitle">' + contentx.title + '</div> <div class="piccontent">' + contentx.description + '</div><img class="picimg" src="' + contentx.image_url + '"></a></div>';
myhtml += "<tr><td class=\"message\">" + exthtml + "</td></tr>";
//$("#" + tabName).append(html);
} else {
myhtml += "<tr><td class=\"message\">" + replaceFace(qq.content) + "</td></tr>";
}
});
myhtml += "</tbody></table>";
html = html.replace("[content]", myhtml);
$("#" + tabName).append(html);
} else {
//html += "<tr><td class=\"message\">" + replaceFace(da.ext) + "</td></tr>";
html = html.replace("[content]", replaceFace(da.ext));
$("#" + tabName).append(html);
}
//if (da.type == 3) {
// html = html.replace("[content]", "[图片]<img style='max-width:300px' id='file_" + da.msgSvrId + "' src=''>");
// $("#" + tabName).append(html);
// GetImage(da);
//} else if (da.type == 47) {
// if (da.url != "" && da.url != "null") {
// html = html.replace("[content]", "<img style='max-width:100px' id='file_" + da.msgSvrId + "' src='" + da.url + "'>");
// $("#" + tabName).append(html);
// } else {
// html = html.replace("[content]", "<img style='max-width:100px' id='file_" + da.msgSvrId + "' src=''>");
// $("#" + tabName).append(html);
// GetImage(da);
// }
//} else if (da.type == 34) {
// html = html.replace("[content]", "<span id='file_" + da.msgSvrId + "' >[语音]<span>");
// $("#" + tabName).append(html);
// GetImage(da);
//} else if (da.type == 43) {
// html = html.replace("[content]", "<span id='file_" + da.msgSvrId + "' >[视频]<span>");
// $("#" + tabName).append(html);
// GetImage(da);
//} else if (da.type == 49) {
// html = html.replace("[content]", "<span id='file_" + da.msgSvrId + "' >[文件]<span>");
// $("#" + tabName).append(html);
// GetImage(da);
//}
//else {//普通文本
// html = html.replace("[content]", replaceFace(da.content));
// $("#" + tabName).append(html);
//}
});
GetAllHgGuanJianCi();//初始化数据
//console.log("成功:"+nowpost);
//if (nowpost == allpost)
// layer.close(loadingindex);
GoLocation();//定位
}, error: function () {
//nowpost++;
//console.log("失败:" + nowpost);
//if (nowpost == allpost)
// layer.close(loadingindex);
}
});
$("#msgcountspan").html(messagecount);
}
function GetImage(da) {
$.ajax({
url: "@Html.Raw(System.Configuration.ConfigurationManager.AppSettings["WeiXinFilePath"])" + da.msgSvrId + "/" + da.type + "/" + da.createTime + "?i=" + GetGuid(),
type: "GET",
dataType: "json",
loading: true,
success: function (data) {
if (data.retmsg != null) {
var index = data.retmsg.indexOf("_");
var msgsId = data.retmsg.substring(0, index);
var path = data.retmsg.substring(index + 1, data.retmsg.length);
if (da.type == 34) {
$("#file_" + msgsId).after("<a id='file_" + msgsId + "' href='javascript:void(0);' onclick=\"PalyRecord('" + path + "');\">[语音]<a>").remove();
} else if (da.type == 43) {
$("#file_" + msgsId).after("<a id='file_" + msgsId + "' href='javascript:void(0);' onclick=\"PalyVideo('" + path + "');\">[视频]<a>").remove();
//$("#file_" + msgsId).attr("href", "javascript:void(0);").attr("onclick", "PalyVideo('" + path + "');");
} else if (da.type == 49) {
$("#file_" + msgsId).after("<a id='file_" + msgsId + "' src='" + path + "' href='" + path + "' target='_blank'>[文件]<a>").remove();
}
else {
$("#file_" + msgsId).attr("src", path);
$("#file_" + msgsId).attr("href", path);
$("#file_" + msgsId).attr("target", "_blank");
}
}
}, error: function (n) {
console.log(n);
}
});
}
//替换表情
function replaceFace(cotent) {
if (!cotent)
return cotent;
var txt = cotent;
$(face).each(function (i, n) {
while (txt.indexOf(n.name) > -1) {
txt = txt.replace(n.name, "<img src=\"/Face/" + n.imgpath + "\">");
}
});
return txt;
}
function findTxt() {
//var reg2 = new RegExp("\\" + escape(txt), "g");
}
var KeyWords = "@Html.Raw(ViewBag.KeyWrods)";
var HgWords = KeyWords.split(';');
var IsCanLoadKeyWords = "@Html.Raw(ViewBag.IsCanLoadKeyWords)";
//console.log(HgWords);
var alnn = 0;
function ReplaceHGKeyWords(content) {
if (IsCanLoadKeyWords != "True")
return content;
$(HgWords).each(function (i, key) {
if (key) {
alnn++;
content = content.replace(key, "<span class='hgguanjianci' id='hgwords_" + alnn + "'>" + key + "</span>");
}
});
return content;
}
var arrHgKey = new Array(); //
function GetAllHgGuanJianCi() {
if (IsCanLoadKeyWords != "True")
return;
arrHgKey = new Array(); //
hgNowIndex - 1;
topac = 0;
$(".hgguanjianci").each(function (my, span) {
arrHgKey[my] = $(span).attr("id");
});
console.log(arrHgKey);
}
var hgNowIndex = -1;
var topac = 0;
function PrvHgWords() {
console.log(hgNowIndex);
if (hgNowIndex - 1 < 0) {
layer.open({
title: '提醒'
, content: '没有了哦!'
, icon: '5'
, time: '1000'
});
return;
}
console.log("上一个:");
hgNowIndex--;
var kongjian = $("#" + arrHgKey[hgNowIndex]);
$(".hgguanjianci_choose").removeClass("hgguanjianci_choose");
$(kongjian).addClass("hgguanjianci_choose");
console.log(kongjian.offset());
console.log(kongjian.position());
topac = topac + (kongjian.offset().top + 30) - 200;
if (topac < 0)
topac = 0;
console.log("scrollTop:" + topac);
$("#mycontent1").animate({ scrollTop: topac }, 100)
}
function NextHgWords() {
if (arrHgKey.length < hgNowIndex + 1) {
layer.open({
title: '提醒'
, content: '没有了哦!'
, icon: '5'
, time: '1000'
});
return;
}
console.log("下一个:");
hgNowIndex++;
var kongjian = $("#" + arrHgKey[hgNowIndex]);
$(".hgguanjianci_choose").removeClass("hgguanjianci_choose");
$(kongjian).addClass("hgguanjianci_choose");
console.log(kongjian.offset());
console.log(kongjian.position());
topac += kongjian.offset().top - 180;
$("#mycontent1").animate({ scrollTop: topac }, 100)
}
function myBrowser() {
var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
var isOpera = userAgent.indexOf("Opera") > -1;
if (isOpera) { //判断是否Opera浏览器
return "Opera"
}
if (userAgent.indexOf("Firefox") > -1) { //判断是否Firefox浏览器
return "Firefox";
}
if (userAgent.indexOf("Chrome") > -1) {
return "Chrome";
}
if (userAgent.indexOf("Safari") > -1) { //判断是否Safari浏览器
return "Safari";
}
if (userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera) { //判断是否IE浏览器
return "IE";
}
if (userAgent.indexOf('Trident') > -1) {//IE11
return "IE";
}
if (userAgent.indexOf("Edge") > -1) {//Edge
return "IE";
}
}
function PalyRecord(url) {
url = url + "&nguid=" + GetGuid();
var html = "";
var browser = myBrowser();
if (browser == "IE" || browser == "Firefox") {
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="' + url + '"><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>'
} else {
html = '<video src=' + url + ' controls="controls" autoplay ="autoplay" style="width:300px; height:50px;" />';
}
layui.use('layer', function () {
var layer = layui.layer;
layer.open({
title: '播放语音',
type: 1,
content: html,
shade: 0,
area: ['300px', '200px']
});
});
//$.post("/Admin/HHUser/WeWorkAudio", { url: url
// }, function (result) {
// if (result.type == 1) {
// var data = result.data;
//$('#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 isChrome = window.navigator.userAgent.indexOf("Chrome") !== -1;
//if (isChrome) {
// $('#recordPlayerWin').html("<video controls=\"\" src=\"" + url + "\" style=\"width:300px; height:50px;\" autoplay=\"autoplay\" />");
//} else {
// $('#recordPlayerWin').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="' + url + '"><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>');
//}
// } else {
// alert(result.message);
// }
//}, "json");
}
function PalyVideo(url) {
url = url + "&nguid=" + GetGuid();
var html = "";
var browser = myBrowser();
if (browser == "IE" || browser == "Firefox") {
//html = '<object id="Player" width="98%" height="98%" 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="' + url + '"><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>'
window.open(url);
return;
} else {
html = '<video src=' + url + ' controls="controls" autoplay width="100%" height="100%"/>';
}
layer.open({
title: '播放视频',
type: 1,
content: html,
resize: true,
maxmin: true,
area: ['410px', '350px']
});
}
function resizeWindow() {
var height = $(window).height();
$("#leftdiv").height(height - 60);
$("#mycontent1").height(height - 120);
$("#mycontent2").height(height - 120);
}
function IsContainMobile(content) {
var txt = content;
//匹配是否有红包信息,有红包信息直接返回
if (txt.match(/(weixin:\/\/weixinhongbao)/g)) {
return false;
}
//var myreg = /(((13[0-9]{1})|(14[0-9]{1})|(15[0-9]{1})|(16[0-9]{1})|(18[0-9]{1}|(17[0-9]{1}))|(19[0-9]{1}))+\d{8})/;
//var reg = new RegExp(myreg, "g");
//if (txt.match(reg)) {
// return true;
//}
//return false;
var reg = /[1][0-9]{10}/;
return reg.test(txt);
}
</script>
@if (ManagerPhoneHelper.GetIsShowPhone() == "0")//不显示号码
{
<script>
function ReplaceMobile(content) {
var txt = content;
var reg = /[1][0-9]{10}/;
if (reg.test(txt)) {
var res = txt.match(reg);
var mm = res[0].replace(/(\d{3})\d{5}(\d{3})/, '$1*****$2');
txt = ReplaceMobile(txt.replace(res[0], mm));//再做一次match
}
return txt;
}
</script>
}
else if (Mini.Web.WebHelper.ManagerPhoneHelper.GetIsShowPhone() == "8")//不显示号码
{
<script>
function ReplaceMobile(content) {
var txt = content;
var reg = /[0-9]{8,}/;
if (reg.test(txt)) {
var res = txt.match(reg);
console.log(res[0]);
if (res[0].length == 8) {
var mm = res[0].replace(/(\d{2})\d{4}(\d{2})/, '$1****$2');
txt = ReplaceMobile(txt.replace(res[0], mm));//再做一次match
} else if (res[0].length == 9) {
var mm = res[0].replace(/(\d{2})\d{5}(\d{2})/, '$1****$2');
txt = ReplaceMobile(txt.replace(res[0], mm));//再做一次match
} else if (res[0].length == 10) {
var mm = res[0].replace(/(\d{2})\d{5}(\d{3})/, '$1****$2');
txt = ReplaceMobile(txt.replace(res[0], mm));//再做一次match
} else {
var xinghao = "";
for (var i = 0; i < (res[0].length - 6); i++) {
xinghao += "*"
}
var mm = res[0].replace(/(\d{3})\d{2,}(\d{3})/, '$1' + xinghao + '$2');
txt = ReplaceMobile(txt.replace(res[0], mm));//再做一次match
}
}
//下标数字
reg = /[₁,₂,₃,₄,₅,₆,₇,₈,₉,₀]{8,}/;
if (reg.test(txt)) {
var res = txt.match(reg);
console.log(res[0]);
if (res[0].length == 8) {
var mm = res[0].replace(/([₁,₂,₃,₄,₅,₆,₇,₈,₉,₀]{2})[₁,₂,₃,₄,₅,₆,₇,₈,₉,₀]{4}([₁,₂,₃,₄,₅,₆,₇,₈,₉,₀]{2})/, '$1****$2');
txt = ReplaceMobile(txt.replace(res[0], mm));//再做一次match
} else if (res[0].length == 9) {
var mm = res[0].replace(/([₁,₂,₃,₄,₅,₆,₇,₈,₉,₀]{2})[₁,₂,₃,₄,₅,₆,₇,₈,₉,₀]{5}([₁,₂,₃,₄,₅,₆,₇,₈,₉,₀]{2})/, '$1****$2');
txt = ReplaceMobile(txt.replace(res[0], mm));//再做一次match
} else if (res[0].length == 10) {
var mm = res[0].replace(/([₁,₂,₃,₄,₅,₆,₇,₈,₉,₀]{2})[₁,₂,₃,₄,₅,₆,₇,₈,₉,₀]{5}([₁,₂,₃,₄,₅,₆,₇,₈,₉,₀]{3})/, '$1****$2');
txt = ReplaceMobile(txt.replace(res[0], mm));//再做一次match
} else {
var xinghao = "";
for (var i = 0; i < (res[0].length - 6); i++) {
xinghao += "*"
}
var mm = res[0].replace(/([₁,₂,₃,₄,₅,₆,₇,₈,₉,₀]{3})[₁,₂,₃,₄,₅,₆,₇,₈,₉,₀]{2,}([₁,₂,₃,₄,₅,₆,₇,₈,₉,₀]{3})/, '$1' + xinghao + '$2');
txt = ReplaceMobile(txt.replace(res[0], mm));//再做一次match
}
}
//上标数字
reg = /[¹,²,³,⁴,⁵,⁶,⁷,⁸,⁹,⁰]{8,}/;
if (reg.test(txt)) {
var res = txt.match(reg);
console.log(res[0]);
if (res[0].length == 8) {
var mm = res[0].replace(/([¹,²,³,⁴,⁵,⁶,⁷,⁸,⁹,⁰]{2})[¹,²,³,⁴,⁵,⁶,⁷,⁸,⁹,⁰]{4}([¹,²,³,⁴,⁵,⁶,⁷,⁸,⁹,⁰]{2})/, '$1****$2');
txt = ReplaceMobile(txt.replace(res[0], mm));//再做一次match
} else if (res[0].length == 9) {
var mm = res[0].replace(/([¹,²,³,⁴,⁵,⁶,⁷,⁸,⁹,⁰]{2})[¹,²,³,⁴,⁵,⁶,⁷,⁸,⁹,⁰]{5}([¹,²,³,⁴,⁵,⁶,⁷,⁸,⁹,⁰]{2})/, '$1****$2');
txt = ReplaceMobile(txt.replace(res[0], mm));//再做一次match
} else if (res[0].length == 10) {
var mm = res[0].replace(/([¹,²,³,⁴,⁵,⁶,⁷,⁸,⁹,⁰]{2})[¹,²,³,⁴,⁵,⁶,⁷,⁸,⁹,⁰]{5}([¹,²,³,⁴,⁵,⁶,⁷,⁸,⁹,⁰]{3})/, '$1****$2');
txt = ReplaceMobile(txt.replace(res[0], mm));//再做一次match
} else {
var xinghao = "";
for (var i = 0; i < (res[0].length - 6); i++) {
xinghao += "*"
}
var mm = res[0].replace(/([¹,²,³,⁴,⁵,⁶,⁷,⁸,⁹,⁰]{3})[¹,²,³,⁴,⁵,⁶,⁷,⁸,⁹,⁰]{2,}([¹,²,³,⁴,⁵,⁶,⁷,⁸,⁹,⁰]{3})/, '$1' + xinghao + '$2');
txt = ReplaceMobile(txt.replace(res[0], mm));//再做一次match
}
}
//全角数字
reg = /[,,,,,,,,,]{8,}/;
if (reg.test(txt)) {
var res = txt.match(reg);
console.log(res[0]);
if (res[0].length == 8) {
var mm = res[0].replace(/([,,,,,,,,,]{2})[,,,,,,,,,]{4}([,,,,,,,,,]{2})/, '$1****$2');
txt = ReplaceMobile(txt.replace(res[0], mm));//再做一次match
} else if (res[0].length == 9) {
var mm = res[0].replace(/([,,,,,,,,,]{2})[,,,,,,,,,]{5}([,,,,,,,,,]{2})/, '$1****$2');
txt = ReplaceMobile(txt.replace(res[0], mm));//再做一次match
} else if (res[0].length == 10) {
var mm = res[0].replace(/([,,,,,,,,,]{2})[,,,,,,,,,]{5}([,,,,,,,,,]{3})/, '$1****$2');
txt = ReplaceMobile(txt.replace(res[0], mm));//再做一次match
} else {
var xinghao = "";
for (var i = 0; i < (res[0].length - 6); i++) {
xinghao += "*"
}
var mm = res[0].replace(/([,,,,,,,,,]{3})[,,,,,,,,,]{2,}([,,,,,,,,,]{3})/, '$1' + xinghao + '$2');
txt = ReplaceMobile(txt.replace(res[0], mm));//再做一次match
}
}
return txt;
}
</script>
}
else
{
<script>
function ReplaceMobile(content) {
return content;
}
</script>
}
<script>
function showTime(val) {
if (val < 60) {
return "00:" + getTimeStr(val);
} else {
var min_total = Math.floor(val / 60); // 分钟
var sec = Math.floor(val % 60); // 余秒
if (min_total < 60) {
return getTimeStr(min_total) + ":" + getTimeStr(sec);
} else {
var hour_total = Math.floor(min_total / 60); // 小时数
var min = Math.floor(min_total % 60); // 余分钟
return hour_total + ":" + getTimeStr(min) + ":" + getTimeStr(sec);
}
}
}
function getTimeStr(st) {
if (st > 9) {
return String(st);
} else {
return "0" + String(st);
}
}
</script>