function matchinfo(typeid,matchid) { $.ajax({ url: "https://liveapi.jiliang.cc/match_info", type: 'GET', data:{ "type_id":typeid, "matchid":matchid }, contentType: "application/x-www-form-urlencoded; charset=utf-8", success: function(res){ console.log(res); const list = res.data; //console.log(list); var htmlContent=""; var bask_qiuyuan=""; var text_zhibo=""; $("#matchinfo_zd_bf").text(res.data["match_info"]["matchinfo"]["score"].split("-")[0]); $("#matchinfo_kd_bf").text(res.data["match_info"]["matchinfo"]["score"].split("-")[1]); //console.log(res.data["match_info"]["matchinfo"]["status"]); if(res.data["match_info"]["matchinfo"]["type"] =="2" && res.data["match_info"]["matchinfo"]["status"]!="1"){ try{ htmlContent += "

关键数据

  • 球队1st2nd3rd4th加时总分
  • "+res.data["match_info"]["matchinfo"]["hteam_name"]+""+res.data["zhibo"]["score"][3][0]+""+res.data["zhibo"]["score"][3][1]+""+res.data["zhibo"]["score"][3][2]+""+res.data["zhibo"]["score"][3][3]+""+res.data["zhibo"]["score"][3][4]+""+res.data["match_info"]["matchinfo"]["score"].split("-")[0]+"
  • "+res.data["match_info"]["matchinfo"]["ateam_name"]+""+res.data["zhibo"]["score"][4][0]+""+res.data["zhibo"]["score"][4][1]+""+res.data["zhibo"]["score"][4][2]+""+res.data["zhibo"]["score"][4][3]+""+res.data["zhibo"]["score"][4][4]+""+res.data["match_info"]["matchinfo"]["score"].split("-")[1]+"
  • "; htmlContent += "
  • "+res.data["match_info"]["matchinfo"]["score"].split("-")[0]+"
    得分
    "+res.data["match_info"]["matchinfo"]["score"].split("-")[1]+"
  • "+res.data["tongji"]["players"][2].split("^")[6]+"
    篮板
    "+res.data["tongji"]["players"][3].split("^")[6]+"
  • "+res.data["tongji"]["players"][2].split("^")[6]+"
    助攻
    "+res.data["tongji"]["players"][3].split("^")[7]+"
  • "+res.data["tongji"]["players"][2].split("^")[9]+"
    盖帽
    "+res.data["tongji"]["players"][3].split("^")[9]+"
  • "+res.data["tongji"]["players"][2].split("^")[8]+"
    抢断
    "+res.data["tongji"]["players"][3].split("^")[8]+"
  • "+res.data["tongji"]["players"][2].split("^")[10]+"
    失误
    "+res.data["tongji"]["players"][3].split("^")[10]+"
  • "; }catch (e) { // 这里是处理错误的代码 console.log(e); // 打印错误信息 } } if(res.data["match_info"]["matchinfo"]["type"] =="1" && res.data["match_info"]["matchinfo"]["status"]=="0" && res.data["zhibo"].hasOwnProperty("stats")){ try{ htmlContent += "

    关键数据

  • "+res.data["zhibo"]["score"][2][3]+"
    黄牌
    "+res.data["zhibo"]["score"][3][3]+"
  • "+res.data["zhibo"]["score"][2][2]+"
    红牌
    "+res.data["zhibo"]["score"][3][2]+"
  • "+res.data["zhibo"]["score"][2][4]+"
    角球
    "+res.data["zhibo"]["score"][3][4]+"
  • 技术数据

  • "+res.data["zhibo"]["stats"][5]["home"]+"
    进攻
    "+res.data["zhibo"]["stats"][5]["away"]+"
  • "+res.data["zhibo"]["stats"][3]["home"]+"
    危险进攻
    "+res.data["zhibo"]["stats"][3]["away"]+"
  • "+res.data["zhibo"]["stats"][2]["home"]+"
    控球率
    "+res.data["zhibo"]["stats"][2]["away"]+"
  • "+res.data["zhibo"]["stats"][1]["away"]+"
    射正
    "+res.data["zhibo"]["stats"][1]["home"]+"
  • "; }catch (e) { //console.log(e); // 打印错误信息 } } if(res.data["match_info"]["matchinfo"]["type"] =="1" && res.data["match_info"]["matchinfo"]["status"]=="2" && res.data["tongji"].hasOwnProperty("stats")){ try{ htmlContent += "

    关键数据

  • "+res.data["tongji"]["score"][2][3]+"
    黄牌
    "+res.data["tongji"]["score"][3][3]+"
  • "+res.data["tongji"]["score"][2][2]+"
    红牌
    "+res.data["tongji"]["score"][3][2]+"
  • "+res.data["tongji"]["score"][2][4]+"
    角球
    "+res.data["tongji"]["score"][3][4]+"
  • 技术数据

  • "+res.data["tongji"]["stats"][5]["home"]+"
    进攻
    "+res.data["tongji"]["stats"][5]["away"]+"
  • "+res.data["tongji"]["stats"][3]["home"]+"
    危险进攻
    "+res.data["tongji"]["stats"][3]["away"]+"
  • "+res.data["tongji"]["stats"][2]["home"]+"
    控球率
    "+res.data["tongji"]["stats"][2]["away"]+"
  • "+res.data["tongji"]["stats"][1]["away"]+"
    射正
    "+res.data["tongji"]["stats"][1]["home"]+"
  • "+res.data["tongji"]["stats"][8]["home"]+"
    射偏
    "+res.data["tongji"]["stats"][8]["away"]+"
  • "; }catch (e) { // 这里是处理错误的代码 console.log(e); // 打印错误信息 } } $("#gjsj").append(htmlContent); /**比分百分比**/ $(".boxC ul li").each(function(){ const zd_current = $(this).find(".num_zd").text(); const kd_current = $(this).find(".num_kd").text(); if(zd_current == ""){ $(this).find(".num_zd").text(0); } if(kd_current == ""){ $(this).find(".num_kd").text(0); } const total = parseInt(zd_current) + parseInt(kd_current); const zd_percentage = (zd_current / total) * 100; const kd_percentage = (kd_current / total) * 100; $(this).find(".progress_zd .van-progress").css("width",zd_percentage + "%"); $(this).find(".progress_kd .van-progress").css("width",kd_percentage + "%"); }); /**比分百分比结束**/ if(res.data["match_info"]["matchinfo"]["type"] =="2" && res.data["tongji"].hasOwnProperty("players")){ bask_qiuyuan += "
    "+res.data["match_info"]["matchinfo"]["hteam_name"]+""+res.data["match_info"]["matchinfo"]["ateam_name"]+"
    "; bask_qiuyuan += "
    球员
    时间投篮三分罚球得分篮板助攻抢断盖帽失误犯规
    "; const list = res.data["tongji"]["players"][0]; //console.log(list); $.each(list,function(i, item) { //console.log(item.teamName); bask_qiuyuan += "
    "+ item[1] +"
    "+item[6].split("^")[0]+""+item[6].split("^")[1]+""+item[6].split("^")[2]+""+item[6].split("^")[3]+""+item[6].split("^")[5]+"+"+item[6].split("^")[4]+""+item[6].split("^")[6]+""+item[6].split("^")[7]+""+item[6].split("^")[8]+""+item[6].split("^")[9]+""+item[6].split("^")[10]+""+item[6].split("^")[11]+"
    " }) bask_qiuyuan += "
    "; bask_qiuyuan += "
    球员
    时间投篮三分罚球得分篮板助攻抢断盖帽失误犯规
    "; const list2 = res.data["tongji"]["players"][1]; //console.log(list); $.each(list2,function(i, item) { //console.log(item.teamName); bask_qiuyuan += "
    "+ item[1] +"
    "+item[6].split("^")[0]+""+item[6].split("^")[1]+""+item[6].split("^")[2]+""+item[6].split("^")[3]+""+item[6].split("^")[5]+"+"+item[6].split("^")[4]+""+item[6].split("^")[6]+""+item[6].split("^")[7]+""+item[6].split("^")[8]+""+item[6].split("^")[9]+""+item[6].split("^")[10]+""+item[6].split("^")[11]+"
    " }) bask_qiuyuan += "
    "; } $("#bask_qiuyuan").append(bask_qiuyuan); /**文字直播**/ //console.log(res.data["zhibo"]["tlive"]); //console.log(res.data["match_info"]["matchinfo"]["type"]); if(res.data["match_info"]["matchinfo"]["type"] =="1" && res.data["zhibo"].hasOwnProperty("tlive")){ //console.log("足球"); text_zhibo += "

    文字直播

    "; $arr5 = res.data["zhibo"]["tlive"]; $.each($arr5,function(i, item) { text_zhibo += "

    "+ item["data"] +"

    "; }) text_zhibo += "
    查看更多
    "; } if(res.data["match_info"]["matchinfo"]["type"] =="2" && res.data["zhibo"].hasOwnProperty("tlive")){ //console.log("篮球"); text_zhibo += "

    文字直播

    第一节第二节第三节第四节
    "; text_zhibo += "
    "; $arr1 = res.data["zhibo"]["tlive"][0]; $.each($arr1,function(i, item) { text_zhibo += "

    "+item.split("^")[2]+" "+item.split("^")[6]+"

    "; }) text_zhibo += "
    "; text_zhibo += "
    "; $arr2 = res.data["zhibo"]["tlive"][1]; $.each($arr2,function(i, item) { text_zhibo += "

    "+item.split("^")[2]+" "+item.split("^")[6]+"

    "; }) text_zhibo += "
    "; text_zhibo += "
    "; $arr3 = res.data["zhibo"]["tlive"][2]; $.each($arr3,function(i, item) { text_zhibo += "

    "+item.split("^")[2]+" "+item.split("^")[6]+"

    "; }) text_zhibo += "
    "; text_zhibo += "
    "; $arr4 = res.data["zhibo"]["tlive"][3]; $.each($arr4,function(i, item) { text_zhibo += "

    "+item.split("^")[2]+" "+item.split("^")[6]+"

    "; }) text_zhibo += "
    "; text_zhibo += "
    查看更多
    "; } $("#text_zhibo").append(text_zhibo); } }); } /**篮球直播内页直播切换**/ $(document).on("click", ".boxD .part span", function () { $(this).addClass("on").siblings().removeClass('on'); $(".boxD .partdetail").eq($(this).index()).addClass("show").siblings().removeClass('show'); }); $(document).on("click", ".item .textmore", function () { if ($('.textmore a').text() == '查看更多') { $(".textmore a").text("点击收起"); $(".boxD").addClass("autoheight"); }else{ $(".textmore a").text("查看更多"); $(".boxD").removeClass("autoheight"); } }) $(document).on("click", ".match_info_item .baskball_part span", function () { $(this).addClass("on").siblings().removeClass('on'); $(".baskball_partmain .baskball_part_qiuyuan_bifen").eq($(this).index()).addClass("show").siblings().removeClass('show'); }); $(function () { $('.topic_box_tag_title li').on('click', function () { $(this).addClass('active').siblings().removeClass('active'); $(this).parent().parent().parent().find('.topic_box_list li').hide(); $(this).parent().parent().parent().find('li[data-tag="' + $(this).data('tag') + '"]').show() }) $('.tocr_block_taggle li').on('click', function () { $(this).addClass('active').siblings().removeClass('active'); $('.ranking_taggle table').hide(); $('.ranking_taggle table[data-index="' + $(this).data('index') + '"]').show(); }) }) $('#match_filter_top li.tabs').click(function() { $(this).addClass('active').siblings().removeClass('active') $('.match_list .match_box').eq($(this).index()).show().siblings().hide().trigger("scroll"); }) $('.mobilemenu').on('click', function () { $(".header_menu").toggle(); }) $('.shaixuan').on('click', function () { $(".match_zhibo_nav").fadeIn(); $(".mobilenav_bg").fadeIn(); }) $('.icooff').on('click', function () { $(".match_zhibo_nav").fadeOut(); $(".mobilenav_bg").fadeOut(); }) var swipernews02 = new Swiper('.news02 .swiper-container', { navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, slidesPerView: "1", loop: true, autoHeight:true, pagination: { el: ".swiper-pagination", clickable: true, } }); /**内页左侧栏目导航**/ $(".ny_leftside .navlist dl dt").click(function() { if ($(this).parent().hasClass("on")) { $(this).parent().removeClass('on'); $(this).find(".caret").removeClass('fa-angle-up').addClass("fa-angle-down"); } else { $(this).parent().addClass("on").siblings().removeClass('on'); $(".ny_leftside .navlist dl dt span").removeClass('fa-angle-up').addClass("fa-angle-down"); $(this).find(".caret").removeClass('fa-angle-down').addClass("fa-angle-up"); } }); /**首页球队排行**/ $(".team_rank_main .team_rank_match span").click(function() { $(this).addClass("on").siblings().removeClass('on'); $(".team_rank_main .team_rank_item").eq($(this).index()).addClass("on").siblings().removeClass('on'); $('.team_rank_score li').remove(); $(".team_rank_item.on .team_rank_match_saishi span:nth-child(1)").trigger("click"); }) $(".team_rank_item .team_rank_match_saishi span").click(function() { var dtype = $(this).attr('data-type'); var dtext = $(this).attr('data-text'); var dssid = $(this).attr('data-ssid'); $(this).addClass("on").siblings().removeClass('on'); $('.team_rank_score li').remove(); if (dtype == "1") { $.ajax({ type: "get", url: 'https://liveapi.jiliang.cc/app/matchTeam', contentType: "application/json; charset=utf-8", data: { type_id: dtype, competition_id: dssid }, dataType: "json", //data: JSON.stringify(person), success: function(data) { const list = data.list; $.each(list, function(i, item) { //console.log(item.teamName); var num = i + 1; if (i < 15) { $('.team_rank_score').append('
  • ' + num + '' + item.teamName + '' + item.sdf + '' + item.points + '
  • '); } }) } }); } if (dtext == "cba") { $(".team_rank_match_saishi_east_west").removeClass('on'); $('.team_rank_score li').remove(); $.ajax({ type: "get", url: 'https://liveapi.jiliang.cc/app/matchTeam', contentType: "application/json; charset=utf-8", data: { type_id: dtype, competition_id: dssid }, dataType: "json", //data: JSON.stringify(person), success: function(data) { const list = data.list; $.each(list, function(i, item) { //console.log(item.teamName); var num = i + 1; if (i < 15) { $('.team_rank_score').append('
  • ' + num + '' + item.teamName + '' + item.sdf + '' + item.wonRate + '
  • '); } }) } }); } if (dtext =="nba") { $(".team_rank_match_saishi_east_west").addClass("on"); $(".team_rank_match_saishi_east_west span").first().addClass("on").trigger("click"); $('.team_rank_score li').remove(); } }); $(".team_rank_item .team_rank_match_saishi_east_west span").click(function() { var dtype = $(this).attr('data-type'); var dtext = $(this).attr('data-text'); var dssid = $(this).attr('data-ssid'); $(this).addClass("on").siblings().removeClass('on'); $('.team_rank_score li').remove(); $.ajax({ type: "get", url: 'https://liveapi.jiliang.cc/app/liveTeamRanking', contentType: "application/json; charset=utf-8", data: { type_id: dtype, competitionId: dssid }, dataType: "json", //data: JSON.stringify(person), success: function(data) { const list = data.nbaData[dtext]; //console.log(list); $.each(list, function(i, item) { //console.log(item.teamName); var num = i + 1; if (i < 15) { $('.team_rank_score').append('
  • ' + num + '' + item.teamName + '' + item.ressult + '' + item.wonRate + '
  • '); } }) } }); }); /**首页球队切换**/ $(".section-tit-nav span").click(function(){ $(this).addClass("on").siblings().removeClass('on'); $(".section-hot-team-box").eq($(this).index()).addClass("on").siblings().removeClass('on').trigger("scroll"); }); $(".index_video_list_qh .section-tit-nav2 span").click(function(){ $(this).addClass("on").siblings().removeClass('on'); $(".index_video_list_qh_main ul").eq($(this).index()).addClass("show").siblings().removeClass('show').trigger("scroll"); }); /**赛事内页分析**/ $('.match_analysis .senav span').click(function() { $(this).addClass('on').siblings().removeClass('on') $('.tabmain .item').eq($(this).index()).show().siblings().hide().trigger("scroll"); }) /**篮球直播内页文字直播切换**/ $(".boxD .part span").click(function(){ $(this).addClass("on").siblings().removeClass('on'); $(".boxD .partdetail").eq($(this).index()).addClass("show").siblings().removeClass('show'); }); $(".item .textmore").click(function(){ if ($('.textmore a').text() == '查看更多') { $(".textmore a").text("点击收起"); $(".boxD").addClass("autoheight"); }else{ $(".textmore a").text("查看更多"); $(".boxD").removeClass("autoheight"); } }) $(".baskball_part span").click(function(){ $(this).addClass("on").siblings().removeClass('on'); $(".baskball_partmain .baskball_part_qiuyuan_bifen").eq($(this).index()).addClass("show").siblings().removeClass('show'); }); /**品牌专题页查看更多**/ $('#loadMoreBtn').click(function(){ if($('#loadMoreBtn').children("span").text()=="点击展开更多"){ $('#match_zt_jieshao').addClass("show"); $('#loadMoreBtn img').addClass("up"); $(this).children("span").text('点击收起'); }else{ $('#match_zt_jieshao').removeClass("show"); $(this).children("span").text('点击展开更多'); $('#loadMoreBtn img').removeClass("up"); } }) /**实时比分聚合查询**/ function index_get_all_match_source(){ var fulljson= ''; $('.match_list .match_box .match-item').each(function() { var typeid = $(this).attr('data-typeid'); var matchid = $(this).attr('data-matchid'); fulljson +='{"type_id":'+typeid+',"match_id":'+matchid+'},' }); newjson = fulljson.replace(/,$/,''); //console.log(newjson); $.ajax({ type: "GET", url: 'https://jk.asdf7.cn/app/matchDetailLive', async: true, contentType: "application/json; charset=utf-8", data: { matches: '['+newjson+']' }, dataType: "json", //data: JSON.stringify(newjson), success: function(data){ //console.log(data); $('.match_list .match_box .match-item').each(function(index) { if(data[index].type_id == 1 && typeof(data[index].score) != "undefined"){ $('[id="zd_'+data[index].score[0]+'"]').text(data[index].score[2][0]); $('[id="kd_'+data[index].score[0]+'"]').text(data[index].score[3][0]); }else if(data[index].type_id == 2 && typeof(data[index].score) != "undefined"){ $('[id="zd_'+data[index].score[0]+'"]').text(data[index].score[3][0]+data[index].score[3][1]+data[index].score[3][2]+data[index].score[3][3]+data[index].score[3][4]); $('[id="kd_'+data[index].score[0]+'"]').text(data[index].score[4][0]+data[index].score[4][1]+data[index].score[4][2]+data[index].score[4][3]+data[index].score[4][4]); }else{ $('[id="zd_'+data[index].score[0]+'"]').text(0); $('[id="kd_'+data[index].score[0]+'"]').text(0); } }); } }); } $('.match_saishi_info ul li').click(function(){ $(this).addClass('active').siblings('li').removeClass('active'); $('.saishi_item_main .saishi_item').eq($(this).index()).show().siblings().hide(); }) /**移动端二级栏目筛选**/ $('.shaixuan').on('click', function () { $(".navlist").toggle(); }) $(document).ready(function() { // 查找带有class="on"的a欧宝全站下载 $('.ny_leftside .navlist dl').each(function() { $(this).removeClass('on'); }); $('.ny_leftside .navlist dl a.on').each(function() { // 对于每个找到的a欧宝全站下载,找到它的父栏目dt并添加class="show" $(this).closest('dl').addClass('on'); }); $(".team_rank_item.on .team_rank_match_saishi span:nth-child(1)").trigger("click"); index_get_all_match_source(); ny_get_all_match_source(); }); //baidu (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();