步骤 2 : 模仿和排错 步骤 3 : 界面效果 步骤 4 : Product 步骤 5 : Review 步骤 6 : ReviewService 步骤 7 : ReviewServiceImpl 步骤 8 : Action4Pojo 步骤 9 : Action4Service 步骤 10 : ProductService 步骤 11 : ProductServiceImpl 步骤 12 : ForeAction 步骤 13 : product.jsp 步骤 14 : productPage.jsp 步骤 15 : imgAndInfo.jsp 步骤 16 : productReview.jsp 步骤 17 : productDetail.jsp
增值内容,请先登录
完整的SSH模仿天猫项目,使用J2SE、前端技术(包含所有前端jsp文件)、J2EE,SSH一整套技术栈, 从无到有涵盖全部133个知识点,571个开发步骤, 充实SSH项目经验,为简历加上一个有吸引力的砝码.
增值内容,点击购买
使用爬虫已经被系统记录,请勿使用爬虫,增大封号风险。 如果是误封 ,请联系站长,谢谢
增值内容,请先登录
完整的SSH模仿天猫项目,使用J2SE、前端技术(包含所有前端jsp文件)、J2EE,SSH一整套技术栈, 从无到有涵盖全部133个知识点,571个开发步骤, 充实SSH项目经验,为简历加上一个有吸引力的砝码.
增值内容,点击购买
使用爬虫已经被系统记录,请勿使用爬虫,增大封号风险。 如果是误封 ,请联系站长,谢谢
增值内容,请先登录
完整的SSH模仿天猫项目,使用J2SE、前端技术(包含所有前端jsp文件)、J2EE,SSH一整套技术栈, 从无到有涵盖全部133个知识点,571个开发步骤, 充实SSH项目经验,为简历加上一个有吸引力的砝码.
增值内容,点击购买
使用爬虫已经被系统记录,请勿使用爬虫,增大封号风险。 如果是误封 ,请联系站长,谢谢
增值内容,请先登录
完整的SSH模仿天猫项目,使用J2SE、前端技术(包含所有前端jsp文件)、J2EE,SSH一整套技术栈, 从无到有涵盖全部133个知识点,571个开发步骤, 充实SSH项目经验,为简历加上一个有吸引力的砝码.
增值内容,点击购买
使用爬虫已经被系统记录,请勿使用爬虫,增大封号风险。 如果是误封 ,请联系站长,谢谢
package com.how2java.tmall.pojo;
import java.util.Date;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;
@Entity
@Table(name = "product")
public class Product {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
int id;
@ManyToOne
@JoinColumn(name="cid")
private Category category;
private String name;
private String subTitle;
private float originalPrice;
private float promotePrice;
private int stock;
private Date createDate;
@Transient
private ProductImage firstProductImage;
@Transient
private List<ProductImage> productSingleImages;
@Transient
private List<ProductImage> productDetailImages;
@Transient
private int reviewCount;
@Transient
private int saleCount;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public Category getCategory() {
return category;
}
public void setCategory(Category category) {
this.category = category;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSubTitle() {
return subTitle;
}
public void setSubTitle(String subTitle) {
this.subTitle = subTitle;
}
public float getOriginalPrice() {
return originalPrice;
}
public void setOriginalPrice(float originalPrice) {
this.originalPrice = originalPrice;
}
public float getPromotePrice() {
return promotePrice;
}
public void setPromotePrice(float promotePrice) {
this.promotePrice = promotePrice;
}
public int getStock() {
return stock;
}
public void setStock(int stock) {
this.stock = stock;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public ProductImage getFirstProductImage() {
return firstProductImage;
}
public void setFirstProductImage(ProductImage firstProductImage) {
this.firstProductImage = firstProductImage;
}
public List<ProductImage> getProductSingleImages() {
return productSingleImages;
}
public void setProductSingleImages(List<ProductImage> productSingleImages) {
this.productSingleImages = productSingleImages;
}
public List<ProductImage> getProductDetailImages() {
return productDetailImages;
}
public void setProductDetailImages(List<ProductImage> productDetailImages) {
this.productDetailImages = productDetailImages;
}
public int getReviewCount() {
return reviewCount;
}
public void setReviewCount(int reviewCount) {
this.reviewCount = reviewCount;
}
public int getSaleCount() {
return saleCount;
}
public void setSaleCount(int saleCount) {
this.saleCount = saleCount;
}
}
增值内容,请先登录
完整的SSH模仿天猫项目,使用J2SE、前端技术(包含所有前端jsp文件)、J2EE,SSH一整套技术栈, 从无到有涵盖全部133个知识点,571个开发步骤, 充实SSH项目经验,为简历加上一个有吸引力的砝码.
增值内容,点击购买
使用爬虫已经被系统记录,请勿使用爬虫,增大封号风险。 如果是误封 ,请联系站长,谢谢
package com.how2java.tmall.pojo;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@Entity
@Table(name = "review")
public class Review {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private int id;
@ManyToOne
@JoinColumn(name="uid")
private User user;
@ManyToOne
@JoinColumn(name="pid")
private Product product;
private String content;
private Date createDate;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public Product getProduct() {
return product;
}
public void setProduct(Product product) {
this.product = product;
}
}
增值内容,请先登录
完整的SSH模仿天猫项目,使用J2SE、前端技术(包含所有前端jsp文件)、J2EE,SSH一整套技术栈, 从无到有涵盖全部133个知识点,571个开发步骤, 充实SSH项目经验,为简历加上一个有吸引力的砝码.
增值内容,点击购买
使用爬虫已经被系统记录,请勿使用爬虫,增大封号风险。 如果是误封 ,请联系站长,谢谢
package com.how2java.tmall.service;
public interface ReviewService extends BaseService {
}
package com.how2java.tmall.service; public interface ReviewService extends BaseService { }
增值内容,请先登录
完整的SSH模仿天猫项目,使用J2SE、前端技术(包含所有前端jsp文件)、J2EE,SSH一整套技术栈, 从无到有涵盖全部133个知识点,571个开发步骤, 充实SSH项目经验,为简历加上一个有吸引力的砝码.
增值内容,点击购买
使用爬虫已经被系统记录,请勿使用爬虫,增大封号风险。 如果是误封 ,请联系站长,谢谢
package com.how2java.tmall.service.impl;
import org.springframework.stereotype.Service;
import com.how2java.tmall.service.ReviewService;
@Service
public class ReviewServiceImpl extends BaseServiceImpl implements ReviewService {
}
package com.how2java.tmall.service.impl; import org.springframework.stereotype.Service; import com.how2java.tmall.service.ReviewService; @Service public class ReviewServiceImpl extends BaseServiceImpl implements ReviewService { }
增值内容,请先登录
完整的SSH模仿天猫项目,使用J2SE、前端技术(包含所有前端jsp文件)、J2EE,SSH一整套技术栈, 从无到有涵盖全部133个知识点,571个开发步骤, 充实SSH项目经验,为简历加上一个有吸引力的砝码.
增值内容,点击购买
使用爬虫已经被系统记录,请勿使用爬虫,增大封号风险。 如果是误封 ,请联系站长,谢谢
package com.how2java.tmall.action;
import java.util.List;
import com.how2java.tmall.pojo.Category;
import com.how2java.tmall.pojo.Order;
import com.how2java.tmall.pojo.Product;
import com.how2java.tmall.pojo.ProductImage;
import com.how2java.tmall.pojo.Property;
import com.how2java.tmall.pojo.PropertyValue;
import com.how2java.tmall.pojo.Review;
import com.how2java.tmall.pojo.User;
public class Action4Pojo extends Action4Pagination {
protected Category category;
protected Property property;
protected Product product;
protected ProductImage productImage;
protected PropertyValue propertyValue;
protected User user;
protected Order order;
protected Review review;
protected List<Category> categorys;
protected List<Property> propertys;
protected List<Product> products;
protected List<ProductImage> productSingleImages;
protected List<ProductImage> productDetailImages;
protected List<PropertyValue> propertyValues;
protected List<User> users;
protected List<Order> orders;
protected List<Review> reviews;
public Category getCategory() {
return category;
}
public void setCategory(Category category) {
this.category = category;
}
public List<Category> getCategorys() {
return categorys;
}
public void setCategorys(List<Category> categorys) {
this.categorys = categorys;
}
public Property getProperty() {
return property;
}
public void setProperty(Property property) {
this.property = property;
}
public List<Property> getPropertys() {
return propertys;
}
public void setPropertys(List<Property> propertys) {
this.propertys = propertys;
}
public Product getProduct() {
return product;
}
public void setProduct(Product product) {
this.product = product;
}
public List<Product> getProducts() {
return products;
}
public void setProducts(List<Product> products) {
this.products = products;
}
public ProductImage getProductImage() {
return productImage;
}
public void setProductImage(ProductImage productImage) {
this.productImage = productImage;
}
public List<ProductImage> getProductSingleImages() {
return productSingleImages;
}
public void setProductSingleImages(List<ProductImage> productSingleImages) {
this.productSingleImages = productSingleImages;
}
public List<ProductImage> getProductDetailImages() {
return productDetailImages;
}
public void setProductDetailImages(List<ProductImage> productDetailImages) {
this.productDetailImages = productDetailImages;
}
public PropertyValue getPropertyValue() {
return propertyValue;
}
public void setPropertyValue(PropertyValue propertyValue) {
this.propertyValue = propertyValue;
}
public List<PropertyValue> getPropertyValues() {
return propertyValues;
}
public void setPropertyValues(List<PropertyValue> propertyValues) {
this.propertyValues = propertyValues;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public List<User> getUsers() {
return users;
}
public void setUsers(List<User> users) {
this.users = users;
}
public Order getOrder() {
return order;
}
public void setOrder(Order order) {
this.order = order;
}
public List<Order> getOrders() {
return orders;
}
public void setOrders(List<Order> orders) {
this.orders = orders;
}
public Review getReview() {
return review;
}
public void setReview(Review review) {
this.review = review;
}
public List<Review> getReviews() {
return reviews;
}
public void setReviews(List<Review> reviews) {
this.reviews = reviews;
}
}
增值内容,请先登录
完整的SSH模仿天猫项目,使用J2SE、前端技术(包含所有前端jsp文件)、J2EE,SSH一整套技术栈, 从无到有涵盖全部133个知识点,571个开发步骤, 充实SSH项目经验,为简历加上一个有吸引力的砝码.
增值内容,点击购买
使用爬虫已经被系统记录,请勿使用爬虫,增大封号风险。 如果是误封 ,请联系站长,谢谢
package com.how2java.tmall.action;
import java.lang.reflect.Method;
import org.apache.commons.lang3.text.WordUtils;
import org.springframework.beans.factory.annotation.Autowired;
import com.how2java.tmall.service.CategoryService;
import com.how2java.tmall.service.OrderItemService;
import com.how2java.tmall.service.OrderService;
import com.how2java.tmall.service.ProductImageService;
import com.how2java.tmall.service.ProductService;
import com.how2java.tmall.service.PropertyService;
import com.how2java.tmall.service.PropertyValueService;
import com.how2java.tmall.service.ReviewService;
import com.how2java.tmall.service.UserService;
public class Action4Service extends Action4Pojo{
@Autowired
CategoryService categoryService;
@Autowired
PropertyService propertyService;
@Autowired
ProductService productService;
@Autowired
ProductImageService productImageService;
@Autowired
PropertyValueService propertyValueService;
@Autowired
UserService userService;
@Autowired
OrderService orderService;
@Autowired
OrderItemService orderItemService;
@Autowired
ReviewService reviewService;
/**
* transient to persistent
* 瞬时对象转换为持久对象
* @param o
*/
public void t2p(Object o){
try {
Class clazz = o.getClass();
int id = (Integer) clazz.getMethod("getId").invoke(o);
Object persistentBean = categoryService.get(clazz, id);
String beanName = clazz.getSimpleName();
Method setMethod = getClass().getMethod("set" + WordUtils.capitalize(beanName), clazz);
setMethod.invoke(this, persistentBean);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
增值内容,请先登录
完整的SSH模仿天猫项目,使用J2SE、前端技术(包含所有前端jsp文件)、J2EE,SSH一整套技术栈, 从无到有涵盖全部133个知识点,571个开发步骤, 充实SSH项目经验,为简历加上一个有吸引力的砝码.
增值内容,点击购买
使用爬虫已经被系统记录,请勿使用爬虫,增大封号风险。 如果是误封 ,请联系站长,谢谢
package com.how2java.tmall.service;
import java.util.List;
import com.how2java.tmall.pojo.Category;
import com.how2java.tmall.pojo.Product;
public interface ProductService extends BaseService {
public void fill(List<Category> categorys);
public void fill(Category category);
public void fillByRow(List<Category> categorys);
public void setSaleAndReviewNumber(Product product);
public void setSaleAndReviewNumber(List<Product> products);
}
package com.how2java.tmall.service; import java.util.List; import com.how2java.tmall.pojo.Category; import com.how2java.tmall.pojo.Product; public interface ProductService extends BaseService { public void fill(List<Category> categorys); public void fill(Category category); public void fillByRow(List<Category> categorys); public void setSaleAndReviewNumber(Product product); public void setSaleAndReviewNumber(List<Product> products); }
增值内容,请先登录
完整的SSH模仿天猫项目,使用J2SE、前端技术(包含所有前端jsp文件)、J2EE,SSH一整套技术栈, 从无到有涵盖全部133个知识点,571个开发步骤, 充实SSH项目经验,为简历加上一个有吸引力的砝码.
增值内容,点击购买
使用爬虫已经被系统记录,请勿使用爬虫,增大封号风险。 如果是误封 ,请联系站长,谢谢
package com.how2java.tmall.service.impl;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.how2java.tmall.pojo.Category;
import com.how2java.tmall.pojo.Product;
import com.how2java.tmall.service.OrderItemService;
import com.how2java.tmall.service.ProductImageService;
import com.how2java.tmall.service.ProductService;
import com.how2java.tmall.service.ReviewService;
@Service
public class ProductServiceImpl extends BaseServiceImpl implements ProductService {
@Autowired
ProductImageService productImageService;
@Autowired
OrderItemService orderItemService;
@Autowired
ReviewService reviewService;
@Override
public void setSaleAndReviewNumber(Product product) {
int saleCount = orderItemService.total(product);
product.setSaleCount(saleCount);
int reviewCount = reviewService.total(product);
product.setReviewCount(reviewCount);
}
@Override
public void setSaleAndReviewNumber(List<Product> products) {
for (Product product : products) {
setSaleAndReviewNumber(product);
}
}
public void fill(List<Category> categorys) {
for (Category category : categorys) {
fill(category);
}
}
@Override
public void fillByRow(List<Category> categorys) {
int productNumberEachRow = 8;
for (Category category : categorys) {
List<Product> products = category.getProducts();
List<List<Product>> productsByRow = new ArrayList<>();
for (int i = 0; i < products.size(); i+=productNumberEachRow) {
int size = i+productNumberEachRow;
size= size>products.size()?products.size():size;
List<Product> productsOfEachRow =products.subList(i, size);
productsByRow.add(productsOfEachRow);
}
category.setProductsByRow(productsByRow);
}
}
@Override
public void fill(Category category) {
List<Product> products= listByParent(category);
for (Product product : products)
productImageService.setFirstProdutImage(product);
category.setProducts(products);
}
}
增值内容,请先登录
完整的SSH模仿天猫项目,使用J2SE、前端技术(包含所有前端jsp文件)、J2EE,SSH一整套技术栈, 从无到有涵盖全部133个知识点,571个开发步骤, 充实SSH项目经验,为简历加上一个有吸引力的砝码.
增值内容,点击购买
使用爬虫已经被系统记录,请勿使用爬虫,增大封号风险。 如果是误封 ,请联系站长,谢谢
@Action("foreproduct")
public String product() {
t2p(product);
productImageService.setFirstProdutImage(product);
productSingleImages = productImageService.list("product",product,"type", ProductImageService.type_single);
productDetailImages = productImageService.list("product",product,"type", ProductImageService.type_detail);
product.setProductSingleImages(productSingleImages);
product.setProductDetailImages(productDetailImages);
propertyValues = propertyValueService.listByParent(product);
reviews = reviewService.listByParent(product);
productService.setSaleAndReviewNumber(product);
return "product.jsp";
}
package com.how2java.tmall.action;
import org.apache.struts2.convention.annotation.Action;
import org.springframework.web.util.HtmlUtils;
import com.how2java.tmall.pojo.User;
import com.how2java.tmall.service.ProductImageService;
import com.opensymphony.xwork2.ActionContext;
public class ForeAction extends Action4Result {
@Action("foreproduct")
public String product() {
t2p(product);
productImageService.setFirstProdutImage(product);
productSingleImages = productImageService.list("product",product,"type", ProductImageService.type_single);
productDetailImages = productImageService.list("product",product,"type", ProductImageService.type_detail);
product.setProductSingleImages(productSingleImages);
product.setProductDetailImages(productDetailImages);
propertyValues = propertyValueService.listByParent(product);
reviews = reviewService.listByParent(product);
productService.setSaleAndReviewNumber(product);
return "product.jsp";
}
@Action("forelogout")
public String logout() {
ActionContext.getContext().getSession().remove("user");
return "homePage";
}
@Action("forelogin")
public String login() {
user.setName(HtmlUtils.htmlEscape(user.getName()));
User user_session = userService.get(user.getName(),user.getPassword());
if(null==user_session){
msg= "账号密码错误";
return "login.jsp";
}
ActionContext.getContext().getSession().put("user", user_session);
return "homePage";
}
@Action("foreregister")
public String register() {
user.setName(HtmlUtils.htmlEscape(user.getName()));
boolean exist = userService.isExist(user.getName());
if(exist){
msg = "用户名已经被使用,不能使用";
return "register.jsp";
}
userService.save(user);
return "registerSuccessPage";
}
@Action("forehome")
public String home() {
categorys = categoryService.list();
productService.fill(categorys);
productService.fillByRow(categorys);
return "home.jsp";
}
}
增值内容,请先登录
完整的SSH模仿天猫项目,使用J2SE、前端技术(包含所有前端jsp文件)、J2EE,SSH一整套技术栈, 从无到有涵盖全部133个知识点,571个开发步骤, 充实SSH项目经验,为简历加上一个有吸引力的砝码.
增值内容,点击购买
使用爬虫已经被系统记录,请勿使用爬虫,增大封号风险。 如果是误封 ,请联系站长,谢谢
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" isELIgnored="false"%>
<%@include file="include/header.jsp"%>
<%@include file="include/top.jsp"%>
<%@include file="include/simpleSearch.jsp"%>
<%@include file="include/product/productPage.jsp"%>
<%@include file="include/footer.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%> <%@include file="include/header.jsp"%> <%@include file="include/top.jsp"%> <%@include file="include/simpleSearch.jsp"%> <%@include file="include/product/productPage.jsp"%> <%@include file="include/footer.jsp"%>
增值内容,请先登录
完整的SSH模仿天猫项目,使用J2SE、前端技术(包含所有前端jsp文件)、J2EE,SSH一整套技术栈, 从无到有涵盖全部133个知识点,571个开发步骤, 充实SSH项目经验,为简历加上一个有吸引力的砝码.
增值内容,点击购买
使用爬虫已经被系统记录,请勿使用爬虫,增大封号风险。 如果是误封 ,请联系站长,谢谢
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" isELIgnored="false"%>
<title>模仿天猫官网 ${p.name}</title>
<div class="categoryPictureInProductPageDiv">
<img class="categoryPictureInProductPage" src="img/category/${product.category.id}.jpg">
</div>
<div class="productPageDiv">
<%@include file="imgAndInfo.jsp" %>
<%@include file="productReview.jsp" %>
<%@include file="productDetail.jsp" %>
</div>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%> <title>模仿天猫官网 ${p.name}</title> <div class="categoryPictureInProductPageDiv"> <img class="categoryPictureInProductPage" src="img/category/${product.category.id}.jpg"> </div> <div class="productPageDiv"> <%@include file="imgAndInfo.jsp" %> <%@include file="productReview.jsp" %> <%@include file="productDetail.jsp" %> </div>
增值内容,请先登录
完整的SSH模仿天猫项目,使用J2SE、前端技术(包含所有前端jsp文件)、J2EE,SSH一整套技术栈, 从无到有涵盖全部133个知识点,571个开发步骤, 充实SSH项目经验,为简历加上一个有吸引力的砝码.
增值内容,点击购买
使用爬虫已经被系统记录,请勿使用爬虫,增大封号风险。 如果是误封 ,请联系站长,谢谢
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" isELIgnored="false"%>
<script>
$(function(){
var stock = ${product.stock};
$(".productNumberSetting").keyup(function(){
var num= $(".productNumberSetting").val();
num = parseInt(num);
if(isNaN(num))
num= 1;
if(num<=0)
num = 1;
if(num>stock)
num = stock;
$(".productNumberSetting").val(num);
});
$(".increaseNumber").click(function(){
var num= $(".productNumberSetting").val();
num++;
if(num>stock)
num = stock;
$(".productNumberSetting").val(num);
});
$(".decreaseNumber").click(function(){
var num= $(".productNumberSetting").val();
--num;
if(num<=0)
num=1;
$(".productNumberSetting").val(num);
});
$(".addCartLink").click(function(){
var page = "forecheckLogin";
$.get(
page,
function(result){
if("success"==result){
var pid = ${product.id};
var num= $(".productNumberSetting").val();
var addCartpage = "foreaddCart";
$.get(
addCartpage,
{"product.id":pid,"num":num},
function(result){
if("success"==result){
$(".addCartButton").html("已加入购物车");
$(".addCartButton").attr("disabled","disabled");
$(".addCartButton").css("background-color","lightgray")
$(".addCartButton").css("border-color","lightgray")
$(".addCartButton").css("color","black")
}
else{
}
}
);
}
else{
$("#loginModal").modal('show');
}
}
);
return false;
});
$(".buyLink").click(function(){
var page = "forecheckLogin";
$.get(
page,
function(result){
if("success"==result){
var num = $(".productNumberSetting").val();
location.href= $(".buyLink").attr("href")+"&num="+num;
}
else{
$("#loginModal").modal('show');
}
}
);
return false;
});
$("button.loginSubmitButton").click(function(){
var name = $("#name").val();
var password = $("#password").val();
if(0==name.length||0==password.length){
$("span.errorMessage").html("请输入账号密码");
$("div.loginErrorMessageDiv").show();
return false;
}
var page = "foreloginAjax";
$.get(
page,
{"user.name":name,"user.password":password},
function(result){
if("success"==result){
location.reload();
}
else{
$("span.errorMessage").html("账号密码错误");
$("div.loginErrorMessageDiv").show();
}
}
);
return true;
});
$("img.smallImage").mouseenter(function(){
var bigImageURL = $(this).attr("bigImageURL");
$("img.bigImg").attr("src",bigImageURL);
});
$("img.bigImg").load(
function(){
$("img.smallImage").each(function(){
var bigImageURL = $(this).attr("bigImageURL");
img = new Image();
img.src = bigImageURL;
img.onload = function(){
console.log(bigImageURL);
$("div.img4load").append($(img));
};
});
}
);
});
</script>
<div class="imgAndInfo">
<div class="imgInimgAndInfo">
<img src="img/productSingle/${product.firstProductImage.id}.jpg" class="bigImg">
<div class="smallImageDiv">
<c:forEach items="${product.productSingleImages}" var="pi">
<img src="img/productSingle_small/${pi.id}.jpg" bigImageURL="img/productSingle/${pi.id}.jpg" class="smallImage">
</c:forEach>
</div>
<div class="img4load hidden" ></div>
</div>
<div class="infoInimgAndInfo">
<div class="productTitle">
${product.name}
</div>
<div class="productSubTitle">
${product.subTitle}
</div>
<div class="productPrice">
<div class="juhuasuan">
<span class="juhuasuanBig" >聚划算</span>
<span>此商品即将参加聚划算,<span class="juhuasuanTime">1天19小时</span>后开始,</span>
</div>
<div class="productPriceDiv">
<div class="gouwujuanDiv"><img height="16px" src="img/site/gouwujuan.png">
<span> 全天猫实物商品通用</span>
</div>
<div class="originalDiv">
<span class="originalPriceDesc">价格</span>
<span class="originalPriceYuan">¥</span>
<span class="originalPrice">
<fmt:formatNumber type="number" value="${product.originalPrice}" minFractionDigits="2"/>
</span>
</div>
<div class="promotionDiv">
<span class="promotionPriceDesc">促销价 </span>
<span class="promotionPriceYuan">¥</span>
<span class="promotionPrice">
<fmt:formatNumber type="number" value="${product.promotePrice}" minFractionDigits="2"/>
</span>
</div>
</div>
</div>
<div class="productSaleAndReviewNumber">
<div>销量 <span class="redColor boldWord"> ${product.saleCount }</span></div>
<div>累计评价 <span class="redColor boldWord"> ${product.reviewCount}</span></div>
</div>
<div class="productNumber">
<span>数量</span>
<span>
<span class="productNumberSettingSpan">
<input class="productNumberSetting" type="text" value="1">
</span>
<span class="arrow">
<a href="#nowhere" class="increaseNumber">
<span class="updown">
<img src="img/site/increase.png">
</span>
</a>
<span class="updownMiddle"> </span>
<a href="#nowhere" class="decreaseNumber">
<span class="updown">
<img src="img/site/decrease.png">
</span>
</a>
</span>
件</span>
<span>库存${product.stock}件</span>
</div>
<div class="serviceCommitment">
<span class="serviceCommitmentDesc">服务承诺</span>
<span class="serviceCommitmentLink">
<a href="#nowhere">正品保证</a>
<a href="#nowhere">极速退款</a>
<a href="#nowhere">赠运费险</a>
<a href="#nowhere">七天无理由退换</a>
</span>
</div>
<div class="buyDiv">
<a class="buyLink" href="forebuyone?product.id=${product.id}"><button class="buyButton">立即购买</button></a>
<a href="#nowhere" class="addCartLink"><button class="addCartButton"><span class="glyphicon glyphicon-shopping-cart"></span>加入购物车</button></a>
</div>
</div>
<div style="clear:both"></div>
</div>
增值内容,请先登录
完整的SSH模仿天猫项目,使用J2SE、前端技术(包含所有前端jsp文件)、J2EE,SSH一整套技术栈, 从无到有涵盖全部133个知识点,571个开发步骤, 充实SSH项目经验,为简历加上一个有吸引力的砝码.
增值内容,点击购买
使用爬虫已经被系统记录,请勿使用爬虫,增大封号风险。 如果是误封 ,请联系站长,谢谢
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" isELIgnored="false"%>
<div class="productReviewDiv" >
<div class="productReviewTopPart">
<a href="#nowhere" class="productReviewTopPartSelectedLink">商品详情</a>
<a href="#nowhere" class="selected">累计评价 <span class="productReviewTopReviewLinkNumber">${p.reviewCount}</span> </a>
</div>
<div class="productReviewContentPart">
<c:forEach items="${reviews}" var="r">
<div class="productReviewItem">
<div class="productReviewItemDesc">
<div class="productReviewItemContent">
${r.content }
</div>
<div class="productReviewItemDate"><fmt:formatDate value="${r.createDate}" pattern="yyyy-MM-dd"/></div>
</div>
<div class="productReviewItemUserInfo">
${r.user.anonymousName}<span class="userInfoGrayPart">(匿名)</span>
</div>
<div style="clear:both"></div>
</div>
</c:forEach>
</div>
</div>
增值内容,请先登录
完整的SSH模仿天猫项目,使用J2SE、前端技术(包含所有前端jsp文件)、J2EE,SSH一整套技术栈, 从无到有涵盖全部133个知识点,571个开发步骤, 充实SSH项目经验,为简历加上一个有吸引力的砝码.
增值内容,点击购买
使用爬虫已经被系统记录,请勿使用爬虫,增大封号风险。 如果是误封 ,请联系站长,谢谢
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<div class="productDetailDiv" >
<div class="productDetailTopPart">
<a href="#nowhere" class="productDetailTopPartSelectedLink selected">商品详情</a>
<a href="#nowhere" class="productDetailTopReviewLink">累计评价 <span class="productDetailTopReviewLinkNumber">${p.reviewCount}</span> </a>
</div>
<div class="productParamterPart">
<div class="productParamter">产品参数:</div>
<div class="productParamterList">
<c:forEach items="${propertyValues}" var="pv">
<span>${pv.property.name}: ${fn:substring(pv.value, 0, 10)} </span>
</c:forEach>
</div>
<div style="clear:both"></div>
</div>
<div class="productDetailImagesPart">
<c:forEach items="${product.productDetailImages}" var="pi">
<img src="img/productDetail/${pi.id}.jpg">
</c:forEach>
</div>
</div>
HOW2J公众号,关注后实时获知最新的教程和优惠活动,谢谢。
问答区域
2019-04-11
提问一下
回答已经提交成功,正在审核。 请于 我的回答 处查看回答记录,谢谢
2018-08-27
有个小问题
回答已经提交成功,正在审核。 请于 我的回答 处查看回答记录,谢谢
2018-05-17
foreAction product对象null
2018-05-15
这个页面里Action4Pojo里少了OrderItem声明,直接复制的同学可能会后来发现后台管理有问题哟
2017-11-17
空指针错误
提问太多,页面渲染太慢,为了加快渲染速度,本页最多只显示几条提问。还有 1 条以前的提问,请 点击查看
提问之前请登陆
提问已经提交成功,正在审核。 请于 我的提问 处查看提问记录,谢谢
|