From e5d5bdd78ec0b9727c7d43e2f82f3628a3590e85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BA=9E=E4=B8=9C=E6=97=AD?= <850374051@qq.com> Date: Tue, 23 Jul 2024 17:33:33 +0800 Subject: [PATCH] =?UTF-8?q?task=20=E4=B9=B3=E5=B1=B1=E4=BA=A7=E4=BA=A4=20?= =?UTF-8?q?=E4=BB=B7=E6=A0=BC=E6=8C=87=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/js/project/new/new.js | 53 ++++++++++++++++++++++++++++++++++-- view/login/registerFrom.html | 4 +-- view/new/newList.html | 25 ++++++++++++++++- 3 files changed, 77 insertions(+), 5 deletions(-) diff --git a/static/js/project/new/new.js b/static/js/project/new/new.js index 93012c5..07755f6 100644 --- a/static/js/project/new/new.js +++ b/static/js/project/new/new.js @@ -9,6 +9,7 @@ define(['jquery', "template", "Tools", "newApi", "paging", 'swiper'], function ( focusListTop: [], //新闻列表 newsInformationList:'', + priceIndexList:'', //页码 pageNum: 1, //页码集合 @@ -33,6 +34,7 @@ define(['jquery', "template", "Tools", "newApi", "paging", 'swiper'], function ( }else{ //新闻资讯 tools.doGet(newList, {number:2,deptId:100,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.NewsInformation,true); + tools.doGet(newList, {number:9,deptId:100,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.NewsInformation2,true); } //网站配置信息(网站名称 底部联系方式 公安备案号 网站备案号) tools.getWebConfig(); @@ -121,13 +123,60 @@ define(['jquery', "template", "Tools", "newApi", "paging", 'swiper'], function ( } } + //新闻资讯数据 + module.NewsInformation2 = function (data) { + if (data.code == 200) { + var content = data.rows; + var pageCount = (data.total/module.data.pageSize).toFixed(0); + if (pageCount < 1){ + pageCount = 1; + } + if(module.data.priceIndexList == ''){ + // 初始化 分页器 + var page_s2=createPage('.page_s2'); + // 设置分页 + setPage(page_s2,{ + pageTotal: data.total, // 数据总条数 + pageSize: module.data.pageSize, // 每页显示条数 + pageCurrent: 1, // 当前页 + maxBtnNum: 5, // 最多按钮个数 (最少5个) + }) + $('#page_s2').html('共'+pageCount+'页') + } + module.data.pageCount = pageCount; + module.data.priceIndexList = content; + var priceIndexData = template('priceIndexData', module.data); + $("#priceIndexContent").html(priceIndexData); + } + } + + tabList = function(type){ + console.log(type) + document.getElementById('NewsInformationContent').style.display = 'none'; + document.getElementById('priceIndexContent').style.display = 'none'; + document.getElementById(type+'Content').style.display = 'block'; + + document.getElementById('NewsInformation').className = ''; + document.getElementById('priceIndex').className = ''; + document.getElementById(type).className = 'active'; + + document.getElementById('NewsInformationNum').style.display = 'none'; + document.getElementById('priceIndexNum').style.display = 'none'; + document.getElementById(type+'Num').style.display = 'block'; + + module.data.clickType = type; + module.data.pageNum = 1 ; + } + turnThePage = function (pageNum) { module.data.pageNum = pageNum ; if (getQueryVariable('title')){ tools.doGet(newList, {deptId:100,pageNum:pageNum,pageSize:module.data.pageSize,title:getQueryVariable('title')}, module.NewsInformation,true); - }else{ + }else if(module.data.clickType == 'NewsInformation'){ tools.doGet(newList, {number:2,deptId:100,pageNum:pageNum,pageSize:module.data.pageSize}, module.NewsInformation,true); + }else if(module.data.clickType == 'priceIndex'){ + tools.doGet(newList, {number:9,deptId:100,pageNum:pageNum,pageSize:module.data.pageSize}, module.NewsInformation2,true); } } return module; -}); \ No newline at end of file +}); diff --git a/view/login/registerFrom.html b/view/login/registerFrom.html index a8cab84..29dccbb 100644 --- a/view/login/registerFrom.html +++ b/view/login/registerFrom.html @@ -126,7 +126,7 @@ *手机号码: - + 默认为登录账户 @@ -135,7 +135,7 @@ *密码: - + 建议8-20位并包含数字和字母 diff --git a/view/new/newList.html b/view/new/newList.html index 9893471..e1d0a70 100644 --- a/view/new/newList.html +++ b/view/new/newList.html @@ -13,6 +13,7 @@ + @@ -141,6 +142,12 @@
+
+ +
+ + +
-
+

+ +