(function () { var base_url = 'https://service.buaapress.com.cn/'; var controller = 'mzs/'; //var strBookTypes = ''; var strBooks = '{"3":[{"id":"18464","book_id":"7806","book_name":"舰载机非线性着舰控制技术","book_img_url":"_mz\/editor\/attached\/image\/20230423\/20230423101929_47307.png"},{"id":"18477","book_id":"7785","book_name":"机械振动基础(第2版)","book_img_url":"_mz\/editor\/attached\/image\/20230216\/20230216140312_63422.png"},{"id":"18536","book_id":"7853","book_name":"MATLAB数学建模方法与实践(第4版)","book_img_url":"_mz\/editor\/attached\/image\/20230718\/20230718152356_13708.png"},{"id":"18566","book_id":"7864","book_name":"发射场特种操作安全防护技术导论","book_img_url":"_mz\/editor\/attached\/image\/20230718\/20230718154909_61696.png"},{"id":"18654","book_id":"7883","book_name":"2024考研政治冲刺背诵手册","book_img_url":"_mz\/editor\/attached\/image\/20231008\/20231008081714_73318.jpg"},{"id":"18661","book_id":"7922","book_name":"无人机导航与飞行控制技术","book_img_url":"_mz\/editor\/attached\/image\/20231008\/20231008082124_27387.png"},{"id":"18677","book_id":"7891","book_name":"TensorFlow机器学习实用指南","book_img_url":"_mz\/editor\/attached\/image\/20231008\/20231008083544_29125.png"}],"4":[{"id":"18448","book_id":"7836","book_name":"嵌入式Linux操作系统原理与应用(第4版)","book_img_url":"_mz\/editor\/attached\/image\/20230423\/20230423101156_61271.png"},{"id":"18528","book_id":"7847","book_name":"MATLAB数值计算(中译本·2022修订版)","book_img_url":"_mz\/editor\/attached\/image\/20230718\/20230718151521_56660.png"},{"id":"18545","book_id":"7875","book_name":"短视频生产实践与社会资本研究:“象牙塔”里的博主们","book_img_url":"_mz\/editor\/attached\/image\/20230718\/20230718153238_18965.png"},{"id":"18569","book_id":"7863","book_name":"航天快响发射指挥控制技术导论","book_img_url":"_mz\/editor\/attached\/image\/20230718\/20230718155021_27525.png"},{"id":"18572","book_id":"7882","book_name":"FreeRTOS源码详解与应用开发—基于STM32(第2版)","book_img_url":"_mz\/editor\/attached\/image\/20230718\/20230718155211_41243.png"},{"id":"18656","book_id":"7918","book_name":"机械设计基础案例MATLAB App编程实践","book_img_url":"_mz\/editor\/attached\/image\/20231008\/20231008081854_87888.png"},{"id":"18670","book_id":"7910","book_name":"赛博物理系统的多范式建模方法","book_img_url":"_mz\/editor\/attached\/image\/20231008\/20231008082940_28574.png"}],"6":[{"id":"12950","book_id":"14","book_name":"基于嵌入式实时操作系统的程序设计技术(第2版)","book_img_url":"_mz\/editor\/attached\/image\/20170928\/20170928150532_75967.jpg"}]}'; //var jsonBookTypes = JSON.parse(strBookTypes); var jsonBooks = JSON.parse(strBooks); //console.log(jsonBooks); //初始化图书列表 initBookList(jsonBooks, $(".swiper-container[tab]")); //初始化滚动效果 initSwiper(); //图书类别 function initBookList(json, obj) { //console.log(json); //循环所有的图书列表dom obj.each(function () { //console.log($(this)); var book = ''; if ($(this).attr("tab") == "recommend") { book = appendBook(json[3]); } else if ($(this).attr("tab") == "new") { book = appendBook(json[4]); } $(this).append(book); }); } function appendBook(json) { var html = '
'; $(json).each(function (idx, data) { html += '
'; html += '
'; html += ''; html += ''; html += ''; html += '
'; html += ''; html += '

'+ data.book_name+ '

'; html += '
'; html += '
'; }); html += '
'; html += '
'; html += '
'; //debugger; return html; } function initSwiper() { //debugger; new Swiper('.swiper-container[tab]', { observer: true, observeParents: true, speed:2000, autoplay: { delay: 5000, }, loop: true, slidesPerView: 4, spaceBetween: 0, slidesPerGroup: 4, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, }); } })();