diff --git a/newBusinessEntities/release.html b/newBusinessEntities/release.html index 4ee00a9..0f4ba3d 100644 --- a/newBusinessEntities/release.html +++ b/newBusinessEntities/release.html @@ -22,8 +22,8 @@

农村经营主体综合供求信息网

-

首页 > 信息发布

+

首页 > 供求信息 > 信息发布

录入信息

@@ -48,11 +48,12 @@ 发布类别 - + + @@ -65,18 +66,14 @@ 类别 - - - - + + 单价 @@ -139,7 +136,7 @@
- + \ No newline at end of file diff --git a/newBusinessEntities/static/js/api/index.js b/newBusinessEntities/static/js/api/index.js index da07090..3515e2c 100644 --- a/newBusinessEntities/static/js/api/index.js +++ b/newBusinessEntities/static/js/api/index.js @@ -66,4 +66,8 @@ var supplyChainAgent = '/webSite/operators/supplyChainAgent' //经纪人列表 var supplyChainPurchaser = '/webSite/operators/supplyChainPurchaser' //采购商列表 +var homePage = '/webSite/operators/homePage' //发布供求服务 + +var productDetails = '/webSite/operators/productDetails' //产品分类子集查询 + var dictType = '/webSite/operators/data/type' //首页-字典查询 diff --git a/newBusinessEntities/static/js/common/main.js b/newBusinessEntities/static/js/common/main.js index d8b8d18..501e860 100644 --- a/newBusinessEntities/static/js/common/main.js +++ b/newBusinessEntities/static/js/common/main.js @@ -21,6 +21,7 @@ requirejs.config({ cupload:'lib/cupload/cupload',//上传图片插件 dateTime:'lib/dateTime/dateTime.min',//时间选择器 LeftNav:'lib/LeftNav/LeftNav',//树状标签插件 + InfinitePullDown:'lib/InfinitePullDown/InfinitePullDown',//无限下拉菜单插件 //自己写的路径配置 Tools: '/newBusinessEntities/static/js/common/tools', @@ -66,6 +67,10 @@ requirejs.config({ deps: ['jquery'], exports: 'LeftNav' }, + InfinitePullDown: { + deps: ['jquery'], + exports: 'InfinitePullDown' + }, } }); diff --git a/newBusinessEntities/static/js/common/tools.js b/newBusinessEntities/static/js/common/tools.js index c12c8ec..eabbe7d 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.86:8081'; +var serverApi = 'http://192.168.31.104:8080'; var friendsLinksList = []; var themeColor = ''; var logo = ''; diff --git a/newBusinessEntities/static/js/lib/InfinitePullDown/InfinitePullDown.js b/newBusinessEntities/static/js/lib/InfinitePullDown/InfinitePullDown.js new file mode 100644 index 0000000..436c8e9 --- /dev/null +++ b/newBusinessEntities/static/js/lib/InfinitePullDown/InfinitePullDown.js @@ -0,0 +1,114 @@ +/*! + * @module 无限极下拉框 + * 2022-2-9 + * by 庞东旭 + */ + +let array = []; + +let childrenArray = []; + +function InfinitePullDown(boxId,data){ + + $('' + boxId + ' > select').change(function () { + + const index = $('' + boxId + ' > select').index(this) + 1; + + const selectLength = $(boxId).children('select').length; + + let id = $(this).val(); + + console.log(index+'-----------------'+selectLength) + + if (index == 1){ + childrenArray = data ; + } + + forArray(childrenArray,index,id) + + if (index < selectLength){ + + for (let i = index ; i < selectLength ; i++){ + + $($(boxId).find("select")[i].remove()); + + } + + } + + // if (index == 1){ + + array = eval(data).filter(function (e) { + return e.id == id; + }) + + // }else{ + // + // childrenArray = eval(childrenArray[0].children).filter(function (e) { return e.id == id; }) + // + // } + + console.log(childrenArray) + + + addArray(boxId,array[0]) + + }) + +}; + +function addArray(boxId,data){ + + if (data.children.length>0){ + + var options = ''; + + for (var i = 0 ; i < data.children.length ; i++){ + + options += '' ; + + } + + $(boxId).append( + + '' + + ) + + InfinitePullDown('#projectContent',data.children) + + } +}; + +let num = 0; + +function forArray(data,index,id){ + + num++; + + let temporaryData = []; + + if (num == index){return;} + + temporaryData = eval(data).filter(function (e) { return e.id == id; }); + + for (let i = 0 ; i < data.length ; i++){ + + console.log(temporaryData.length) + + console.log(data) + + if (temporaryData.length == 0){ + forArray(data[i].children,index,id) + }else{ + temporaryData = eval(data).filter(function (e) { return e.id == id; }); + return; + } + console.log(temporaryData) + // forArray(array,index); + } + +} \ No newline at end of file diff --git a/newBusinessEntities/static/js/project/release.js b/newBusinessEntities/static/js/project/release.js new file mode 100644 index 0000000..359caed --- /dev/null +++ b/newBusinessEntities/static/js/project/release.js @@ -0,0 +1,99 @@ +/** + * Created by Administrator on 2021/4/5. + */ +define(['jquery', "template", "Tools", "InfinitePullDown","cupload"], function ($, template, Tools) { + //数据存储 + var module = { + data: { + + }, + }; + var tools = new Tools(); + + module.init = function (page) { + + tools.doGet(dictType + '/supply_demand_sort', {}, module.dictType , true); + tools.doGet(productCategories , {}, module.projectList , true); + + var cupload2 = new Cupload ({ + ele: '#cupload-3', + num: 5, + }); + + }; + + //类别 + module.projectList = function (data) { + if (data.code == 200) { + var content = data.data; + module.data.projectList = content; + + addSelect(content[0].id); + + var projectData = template('projectData', module.data); + $("#projectContent").html(projectData); + // InfinitePullDown('#projectContent',content); + } + } + + addSelect = function(id){ + + tools.doGet(productDetails + '/'+id, {}, function(data){ + + if ( data.data.length == 0 ){ + + return; + } + + var options = ''; + + for (var i = 0 ; i < data.data.length ; i++){ + + options += '' ; + + } + + $('#projectContent').append( + + '' + + ) + + addSelect(data.data[0].id) + + } , true); + + } + + changeSelect = function(data){ + const index = $('#projectContent > select').index(data) + 1; + + const selectLength = $('#projectContent').children('select').length; + + console.log(index + '------------' + selectLength) + + for (let i = selectLength ; i >= index ; i--){ + + console.log($('#projectContent').find("select")[i]) + $('#projectContent').find("select")[i].remove(); + + } + setTimeout(function(){ + addSelect(data.value) + },1000) + + } + + module.dictType = function (data) { + var content = data.data; + module.data.sortOptions = content; + var sortData = template('sortData', module.data); + $("#sortContent").html(sortData); + } + + return module; +}); \ No newline at end of file diff --git a/newBusinessEntities/static/js/project/supply/index.js b/newBusinessEntities/static/js/project/supply/index.js index a010b56..86748a1 100644 --- a/newBusinessEntities/static/js/project/supply/index.js +++ b/newBusinessEntities/static/js/project/supply/index.js @@ -35,7 +35,24 @@ define(['jquery', "template", "Tools", 'LeftNav', 'dateTime'], function ($, temp // //console.log(res) // } // }) + var tabs = $('.tab').find('li'); + var informationBox = $("#information_box > div"); + tabs.on('click', function (e) { + e.preventDefault();//防止打开链接 + + var index = $(this).data('index'); + + + tabs.removeClass('active'); + + informationBox.css("display",'none'); + + $(this).addClass('active'); + + $('#'+index).css("display",'block') + + }); tools.doGet(dictType + '/supply_demand_unit', {}, module.dictType , true); tools.doGet(productCategories , {}, module.projectList , true); }; @@ -44,9 +61,11 @@ define(['jquery', "template", "Tools", 'LeftNav', 'dateTime'], function ($, temp module.data.unitOptions = data.data; tools.doGet(depositInformation, {}, module.recommendList, true); tools.doGet(supplyInformation, {}, module.supplyInformationList , true); + tools.doGet(management, {}, module.managementList , true); + tools.doGet(serviceList, {}, module.serviceList , true); } - //新闻列表 + //类别 module.projectList = function (data) { if (data.code == 200) { var content = data.data; @@ -54,6 +73,10 @@ define(['jquery', "template", "Tools", 'LeftNav', 'dateTime'], function ($, temp module.data.projectList = content; var projectData = template('projectData', module.data); $("#projectContent").html(projectData); + var managementProjectData = template('managementProjectData', module.data); + $("#managementProjectContent").html(managementProjectData); + var serviceProjectData = template('serviceProjectData', module.data); + $("#serviceProjectContent").html(serviceProjectData); // content.forEach(res => { // module.data.dataList.children.push(res); // }) @@ -61,6 +84,44 @@ define(['jquery', "template", "Tools", 'LeftNav', 'dateTime'], function ($, temp } } + //求购信息 + module.managementList = function (data) { + if (data.code == 200) { + var content = data.data; + + for ( var i = 0 ; i < content.length ; i++ ){ + + content[i].unit = module.selectDictLabel(module.data.unitOptions,content[i].unit); + + content[i].supplyMasterMap = serverApi + content[i].supplyMasterMap ; + + } + + module.data.managementList = content; + var managementData = template('managementData', module.data); + $("#managementContent").html(managementData); + } + } + + //服务信息 + module.serviceList = function (data) { + if (data.code == 200) { + var content = data.data; + + for ( var i = 0 ; i < content.length ; i++ ){ + + content[i].unit = module.selectDictLabel(module.data.unitOptions,content[i].unit); + + content[i].supplyMasterMap = serverApi + content[i].supplyMasterMap ; + + } + + module.data.serviceList = content; + var serviceData = template('serviceData', module.data); + $("#serviceContent").html(serviceData); + } + } + //推荐列表 module.recommendList = function (data) { if (data.code == 200) { diff --git a/newBusinessEntities/static/js/project/supplyChain/index.js b/newBusinessEntities/static/js/project/supplyChain/index.js index a0b53c9..933707c 100644 --- a/newBusinessEntities/static/js/project/supplyChain/index.js +++ b/newBusinessEntities/static/js/project/supplyChain/index.js @@ -69,7 +69,7 @@ define(['jquery', "template", "Tools", 'LeftNav', 'dateTime'], function ($, temp module.data.industryClassOptions = data.data; tools.doPost(entityMain, {}, module.entityMain , true); tools.doPost(supplyChainAgent, {}, module.supplyChainAgent , true); - tools.doPost(supplyChainPurchaser, {}, module.supplyChainPurchaser , true); + tools.doGet(supplyChainPurchaser, {}, module.supplyChainPurchaser , true); } //经营主体 diff --git a/newBusinessEntities/view/supply/index.html b/newBusinessEntities/view/supply/index.html index 434584f..1cb6f20 100644 --- a/newBusinessEntities/view/supply/index.html +++ b/newBusinessEntities/view/supply/index.html @@ -54,157 +54,407 @@

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

-
-

推荐供应

-
- - -
-
    + + {{/each}} + +
    +
      +
      +
      -
      -
      - - -
      - -
      -