瀏覽代碼

添加 修改 删除服务

wangshan 9 年之前
父節點
當前提交
a0b7d1b318

+ 1 - 1
core/src/qfw/manage/auditing.go

@@ -498,7 +498,7 @@ func (s *SystemManage) Updateaudit() error {
 				Update("user", "{'_id':'"+s_submitid+"'}", `{"$set":{"i_identificationway":1,"s_audit_record_id":"`+_id+`"}}`, true, false)
 				s_result = util.GetPropertie("ptcindentify.false.result", coreconfig.MessageConfig).(string)
 				s_remark = util.GetPropertie("ptcindentify.false.remark", coreconfig.MessageConfig).(string)
-			} else if i_identificationtype == "1" && s_comauthenttype == "2" {
+			} else if i_identificationtype == "1" && s_comauthenttype == "2" { //企业追加营业执照
 				data["i_comauthenttype"] = 2
 				//更新用户表,
 				Update("user", "{'_id':'"+s_submitid+"'}", `{"$set":{"i_identificationway":1,"s_audit_record_id":"`+_id+`"}}`, true, false)

+ 36 - 23
core/src/qfw/member/service.go

@@ -46,6 +46,7 @@ func (yp *Service) Save() error {
 	enterpriseid := yp.GetSession("entid").(string)
 	enterprisename := yp.GetSession("entname").(string)
 	//行政区划
+	serentid := yp.GetString("enterpriseid")
 	opLocD := yp.GetSession("opLocDistrict")
 	identType := yp.GetSession("identType")
 	comauthenttype := yp.GetSession("comauthenttype")
@@ -125,27 +126,23 @@ func (yp *Service) Save() error {
 	doc["i_status"] = 0
 	var tempFlag = false
 	//当服务ID不为空的时候执行编辑方法
-	if len(serviceid) > 0 {
+	if len(serviceid) > 0 && serentid == yp.GetSession("entid") {
 		docSet := map[string]interface{}{
 			"$set": doc,
 		}
 		//更新服务
 		//判断是否能删除
-
 		b, _ := CheckAuth(K{"_id": serviceid})
 		if b == false {
 			return nil
 		}
-
-		flag := mongodb.Update("service", "{'_id':'"+serviceid+"'}", &docSet, false, false)
+		tempFlag = mongodb.Update("service", "{'_id':'"+serviceid+"'}", &docSet, false, false)
 		//更新企业表,服务表
-		if flag {
+		if tempFlag {
 			//将数据存到elastic中
-			doc["_id"] = serviceid
-			tempFlag = true
+			doc = *mongodb.FindById("service", serviceid, nil)
 			//更新服务表到elastic
-			elastic.UpdateNewDoc("service", "service", mongodb.FindById("service", serviceid, nil))
-
+			elastic.UpdateNewDoc("service", "service", doc)
 		}
 
 	} else {
@@ -410,26 +407,42 @@ func (yp *Service) Edit(id string) error {
 	if yp.GetSession("identWay") != 1 {
 		return yp.Redirect("/member/accountset/index")
 	}
-	yp.T["serviceName"] = "编辑产品服务信息"
-	yp.T["serviceClassify"] = coreconfig.ServiceClassify
-
-	opLocD := yp.GetSession("opLocDistrict")
-	yp.T["opLocDistrict"] = opLocD
-
 	res := mongodb.FindById("service", id, `{"id":0}`)
-	//res["f_price"] = fmt.Sprintf("%.2f", res["f_price"])
 	yp.T["service"] = &res
 	tmp := (*res)
 	serentid := tmp["s_enterpriseid"].(string)
-	//格式化价格
-	if tmp["f_price"] == nil {
-		yp.T["price"] = 0
+	screateid := tmp["s_createuserid"].(string)
+	if screateid == yp.GetSession("userId") && serentid == yp.GetSession("entid") {
+
+		yp.T["serviceName"] = "编辑产品服务信息"
+		yp.T["serviceClassify"] = coreconfig.ServiceClassify
+		yp.T["pricemy"] = ""
+		opLocD := yp.GetSession("opLocDistrict")
+		yp.T["opLocDistrict"] = opLocD
+
+		//res["f_price"] = fmt.Sprintf("%.2f", res["f_price"])
+		//格式化价格
+		if tmp["s_pricemy"] != "1" {
+			if tmp["f_price"] == nil {
+				yp.T["price"] = 0
+			} else {
+				price := fmt.Sprintf("%.2f", tmp["f_price"])
+				yp.T["price"] = price
+			}
+		} else {
+			yp.T["pricemy"] = tmp["s_pricemy"]
+		}
+		yp.T["pservicecode"] = tmp["s_pservicecode"]
+		yp.T["servicecode"] = tmp["s_servicecode"]
+		yp.T["introduction"] = tmp["s_introduction"]
+		yp.T["editflog"] = "Y"
+		yp.T["images"] = tmp["s_images"]
+		yp.T["entid"] = serentid
+		yp.T["serviceid"] = id
+
 	} else {
-		price := fmt.Sprintf("%.2f", tmp["f_price"])
-		yp.T["price"] = price
+		return yp.Redirect("/member/service/add")
 	}
-
-	yp.T["entid"] = serentid
 	//根据服务ID获取服务信息
 	return yp.Render("/member/editservice.html", &yp.T)
 }

+ 45 - 2
core/src/qfw/searchmarket/service.go

@@ -16,6 +16,7 @@ import (
 	mongo "qfw/util/mongodb"
 	mutil "qfw/util/mongodbutil"
 	//	"qfw/util/redis"
+	"qfw/util/elastic"
 	"strings"
 	"time"
 )
@@ -34,6 +35,40 @@ type Service struct {
 	commentinfo xweb.Mapper `xweb:"POST /market/commentinfo"`
 	//回复
 	reply xweb.Mapper `xweb:"/market/service/reply"`
+	//服务列表
+	slist xweb.Mapper `xweb:"/market/service/list"`
+}
+
+//服务列表
+func (s *Service) Slist() error {
+	id := s.GetString("id")
+	if s.Is("GET") {
+		return s.Render("/market/detail/" + id + ".html")
+	} else {
+		limit, _ := s.GetInteger("pageSize")
+		currentPage, _ := s.GetInteger("currentPage")
+		start := (currentPage - 1) * limit
+		var count int
+		var r []map[string]interface{}
+		searchtype := "service"
+		str := `{"prefix":{"s_enterpriseid":"` + id + `"}}`
+		var tempQuery = ""
+		tempQuery = `{"query": {
+	    "bool": {
+		  "must":[` + str + `],
+	      "minimum_should_match": 1
+	    }
+	  }}`
+		sort := `{"l_createdate":"desc"}`
+		if currentPage == 1 {
+			count = int(elastic.Count(searchtype, searchtype, tempQuery))
+		}
+		//
+		query := `{"query":{"term":{"s_enterpriseid":"` + id + `"}},"from":` + fmt.Sprintf("%v", start) + `,"size":` + fmt.Sprintf("%v", limit) + `,"sort":[` + sort + `]}`
+		r = *elastic.Get(searchtype, searchtype, query)
+		s.ServeJson(M{"list": r, "count": count})
+		return nil
+	}
 }
 
 //服务展示
@@ -41,6 +76,7 @@ func (s *Service) ServiceInfo(params string) error {
 	paramsa := strings.Split(params, "_")
 	isComment := 0
 	s.T["isal"] = 0
+	s.T["candoit"] = ""
 	//1个则是普通查看
 	if len(paramsa) > 0 {
 		id := paramsa[0]
@@ -66,6 +102,11 @@ func (s *Service) ServiceInfo(params string) error {
 			if len(servicecode) > 2 {
 				serviceTypeName = serviceTypeName + coreconfig.GetServiceName(servicecode)
 			}
+			serentid := sinfo["s_enterpriseid"].(string)
+			screateid := sinfo["s_createuserid"].(string)
+			if screateid == s.GetSession("userId") && serentid == s.GetSession("entid") {
+				s.T["candoit"] = "Y"
+			}
 			sinfo["servicetypename"] = serviceTypeName
 			if sinfo["s_enterpriseid"] != nil {
 				_id := sinfo["s_enterpriseid"].(string)
@@ -87,7 +128,6 @@ func (s *Service) ServiceInfo(params string) error {
 				einfo1 := *mutil.FindOne("enterprise", coreconfig.SysConfig.EntMongodbAlias, coreconfig.SysConfig.EntMongodbName, `{"_id":"`+_id+`"}`)
 				for k, v := range einfo1 {
 					einfo[k] = v
-					log.Println("sdfsdf")
 				}
 				//取自身评价
 				if s.T["status"] != nil && s.T["status"].(string) == "appendcomment" && s.GetSession("userId") != nil {
@@ -164,7 +204,10 @@ func (s *Service) ServiceInfo(params string) error {
 				} else {
 					s.T["style"] = "0"
 				}
-				einfo["_id"] = strings.Split(fmt.Sprintf("%s", einfo["_id"]), `"`)[1]
+				fmt.Println("einfoid:", einfo["_id"])
+				if einfo["_id"] != "" && einfo["_id"] != nil {
+					einfo["_id"] = strings.Split(fmt.Sprintf("%s", einfo["_id"]), `"`)[1]
+				}
 				s.T["einfo"] = einfo //企业信息
 
 				return s.Render("/service/detail.html")

+ 1 - 1
core/src/timetask.json

@@ -1 +1 @@
-{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-04-20 16:56:26"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-04-20 16:56:26"}},"marketisstart":true,"marketrate":300}
+{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-05-13 14:43:31"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-05-13 14:43:31"}},"marketisstart":true,"marketrate":300}

+ 2 - 2
core/src/web/staticres/css/enterprise.css

@@ -2,7 +2,7 @@
 .qfw-row { margin-left: 0px; margin-right: 0px;}
 #titleactionimgs  img{margin-left:15px;width:18px;height:18px;}
 #titleactionimgs  h3{font-weight: normal;}
-.qfw-p-margintop{margin-top:5px;background-color: #fff;}
+.qfw-p-margintop{margin-top:10px;background-color: #fff;}
 .qfw-row-marginbottom{margin-bottom:10px;}
 span.highlight {
     text-decoration: inherit;
@@ -84,7 +84,7 @@ span.highlight {
 }
 #entinfobg {
 	height:auto;
-	background: url("/images/qmx_ent_bgimg.png") ;
+/*	background: url("/images/qmx_ent_bgimg.png") ;*/
 	filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale')";  
 -moz-background-size:100% 100%;  
     background-size:100% 100%; 

+ 1 - 1
core/src/web/templates/common/indexhead.html

@@ -106,7 +106,7 @@ $(function (){
 	//
 	$("[id='releaseService']").click(function(){
 		if(isLogined){
-			window.location.href = "/front/reurl";
+			window.location.href = "/member/service/add";
 		}else{
 			loginModalShow("/front/reurl");
 		}

+ 1 - 1
core/src/web/templates/common/memberleft.html

@@ -361,7 +361,7 @@ var MemberLeftMenu = {
 	serverMenu: function(){
 		var href = null;
 		if(isCanEditEnt){
-			href = "";
+			href = "/member/service/add";
 		}else{//不可编辑黄页跳转到企业认证页面
 			href = this.authentHref;
 		}

+ 212 - 103
core/src/web/templates/member/editservice.html

@@ -12,49 +12,65 @@
 <script charset="utf-8" src="{{Msg "seo" "cdn"}}/js/kindeditor/kindeditor-all.js"></script>
 <script charset="utf-8" src="{{Msg "seo" "cdn"}}/js/kindeditor/kinditem.js"></script>
 <script src="{{Msg "seo" "cdn"}}/js/validform-min.js"></script>
+<link href="{{Msg "seo" "cdn"}}/css/index-new.css" rel="stylesheet">
+<style>
+	body{
+		background-color:#F0F0F0;
+	}
+	.a-com-active {
+    background-color: rgb(255, 90, 95) !important;
+	}
+	.a-c-right{
+		margin-top:10px;
+	}
+	.a-c-left{
+		width:940px !important;
+		height: 1048px;
+	}
+	.u-title{
+		display: block;
+		height: 45px;
+		font-weight: 700;
+		font-size: 18px;
+		background: rgb(246, 248, 250);
+		width:938px;
+	}
+	.u-title div {
+	    border-top: 3px solid rgb(255, 90, 95);
+	    width: 120px;
+	    height: 45px;
+	    line-height: 42px;
+	    margin-left: 40px;
+	    text-align: center;
+	    background: rgb(255, 255, 255);
+	    font-size: 13px;
+	}
+	#tips{
+		top:88px !important;
+		left:1px !important;
+	}
+	.tpsc_btnsize{
+		width: 83px !important;
+		top: -25px;
+		padding-top: 2px;
+		background-color: #ccc;
+		border-color: #fff;
+		border-radius: 0px;
+		height: 25px;
+	}
+	.tipAssembly{
+		width: 230px;
+	    background-color: #fff !important;
+	    border: 1px solid #ccc;
+	}
+</style>
 </head>
 <body>
-{{include "/common/centerhead.html"}}
+{{include "/common/indexhead.html"}}
 <div id="entinfobg">	
 	<div class="a-content">
 		<!--标题-->
-		<div id="titleactionimgs" class="row qfw-row">
-			<div>
-			<h3>
-			{{if .T.entinfo.EntName }}
-				{{.T.entinfo.EntName}}
-			{{end}}
-			</h3>
-			<!--企业认证图标--> 
-			{{if .T.entinfo.EntName }}
-				{{if .T.entinfo.s_action}}
-					{{$identaction:=.T.entinfo.s_action}}		
-					{{if eq $identaction "01"}}
-						<span class="glyphicon qyrz   margin-l-10 jhtb"></span> <span style="color:#fff;">已认证企业 </span> 
-						{{ if .T.entinfo.i_comauthenttype }}
-								{{ if eq .T.entinfo.i_comauthenttype 2}}
-									<span class="glyphicon mprz   margin-r-10 jhtbtype"></span><span class="lineb " ><small style="color:#fff;margin-right:5px;">名片认证</small></span>					
-								{{else if eq .T.entinfo.i_comauthenttype 1}}
-									<span class="glyphicon yyzzrz   margin-r-10 jhtbtype"></span><span class="lineb " ><small style="color:#fff;margin-left:3px;margin-right:5px;">营业执照认证</small></span>
-								{{else if eq .T.entinfo.i_comauthenttype 3}}
-									<span class="glyphicon yjrz   margin-r-10 jhtbtype"></span><span class="lineb " ><small style="color:#fff;margin-right:5px;">年报邮箱认证</small></span>
-								{{end}}
-						{{else}}
-								<span class="glyphicon yyzzrz   margin-r-10 jhtbtype"></span><span class="lineb " ><small style="color:#fff;margin-left:3px;margin-right:5px;">营业执照认证</small></span>
-						{{end}}
-					{{else if eq $identaction "02"}}
-						<span class="glyphicon grrz   margin-l-10 jhtb"></span> <span style="color:#fff;">已认证个人</span> 
-					{{else if eq $identaction "03"}}
-						<span class="glyphicon jgrz   margin-l-10 jhtb"></span> <span style="color:#fff;">已认证机构</span> 
-					{{else}}
-						<img src="{{Msg "seo" "cdn"}}/images/ent_authe.png" /> <span style="color:#fff;">企业认证</span>
-					{{end}}
-				{{end}}
-			{{end}}
-			</div>
-		</div>
-		
-		
+	<div class="a-c-left">
 		<!--产品服务-->	
 		<div class="row qfw-row qfw-p-margintop">
 			<div class="col-lg-12 border" id="addModal">
@@ -63,19 +79,24 @@
 				<div id="serviceForm">
 					<form class="validForm form-horizontal addform" method="POST" id="serdialogform" name="addservice">
 					<input name="username" type="hidden" value='{{session "userName"}}'/>
-					<input class="sentid" name="enterpriseid" type="hidden" value="{{.T.entinfo._id}}">
-					<input class="sid" name="serviceid" type="hidden" value="{{.T.service._id}}" >
+					<input class="sentid" name="enterpriseid" type="hidden" value="{{.T.entid}}">
+					<input class="sid" name="serviceid" type="hidden" value="{{.T.serviceid}}" >
+					<div class="u-title text-primary">
+						<div style="float:left;font-size:16px;">发布服务</div>
+					</div>
+						
 					<div class="qfw-entinfo-padding41" id="service">
-						<h4><span class="glyphicon fuwu icon_gray icon_large"></span>
+						<!--<h4><span class="glyphicon fuwu icon_gray icon_large"></span>
 						<b>产品服务</b>
 						</h4>
-						<hr>
+						<hr>-->
 						<!--企业名片详细信息-->
 						
 						<div class="tablediv"> 
 							<div class="rowcontent">  
-								<div class="two">产品服务名称:</div> 
-								<div class="three"><input style="height:40px;" type="text" class="form-control sn"  name="servicename" id="servicename" value="{{.T.service.s_name}}"  datatype="*" maxlength="30" nullmsg="请输入产品服务名称" errormsg="请输入产品服务名称"/></div> 
+								<div class="two">服务名称:</div> 
+								<div class="three">
+								<input style="height:40px;" type="text" class="form-control sn"  name="servicename" id="servicename" value="{{.T.service.s_name}}"  datatype="*" maxlength="30" nullmsg="请输入产品服务名称" errormsg="请输入产品服务名称"/></div> 
 						        <div class="four" > <span class="Validform_checktip">请输入产品服务名称</span></div>
 							</div> 
 						</div>
@@ -83,9 +104,9 @@
 							<div class="rowcontent"> 
 								<div class="two"></div> 
 								<div class="three">
-									<input type="checkbox" id="isshow_checked1" name="isshow" value="1" checked=true>是否在微官网显示
+									<input type="checkbox" id="isshow_checked1" name="isshow" value="1" checked=true>是否在微官网显示&nbsp;&nbsp;&nbsp;
 									<input type="checkbox" class="isshow_checked" name="isshow" value="2" checked=true>是否在微官网首位显示 <br>
-									<input type="checkbox" id="isshow_checked3" name="isshow" value="3" checked=true>是否发布到服务交易市场
+									<input style="display:none;" type="checkbox" id="isshow_checked3" name="isshow" value="3" checked=true><!--是否发布到服务交易市场-->
 								</div> 
 							</div> 
 						</div>						
@@ -106,48 +127,23 @@
 						
 						<div class="tablediv" id="serviecetype"> 
 							<div class="rowcontent"> 
-								<div class="two">产品服务类型:</div> 
+								<div class="two">服务类型:</div> 
 								<div class="three">
-									<select style="width:20%" class="cxselect select-control firstservicetype" id="firstservicetype" name="s_firstservicetype">
+									<select style="width:25%" class="cxselect select-control firstservicetype" id="firstservicetype" name="s_firstservicetype">
 									   <option value="00" selected="selected">一级类目</option>                      
+										{{$pservicecode := .T.pservicecode}}
 										{{range $k, $v := .T.serviceClassify}}
-											<option value="{{$v.code}}">{{$v.name}}</option>
+											<option value="{{$v.code}}" {{if $pservicecode }}{{if eq $v.code $pservicecode }} selected="selected"{{end}}{{end}}>{{$v.name}}</option>
 										{{end}}
 									</select>
 									<select style="width:19%" class="cxselect select-control secondservicetype" id="secondservicetype" name="s_secondservicetype">
 									  <option value="11" >二级栏目</option>
-									<script>
-										$(function(){
-											$("#firstservicetype").change(function(){
-												//当一级栏目发生改时移除二级栏目下的所有内容
-												$("#secondservicetype option").remove();
-												//为二级栏目加载内容
-												var $code = $("#firstservicetype").val();
-												if($code == "00"){
-													$(this).nextAll(".Validform_checktip").addClass("Validform_wrong").show();
-												}else{
-													$(this).nextAll(".Validform_checktip").removeClass("Validform_wrong").hide();
-												}
-												{{range $k, $v := .T.serviceClassify}}
-													var tempcodes = {{$v.code}};
-													if($code == tempcodes){
-														{{range $k, $v := $v.children}}
-															{{range $k, $v := $v.children}}
-																var $valuet = {{$v.code}};
-																var $textt = {{$v.name}};
-																$("#secondservicetype").append("<option value='"+$valuet+"'>"+$textt+"</option>");
-															{{end}}
-													    {{end}}	
-													}
-													
-												{{end}}
-											});
-											
-										});
-									</script>
-									</select>
+									
+									</select> <br>
+									<div style="padding:10px 0px 5px 0px;">
 									<span class="text-primary">现在服务分类里,没有我要选择的类型,</span><a id="goToFeedback" style="color:blue;text-decoration:underline;" >去提建议</a>
 									<span class="Validform_checktip">请选择服务分类</span>
+									</div>
 									<script>
 										$(function(){
 											$("#goToFeedback").click(function(){
@@ -164,25 +160,25 @@
 							<div class="rowcontent"> 
 								<div class="two">价格:</div> 
 								<div class="three">
-									<input type="text" class="form-control price" id="s_price" name="s_price" onblur="checkprice(this);" value="{{.T.price}}"  maxlength="6" />元
+									<input type="text" class="form-control price" id="s_price" name="s_price"  onblur="checkprice(this);" value="{{.T.price}}"  maxlength="6" />元
 									<!--面议-->
-									<input type="checkbox" id="s_pricemy" name="s_pricemy" value="1" >面议
+									<input type="checkbox" id="s_pricemy" name="s_pricemy" value="1" {{if .T.pricemy}}{{if eq .T.pricemy "1"}}checked{{end}}{{end}} >面议
 								</div> 
 							</div> 
 						</div>	
 						
-						<div class="tablediv"> 
+						<!--<div class="tablediv"> 
 							<div class="rowcontent"> 
 								<div class="two">手机号:</div> 
 								<div class="three"><input type="text" class="form-control phone"  name="s_phone" id="s_phone" value="{{.T.service.s_phone}}"  maxlength="11"  datatype="m" nullmsg="请输入手机号码" errormsg="手机号码格式错误" /></div> 
 								<div class="four" > <span class="Validform_checktip">请输入手机号码</span></div>
 							</div> 
-						</div>					
-						<div class="tablediv"> 
+						</div>-->					
+						<div class="tablediv" style="margin-top:20px;"> 
 							<div class="rowcontent">  
-								<div class="two" style="vertical-align: top;">描述:</div> 
+								<div class="two" style="vertical-align: top;">服务描述:</div> 
 								<div class="three">
-									<textarea  class="introduction gray sd" id="s_introduvtion" name="s_introduvtion">{{.T.service.data.s_introduvtion}}</textarea>
+									<textarea  class="introduction gray sd" id="s_introduvtion" name="s_introduvtion">{{.T.introduction}}</textarea>
 									<script>
 										$(function(){
 											var kindEditInit=function(){
@@ -213,13 +209,15 @@
 						<div id="picimages" class="tablediv"> 
 							<div class="rowcontent"> 
 								<div class="two" style="vertical-align: top;">示例图片:</div> 
-								<div class="three" style="width:220px;">
+								<div class="three">
 									<ul  class="pic" style="width: 100%;">
-									 <li class="imgLi" style="background-color:#eee;width:200px;text-align: center; height:200px;border:1px dashed #000;"><img src="{{Msg "seo" "cdn"}}/images/services/default.png" style="width:176px; height:176px;margin:0px 5px;"><div id="tips" style="text-align: center; width: 196px; position: absolute; cursor: pointer; border: 1px solid rgb(221, 221, 221); padding: 8px; color: rgb(255, 255, 255); font-size: 20px; left: 154px; top: 948px; background-color: rgb(128, 128, 128);">图片上传</div></li>
+									 <li style="font-size:14px; color:#999;margin-bottom:10px;">上传1张大小不超过10M的图片,支持jpg、png、bmp格式。建议尺寸250*230像素</li>
+									 <li class="imgLi" style="background-color:#eee;width:85px;text-align: center; height:81px;border:1px dashed #000;"><img src='{{if .T.images}}{{.T.images}}{{else}}{{Msg "seo" "cdn"}}/images/services/default.png{{end}}' style="width:83px; height:79px;"><div id="tips" ></div></li>
 									</ul>
-									 <input type="hidden" value="{{Msg "seo" "cdn"}}/images/services/default.png"  class="imgs" name="imgurl"/> 
+									 <input type="hidden" value="{{if .T.images}}{{.T.images}}{{else}}{{Msg "seo" "cdn"}}/images/services/default.png{{end}}"  class="imgs" name="imgurl"/> 
 								</div>
-								<div class="foure" id="imgmessage">建议尺寸200*200像素,不支持GIF格式</div>
+								<div class="foure" style="visibility:hidden;" id="imgmessage">
+								建议尺寸200*200像素,不支持GIF格式</div>
 							</div> 
 						</div>	
 						<div id="imgshide" class="tablediv" style="display:none;"> 
@@ -233,16 +231,17 @@
 								</div>  
 							</div> 
 						</div>
-						<hr>
 						<!--点击取消按钮使用的条件-->
 						<input id="entid" type="hidden" value="{{.T.entid}}" />
 						<div class="row" style="margin-bottom:10px;">
-							<div class=" text-right" style="padding-right:20px;">
+							<div style="padding-left:128px;">
 							  <a onclick="cancelService();" class="btn btn-default ">取消</a>
-							  <button onclick="btnAddServices()" class="btn btn-primary ">完成</button>
+							  <button onclick="btnAddServices()" class="btn btn-primary ">提交</button>
 							</div>
 						</div>
 					
+						<hr>
+						
 					</div>
 					</form>
 				</div>
@@ -251,8 +250,10 @@
 				</div>
 			</div>
 		</div>	
-		
-		
+	</div>
+	<div class="a-c-right">
+	{{include "/common/hotservice.html"}}
+	</div>
 	</div>
 </div>
 
@@ -263,6 +264,46 @@
 
 </body>
 <script>
+var editflog = {{.T.editflog}}
+if (editflog&&editflog == "Y"){
+	afterChange();
+}
+$("#firstservicetype").change(function(){
+	afterChange();					
+});
+function afterChange(){
+	//当一级栏目发生改时移除二级栏目下的所有内容
+												$("#secondservicetype option").remove();
+												//为二级栏目加载内容
+												{{$servicecode := .T.servicecode}}
+												var $code = $("#firstservicetype").val();
+												if($code == "00"){
+													$(this).nextAll(".Validform_checktip").addClass("Validform_wrong").show();
+												}else{
+													$(this).nextAll(".Validform_checktip").removeClass("Validform_wrong").hide();
+												}
+												{{range $k, $v := .T.serviceClassify}}
+													var tempcodes = {{$v.code}};
+													if($code == tempcodes){
+														{{range $k, $v := $v.children}}
+															{{range $k, $v := $v.children}}
+																var $valuet = {{$v.code}};
+																var $textt = {{$v.name}};
+																$("#secondservicetype").append("<option value='"+$valuet+"' {{if $servicecode }}{{if eq $v.code $servicecode }} selected='selected'{{end}}{{end}}>"+$textt+"</option>");
+															{{end}}
+													    {{end}}	
+													}
+													
+												{{end}}
+}
+											
+$("#s_pricemy").click(function(){
+	if (document.getElementById("s_pricemy").checked){
+		document.getElementById("s_price").disabled = true;
+	}else{
+		document.getElementById("s_price").disabled = false;
+	}
+})
             	//
 			$("#servicename").blur(function(){
 				var str = $("#servicename").val();
@@ -291,10 +332,10 @@
 
 //添加服务
 function btnAddServices(){	
-    var t = new Date().getTime();
+    //var t = new Date().getTime();
     //表单验证
 	var validForm = bindValidForm({
-		url: "/member/service/add?_new="+t,
+		url: "/member/service/save",
 		ajaxPost:true,
 		beforeSubmit:function(curform){
 			
@@ -314,16 +355,18 @@ function btnAddServices(){
 		},
 		callback:function(data){
    		if(data.status=="y"){
-			alert(data.info);
-			cancelService();
+			//alert(data.info);
+			TipAssembly.show("<img src='/images/u28.png' style='width:30px; height:30px;margin-right: 10px;margin-left: -20px;'> <span style='font-size: 16px;color: #999;'>发布成功</span>")
+			//cancelService();
 		}else{
-			alert("保存服务信息失败");
+			TipAssembly.show("<img src='/images/cancel-circle.png' style='width:30px; height:30px;margin-right: 10px;margin-left: -20px;'> <span style='font-size: 16px;color: #999;'>发布失败</span>")
+			//alert("保存服务信息失败");
 		}
 		}
 	});
 	
 	
-	initServiceList()
+	//initServiceList()
 }
 //
 var province=city=area=0;
@@ -357,10 +400,76 @@ function initSecondServiceType(firstsertype){
 		}
 	{{end}}
 }
+$("#tips").upload(
+		option={
+		btnname:"图片上传",//按钮名
+		btnClass:"btn btn-primary tpsc_btnsize",
+		btnCss:{"width":"80px","height":"26px;"},
+	    name:"upload",
+		action:"/filemanage/upload?resize=250",
+		afterUpload:function(data){ //此处可以重写,上传后的处理	
+			
+			$("#mblocation .pic").css('display','block'); 
+			$("#mblocation .pic .imgLi").remove();
+			$("<li class='imgLi' style='background-color:#eee;width:85px;text-align: center; height:81px;border:1px dashed #000;'><img src='"+data.url+"' style='width:83px; height:79x;'><div id=tips style='text-align:center;width:83px;position: absolute;cursor: pointer; border:1px solid #ddd;background-color:#808080;color:#fff;font-size:14px;'>图片上传</div></li>").appendTo("#mblocation ul.pic");
+			var urls=$("#mblocation input.imgs").val();
+			urls=urls||""
+			//urls +=data.url+",";
+			urls= data.url;
+			$("#mblocation input.imgs").attr("value",urls);
+			if($("#mblocation ul.pic li img").size()>=1){
+				$("#upload").attr("disabled",false)
+			}
+		}
+	}
+);
+//图片上传
+
+//提示框
+var TipAssembly = {
+	timeout: null,
+	show: function(text,css){
+		if(this.timeout != null){
+			clearTimeout(this.timeout);
+			this.hide();
+			this.timeout = null;
+		}
+		var thisClass = this;
+		this.timeout = setTimeout(function(){
+			thisClass.hide();
+			thisClass.timeout = null;
+			if (serviceid !=""){
+				window.location.href="/market/detail/"+serviceid+".html";
+			}else{
+				window.location.href="/market/0/list.html";
+			}
+		},2000);
+		$("body").append('<div class="tipAssembly" id="tipAssembly">'+text+'</div>');
+		if(typeof(css) != "undefined"){
+			$("#tipAssembly").css(css);
+		}
+		$("#tipAssembly").css({"margin-top":-($("#tipAssembly").height()/2),"margin-left":-($("#tipAssembly").width()/2)});
+	},
+	hide: function(){
+		$("#tipAssembly").remove();
+	},
+	triangleShow: function(obj,direction,width,top,left){
+		$("#maskLayer").unbind("click").click(function(e){
+			$(this).hide();
+			$("#tipTriangle").hide();
+		});
+		$("#tipTriangle>span").addClass("triangle-"+direction);
+		$("#tipTriangle").css({width:width,top: obj.offset().top+top,left: obj.offset().left+left}).show();
+		$("#maskLayer,#tipTriangle").show();
+	},
+	triangleHide: function(){
+		$("#maskLayer,#tipTriangle").hide();
+	}
+}
 </script>
-<script src="/js/enterprise.js"></script>
+
 <script>
-   window.onload=function(){limouseover();}
+   //window.onload=function(){limouseover();}
 	if ($("#isshow_checked3").is(":checked")) {  
 		$("#serviecetype").removeClass("hidden");
 	}else{

+ 128 - 2
core/src/web/templates/service/detail.html

@@ -29,6 +29,7 @@
 	.a-servicedetail .btnactive{
 		border-top:3px solid #FF5A5F;
 		line-height: 30px !important;
+		font-weight:600;
 	}
 	.m-linkman span.glyphicon{
 		font-size:18px;
@@ -81,7 +82,64 @@
     z-index:1003; 
     overflow: auto; 	
 }
-
+.d_fuwu{
+	width:100% !important;
+}
+#sl_img{
+	float:left;width:15%;
+}
+#sl_img img{
+	width:100px;height:92px;
+}
+#sl_cont{
+	float:left;width:84%;
+}
+#sl_bt{
+	float:left;width:40%;font-size:16px;height:42px;line-height:20px;padding-top: 5px;
+}
+#sl_bj{
+	float:left;width:20%;font-size:15px;
+}
+#sl_bj span,#sl_fy span{
+	font-weight: 600;
+	color:#FF5A5F;
+	font-size:16px;
+}
+#sl_fy{
+	float:right;width:28%;
+}
+#sl_intro{
+	height:38px;overflow: hidden;text-overflow: ellipsis;margin-top: 10px;
+}
+#sl_intro p{
+	font-family: tahoma, arial, 'Hiragino Sans GB', 'Microsoft YaHei', 宋体, sans-serif  !important;
+	line-height:20px !important;
+	color:#999 !important; 
+}
+#sl_intro span{
+	font-family: tahoma, arial, 'Hiragino Sans GB', 'Microsoft YaHei', 宋体, sans-serif  !important;
+	line-height:20px !important;
+	color:#999 !important; 
+}
+.sl_border{
+	height:120px; border-bottom:1px solid #f0f0f0;
+	margin:20px 0px;
+}
+.sl_edit{
+	cursor:pointer;
+	margin: 0px 20px;
+}
+.sl_del{
+	cursor:pointer;
+}
+.sl_edit:hover,.sl_del:hover{
+	color:#FF5A5F;
+}
+#sl_editdel{
+	padding-top: 8px;
+	width: 12%;
+	float:left
+}
 	</style>
 <link href="{{Msg "seo" "cdn"}}/css/index-new.css" rel="stylesheet">
 </head>
@@ -209,6 +267,7 @@
 			<a type="button" class="text-muted btnactive" style="margin-left:18px;border-left:1px solid #FFF;">服务详情</a>
 			<a type="button" class="text-muted">服务评价({{.T.sinfo.i_comments}})</a>
 			<a type="button" class="text-muted">预约记录({{.T.appcount}})</a>
+			<a type="button" class="text-muted">更多服务</a>
 			{{end}}
 			
 			{{if .T.status }}
@@ -278,11 +337,26 @@
 				</table>
 			</div>
 		</div>
+		<!--服务列表-->
+		<div class="m-detailintroduction hide">
+			<div class="d_liebiao d_fuwu">
+				<div class="table a-table margin-t-20" id="serviceList">
+					<div id="tableTitle">
+						
+					</div>
+					
+					<div>
+						<div class="text-center" id="servicePaging"></div>
+					</div>
+				</div>
+			</div>
+		</div>
 		{{end}}
 		{{if .T.status }}
 			{{if eq .T.status "comment"}}
 		<div class="margin-15">
 			<div class="g-comment">
+				<input type="hidden" id="s_entid" value="{{.T.s_entid}}"/>
 				<input type="hidden" id="s_orderid" value="{{.T.s_orderid}}"/>
 				<input type="hidden" id="s_serviceid" value="{{.T.sinfo._id}}"/>
 				<input type="hidden" id="i_score" value="1"/>
@@ -364,6 +438,58 @@
 <div id="fade" class="black_overlay"></div>
 {{include "/common/bottom.html"}}
 <script type="text/javascript">
+
+function edit(id){
+	if (id.length > 0 ){	
+		window.open("/member/service/edit/"+id);
+	}
+}
+function del(id){
+	if (id.length > 0 ){	
+		$.ajax({    
+		        type:'post',        
+		        url:'/member/service/delete',
+		        data:{id:id}, 
+				async:false,   
+		        cache:false,    
+		        dataType:'json',    
+		        success:function(data){
+					if(id == {{.T.sinfo._id}}){
+		            	alert(data.msg);
+						window.location.href="/market/0/list.html";
+					}else{
+						alert(data.msg);
+						paging.getDatas();
+					}
+		        }    
+		    });  
+	}
+}
+var paging;
+$(function(){
+	 paging = new Paging("servicePaging","/market/service/list",{id:{{.T.sinfo.s_enterpriseid}}},5,function(r){
+		var html = '';
+		for(var i=0; i< r.length;i++){
+			var _id = r[i]._id;
+			var jg = ""
+			if(r[i].s_pricemy == "1"){
+			jg = "面议"
+			}else{ 
+			jg = r[i].f_price+" 元"
+			}
+			html +='<div  data-id="'+_id+'"  class="sl_border"><div id="sl_img" class="text-center"><img src="'+r[i].s_images+'"></div><div id="sl_cont">	'
+			+'<div><div id="sl_bt"><span><a target="_blank" href="/market/detail/'+_id+'.html">'+r[i].s_name+'</a></span></div>'
+			+'{{if eq .T.candoit "Y"}}<div class="text-center" id="sl_editdel"><span class="glyphicon bianji sl_edit" onClick="edit(\''+_id+'\')" title="编辑"></span><span class="glyphicon guanbi1 sl_del"  onClick="del(\''+_id+'\')" title="删除 "></span></div>{{end}}'
+			+'<div class="text-center" id="sl_bj">报价:<span> '+jg+'</span></div>'
+			+'<div id="sl_fy" class="text-center">成交 <span> '+r[i].i_sales+'</span> 丨 评价  <span> '+r[i].i_comments+'</span> </div><div style="clear:both;"></div>	</div>	'
+			+'<div id="sl_intro">'+r[i].s_introduction+'</div></div>	'
+			+'<div style="clear:both;"></div></div>';
+		}
+		$("#serviceList #tableTitle").nextAll("[data-id]").remove();
+		$("#serviceList #tableTitle").after(html);
+	
+	});
+});
 compulsoryreRresh = true;
 $(function(){
 	//获取地图的经纬度
@@ -635,7 +761,7 @@ function comment(){
 }
 </script>
 <script charset="utf-8" src="/js/paging.js"></script>
-	<script>
+<script>
 		$(function(){
 			new Paging("appRecordPaging","/market/appinfo",{id:"{{.T.sinfo._id}}"},10,function(r){
 				var html = '';