第二次冲刺 01
今天进行了第二阶段的计划。
为优化用户体验做出分析。
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page import="toolse.Tool"%> <%@page import="java.util.*"%> <%@ page import="java.sql.*"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <link rel="stylesheet" type="text/css" href="https://www.layuicdn.com/layui/css/layui.css" /> <script src="https://www.layuicdn.com/layui/layui.js"></script> <script type="text/javascript"> var msg= new window.SpeechSynthesisUtterance(); msg.text = '可乐购买!'; msg.lang="zh-CN"; msg.volume = '1'; msg.rate = 1; msg.pitch = 1; speechSynthesis.speak(msg); </script> <style type="text/css"> p{ font-size: 25px} .fls{ border: 1px solid #000099; height: 60px; width: 200px; margin:2px; } .ff{ width: 200px; height: 200px; position: absolute; left: 520px; top: 20px; } </style> <% String tel=request.getParameter("id"); Connection conn = Tool.getConnection(); PreparedStatement pre = null; ResultSet res = null; String s1="",s2="",s3=""; String sql = "SELECT * FROM car_commodity where name=? and user_phone= ?"; try { pre = conn.prepareStatement(sql); pre.setString(1,"可乐(350ml)"); pre.setString(2,tel); res = pre.executeQuery(); while (res.next()) { String num1 = res.getString("total"); String num2 =res.getString("leftover"); String num3 =res.getString("price"); s1=num1; s2=num2; s3=num3; } } catch (SQLException e) { e.printStackTrace(); } finally { Tool.release(conn, pre, res); } %> <script language="JavaScript"> window.onload=function() { var now = new Date(); document.getElementById("time").value = now.getFullYear() + "-" + (now.getMonth() + 1) + "-" + now.getDate(); document.getElementById("time").value += " " + now.getHours() + ":" + now.getMinutes(); } </script> <title>可乐</title> </head> <body> <a href="index.jsp"><button type="submit" class="layui-btn"style="background-color: #1571b2" >返回</button></a> <div class="ff"> <div class="fls"> <img alt="" src="images/1000.jpg" width='400' height='300'/> </br> <p>可乐(350ml) </p><p> 售价:<%out.print(s3);%>¥</p> <p>剩余量<%out.print(s2); %> </p> <form action="Sere" method="post"> <input type="hidden" name="method" value="find"/> <input type="hidden" name="num" value="<%=s2 %>"/> <input type="hidden" name="tel" value="<%=tel %>"/> <input type="hidden" name="price" value="<%=s3 %>"/> <input type="hidden" name="date" id="time" value=""/> <input type="hidden" name="name" value="可乐(350ml)"/> <%if(s2.equals("0")){ %> <input type="submit" value="已售完" class="layui-btn"style="background-color: #1571b2" disabled> <% }else{%> <input type="submit" value="购买" class="layui-btn"style="background-color: #1571b2"> <% }%> </form> </div> </div> </body> </html>
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 周边上新:园子的第一款马克杯温暖上架
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· DeepSeek如何颠覆传统软件测试?测试工程师会被淘汰吗?
· 使用C#创建一个MCP客户端