diff --git a/newBusinessEntities/static/js/api/index.js b/newBusinessEntities/static/js/api/index.js index 3515e2c..200bd20 100644 --- a/newBusinessEntities/static/js/api/index.js +++ b/newBusinessEntities/static/js/api/index.js @@ -70,4 +70,6 @@ var homePage = '/webSite/operators/homePage' //发布供求服务 var productDetails = '/webSite/operators/productDetails' //产品分类子集查询 +var supplyDetails = '/webSite/operators/supplyDetails' //产品分类子集查询 + var dictType = '/webSite/operators/data/type' //首页-字典查询 diff --git a/newBusinessEntities/static/js/common/tools.js b/newBusinessEntities/static/js/common/tools.js index eabbe7d..ea1d4eb 100644 --- a/newBusinessEntities/static/js/common/tools.js +++ b/newBusinessEntities/static/js/common/tools.js @@ -1,4 +1,4 @@ -var serverApi = 'http://192.168.31.104:8080'; +var serverApi = 'http://192.168.31.109:8080'; var friendsLinksList = []; var themeColor = ''; var logo = ''; diff --git a/newBusinessEntities/static/js/project/supply/detail.js b/newBusinessEntities/static/js/project/supply/detail.js new file mode 100644 index 0000000..98f2d5c --- /dev/null +++ b/newBusinessEntities/static/js/project/supply/detail.js @@ -0,0 +1,120 @@ +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; +}) \ No newline at end of file diff --git a/newBusinessEntities/view/supply/detail.html b/newBusinessEntities/view/supply/detail.html index 168961f..8154779 100644 --- a/newBusinessEntities/view/supply/detail.html +++ b/newBusinessEntities/view/supply/detail.html @@ -12,6 +12,99 @@ + + @@ -41,11 +134,50 @@

首页 > 供求信息 > 供应信息

-
+ +
@@ -126,7 +259,7 @@
- - + \ No newline at end of file diff --git a/newBusinessEntities/view/supply/index.html b/newBusinessEntities/view/supply/index.html index 1cb6f20..1f4c99f 100644 --- a/newBusinessEntities/view/supply/index.html +++ b/newBusinessEntities/view/supply/index.html @@ -180,7 +180,7 @@