yuhaitao14 7 years ago
parent
commit
3c0ed36f5c

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

@@ -140,6 +140,7 @@ public class H5BuyOrderController extends AbstractController{
 		model.addAttribute("orders", beans);
 		model.addAttribute("title", "暂无体检报告");
 		model.addAttribute("subTitle", "体检报告正在创建中,请耐心等待");
+		model.addAttribute("iscomplete", Boolean.TRUE);
 		return "/h5/mypayedorders";
 	}
 	

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

@@ -27,9 +27,11 @@ import com.zskk.shop.dao.entry.GoodAd;
 import com.zskk.shop.dao.entry.GoodBase;
 import com.zskk.shop.dao.entry.GoodDescribe;
 import com.zskk.shop.dao.entry.GoodPrice;
+import com.zskk.shop.dao.entry.ShopConfig;
 import com.zskk.shop.dao.entry.SysLabel;
 import com.zskk.shop.service.BannerService;
 import com.zskk.shop.service.GoodService;
+import com.zskk.shop.service.ShopConfigService;
 import com.zskk.shop.service.SysLabelService;
 import com.zskk.shop.service.TJCenterService;
 
@@ -49,6 +51,9 @@ public class H5IndexController extends AbstractController {
 	@Autowired
 	private BannerService  bannerService;
 	
+	@Autowired
+	private ShopConfigService shopConfigService;
+	
 	@Value("${zskk.myhost}")
 	private String myhost;
 	
@@ -63,10 +68,25 @@ public class H5IndexController extends AbstractController {
 		model.addAttribute("banners", banners);
 		search = search != null? search: "";
 		model.addAttribute("search", search);
+		ShopConfig picCheckLabelConfig = shopConfigService.getOnline(ShopConfigService.KEY_PIC_CHECK_LABEL);
+		model.addAttribute("picCheckLabel", picCheckLabelConfig != null? picCheckLabelConfig.getValue(): "");
 		
 		return "/h5/indexv2";
 	}
 	
+	@RequestMapping("/search")
+	public String search(Model model, @RequestParam(name="search", required=false) String search, @RequestParam(name="label", required=false) Integer label){
+		List<GoodBean> beans 		= this.getGoodList(label, search);
+		List<SysLabel> labels		= this.queryAllSysLabel();
+		
+		model.addAttribute("beans", beans);
+		model.addAttribute("labels", labels);
+		search = search != null? search: "";
+		model.addAttribute("search", search);
+		
+		return "/h5/search";
+	}
+	
 	@RequestMapping("/detail/{gid}")
 	public String detail(Model model, @PathVariable("gid") Integer gid){
 		GoodBase base 					= goodService.queryOneGoodBase(gid);

+ 6 - 0
shop/src/main/java/com/zskk/shop/service/ShopConfigService.java

@@ -40,6 +40,11 @@ public class ShopConfigService {
 	 */
 	public static final String KEY_CHECK_INFO = "check_info";
 	
+	/**
+	 * KEY 影像检查对应的标签
+	 */
+	public static final String KEY_PIC_CHECK_LABEL = "pic_check_labe";
+	
 	private Set<String> ALL_KEYS = new HashSet<>();
 	
 	@PostConstruct
@@ -47,6 +52,7 @@ public class ShopConfigService {
 		ALL_KEYS.add(KEY_EQUIPMENT_INFO);
 		ALL_KEYS.add(KEY_DOCTOR_INFO);
 		ALL_KEYS.add(KEY_CHECK_INFO);
+		ALL_KEYS.add(KEY_PIC_CHECK_LABEL);
 	}
 	
 	@Autowired

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

@@ -14,7 +14,7 @@
 	<div class="index-top">
     	<button class="l left"></button>
         <div class="txt">
-        	<form id="searchForm" action="/h5/index" method="post">
+        	<form id="searchForm" action="/h5/search" method="post">
         		<input id="search" name="search" type="search" placeholder="搜索商品" th:attr="value=${search}"/>
         	 </form>
         </div>
@@ -22,13 +22,13 @@
     <div class="bgDiv"></div>
     <div class="leftNav">
     	<h3>商品分类</h3>
-        <a href="/h5/index">全部</a>
-        <a th:each="label : ${labels}" th:attr="href='/h5/index?label=' + ${label.id}" th:text="${label.name}"></a>
+        <a href="/h5/search">全部</a>
+        <a th:each="label : ${labels}" th:attr="href='/h5/search?label=' + ${label.id}" th:text="${label.name}"></a>
     </div>
 	<!--轮播-->
 	<style>
 	.relative { position: relative; left: 0; top: 0;}
-    .scroll { margin: 46px auto 0; max-width: 750px; height:180px; }
+    .scroll { margin: 46px auto 0; max-width: 750px;  }
     .scroll_box { overflow: hidden; visibility: hidden; position: relative; }
     .scroll_wrap { overflow: hidden; position: relative; }
     .scroll_wrap li { position: relative; display: block; width: 100%; float: left; }
@@ -85,7 +85,7 @@
 	<!--入口-->
     <ul class="nav ml10 mr10">
     	<li><a href="/h5/index"><img src="style/index-tj-icon.png" /><p>体检套餐</p></a></li>
-        <li><a href="/h5/index"><img src="style/index-yx-icon.png" /><p>影像检查</p></a></li>
+        <li><a th:attr="href='/h5/search?label=' + ${picCheckLabel}"><img src="style/index-yx-icon.png" /><p>影像检查</p></a></li>
         <li><a href="/h5/buy/completedorders"><img src="style/index-bg-icon.png" /><p>报告查询</p></a></li>
         <li><a href="/h5/buy/mypayedorders"><img src="style/index-yy-icon.png" /><p>我的预约</p></a></li>
     </ul>

+ 10 - 0
shop/src/main/resource/templates/h5/my.html

@@ -33,5 +33,15 @@
         </ul>
         <!-- <a href="####" class="tcdl">退出登录</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="/h5/buy/completedorders" class="n-2">报告</a></td>
+            <td><a href="/h5/my/index" class="n-3">我的</a></td>
+        </tr>
+    </table>
 </body>
 </html>

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

@@ -49,6 +49,16 @@
 	        <p th:unless="${subTitle}">如已购买请稍后刷新重试</p>
 	 </div>
 	 
+	 <!--底部-->
+    <div style="height:60px;" th:if="${iscomplete}"></div>
+	<table class="n-tab" th:if="${iscomplete}">
+    	<tr>
+        	<td><a href="/h5/index" class="n-1-c">首页</a></td>
+            <td><a href="/h5/buy/completedorders" class="n-2">报告</a></td>
+            <td><a href="/h5/my/index" class="n-3">我的</a></td>
+        </tr>
+    </table>
+	 
 	 <script>
 	 	function delOrder(id){
 	 		if (confirm("是否要删除订单吗?")){

+ 57 - 0
shop/src/main/resource/templates/h5/search.html

@@ -0,0 +1,57 @@
+<!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="style/style.css" rel="stylesheet" />
+<script src="js/jquery-2.1.1.min.js"></script>
+<script src="js/nav.js"></script>
+</head>
+
+<body>
+	<!--顶部-->
+	<div class="index-top">
+    	<button class="l left"></button>
+        <div class="txt">
+        <form id="searchForm" action="/h5/search" method="post">
+        		<input id="search" name="search" type="search" placeholder="搜索商品" th:attr="value=${search}"/>
+        	 </form>
+        </div>
+    </div>
+    <div class="bgDiv"></div>
+    <div class="leftNav">
+    	<h3>商品分类</h3>
+        <a href="/h5/search">全部</a>
+        <a th:each="label : ${labels}" th:attr="href='/h5/search?label=' + ${label.id}" th:text="${label.name}"></a>
+    </div>
+
+    <div class="v-list" style="padding-top:50px; ">
+        <a th:each="bean : ${beans}" th:attr="href='/h5/detail/' + ${bean.gid}">
+            <div class="img l mr10"><img th:attr="src=${bean.icon}"/></div>
+            <dl>
+                <dt th:text="${bean.name}"></dt>
+                <dd th:text="${bean.describe}"></dd>
+                <span class="price-new l">
+                	<em>¥</em>
+                	<span th:text="${bean.price.discountPrice}"></span>
+                </span>
+            </dl>
+        </a>
+        
+        <div class="shopOrder_none" th:if="${beans.size() eq 0}">
+	    	<p>没有找到体检套餐</p>
+	 </div>
+    </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="/h5/buy/completedorders" class="n-2">报告</a></td>
+            <td><a href="/h5/my/index" class="n-3">我的</a></td>
+        </tr>
+    </table>
+</body>
+</html>

+ 5 - 1
shop/static/manager/src/components/page/EditLabel.vue

@@ -55,9 +55,13 @@ export default {
   },
   mounted: function() {
     var id = this.$route.query.id
+    this.form.id = id
+    if (id === 0){
+      return;
+    }
     this.$http.getLabel({ id: id }, this).then(res => {
       if (res.code === 0) {
-        this.form.id = id
+        
         this.form.name = res.obj.name
         this.form.status = res.obj.status === 1
       }

+ 28 - 22
shop/static/manager/src/components/page/SysLabelManager.vue

@@ -1,22 +1,25 @@
 <template>
-    <el-table :data="items">
-        <el-table-column label="标签名称" prop="name"></el-table-column>
-        <el-table-column label="标签状态">
-            <template slot-scope="scope">
-                <template v-if="scope.row.status === 1">
-                    <p class="online">启用</p>
+    <div>
+        <el-button type="primary" @click="goAdd">添加</el-button>
+        <el-table :data="items">
+            <el-table-column label="标签名称" prop="name"></el-table-column>
+            <el-table-column label="标签状态">
+                <template slot-scope="scope">
+                    <template v-if="scope.row.status === 1">
+                        <p class="online">启用</p>
+                    </template>
+                    <template v-else>
+                        <p class="offline">禁用</p>
+                    </template>
                 </template>
-                <template v-else>
-                    <p class="offline">禁用</p>
+            </el-table-column>
+            <el-table-column label="操作">
+                <template slot-scope="scope">
+                    <el-button type="text" size="small" @click="goEdit(scope.row)">编辑</el-button>
                 </template>
-            </template>
-        </el-table-column>
-        <el-table-column label="操作">
-            <template slot-scope="scope">
-                <el-button type="text" size="small" @click="goEdit(scope.row)">编辑</el-button>
-            </template>
-        </el-table-column>
-    </el-table>
+            </el-table-column>
+        </el-table>
+    </div>
 </template>
 <script>
 export default {
@@ -28,6 +31,9 @@ export default {
   methods: {
     goEdit: function(row) {
       this.$router.push({ path: '/editLabel', query: { id: row.id } })
+    },
+    goAdd: function() {
+      this.$router.push({ path: '/editLabel', query: { id: 0 } })
     }
   },
   mounted: function() {
@@ -41,11 +47,11 @@ export default {
 </script>
 
 <style>
-    .online {
-        color: #67c23a
-    }
-    .offline {
-        color: #f56c6c;
-    }
+.online {
+  color: #67c23a;
+}
+.offline {
+  color: #f56c6c;
+}
 </style>