Web开发——手机销售网

手机销售网

功能包括用户注册、登录、浏览手机、查询手机、查看购物车、查看订单、退出、返回主页这8个功能,添加了后台管理功能。

Web开发——手机销售网

一、简单介绍前台功能:

用户注册:

Web开发——手机销售网

 

注册成功:

Web开发——手机销售网

 

用户登录:

Web开发——手机销售网

 

登录成功:

Web开发——手机销售网

 

浏览手机:

Web开发——手机销售网

提交:

Web开发——手机销售网

查看细节:

Web开发——手机销售网

放入购物车:

Web开发——手机销售网

 

查看购物车:

Web开发——手机销售网

 

查询手机:

Web开发——手机销售网

提交:

Web开发——手机销售网

退出与主页:

Web开发——手机销售网

 

二、接下来介绍后台管理功能:

树形菜单:

Web开发——手机销售网

树形菜单具体实现代码之一:

<%@ page language="java" contentType="text/html; charset=UTF-8"

    pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>网上商城管理中心</title>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<link href="${pageContext.request.contextPath }/css/general.css" rel="stylesheet" type="text/css" />

<link href="${pageContext.request.contextPath }/css/main.css" rel="stylesheet" type="text/css" />

 

<style type="text/css">

body {

  color: white;

}

</style>

</head>

<body style="background: #278296">

<center></center>

<form method="post" action="${pageContext.request.contextPath }/admin/home.jsp" target="_parent" name='theForm' onsubmit="return validate()">

  <table cellspacing="0" cellpadding="0" style="margin-top: 100px" align="center">

  <tr>

    <td style="padding-left: 50px">

      <table>

      <tr>

        <td>管理员姓名:</td>

        <td><input type="text" name="username" /></td>

      </tr>

      <tr>

        <td>管理员密码:</td>

        <td><input type="password" name="password" /></td>

      </tr>

      <tr><td>&nbsp;</td><td><input type="submit" value="进入管理中心" class="button" /></td></tr>

      </table>

    </td>

  </tr>

  </table>

</form>

<script language="JavaScript">

<!--

  document.forms['theForm'].elements['username'].focus();

 

  /**

   * 检查表单输入的内容

   */

  function validate()

  {

    var validator = new Validator('theForm');

    validator.required('username', user_name_empty);

    //validator.required('password', password_empty);

    if (document.forms['theForm'].elements['captcha'])

    {

      validator.required('captcha', captcha_empty);

    }

    return validator.passed();

  }

 

//-->

</script>

</body>

 

 

具体功能有三类,分别是添加管理、删除管理和退出。添加管理有添加分类、添加商品、添加用户、添加订单。删除管理有删除分类、删除商品、删除用户、删除订单。

 

部分功能运行截图:

添加订单:

Web开发——手机销售网

 

添加商品:

Web开发——手机销售网

 

删除用户即用户注销:

Web开发——手机销售网

三、总结与体会

这次的实验前前后后花了很长时间,准备实验环境即下载安装myeclipse和mqsql等软件就用了很长时间,比其他同学花了更长的时间去下载和安装。这意味着以后我需要提前去准备好实验环境,不懂的地方及时百度查询,还是弄不懂就需要及时询问同学或者身边的大佬。

一开始把前台源代码复制到相应的目录下并运行,出现了连不上数据库的情况,一开始我以为是数据库的驱动版本不对,所以连不上,再装了相应的JDBC驱动之后,还是连不上mysql。找了很久的问题,才发现自己建立数据库的时候,表名与代码中的名字不一致,更改之后,就可以连上了。

在这次实验过程中,出现了许多问题,通过问老师和身边大佬以及百度后,才一一解决。这次实验时间说长不长说短不短,但由于我前期准备实验环境花费的时间太多,导致后期真正开始实验的时间缩短了很多。

这次的功能较少,只有添加、删除和退出功能,以后我会慢慢补全其他功能,如查询功能(查询用户、查询商品等)等。