Browse Source

我的订单

yuhaitao14 7 years ago
parent
commit
56b1733c61

+ 1 - 1
shop/src/main/java/com/zskk/shop/controller/AbstractController.java

@@ -111,7 +111,7 @@ public class AbstractController {
 		if (user != null) {
 		if (user != null) {
 			model.addAttribute("user", user);
 			model.addAttribute("user", user);
 		}
 		}
-		model.addAttribute("loginurl", uccenter + "wx/enter/" + companyid + "?redirect=" + urlEncoding(myhost));
+		model.addAttribute("loginurl", uccenter + "wx/enter/" + companyid + "?redirect=" + urlEncoding(redirect));
 	}
 	}
 
 
 	public void initUser(Model model) {
 	public void initUser(Model model) {

+ 19 - 0
shop/src/main/java/com/zskk/shop/controller/h5/H5BuyOrderController.java

@@ -8,6 +8,9 @@
 
 
 package com.zskk.shop.controller.h5;
 package com.zskk.shop.controller.h5;
 
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.ui.Model;
@@ -15,6 +18,7 @@ import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 
 
 import com.zskk.shop.controller.AbstractController;
 import com.zskk.shop.controller.AbstractController;
+import com.zskk.shop.controller.bean.BuyOrderBean;
 import com.zskk.shop.controller.bean.ControllerResult;
 import com.zskk.shop.controller.bean.ControllerResult;
 import com.zskk.shop.controller.bean.UserBean;
 import com.zskk.shop.controller.bean.UserBean;
 import com.zskk.shop.dao.entry.BuyOrder;
 import com.zskk.shop.dao.entry.BuyOrder;
@@ -73,4 +77,19 @@ public class H5BuyOrderController extends AbstractController{
 	public String paySuccess(Model model){
 	public String paySuccess(Model model){
 		return "/h5/";
 		return "/h5/";
 	}
 	}
+	
+	@RequestMapping("/buy/mypayedorders")
+	public String myorders(Model model){
+		UserBean userBean			= this.getUser();
+		String uid 					= userBean.getUserid();
+		List<BuyOrder> orders 		= buyOrderService.queryMyPayedOrders(uid);
+		List<BuyOrderBean> beans 	= new ArrayList<>(orders.size());
+		for (BuyOrder order: orders){
+			BuyOrderBean bean = buyOrderService.toBuyOrderBean(order);
+			beans.add(bean);
+		}
+		model.addAttribute("orders", beans);
+		this.initUser(model);
+		return "/h5/mypayedorders";
+	}
 }
 }

+ 1 - 1
shop/src/main/java/com/zskk/shop/controller/h5/H5IndexController.java

@@ -76,7 +76,7 @@ public class H5IndexController extends AbstractController {
 		GoodBean bean = goodService.toDetailGoodBean(base, price, ads, describes);
 		GoodBean bean = goodService.toDetailGoodBean(base, price, ads, describes);
 		model.addAttribute("good", bean);
 		model.addAttribute("good", bean);
 		model.addAttribute("checklist", tjCheckList);
 		model.addAttribute("checklist", tjCheckList);
-		this.wxInitUser(model, myhost + "detail/" + gid);
+		this.wxInitUser(model, myhost + "h5/detail/" + gid);
 		return "/h5/detail";
 		return "/h5/detail";
 	}
 	}
 	
 	

+ 5 - 1
shop/src/main/resource/templates/h5/detail.html

@@ -64,9 +64,13 @@
 	</div>
 	</div>
 
 
 	<script src="/h5/js/jquery-2.1.1.min.js"></script>
 	<script src="/h5/js/jquery-2.1.1.min.js"></script>
-	<script>
+	<script th:inline="javascript">
 		$(function(){
 		$(function(){
 			$("#login").click(function(){
 			$("#login").click(function(){
+				if (confirm("您还没有登录,请先登录")){
+					var ur = [[${loginurl}]]
+					window.location.href=[[${loginurl}]]
+				}
 			});
 			});
 		});
 		});
 	</script>
 	</script>

+ 34 - 0
shop/src/main/resource/templates/h5/mypayedorders.html

@@ -0,0 +1,34 @@
+<!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>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>昆仑医疗</title>
+<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/>
+<link href="/h5/style/style.css" rel="stylesheet" />
+<script src="/h5/js/jquery-2.1.1.min.js"></script>
+<script src="/h5/js/nav.js"></script>
+</head>
+
+<body>
+	<!--热销-->
+    <div class="v-list">
+        <a href="#">
+            <div class="img l mr10"><img src="" /></div>
+            <dl>
+                <dt>白领高级体检套餐</dt>
+                <dd>重点检查心检查心脏脏、胰</dd>
+                <span class="price-new l"><em>¥</em>500</span>
+            </dl>
+        </a>
+    </div>
+	<!--底部-->
+    <div style="height:60px; "></div>
+	<table class="n-tab">
+    	<tr>
+        	<td><a href="/h5/index" class="n-1-c">首页</a></td>
+            <td><a href="#" class="n-2">报告</a></td>
+            <td><a href="#" class="n-3">我的</a></td>
+        </tr>
+    </table>
+</body>
+</html>