Browse Source

添加渠道

wangxiaoming 6 years ago
parent
commit
de2801da34

+ 16 - 0
tooth-wechat-web/src/main/java/com/iamberry/wechat/handles/channel/AdminChannelHandler.java

@@ -236,4 +236,20 @@ public class AdminChannelHandler {
 			return msg;
 			return msg;
 		}
 		}
 	}
 	}
+
+
+	/**
+	 * 添加返利页面
+	 *
+	 * @return
+	 * @author LJK
+	 * @date 时间
+	 */
+	@RequestMapping("/toAddChannel")
+	public ModelAndView toAddChannel(HttpServletRequest request,Integer type) {
+		ModelAndView mv = new ModelAndView("/admin/adminChannel/addChannel");
+		mv.addObject("type",type);
+		return mv;
+	}
+
 }
 }

+ 20 - 15
tooth-wechat-web/src/main/java/com/iamberry/wechat/handles/porduct/ProductHandler.java

@@ -139,24 +139,29 @@ public class ProductHandler {
 		List<ProductType> list = productTypeService.getAll();
 		List<ProductType> list = productTypeService.getAll();
 		List<Object> toothInfoMap = new ArrayList<Object>();
 		List<Object> toothInfoMap = new ArrayList<Object>();
 		List<Object> toothInfoJson = new ArrayList<Object>();
 		List<Object> toothInfoJson = new ArrayList<Object>();
-		String json =  HttpUtility.httpsGet(ResultInfo.GET_TOOTH_INFO);
-		JSONObject toothJson = JSONObject.fromObject(json);
-		if(toothJson.get("resultCode").toString().equals("200")){
-			JSONObject message = JSONObject.fromObject(toothJson.get("message"));
-			if(message.size() > 0){
-				JSONArray produce = message.getJSONArray("produce");
-				for(int i=0;i<produce.size();i++){
-					JSONObject tooth = produce.getJSONObject(i);
-					Map<String,String> toothInfo = new HashMap<>();
 
 
-					toothInfo.put("produceId",tooth.get("produceId").toString());
-					toothInfo.put("produceName",tooth.get("produceName").toString());
-					JSONObject jsonObject = JSONObject.fromObject(toothInfo);
-					String result = jsonObject.toString();
-					toothInfoJson.add(result);
-					toothInfoMap.add(toothInfo);
+		try {
+			String json =  HttpUtility.httpsGet(ResultInfo.GET_TOOTH_INFO);
+			JSONObject toothJson = JSONObject.fromObject(json);
+			if(toothJson.get("resultCode").toString().equals("200")){
+				JSONObject message = JSONObject.fromObject(toothJson.get("message"));
+				if(message.size() > 0){
+					JSONArray produce = message.getJSONArray("produce");
+					for(int i=0;i<produce.size();i++){
+						JSONObject tooth = produce.getJSONObject(i);
+						Map<String,String> toothInfo = new HashMap<>();
+
+						toothInfo.put("produceId",tooth.get("produceId").toString());
+						toothInfo.put("produceName",tooth.get("produceName").toString());
+						JSONObject jsonObject = JSONObject.fromObject(toothInfo);
+						String result = jsonObject.toString();
+						toothInfoJson.add(result);
+						toothInfoMap.add(toothInfo);
+					}
 				}
 				}
 			}
 			}
+		}catch (Exception e){
+			e.printStackTrace();
 		}
 		}
 		mv.addObject("typeList", list);
 		mv.addObject("typeList", list);
 		mv.addObject("toothInfo", toothInfoMap);
 		mv.addObject("toothInfo", toothInfoMap);

+ 105 - 0
tooth-wechat-web/src/main/webapp/WEB-INF/views/admin/adminChannel/addChannel.jsp

@@ -0,0 +1,105 @@
+<%@ page language="java" contentType="text/html; charset=utf-8"
+	pageEncoding="utf-8"%>
+	<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+<!DOCTYPE HTML>
+<html>
+<head>
+<meta charset="utf-8">
+<meta name="renderer" content="webkit|ie-comp|ie-stand">
+<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
+<meta http-equiv="Cache-Control" content="no-siteapp" />
+<link href="${pageContext.request.contextPath }/common/admin/css/H-ui.min.css" rel="stylesheet" type="text/css" />
+<link href="${pageContext.request.contextPath }/common/admin/css/H-ui.login.css" rel="stylesheet" type="text/css" />
+<link href="${pageContext.request.contextPath }/common/admin/css/style.css" rel="stylesheet" type="text/css" />
+<link href="${pageContext.request.contextPath }/common/admin/lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
+<title>添加渠道</title>
+</head>
+<body>
+<div class="pd-20">
+	<form action="${pageContext.request.contextPath }/admin/" class="form form-horizontal" id="form-addGoods" method="POST" enctype="multipart/form-data">
+
+		<div class="row cl">
+			<label class="form-label col-2"><span class="c-red">*</span>渠道类型:</label>
+			<div class="formControls col-10 skin-minimal">
+				<div class="radio-box">
+					<input type="radio" id="sex-1" name="" <c:if test="type == 1"> checked="checked"</c:if> value="1" datatype="*" nullmsg="渠道类型!">
+					<label for="sex-1"  >主渠道</label>
+				</div>
+				<div class="radio-box">
+					<input type="radio" id="sex-2" name="" <c:if test="type == 2"> checked="checked"</c:if> value="2">
+					<label for="sex-2">子渠道</label>
+				</div>
+			</div>
+		</div>
+
+		<div class="row cl">
+			<label class="form-label col-2"><span class="c-red">*</span>渠道名称:</label>
+			<div class="formControls col-4">
+				<input id="mainChannelName" name="mainChannelName" type="text" class="input-text" value="" placeholder="" >
+			</div>
+		</div>
+		<div class="row cl">
+			<label class="form-label col-2"><span class="c-red">*</span>对接人:</label>
+			<div class="formControls col-4">
+				<input id="mainChannelDockingName" name="mainChannelDockingName" type="text" class="input-text" value="" placeholder="">
+			</div>
+		</div>
+		<div class="row cl">
+			<label class="form-label col-2"><span class="c-red">*</span>对接人手机:</label>
+			<div class="formControls col-4">
+				<input id="mainChannelDockingTel" name="mainChannelDockingTel" type="text" class="input-text" value="" placeholder="">
+			</div>
+		</div>
+		<div class="row cl">
+			<label class="form-label col-2"><span class="c-red">*</span>账户银行:</label>
+			<div class="formControls col-4">
+				<input id="mainChannelBank" name="mainChannelBank" type="text" class="input-text" value="" placeholder="">
+			</div>
+		</div>
+		<div class="row cl">
+			<label class="form-label col-2"><span class="c-red">*</span>账户银行账号:</label>
+			<div class="formControls col-4">
+				<input id="mainChannelBankAccount" name="mainChannelBankAccount" type="text" class="input-text" value="" placeholder="">
+			</div>
+		</div>
+		<div class="row cl">
+			<label class="form-label col-2"><span class="c-red">*</span>开户名称:</label>
+			<div class="formControls col-4">
+				<input id="mainChannelBankName" name="mainChannelBankName" type="text" class="input-text" value="" placeholder="">
+			</div>
+		</div>
+		<div class="row cl">
+			<label class="form-label col-2"><span class="c-red">*</span>开户支行:</label>
+			<div class="formControls col-4">
+				<input id="mainChannelBankBranch" name="mainChannelBankBranch" type="text" class="input-text" value="" placeholder="">
+			</div>
+		</div>
+
+		<div class="row cl">
+			<label id="" class="form-label col-2">备注:</label>
+			<div id="" class="formControls col-4">
+				<textarea id="mainChannelDesc" name="mainChannelDesc" class="textarea-text" placeholder="" style="width:200px;height:60px;"></textarea>
+			</div>
+		</div>
+
+		</form>
+</div>
+<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/jquery/1.9.1/jquery.min.js"></script>
+<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/layer/1.9.3/layer.js"></script>
+<%--
+<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/H-ui.js"></script>
+<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/H-ui.admin.js"></script>
+<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/tips.js"></script> 
+<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/ueditor.all.min.js"></script> 
+<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/ueditor.config.js"></script>
+<script type="text/javascript" src="${pageContext.request.contextPath }/common/js/utils/tools.js"></script>
+<script type="text/javascript" src="${pageContext.request.contextPath }/common/js/utils/jquery-1.9.1.min.js"></script>
+--%>
+
+
+
+
+</body>
+</html>

+ 6 - 0
tooth-wechat-web/src/main/webapp/WEB-INF/views/admin/adminChannel/main_channel_list.jsp

@@ -45,6 +45,9 @@
 
 
     </form>
     </form>
     <form id="goodsform" >
     <form id="goodsform" >
+        <%--<div class="cl pd-5 bg-1 bk-gray mt-20">
+			<span class="l"><a href="javascript:;" onclick="toAddChannel('1')" class="btn btn-danger radius">添加主渠道</a>&nbsp;</span>
+        </div>--%>
         <table class="table table-border table-bordered table-bg">
         <table class="table table-border table-bordered table-bg">
             <thead>
             <thead>
             <tr>
             <tr>
@@ -125,6 +128,9 @@
     function toRebateList(id) {
     function toRebateList(id) {
         window.location.href = '${pageContext.request.contextPath }/admin/channel/listChannelRebate?rebackChannelType=1&rebackChannelId='+id;
         window.location.href = '${pageContext.request.contextPath }/admin/channel/listChannelRebate?rebackChannelType=1&rebackChannelId='+id;
     }
     }
+    function toAddChannel(type) {
+        window.location.href = '${pageContext.request.contextPath }/admin/channel/toAddChannel?type='+type;
+    }
     // 关闭窗口
     // 关闭窗口
     function exitWindowsDiv(_this) {
     function exitWindowsDiv(_this) {
         $(_this).parent().parent().hide();
         $(_this).parent().parent().hide();