define(['jquery', "template", "Tools",'swiper',], function ($, template, Tools, swiper) { //数据存储 var module = { data: { //服务器地址 serverApi: '', trainStudentsList:[{ name:'', phone:'', sex: '', trainId:'' }] }, }; var tools = new Tools(); module.init = function (page) { //新闻管理列表 tools.doGet(dictType + '/training_type', {}, module.dictType , true); tools.doGet(dictType + '/apply_state', {}, function(data){module.data.studentsTypeOptions = data.data;} , true); module.data.trainStudentsList[0].trainId = getQueryVariable('id'); }; module.dictType = function (data) { module.data.trainingTypeOptions = data.data; tools.doGet(supplyDetails + '/' + getQueryVariable('id'), {}, module.technologyTrainingDetails, true); } //获取地址栏参数 function getQueryVariable(variable){ var query = window.location.search.substring(1); var vars = query.split("&"); for (var i=0;i previewSwiper.activeIndex) { var thumbsPerNav = Math.floor(previewSwiper.width / activeNav.width()) - 1 previewSwiper.swipeTo(activeNav.index() - thumbsPerNav) } else { previewSwiper.swipeTo(activeNav.index()) } } } } //专家列表 module.technologyTrainingDetails = function (data) { if (data.code == 200) { var content = data.data; content.trainingType = module.selectDictLabel(module.data.trainingTypeOptions,content.trainingType); const masterMapList = content.supplyMasterMap.split(","); for (var i = 0 ; i < masterMapList.length ; i++){ masterMapList[i] = serverApi + masterMapList[i]; } content.supplyMasterMap = masterMapList; module.data.technologyDetail = content; var technologyData = template('technologyData', module.data); $("#technologyContent").html(technologyData); module.swiperBanner(); } } module.selectDictLabel = function (datas, value) { var actions = []; Object.keys(datas).some((key) => { if (datas[key].dictValue == ('' + value)) { actions.push(datas[key].dictLabel); return true; } }) return actions.join(''); } return module; })