<ec: column></ec: column >中的属性

本文详细介绍了如何使用特定属性格式化日期和金额。包括日期格式化为yyyy-MM-dd形式,金额格式化为保留两位小数。适用于编程场景中的数据展示需求。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

format="yyyy-MM-dd" cell="date"  escapeAutoFormat="true" 注:property="rq"中日期必须是date类型,否则不起作用!

 

escapeAutoFormat="true" cell="currency" format="0.00"  注:property="je"中金额可以是string类型。用于格式化成保留两位小数值!

<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%> <%@ include file="/commons/taglibs.jsp"%> <%@ include file="/commons/msg.jsp"%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>${applicationScope['System.ConsoleWebName']}</title> <link href="${ctx}/console/styles/common/main.css" rel="stylesheet" type="text/css" /> <link href="${ctx}/console/styles/extremetable/extremecomponents.css" rel="stylesheet" type="text/css"> <link href="${ctx}/console/styles/validation/validation_style.css" rel="stylesheet" type="text/css" /> <script src="${ctx}/console/scripts/jquery/${applicationScope['System.JQuery.JS']}" type="text/javascript"></script> <script src="${ctx}/console/scripts/extremetable/extremecomponents.js" type="text/javascript"></script> <script type="text/javascript" src="${ctx}/console/scripts/validation/validation.js"></script> <script type="text/javascript"> // 查询方法设置首页 function setPage() { $("input[name='ec_p']").val(1); } function submitValue() { const checkedBoxes = $("input[name='sub']:checked"); if (checkedBoxes.length === 0) { alert("请至少选择一个网段"); console.log("选中的网段: 无"); return false; } const selectedSubnets = checkedBoxes.map(function() { return $(this).val(); }).get(); console.log("选中的网段:", selectedSubnets); // 现在变量名正确 return true; } </script> </head> <body> <div class="wrap"> <form action="${ctx}/console/admin/AdminManage.do?method=doSubList" method="post" id="presForm" name="presForm"> <!-- 隐藏域 开始 --> <cpm:input type="hidden" id="search" name="search" value="role" /> <!-- 隐藏域 结束 --> <!-- 导航 开始 --> <%-- <cpm:position pos="分级管理员管理-角色管理"/> --%> <cpm:br /> <!-- 导航 结束 --> <!-- 功能描述 开始 --> <cpm:description content="管理员角色列表" /> <cpm:br /> <!-- 功能描述 结束 --> <!-- 页面查询 开始 --> <cpm:wrap> <table width="100%" border="0" align="left" cellspacing="1" cellpadding="0" class="mainForm_z"> <tr> <td class="divLeft"><span class="spanTxt">网段</span></td> <td style="padding-left: 10px;"><cpm:input type="text" id="keyword" name="keyword" value="${keyword}" /></td> </tr> <tr> <td colspan="4" style="padding-left: 10px; padding-top: 5px; padding-bottom: 5px;"> <cpm:btn category="mini" id="searchBtn" name="searchBtn" value="查询" forceSubmit="true" onclick="javascript: setPage();" />   </td> </tr> </table> </cpm:wrap> <cpm:br /> <cpm:wrap> <ec:table items="subList" var="item" action="${ctx}/console/admin/AdminManage.do?method=doSubList&keyword=${keyword}" view="footerView" form="presForm" filterable="false" cellspacing="0"> <ec:row highlightRow="true"> <ec:column property="rowCount" cell="rowCount" title="行号" width="5%" sortable="false" style="text-align: center;" /> <ec:column property="subnetAddress" title="网段" width="25%" sortable="false" style="padding-left: 5px;" /> <ec:column property="subnetAddress" title="选择" width="5%" style="text-align: center;" > <cpm:input type="checkbox" name="sub" value="${item.subnetAddress}"/> </ec:column> </ec:row> </ec:table> </cpm:wrap> <!-- 角色列表 结束 --> <cpm:br height="20px" /> </form> </div> </body> </html><%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%> <%@ include file="/commons/taglibs.jsp"%> <%@ include file="/commons/msg.jsp"%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>${applicationScope['System.ConsoleWebName']}</title> <link href="${ctx}/console/styles/common/main.css" rel="stylesheet" type="text/css" /> <link href="${ctx}/console/styles/validation/validation_style.css" rel="stylesheet" type="text/css" /> <script src="${ctx}/console/scripts/jquery/${applicationScope['System.JQuery.JS']}" type="text/javascript"></script> <script src="${ctx}/console/scripts/validation/validation.js" type="text/javascript"></script> <script type="text/javascript" src="${ctx}/console/scripts/validation/validation-ui-utils.js"></script> <script src="${ctx}/console/scripts/sha1/sha1.js" type="text/javascript"></script> <link href="${ctx}/console/styles/extremetable/extremecomponents.css" rel="stylesheet" type="text/css"> <link href="${ctx}/console/styles/jqueryui/jquery-ui-1.7.1.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="${ctx}/console/scripts/extremetable/extremecomponents.js"></script> <script type="text/javascript" src="${ctx}/console/scripts/common/rafdialogutils.js"></script> <script type="text/javascript" src="${ctx}/console/scripts/jquery/jquery-ui-dialog-1.7.1.min.js"></script> <script type="text/javascript" src="${ctx}/console/scripts/validation/validation.js"></script> <script type="text/javascript"> function check() { var objform = new web_validator(); objform.add("adminName", "管理员姓名不能为空,长度必须大于等于2,小于等于10,且不能包含特殊符号!", "[notnull]&&[specialchar]&&[length,>=,2]&&[length,<=,10]"); objform.add("loginName", "管理员帐号不能为空,长度必须大于等于2,小于等于20,且不能包含特殊符号!", "[notnull]&&[specialchar]&&[length,>=,2]&&[length,<=,20]"); objform.add("commonPassword", "管理员登录口令不能为空,密码长度须在${adminPwdMinLength}~${adminPwdMaxLength}位之间,由英文字母a~z (区分大小写)、数字0~9、特殊字符至少两种组合组成,且不可与帐号相同!", "[notnull]&&([length,>=,${adminPwdMinLength}]&&[length,<=,${adminPwdMaxLength}])"); objform.add("confirmpassword", "管理员确认口令不能为空或您两次输入的登录口令不一致,请重新输入!", "[notnull]&&[equaltext,commonPassword]"); objform.add("roleId", "请选择管理员角色!", "[selected]"); var result = objform.check(); if (!result) { return false; } var confirm = false; var loginName = jQuery("#loginName").val(); if (/.*[\u4e00-\u9fa5]+.*$/.test(loginName)) { alert("管理员姓名不能为空,长度必须大于等于2,小于等于10,且不能包含特殊符号!"); return false; } var commonPassword = jQuery("#commonPassword").val(); if (commonPassword == loginName) { alert("管理员登录口令不可与帐号相同!"); return false; } if (/^.*?[\d]+.*$/.test(commonPassword) && /^.*?[A-Za-z].*$/.test(commonPassword)) confirm = true; else if (/^.*?[\d]+.*$/.test(commonPassword) && /^.*?[!@#$-].*$/.test(commonPassword)) confirm = true; else if (/^.*?[A-Za-z].*$/.test(commonPassword) && /^.*?[!@#$-].*$/.test(commonPassword)) confirm = true; if (!confirm) { alert("管理员登录口令不能为空,口令长度${adminPwdMinLength}~${adminPwdMaxLength}位,由英文字母a~z (区分大小写)、数字0~9、特殊字符至少两种组合组成,且不可与帐号相同!"); return false; } var passwd = hex_sha1(jQuery("#commonPassword").val()); jQuery("#commonPassword").val(passwd); jQuery("#password").val(passwd); jQuery("#confirmpassword").val(passwd); return true; } function getCAInfo() { var validator = new web_validator(); validator.add("caServerIp", "CA服务地址不能为空或格式不正确!", "[notnull] && [ipaddress]", trimObj); validator.add("caServerPort", "CA服务地址端口不能为空且只能是0~65535之间的数字!", "[notnull] && [scale,>,0] && [scale,<=,65535]", trimObj); validator.add("caServerName", "CA服务名不能为空!", "[notnull]", trimObj); validator.add("raunicode", "RA唯一编码不能为空!", "[notnull] && [length,<=,10]", trimObj); var result = validator.check(); if (result) { var caServerIp = jQuery("#caServerIp").val(); var caServerPort = jQuery("#caServerPort").val(); var caServerName = jQuery("#caServerName").val(); var isSSL = jQuery("#isSSL").val(); var raunicode = jQuery("#raunicode").val(); var url = "${ctx}/console/credential/caConfig.do?method=loadCAInfo&caServerIp=" + caServerIp + "&caServerPort=" + caServerPort + "&caServerName=" + caServerName + "&isSSL=" + isSSL + "&raunicode=" + raunicode + "&random=" + Math.random() + ""; popupDialog({ title : "获取CA信息", content : url, width : 600, height : 400, modal : true, overlay : true, buttons : { "确认并保存" : function() { var frameName = $(this).attr("name"); var frameObj = eval(frameName); if (frameObj.submitData()) { alert("保存CA配置成功!"); window.location = "${ctx}/console/credential/caConfig.do?method=caConfig&random=" + Math.random() + ""; $(this).dialog("close"); } }, "关闭窗口" : function() { $(this).dialog("close"); } } }); } } function chooseDept() { var url = "${ctx}/console/admin/AdminManage.do?method=doSubList"; popupDialog({ title : "选择网段", content : url, width : 600, height : 700, modal : true, overlay : true, buttons : { "确认" : function() { var frameName = $(this).attr("name"); var frameObj = eval(frameName); if (frameObj.submitValue()) { // 收集所有选中的网段地址 var selectedSubnets = []; $("input[name='sub']:checked").each(function() { selectedSubnets.push($(this).val()); }); // 将选中的网段地址设置到目标输入框 $("#subnetAddress").val(selectedSubnets.join(", ")); // 关闭对话框 $(this).dialog("close"); } }, "关闭" : function() { $(this).dialog("close"); } } }); } </script> </head> <body> <div class="wrap"> <form action="${ctx}/console/admin/AdminManage.do?method=doAdminAdd" method="post" name="presForm" onsubmit="return check();"> <!-- 导航 开始 --> <%-- <cpm:position pos="分级管理员管理-管理员管理-创建管理员"/> --%> <cpm:br /> <!-- 导航 结束 --> <!-- 功能描述 开始 --> <cpm:description content="带红色“<font color=red>*</font>”为必填项" /> <cpm:br /> <!-- 功能描述 结束 --> <!-- Tab部分 开始 --> <cpm:staticTabs> <cpm:staticTab title="创建管理员" /> </cpm:staticTabs> <!-- Tab部分 结束 --> <!-- 角色信息 开始 --> <cpm:wrap> <table width="100%" border="0" align="left" cellspacing="1" cellpadding="0" class="mainForm"> <tr class="tr_title"> <td style="padding-left: 5px; font-size: 12px; font-weight: bold;" colspan="2">基本配置</td> </tr> <tr> <td class="left">管理员帐号</td> <td class="right"><cpm:input type="text" id="loginName" name="loginName" required="true" value="${user.loginName}" readonly="${!empty user ? true : false}" /></td> </tr> <tr> <td class="left">管理员姓名</td> <td class="right"><cpm:input type="text" id="adminName" name="adminName" required="true" value="${user.userName}" readonly="${!empty user ? true : false}" /></td> </tr> <tr> <td class="left">登录口令</td> <td class="right"><cpm:input type="password" id="commonPassword" name="commonPassword" required="true" /> <cpm:input type="hidden" id="password" name="password" /> <font color="blue">  ( 注:密码长度${adminPwdMinLength}~${adminPwdMaxLength}位,由英文字母a~z (区分大小写)、数字0~9、特殊字符至少两种组合组成,且不可与帐号相同!)</font></td> </tr> <tr> <td class="left">确认口令</td> <td class="right"><cpm:input type="password" id="confirmpassword" name="confirmpassword" required="true" /> <font color="blue">  ( 注:两次输入密码相同时才会更改密码)</font></td> </tr> <tr class="tr_title"> <td style="padding-left: 5px; font-size: 12px; font-weight: bold;" colspan="2">权限信息</td> </tr> <tr> <td class="left">所属角色</td> <td class="right"><select name="roleId" id="roleId" class="txt"> <c:if test="${empty adminRoles}"> <option value="">未授权可管理的管理员角色</option> </c:if> <c:if test="${!empty adminRoles}"> <c:forEach items="${adminRoles}" var="item"> <option value="${item.id}">${item.roleName}</option> </c:forEach> </c:if> </select>  <span style="color: red;">*</span></td> </tr> <tr> <td class="left">网段</td> <td class="right" colspan="2"><cpm:input type="text" name="subnetAddress" id="subnetAddress" readonly="true" onclick="chooseDept();" /> <font color="gray">请选择网段</font></td> </tr> </table> </cpm:wrap> <cpm:br /> <!-- 角色信息 结束 --> <!-- 操作部分 开始 --> <cpm:wrap> <cpm:btn category="submit" name="submitBtn" value="保存" /> <cpm:btn category="return" name="returnBtn" value="返回" onclick="javascript: window.location = '${ctx}/console/admin/AdminManage.do?method=doAdminList';" /> </cpm:wrap> <!-- 操作部分 结束 --> <cpm:br height="20px" /> </form> </div> </body> </html> 第二个jsp页面点击确认选不到网段信息该咋该
07-18
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>模块导航系统</title> <style> /* 全局样式 */ * { box-sizing: border-box; } /* 导航栏样式 - 优化 */ .navbar { background-color: transparent; position: relative; padding: 15px 0; margin-bottom: 30px; } .nav-container { width: 90%; max-width: 1200px; margin: 0 auto; display: flex; justify-content: center; /* 居中导航 */ } .nav-links { display: flex; list-style: none; gap: 15px; /* 按钮间距 */ } .nav-item { margin: 0 5px; } .nav-link { text-decoration: none; color: #0566a8; /* 蓝色文字 */ background: white; /* 白色背景 */ font-weight: 500; padding: 10px 25px; border-radius: 30px; /* 圆角 */ border: 2px solid #0566a8; /* 蓝色边框 */ transition: all 0.3s ease; display: inline-block; text-align: center; min-width: 120px; } .nav-link:hover { background: rgba(5, 102, 168, 0.1); } .nav-link.active { background: #0566a8; /* 蓝色背景 */ color: white; /* 白色文字 */ font-weight: 600; } /* 模块容器样式 */ .module-container { width: 90%; max-width: 1200px; margin: 40px auto; position: relative; min-height: 600px; overflow: hidden; } .module { position: absolute; top: 0; left: 0; width: 100%; opacity: 0; visibility: hidden; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease, visibility 0.6s; z-index: 1; } .module.active { opacity: 1; visibility: visible; transform: translateY(0); z-index: 2; } /* 模块特定样式 */ .module-content { background-color: #fff; border-radius: 12px; box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05); overflow: hidden; margin-bottom: 30px; } /* 响应式设计 */ @media (max-width: 768px) { .nav-container { flex-direction: column; align-items: flex-start; } .nav-links { margin-top: 15px; flex-wrap: wrap; } .nav-item { margin: 5px 15px 5px 0; } .module-container { margin: 20px auto; } } /* 模块1样式 */ #module1 .minimal-process { max-width: 100%; margin: 0; } /* 模块2样式 */ #module2 .fp-carousel-module { max-width: 100%; margin: 0; } /* 模块3样式 */ #module3 .luxemg-container { max-width: 100%; padding: 20px; } /* 模块4样式 */ #module4 .carousel-container { max-width: 100%; margin: 0; } </style> </head> <body> <!-- 导航栏 --> <nav class="navbar"> <div class="nav-container"> <ul class="nav-links"> <li class="nav-item"> <a href="#" class="nav-link active" data-target="module1">服务流程</a> </li> <li class="nav-item"> <a href="#" class="nav-link" data-target="module2">3D轮播</a> </li> <li class="nav-item"> <a href="#" class="nav-link" data-target="module3">材料展示</a> </li> <li class="nav-item"> <a href="#" class="nav-link" data-target="module4">图片轮播</a> </li> </ul> </div> </nav> <!-- 模块容器 --> <div class="module-container"> <!-- 模块1:服务流程 --> <div id="module1" class="module active"> <div class="module-content"> <!-- 代码1的内容 --> <div class="minimal-process"> <div class="process-container"> <!-- 步骤 1 --> <div class="process-step"> <div class="step-icon"> <img src="https://www.fetchingpack.com/wp-content/uploads/2025/06/youxiang.png" alt="咨询"> </div> <div class="step-content"> <span class="step-number">1</span> <h3 class="step-title">Demand consultation</h3> <p class="step-desc">The customer sends a contact email to get the consultation.</p> </div> </div> <!-- 步骤 2 --> <div class="process-step"> <div class="step-icon"> <img src="https://www.fetchingpack.com/wp-content/uploads/2025/06/kefu.png" alt="设计"> </div> <div class="step-content"> <span class="step-number">2</span> <h3 class="step-title">Solution Design</h3> <p class="step-desc">The business manager conducts content docking with the customer.</p> </div> </div> <!-- 步骤 3 --> <div class="process-step"> <div class="step-icon"> <img src="https://www.fetchingpack.com/wp-content/uploads/2025/06/emptybox.png" alt="实施"> </div> <div class="step-content"> <span class="step-number">3</span> <h3 class="step-title">Professional implementation</h3> <p class="step-desc">We make a samptle according to the customer's requirements and confirm the details.</p> </div> </div> <!-- 步骤 4 --> <div class="process-step"> <div class="step-icon"> <img src="https://www.fetchingpack.com/wp-content/uploads/2025/06/woshou.png" alt="交付"> </div> <div class="step-content"> <span class="step-number">4</span> <h3 class="step-title">Successfully placed order</h3> <p class="step-desc">After the customer's confirmation,the customer pays the deposit and places the order.</p> </div> </div> </div> </div> </div> </div> <!-- 模块2:3D轮播 --> <div id="module2" class="module"> <div class="module-content"> <!-- 代码2的内容 --> <div class="fp-carousel-module"> <div class="fp-carousel-container"> <div class="fp-carousel-item fp-active" data-index="0"> <img src="https://www.fetchingpack.com/wp-content/uploads/2025/06/ChatGPT-Image-2025年6月18日-14_59_30_compressed.png" alt="Printing"> <div class="fp-description">Printing:Transfer your design onto paper or board using offset, digital or flexo presses.</div> </div> <div class="fp-carousel-item fp-next" data-index="1"> <img src="https://www.fetchingpack.com/wp-content/uploads/2025/06/ChatGPT-Image-2025年6月18日-15_02_51_compressed.png" alt="Surface Finishing"> <div class="fp-description">Surface Finishing:Enhance and protect the print by adding coatings or varnishes (e.g. UV, matte or gloss).</div> </div> <div class="fp-carousel-item fp-next-far" data-index="2"> <img src="https://www.fetchingpack.com/wp-content/uploads/2025/06/ChatGPT-Image-2025年6月18日-15_05_48_compressed.png"> <div class="fp-description">Lamination (Mounting):Bond the printed sheet to a sturdier substrate or apply a clear film for extra durability.</div> </div> <div class="fp-carousel-item fp-prev" data-index="3"> <img src="https://www.fetchingpack.com/wp-content/uploads/2025/06/ChatGPT-Image-2025年6月18日-15_11_40_compressed.png" alt="Die-Cutting"> <div class="fp-description">Die-Cutting:Use a custom metal die to cut out shapes, create windows or trim the edges precisely.</div> </div> <div class="fp-carousel-item fp-prev-far" data-index="4"> <img src="https://www.fetchingpack.com/wp-content/uploads/2025/06/ChatGPT-Image-2025年6月18日-15_21_01_compressed.png"> <div class="fp-description">Gluing & Assembly:Fold and glue the die-cut pieces together to form boxes, folders or other finished items.</div> </div> <div class="fp-carousel-item fp-prev-far" data-index="5"> <img src="https://www.fetchingpack.com/wp-content/uploads/2025/06/ChatGPT-Image-2025年6月18日-15_24_28_compressed.png" alt="Packing & Shipping"> <div class="fp-description">Packing & Shipping:Stack, bundle or carton the completed products, then palletize and dispatch them to the client.</div> </div> <div class="fp-nav-btn fp-prev-btn"> <div class="fp-arrow">❮</div> </div> <div class="fp-nav-btn fp-next-btn"> <div class="fp-arrow">❯</div> </div> </div> </div> </div> </div> <!-- 模块3:材料展示 --> <div id="module3" class="module"> <div class="module-content"> <!-- 代码3的内容 --> <div class="luxemg-container"> <!-- Paper board 部分 --> <h2 class="luxemg-section-title">Paper board</h2> <div class="luxemg-grid"> <!-- SBS C1S --> <div class="luxemg-card"> <div class="luxemg-card-image"> <img src="https://www.fetchingpack.com/wp-content/uploads/2025/06/ChatGPT-Image-2025年6月18日-16_59_47_compressed.png" alt="SBS C1S" class="luxemg-card-img"> </div> <div class="luxemg-card-content"> <h3 class="luxemg-card-title">SBS C1S</h3> <button class="luxemg-detail-btn" data-luxemg-modal="modal-sbs-c1s">VIEW MORE</button> </div> </div> <!-- SBS C2S --> <div class="luxemg-card"> <div class="luxemg-card-image"> <img src="https://www.fetchingpack.com/wp-content/uploads/2025/06/ChatGPT-Image-2025年6月18日-16_45_42_compressed.png" alt="SBS C2S" class="luxemg-card-img"> </div> <div class="luxemg-card-content"> <h3 class="luxemg-card-title">SBS C2S</h3> <button class="luxemg-detail-btn" data-luxemg-modal="modal-sbs-c2s">VIEW MORE</button> </div> </div> <!-- CCNB --> <div class="luxemg-card"> <div class="luxemg-card-image"> <img src="https://www.fetchingpack.com/wp-content/uploads/2025/06/ChatGPT-Image-2025年6月18日-16_44_52_compressed.png" alt="CCNB" class="luxemg-card-img"> </div> <div class="luxemg-card-content"> <h3 class="luxemg-card-title">CCNB</h3> <button class="luxemg-detail-btn" data-luxemg-modal="modal-ccnb">VIEW MORE</button> </div> </div> <!-- UUK --> <div class="luxemg-card"> <div class="luxemg-card-image"> <img src="https://via.placeholder.com/300x240?text=UUK" alt="UUK" class="luxemg-card-img"> </div> <div class="luxemg-card-content"> <h3 class="luxemg-card-title">UUK</h3> <button class="luxemg-detail-btn" data-luxemg-modal="modal-uuk">VIEW MORE</button> </div> </div> <!-- Metallic --> <div class="luxemg-card"> <div class="luxemg-card-image"> <img src="https://via.placeholder.com/300x240?text=Metallic" alt="Metallic" class="luxemg-card-img"> </div> <div class="luxemg-card-content"> <h3 class="luxemg-card-title">Metallic</h3> <button class="luxemg-detail-btn" data-luxemg-modal="modal-metallic">VIEW MORE</button> </div> </div> </div> <!-- Corrugated 部分 --> <h2 class="luxemg-section-title">Corrugated</h2> <!-- single wall部分 --> <h3 class="luxemg-subsection-title">single wall</h3> <div class="luxemg-grid"> <!-- A Flute --> <div class="luxemg-card"> <div class="luxemg-card-image"> <img src="https://via.placeholder.com/300x240?text=A+Flute" alt="A Flute" class="luxemg-card-img"> </div> <div class="luxemg-card-content"> <h3 class="luxemg-card-title">A Flute</h3> <button class="luxemg-detail-btn" data-luxemg-modal="modal-a-flute">VIEW MORE</button> </div> </div> <!-- C Flute --> <div class="luxemg-card"> <div class="luxemg-card-image"> <img src="https://via.placeholder.com/300x240?text=C+Flute" alt="C Flute" class="luxemg-card-img"> </div> <div class="luxemg-card-content"> <h3 class="luxemg-card-title">C Flute</h3> <button class="luxemg-detail-btn" data-luxemg-modal="modal-c-flute">VIEW MORE</button> </div> </div> <!-- B Flute --> <div class="luxemg-card"> <div class="luxemg-card-image"> <img src="https://via.placeholder.com/300x240?text=B+Flute" alt="B Flute" class="luxemg-card-img"> </div> <div class="luxemg-card-content"> <h3 class="luxemg-card-title">B Flute</h3> <button class="luxemg-detail-btn" data-luxemg-modal="modal-b-flute">VIEW MORE</button> </div> </div> <!-- E Flute --> <div class="luxemg-card"> <div class="luxemg-card-image"> <img src="https://via.placeholder.com/300x240?text=E+Flute" alt="E Flute" class="luxemg-card-img"> </div> <div class="luxemg-card-content"> <h3 class="luxemg-card-title">E Flute</h3> <button class="luxemg-detail-btn" data-luxemg-modal="modal-e-flute">VIEW MORE</button> </div> </div> <!-- F Flute --> <div class="luxemg-card"> <div class="luxemg-card-image"> <img src="https://via.placeholder.com/300x240?text=F+Flute" alt="F Flute" class="luxemg-card-img"> </div> <div class="luxemg-card-content"> <h3 class="luxemg-card-title">F Flute</h3> <button class="luxemg-detail-btn" data-luxemg-modal="modal-f-flute">VIEW MORE</button> </div> </div> </div> <!-- double wall部分 --> <h3 class="luxemg-subsection-title">double wall</h3> <div class="luxemg-grid"> <!-- B/C Flute --> <div class="luxemg-card"> <div class="luxemg-card-image"> <img src="https://via.placeholder.com/300x240?text=B/C+Flute" alt="B/C Flute" class="luxemg-card-img"> </div> <div class="luxemg-card-content"> <h3 class="luxemg-card-title">B/C Flute</h3> <button class="luxemg-detail-btn" data-luxemg-modal="modal-bc-flute">VIEW MORE</button> </div> </div> <!-- E/C Flute --> <div class="luxemg-card"> <div class="luxemg-card-image"> <img src="https://via.placeholder.com/300x240?text=E/C+Flute" alt="E/C Flute" class="luxemg-card-img"> </div> <div class="luxemg-card-content"> <h3 class="luxemg-card-title">E/C Flute</h3> <button class="luxemg-detail-btn" data-luxemg-modal="modal-ec-flute">VIEW MORE</button> </div> </div> <!-- E/B Flute --> <div class="luxemg-card"> <div class="luxemg-card-image"> <img src="https://via.placeholder.com/300x240?text=E/B+Flute" alt="E/B Flute" class="luxemg-card-img"> </div> <div class="luxemg-card-content"> <h3 class="luxemg-card-title">E/B Flute</h3> <button class="luxemg-detail-btn" data-luxemg-modal="modal-eb-flute">VIEW MORE</button> </div> </div> <!-- F/E Flute --> <div class="luxemg-card"> <div class="luxemg-card-image"> <img src="https://via.placeholder.com/300x240?text=F/E+Flute" alt="F/E Flute" class="luxemg-card-img"> </div> <div class="luxemg-card-content"> <h3 class="luxemg-card-title">F/E Flute</h3> <button class="luxemg-detail-btn" data-luxemg-modal="modal-fe-flute">VIEW MORE</button> </div> </div> </div> <!-- Print 部分 --> <h2 class="luxemg-section-title">Print</h2> <div class="luxemg-grid"> <!-- CMYK --> <div class="luxemg-card"> <div class="luxemg-card-image"> <img src="https://via.placeholder.com/300x240?text=CMYK" alt="CMYK" class="luxemg-card-img"> </div> <div class="luxemg-card-content"> <h3 class="luxemg-card-title">CMYK</h3> <button class="luxemg-detail-btn" data-luxemg-modal="modal-cmyk">VIEW MORE</button> </div> </div> <!-- Pantone --> <div class="luxemg-card"> <div class="luxemg-card-image"> <img src="https://via.placeholder.com/300x240?text=Pantone" alt="Pantone" class="luxemg-card-img"> </div> <div class="luxemg-card-content"> <h3 class="luxemg-card-title">Pantone</h3> <button class="luxemg-detail-btn" data-luxemg-modal="modal-pantone">VIEW MORE</button> </div> </div> </div> </div> </div> </div> <!-- 模块4:图片轮播 --> <div id="module4" class="module"> <div class="module-content"> <!-- 代码4的内容 --> <div class="carousel-container"> <!-- 轮播轨道 --> <div class="carousel"> <!-- 轮播项1 --> <div class="carousel-item"> <img src="https://www.fetchingpack.com/wp-content/uploads/2025/06/Lamination-Gloss_Matte1_compressed.png" alt="Lamination (Gloss/Matte)"> <div class="image-info"> <h3>Lamination (Gloss/Matte)</h3> <p>– Applying a thin plastic film over the printed sheet to enhance scratch resistance, moisture protection and overall durability. Gloss lamination yields a shiny surface, while matte lamination gives a low-sheen, soft-touch effect.</p> </div> </div> <!-- 轮播项2 --> <div class="carousel-item"> <img src="https://www.fetchingpack.com/wp-content/uploads/2025/06/UV-Coating-Spot_Overall_compressed.png" alt="UV Coating (Spot/Overall)"> <div class="image-info"> <h3>UV Coating (Spot/Overall)</h3> <p>– Spreading a liquid UV-curable varnish onto either selected areas (spot UV) or the entire sheet, then instantly curing it under UV light. Creates high gloss and tactile contrast.</p> </div> </div> <!-- 轮播项3 --> <div class="carousel-item"> <img src="https://www.fetchingpack.com/wp-content/uploads/2025/06/Hot-Foil-Stamping_compressed.png" alt="Hot Foil Stamping"> <div class="image-info"> <h3>Hot Foil Stamping</h3> <p>– Transferring metallic or pigmented foil onto specific areas of the print using heat and pressure. Delivers a premium metallic sheen (gold, silver, colored foils) for logos or decorative accents.</p> </div> </div> <!-- 轮播项4 --> <div class="carousel-item"> <img src="https://www.fetchingpack.com/wp-content/uploads/2025/06/Embossing-_-Debossing1_compressed.png" alt="Embossing / Debossing"> <div class="image-info"> <h3>Embossing / Debossing</h3> <p>– Pressing the paper between male and female dies to create a raised (emboss) or recessed (deboss) 3D relief. Adds tactile interest and a sense of depth.</p> </div> </div> <!-- 轮播项5 --> <div class="carousel-item"> <img src="https://www.fetchingpack.com/wp-content/uploads/2025/06/Die-Cutting_compressed.png" alt="Die-Cutting"> <div class="image-info"> <h3>Die-Cutting</h3> <p>– Using a custom-made metal die to cut the printed sheet into precise shapes or create windows/slots. Essential for producing custom box shapes, hang-tabs, or intricate cut-outs.</p> </div> </div> <!-- 轮播项6 --> <div class="carousel-item"> <img src="https://www.fetchingpack.com/wp-content/uploads/2025/06/Creasing-Folding-Crease_compressed.png" alt="Creasing (Folding Crease)"> <div class="image-info"> <h3>Creasing (Folding Crease)</h3> <p>– Impressing a crease line on the sheet to facilitate clean, accurate folds without cracking the coating or ink. Critical for boxes, folders, and other folded structures.</p> </div> </div> <!-- 轮播项7 --> <div class="carousel-item"> <img src="https://www.fetchingpack.com/wp-content/uploads/2025/06/Spot-UV-Emboss-Combination_compressed.png" alt="Spot UV + Emboss Combination"> <div class="image-info"> <h3>Spot UV + Emboss Combination</h3> <p>– First applying spot UV coating, then embossing the same area to create a shiny, raised element. Enhances both visual shine and tactile relief simultaneously.</p> </div> </div> <!-- 轮播项8 --> <div class="carousel-item"> <img src="https://www.fetchingpack.com/wp-content/uploads/2025/06/Laser-Finishing-Holographic-Etch-Combination_compressed.png" alt="Holographic Foil Stamping"> <div class="image-info"> <h3>Holographic Foil Stamping</h3> <p>— Laser-etch microscopic holographic patterns onto foil, then heat- or UV-cure to lock in vibrant, angle-shifting colors and subtle texture for a premium anti-counterfeiting finish.</p> </div> </div> </div> <!-- 控制按钮 --> <div class="carousel-controls"> <button class="control-btn" id="prevBtn">Previous</button> <button class="control-btn" id="nextBtn">next</button> <button class="control-btn" id="autoBtn">暂停轮播</button> </div> <!-- 指示器 --> <div class="indicator"> <div class="indicator-dot active" data-index="0"></div> <div class="indicator-dot" data-index="1"></div> <div class="indicator-dot" data-index="2"></div> <div class="indicator-dot" data-index="3"></div> </div> </div> </div> </div> </div> <!-- 模态框容器 --> <div id="luxemg-modal-container" class="luxemg-modal-container"> <div class="luxemg-modal-wrapper"> <div class="luxemg-modal-content"> <div class="luxemg-modal-header"> <h3 id="luxemg-modal-title" class="luxemg-modal-title">Material Details</h3> <button id="luxemg-close-modal" class="luxemg-close-btn">×</button> </div> <div class="luxemg-modal-body"> <div class="luxemg-modal-image-container"> <img id="luxemg-modal-image" class="luxemg-modal-img" src="" alt="Material"> </div> <div class="luxemg-modal-description"> <div id="luxemg-modal-description" class="luxemg-modal-desc"></div> </div> </div> </div> </div> </div> <!-- JavaScript --> <script> // 导航切换功能 document.addEventListener('DOMContentLoaded', function() { // 导航切换 const navLinks = document.querySelectorAll('.nav-link'); const modules = document.querySelectorAll('.module'); navLinks.forEach(link => { link.addEventListener('click', function(e) { e.preventDefault(); // 获取目标模块ID const targetId = this.getAttribute('data-target'); // 更新导航状态 navLinks.forEach(l => l.classList.remove('active')); this.classList.add('active'); // 切换模块 modules.forEach(module => { module.classList.remove('active'); }); document.getElementById(targetId).classList.add('active'); }); }); // 初始化模块2的轮播功能 initCarousel(document.querySelector('#module2 .fp-carousel-module')); // 初始化模块3的模态框功能 initLuxemgGallery(); // 初始化模块4的轮播功能 initModule4Carousel(); }); // 模块2的轮播功能 function initCarousel(module) { const container = module.querySelector('.fp-carousel-container'); const items = Array.from(module.querySelectorAll('.fp-carousel-item')); const prevBtn = module.querySelector('.fp-prev-btn'); const nextBtn = module.querySelector('.fp-next-btn'); let currentIndex = 0; let isAnimating = false; // 初始化位置 updatePositions(); // 事件绑定函数 const bindEvents = function() { // 图片点击事件 items.forEach(item => { item.addEventListener('click', function(e) { e.stopPropagation(); if (isAnimating) return; isAnimating = true; if (this.classList.contains('fp-next') || this.classList.contains('fp-next-far')) { navigate(1); } else if (this.classList.contains('fp-prev') || this.classList.contains('fp-prev-far')) { navigate(-1); } // 动画结束后重置标志 setTimeout(() => isAnimating = false, 700); }); }); // 容器区域点击 container.addEventListener('click', function(e) { if (isAnimating) return; isAnimating = true; const rect = container.getBoundingClientRect(); const clickX = e.clientX - rect.left; if (clickX > rect.width * 3/4) { navigate(1); } else if (clickX < rect.width * 1/4) { navigate(-1); } setTimeout(() => isAnimating = false, 700); }); // 导航按钮 prevBtn.addEventListener('click', function(e) { e.stopPropagation(); if (isAnimating) return; isAnimating = true; navigate(-1); setTimeout(() => isAnimating = false, 700); }); nextBtn.addEventListener('click', function(e) { e.stopPropagation(); if (isAnimating) return; isAnimating = true; navigate(1); setTimeout(() => isAnimating = false, 700); }); // 键盘导航 document.addEventListener('keydown', function(e) { if (isAnimating) return; isAnimating = true; if (e.key === 'ArrowLeft') { navigate(-1); } else if (e.key === 'ArrowRight') { navigate(1); } setTimeout(() => isAnimating = false, 700); }); // 响应式调整 window.addEventListener('resize', function() { updatePositions(); }); }; // 导航函数 function navigate(direction) { currentIndex = (currentIndex + direction + items.length) % items.length; updatePositions(); } // 更新位置 function updatePositions() { items.forEach((item, index) => { item.classList.remove('fp-active', 'fp-prev', 'fp-next', 'fp-prev-far', 'fp-next-far', 'fp-hidden'); const position = (index - currentIndex + items.length) % items.length; if (position === 0) { item.classList.add('fp-active'); } else if (position === 1) { item.classList.add('fp-next'); } else if (position === 2) { item.classList.add('fp-next-far'); } else if (position === items.length - 1) { item.classList.add('fp-prev'); } else if (position === items.length - 2) { item.classList.add('fp-prev-far'); } else { item.classList.add('fp-hidden'); } }); } // 初始化事件绑定 bindEvents(); } // 模块3的模态框功能 function initLuxemgGallery() { // 材料详情数据 const luxemgMaterialDetails = { // Paper board "modal-sbs-c1s": { title: "SBS C1S", image: "https://www.fetchingpack.com/wp-content/uploads/2025/06/ChatGPT-Image-2025年6月18日-16_59_47_compressed.png", description: "<p>SBS C1S(Solid Bleached Sulfate – Coated One Side) is a premium-grade paperboard made from 100% virgin bleached wood pulp. It is coated on one side to provide an exceptionally smooth and white printing surface, while the reverse side remains uncoated for functional versatility.</p><p>Key Features:<br>- Bright White Appearance: Produced from fully bleached fibers for a clean, uniform, and high-end look.<br>- Coated One Side (C1S): One side has a clay coating for excellent printability; the reverse side is uncoated for better glue adhesion or writing.<br>- Excellent Print Surface: Ideal for offset, digital, and specialty printing methods; supports vibrant color reproduction and fine detail.<br>- High Stiffness and Strength: Offers good structural integrity, making it suitable for rigid packaging and die-cut designs.<br>- Environmentally Friendly: Recyclable, biodegradable, and available with FSC certification upon request.</p><p>Main Advantages:<br>✅ Preferred choice for premium packaging (cosmetics, personal care, high-end retail)<br>✅ Superior surface for specialty finishes like foil stamping, embossing, and spot UV<br>✅ Balanced combination of print quality and converting performance<br>✅ Consistent white core and surface enhance the perceived value of the final product<br>✅ Compatible with folding, scoring, gluing, and other post-press operations</p>" }, // ... 其他材料详情 }; // DOM元素引用 const luxemgModalContainer = document.getElementById('luxemg-modal-container'); const luxemgModalTitle = document.getElementById('luxemg-modal-title'); const luxemgModalImage = document.getElementById('luxemg-modal-image'); const luxemgModalDescription = document.getElementById('luxemg-modal-description'); const luxemgCloseModal = document.getElementById('luxemg-close-modal'); // 打开模态框函数 function openLuxemgModal(modalId) { const material = luxemgMaterialDetails[modalId]; const modalContent = luxemgModalContainer.querySelector('.luxemg-modal-content'); if (!material) { console.error("Material details not found for:", modalId); return; } // 填充模态框内容 luxemgModalTitle.textContent = material.title; luxemgModalImage.src = material.image; luxemgModalImage.alt = material.title; luxemgModalDescription.innerHTML = material.description; // 显示模态框 luxemgModalContainer.style.display = 'block'; // 强制重绘确保动画执行 void luxemgModalContainer.offsetWidth; // 应用显示动画 setTimeout(() => { luxemgModalContainer.style.opacity = '1'; modalContent.style.transform = 'scale(1)'; modalContent.style.opacity = '1'; }, 10); // 禁止背景滚动 document.body.style.overflow = 'hidden'; } // 关闭模态框函数 function closeLuxemgModal() { const modalContent = luxemgModalContainer.querySelector('.luxemg-modal-content'); luxemgModalContainer.style.opacity = '0'; modalContent.style.transform = 'scale(0.95)'; modalContent.style.opacity = '0'; setTimeout(() => { luxemgModalContainer.style.display = 'none'; document.body.style.overflow = ''; }, 300); } // 事件绑定函数 luxemgCloseModal.addEventListener('click', closeLuxemgModal); luxemgModalContainer.addEventListener('click', function(e) { if (e.target === this) closeLuxemgModal(); }); document.addEventListener('keydown', function(e) { if (e.key === 'Escape') closeLuxemgModal(); }); document.addEventListener('click', function(e) { if (e.target.classList.contains('luxemg-detail-btn')) { const modalId = e.target.getAttribute('data-luxemg-modal'); openLuxemgModal(modalId); } }); } // 模块4的轮播功能 function initModule4Carousel() { // 获取DOM元素 const carousel = document.querySelector('#module4 .carousel'); const items = document.querySelectorAll('#module4 .carousel-item'); const prevBtn = document.getElementById('prevBtn'); const nextBtn = document.getElementById('nextBtn'); const autoBtn = document.getElementById('autoBtn'); const dots = document.querySelectorAll('#module4 .indicator-dot'); // 初始化变量 let currentIndex = 0; let itemsPerView = calculateItemsPerView(); let autoPlayInterval; let isAutoPlay = true; // 计算当前视图显示的项目数 function calculateItemsPerView() { const width = window.innerWidth; if (width <= 500) return 1; if (width <= 700) return 2; if (width <= 900) return 3; return 4; } // 更新轮播位置 function updateCarousel() { // 计算每个项目的宽度百分比 const itemWidth = 100 / itemsPerView; // 计算偏移量 const offset = -currentIndex * itemWidth; // 应用转换效果 carousel.style.transform = `translateX(${offset}%)`; // 更新指示点状态 dots.forEach((dot, index) => { dot.classList.toggle('active', index === currentIndex); }); } // 下一张 function nextSlide() { // 计算最大索引 const maxIndex = items.length - itemsPerView; // 更新当前索引(循环) currentIndex = currentIndex >= maxIndex ? 0 : currentIndex + 1; updateCarousel(); } // 上一张 function prevSlide() { // 计算最大索引 const maxIndex = items.length - itemsPerView; // 更新当前索引(循环) currentIndex = currentIndex <= 0 ? maxIndex : currentIndex - 1; updateCarousel(); } // 自动轮播 function startAutoPlay() { if (isAutoPlay) { // 设置轮播间隔 autoPlayInterval = setInterval(nextSlide, 3000); // 更新按钮文本 autoBtn.textContent = 'stop'; } } // 停止自动轮播 function stopAutoPlay() { // 清除轮播间隔 clearInterval(autoPlayInterval); // 更新按钮文本 autoBtn.textContent = 'start'; } // 切换自动轮播状态 function toggleAutoPlay() { // 反转自动播放状态 isAutoPlay = !isAutoPlay; if (isAutoPlay) { startAutoPlay(); } else { stopAutoPlay(); } } // 初始化轮播 function init() { // 计算每屏显示数量 itemsPerView = calculateItemsPerView(); // 更新轮播位置 updateCarousel(); // 开始自动播放 startAutoPlay(); } // 事件监听器 nextBtn.addEventListener('click', () => { nextSlide(); // 如果自动播放已暂停,则停止轮播 if (!isAutoPlay) stopAutoPlay(); }); prevBtn.addEventListener('click', () => { prevSlide(); // 如果自动播放已暂停,则停止轮播 if (!isAutoPlay) stopAutoPlay(); }); autoBtn.addEventListener('click', toggleAutoPlay); // 为每个指示点添加点击事件 dots.forEach(dot => { dot.addEventListener('click', () => { // 获取并设置当前索引 currentIndex = parseInt(dot.getAttribute('data-index')); updateCarousel(); // 如果自动播放已暂停,则停止轮播 if (!isAutoPlay) stopAutoPlay(); }); }); // 窗口大小变化时重新计算 window.addEventListener('resize', () => { // 重新计算每屏显示数量 itemsPerView = calculateItemsPerView(); // 更新轮播位置 updateCarousel(); }); // 初始化轮播 init(); } </script> </body> </html> 将这个代码中的按钮都改成#0566a8色的字和微微圆角边框,代码四下方的原点增加到8个
07-01
using AIToy.Common; using System.Collections.ObjectModel; using System.ComponentModel; namespace AIToy.Pages.My; public partial class UpdateResources : BasePage { public ObservableCollection<MenuItem> MenuItems { get; set; } = new(); public UpdateResources() { InitializeComponent(); LoadMenuItems(); BindingContext = this; } private async void LoadMenuItems() { await Task.Run(() => { var data = GenerateMenuItems(); Dispatcher.Dispatch(() => { MenuItems.Clear(); foreach (var item in data) MenuItems.Add(item); }); }); } private List<MenuItem> GenerateMenuItems() { var female = new[] { "female01", "female02", "female03", "female04", "female05", "female06" }; var male = new[] { "male01", "male02", "male03", "male04", "male05", "male06" }; var result = new List<MenuItem>(12); for (int i = 0; i < 12; i++) { result.Add(new MenuItem { Name = i > 5 ? female[i - 6] : male[i], SubItems = new ObservableCollection<SubItem> { new() { Name = "视频" }, new() { Name = "音频" } } }); } return result; } public class MenuItem : INotifyPropertyChanged { public string Name { get; set; } public ObservableCollection<SubItem> SubItems { get; set; } = new(); private bool _isChecked; public bool IsChecked { get => _isChecked; set { _isChecked = value; foreach (var subItem in SubItems) { subItem.IsChecked = value; } OnPropertyChanged(); } } private bool _isExpanded = true; public bool IsExpanded { get => _isExpanded; set { _isExpanded = value; OnPropertyChanged(); } } public event PropertyChangedEventHandler PropertyChanged; protected virtual void OnPropertyChanged(string propertyName = null) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } } public class SubItem : INotifyPropertyChanged { public string Name { get; set; } private bool _isChecked; public bool IsChecked { get => _isChecked; set { _isChecked = value; OnPropertyChanged(); } } public event PropertyChangedEventHandler PropertyChanged; protected virtual void OnPropertyChanged(string propertyName = null) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } } }<?xml version="1.0" encoding="utf-8" ?> <common:BasePage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="AIToy.Pages.My.UpdateResources" xmlns:common="clr-namespace:AIToy.Common" xmlns:m="clr-namespace:AIToy.Manager" xmlns:controls="clr-namespace:AIToy.Controls" Title="UpdateResources" BackgroundColor="#0D0C0D"> <ScrollView> <VerticalStackLayout Padding="20" Spacing="15"> <Label Text="资源管理器" FontSize="24" FontAttributes="Bold" HorizontalOptions="Center"/> <Border Stroke="#512BD4" StrokeThickness="2" StrokeShape="RoundRectangle 10" Padding="10"> <VerticalStackLayout Spacing="10"> <CollectionView ItemsSource="{Binding MenuItems}"> <CollectionView.ItemTemplate> <DataTemplate> <VerticalStackLayout Spacing="5"> <Grid> <CheckBox IsChecked="{Binding IsChecked}" VerticalOptions="Center"/> <Label Text="{Binding Name}" FontSize="18" FontAttributes="Bold" Margin="30,0,0,0"/> </Grid> <BoxView HeightRequest="1" Color="LightGray" Margin="30,0,0,0"/> <StackLayout Margin="30,0,0,0" Spacing="5" IsVisible="{Binding IsExpanded}"> <CollectionView ItemsSource="{Binding SubItems}"> <CollectionView.ItemTemplate> <DataTemplate> <Grid> <CheckBox IsChecked="{Binding IsChecked}" VerticalOptions="Center"/> <Label Text="{Binding Name}" Margin="30,0,0,0"/> </Grid> </DataTemplate> </CollectionView.ItemTemplate> </CollectionView> </StackLayout> </VerticalStackLayout> </DataTemplate> </CollectionView.ItemTemplate> </CollectionView> </VerticalStackLayout> </Border> </VerticalStackLayout> </ScrollView> </common:BasePage> 这是.net maui代码,加载需要6-7秒,如何优化让他秒开,前端写死也行
最新发布
08-07
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值