let displayStatus = true,
  user = "",
  userId = "",
  userSig = "",
  encryptKey = "",
  SDKAppID = "",
  serviceList = [];
// 切换列表显示隐藏
$(".contact").click(function () {
  if (displayStatus) {
    getServiceList();
    $(".contact").animate({ right: "-0px" }, 300);
    displayStatus = false;
  } else {
    $(".contact").animate({ right: "-190" }, 300);
    displayStatus = true;
  }
});
// 获取客服列表
function getServiceList() {
  if (serviceList.length) {
    return;
  }
  $.ajax({
    url: "buss/bussModel_exeFunc.ms?funcMId=11da3c933d1143d7974bbc4249755c05&FUNC_CODE=F_491b9b4ca864418897012247939b7edf",
    type: "get",
    dataType: "json",
    success: function (data) {
      encryptKey = data.ajaxMap.ntalk_encrypt_key;
      SDKAppID = data.ajaxMap.ntalk_sdk_app_id;
      serviceList = data.ajaxMap.list;
      renderService(serviceList);
    },
    error: function (err) {
      utilsFp.confirmIcon(3, "", "", "", err.msg, "", "300", "145");
    },
  });
}
// 渲染客服列表
function renderService(list) {
  var html = "";
  list.forEach((item) => {
    html +=
      '
 ' +
      item.NICK_NAME +
      "
' +
      item.NICK_NAME +
      "