Преглед изворни кода

Merge branch 'develop' of 192.168.3.17:zhanghongbo/qfw into develop

wangshan пре 9 година
родитељ
комит
39d779585b

+ 1 - 0
core/src/qfw/yellowpage/yellowpagemanager.go

@@ -293,6 +293,7 @@ func (yp *Yellowpage) EnterpriseInfo(id string) error {
 			yp.T["dishonesty"] = getDishonesty(util.If(info["LegCerNO"] != nil, info["LegCerNO"], "").(string), 1)
 			//服务列表第一页数据
 			yp.T["service"] = findServiceByEntId(id, 1, yp.Session())
+			log.Println(yp.T["service"])
 			//关系网数据
 			yp.T["relation"] = relation
 			contentuser, erruser := yp.Render4Cache("/yellowpage/enterpriseinfo.html", &yp.T)

+ 9 - 5
core/src/web/staticres/js/qfw.js

@@ -271,12 +271,16 @@ function makeImmediately(data,b){
 	if(data&&data.length>0&&!(typeof data == "string")){
 		for(var i=0;i<data.length;i++){
 			var ds=data[i].split("_")
-			//res+="<div onclick='iq(this)'>"+ds[0]+"</div>"
-			if($("#loginStatus").length == 1){
-				res+="<div onclick='window.open(\"/wx/enterprise/"+ds[1]+".html\")'>"+ds[0]+"</div>"
-			}else{
-				res+="<div onclick='window.open(\"/enterprise/"+ds[1]+".html\")'>"+ds[0]+"</div>"
+			//res+="<div onclick=''>"+ds[0]+"</div>"
+			var clickVal = "iq(this)";
+			if(!b){
+				if($("#loginStatus").length == 1){
+					clickVal = "window.open('/wx/enterprise/"+ds[1]+".html')";
+				}else{
+					clickVal = "window.open('/enterprise/"+ds[1]+".html')";
+				}
 			}
+			res+='<div onclick="'+clickVal+'">'+ds[0]+'</div>';
 		}
 		if(b){
 			res+=delLog

+ 1 - 1
core/src/web/templates/member/editenterprise.html

@@ -227,7 +227,7 @@ var option={
 			 	dataType: "text",
 			  	success: function(result){
 					if (result == "y"){
-						$("#logoArea").html("<img class='ent-LOGO' src='"+data.url+"'>");
+						$("#logoArea").html('<img class="ent-LOGO cursor-pointer" src="'+data.url+'" onclick="document.getElementById(\'upload\').click();">');
 					}else{
 						alert("上传LOGO失败,请重新上传。");
 					}

+ 13 - 8
core/src/web/templates/service/list.html

@@ -158,7 +158,7 @@
 						</div></a>
 					{{end}}
 				</div>
-				<div class="col-sm-4 col-xs-8">		
+				<div class="col-sm-5 col-xs-8" style="padding-right:30px;">		
 				<div class="title" style="height:40px;" >
 					{{if eq "demand" $.T.querymap.c_searchtype}}
 						<a target="_blank" style="float: left;max-width: 230px;display: inline-block;word-break: break-all;" href="/market/demandview/{{$v._id}}.html">{{$v.s_name}}</a>
@@ -219,9 +219,9 @@
 					{{end}}
 				{{end}}
 				</div>
-					<div style="padding-top:10px;padding-bottom:10px;">
+					<div style="padding:10px 30px 10px 0">
 						<span class="d_service_span text-muted">{{if $v.s_enterprisename}}<a style="color:#aea79f;" href="/enterprise/{{$v.s_enterpriseid}}.html" target="_blank">{{$v.s_enterprisename}}</a>{{else}}{{$v.s_nickname}}{{end}}</span>
-						<span class="d_service_span text-muted f-code">{{$v.i_area}}</span>
+						<span class="d_service_span text-muted f-code" style="float:right;">{{$v.i_area}}</span>
 					</div>
 				</div>
 				{{if eq "demand" $.T.querymap.c_searchtype}}
@@ -243,10 +243,11 @@
 				<div class="col-sm-2 col-xs-4" style="margin-top: 5px;">
 					价格:{{if eq $v.f_price 0.0}}<span class="text-primary text-bold">面议</span>{{else}}<span class="text-primary text-bold">{{$v.f_price}}</span>元{{end}}
 				</div>
-				<div class="col-sm-4 col-xs-4 text-center hidden-xs" style="margin-top:5px;padding-right:0px;margin-left:30px;">
-					<div class="col-sm-8 " style="float:right;text-align:right;">
-						<div style="float:right;"><span class="d_col_span" style="font-size:14px;">成交量:<span style="color:#FF5A5F;font-weight:600;">{{if $v.i_sales}}{{$v.i_sales}}{{else}}0{{end}}</span></span></div>
-						<div style="float:right;" ><span class="d_col_span" style="font-size:14px;">评价数:<span style="color:#FF5A5F;font-weight:600;">{{if $v.i_comments}}{{$v.i_comments}}{{else}}0{{end}}</span></span>&nbsp;&nbsp;|&nbsp;&nbsp;</div>
+				<div class="hidden-xs" style="float:right ;margin-top:5px;padding-right:0px;margin-left:30px;">
+					<div style="float:right;text-align:right;">
+						<div style="float:left;"><span class="d_col_span" style="font-size:14px;">成交量:<span style="color:#FF5A5F;font-weight:600;">{{if $v.i_sales}}{{$v.i_sales}}{{else}}0{{end}}</span></span></div>
+						<div style="float:left">&nbsp;&nbsp;|&nbsp;&nbsp;</div>
+						<div style="float:left;" ><span class="d_col_span" style="font-size:14px;">评价数:<span style="color:#FF5A5F;font-weight:600;">{{if $v.i_comments}}{{$v.i_comments}}{{else}}0{{end}}</span></span></div>
 					</div>
 				</div>
 				{{else}}
@@ -349,7 +350,11 @@
 		});
 		$(".f-code").each(function(i,n){
 			var $n=$(n);
-			$n.text(getChineseLoc($n.text()));
+			var code=$n.text();
+			if(code.length>2){
+				code=code.substr(0,2);
+			}
+			$n.text(getChineseLoc(code));
 		});
 	});
 	

+ 2 - 2
core/src/web/templates/yellowpage/enterpriseinfo.html

@@ -122,8 +122,8 @@
 		<li>关系网</li>
 		<li{{if not .T.res.staffinfo}} class="disabled"{{end}}>主要人员</li>
 		<li{{if not .T.res.alterInfo}} class="disabled"{{end}}>变更信息</li>
-		<li{{if eq .T.dishonesty.count 0}} class="disabled"{{end}}>失信信息</li>
-		<li class="{{if and (not .T.res.s_synopsis) (eq .T.service.count 0)}}disabled {{end}}border-r-0">{{if eq .T.res.s_action "01"}}企业{{else if eq .T.res.s_action "02"}}商家{{else if eq .T.res.s_action "03"}}机构{{else}}企业{{end}}黄页</li>
+		<li{{if not .T.dishonesty.count}} class="disabled"{{end}}>失信信息</li>
+		<li class="{{if and (not .T.service.count) (not .T.res.s_synopsis)}}disabled {{end}}border-r-0">{{if eq .T.res.s_action "01"}}企业{{else if eq .T.res.s_action "02"}}商家{{else if eq .T.res.s_action "03"}}机构{{else}}企业{{end}}黄页</li>
 	</ul>
 	<div class="ent-tab-content b-left">
 		<div>

+ 17 - 8
weixin/src/qfw/weixin/voicehandler.go

@@ -29,7 +29,7 @@ func MsgVoiceHandler(w ResponseWriter, r *Request) {
 			arts := []Article{}
 			for _, item := range ret {
 				url := fmt.Sprintf("http://%s/enterprise/%s.html", wf.SysConfig.Domain, item["_id"])
-				arts = append(arts, Article{Title: item["EntName"], Url: url, PicUrl: item["s_avatar"]})
+				arts = append(arts, Article{Title: item["EntName"], Url: url, PicUrl: "http://" + wf.SysConfig.Domain + item["s_avatar"]})
 			}
 			w.ReplyNews(arts)
 		}
@@ -73,16 +73,25 @@ func findEntprise(keyword string) (ret []ItemMap, err error) {
 			var res map[string]interface{}
 			json.Unmarshal(*hit.Source, &res)
 			tmp := map[string]string{}
-			tmp["_id"] = res["_id"].(string)
-			tmp["EntName"] = res["EntName"].(string)
-			tmp["EntTypeName"] = res["EntTypeName"].(string)
-			tmp["OpLocDistrictName"] = res["OpLocDistrictName"].(string)
-			s_avatar := res["s_avatar"]
-			if s_avatar != nil && s_avatar != "" {
-				tmp["s_avatar"] = s_avatar.(string)
+			tmp["_id"] = sNull(res["_id"])
+			tmp["EntName"] = sNull(res["EntName"])
+			tmp["EntTypeName"] = sNull(res["EntTypeName"])
+			tmp["OpLocDistrictName"] = sNull(res["OpLocDistrictName"])
+			s_avatar := sNull(res["s_avatar"])
+			if s_avatar != "" {
+				tmp["s_avatar"] = s_avatar
 			}
 			ret = append(ret, tmp)
 		}
 	}
 	return
 }
+
+//转移空字符
+func sNull(src interface{}) string {
+	if src == nil {
+		return ""
+	} else {
+		return src.(string)
+	}
+}