Procházet zdrojové kódy

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

wangchuanjin před 9 roky
rodič
revize
7c320b081f

+ 2 - 2
core/src/config.json

@@ -32,6 +32,6 @@
     "pushRpc": "127.0.0.1:8766",
     "domainName": "http://www.qimingxing.info",
     "ocr_uid": "120.25.216.197",
-    "ocr_servicekey": "91e77f8a-cb28-4fc2-96d7-5b08e7dfb6c5",
-    "ocr_servicecode": "cf22e3bb-d41c-47e0-aa44-a92984f5829d"
+    "ocr_servicekey": "c1608f6b-b507-46d4-98de-12e98f613715",
+    "ocr_servicecode": "91f6a58d-e418-4e58-8ec2-61b583c55ba2"
 }

+ 1 - 1
core/src/message.json

@@ -2,7 +2,7 @@
 	"weixinrpc":"127.0.0.1:82",
 	"swordfishaction":"/swordfish/page",
 	"signature":"/member/credit/myCredit",
-	"entsearchaction":"/front/entCommunity.html",
+	"entsearchaction":"/wx/search/enterprise/index.html",
 	"lawsearchaction":"/law/qfw/index",
 	"msiteaction":"/ent/wsite/edit",
 	"wxpushlist":"/wxpush/bidinfo/%s",

+ 3 - 2
core/src/qfw/coreutil/imagemsghandler.go

@@ -9,10 +9,11 @@ import (
 	"net/http"
 	"os"
 	cf "qfw/coreconfig"
+	"qfw/util"
 )
 
 //名片识别
-func CardRecognition(picpath string) []interface{} {
+func CardRecognition(picpath string) (string, []interface{}) {
 	comps := []interface{}{}
 	//识别
 	fi, _ := os.Open(picpath)
@@ -38,5 +39,5 @@ func CardRecognition(picpath string) []interface{} {
 	if v, ok := ocr_ret["comp"]; ok {
 		comps, _ = v.([]interface{})
 	}
-	return comps
+	return util.ObjToString(ocr_ret["code"]), comps
 }

+ 20 - 16
core/src/qfw/search/wxsearchservice.go

@@ -8,7 +8,7 @@ import (
 	"github.com/p/mahonia"
 	"html/template"
 	"qfw/coreutil"
-	//	"qfw/mobile"
+	"qfw/mobile"
 	. "qfw/util"
 	"qfw/util/consts"
 	"qfw/util/elastic"
@@ -21,13 +21,14 @@ import (
 
 //企业社区首页
 func (n *Wxsearch) WxIndex() error {
-	//n.T["signature"] = mobile.GetSignature(n.Url())
+	n.T["signature"] = mobile.GetSignature(n.Url())
 	n.Render("/member/incmobile/index.html", &n.T)
 	return nil
 }
 
 //企业列表
 func (n *Wxsearch) WxgetEnterpriseList(reqType, param /*参数*/ string) error {
+	n.T["signature"] = mobile.GetSignature(n.Url())
 	i_mingpian := n.GetString("i_mingpian") //是否走名片查询
 	if len(param) == 0 {
 		//请求是表单提交,走的查询
@@ -515,34 +516,37 @@ func wxsearhWebContententMp(querymap map[string]string, n *Wxsearch, reqType str
 
 //获取名片名称
 func (n *Wxsearch) WxMingpian() error {
-	res := make(map[string]string)
-	res["name"] = ""
-	res["on"] = "y"
+	res := make(map[string]interface{})
+	names := []string{}
+	res["on"] = "y" //y正常,n调用频繁或超出调用次数
 	if n.GetSession("s_m_openid") != nil {
 		serverId := n.GetString("serverId")
 		ret := coreutil.WxDownloadImg(serverId)
 		if len(ret) > 1 {
 			res["on"] = ret[0]
-			names := coreutil.CardRecognition(ret[1])
-			for _, v := range names {
+			code, tmps := coreutil.CardRecognition(ret[1])
+			if code == "434" {
+				res["on"] = "n"
+			}
+			tmps2 := []string{}
+			for _, v := range tmps {
 				name := fmt.Sprint(v)
 				if mpian_reg.MatchString(name) {
-					res["name"] = name
-					break
+					names = append(names, name)
+				} else {
+					tmps2 = append(tmps2, name)
 				}
 			}
-			var name = ""
-			if res["name"] == "" {
-				for _, v := range names {
-					tmp := fmt.Sprint(v)
-					if len(name) < len(tmp) {
-						name = tmp
+			if len(names) < 5 {
+				for _, v := range tmps2 {
+					if len(v) > 5 && len(names) < 6 {
+						names = append(names, v)
 					}
 				}
-				res["name"] = name
 			}
 		}
 	}
+	res["names"] = names
 	n.ServeJson(&res)
 	return nil
 }

+ 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-03-24 11:22:15"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-03-24 11:22:15"}},"marketisstart":true,"marketrate":300}
+{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-03-25 11:59:32"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-03-25 11:59:32"}},"marketisstart":true,"marketrate":300}

+ 86 - 5
core/src/web/staticres/css/mobile/incmobile.css

@@ -26,7 +26,6 @@ ul{
 	height: 30px;
 	width: 71%;
 	border: 1px solid #DDDFDB !important;
-	border-radius: 15px;
 	padding-left: 15px;
 }
 .m-searchbar .immediately{
@@ -52,13 +51,21 @@ ul{
 .m-searchbar .searchbtn{
 	display: inline-block;
 	position: absolute;
-	border-radius: 17px;
 	height: 30px;
-	width: 30px;
-	margin:0  0 0 -35px;
+	width: 50px;
+	margin:0  0 0 -50px;
 	text-align:center;
 	background-color:#16A086 !important;
 }
+.m-searchbar .searchbtn1{
+	display: inline-block;
+	position: absolute;
+	height: 30px;
+	line-height: 30px;
+	margin: 0 0 0 -72px;
+	text-align: center;
+	color: #A0A0A0;
+}
 .m-searchbar .searchbtn b{
 	color:#FFF;
 	line-height:27px;
@@ -511,10 +518,12 @@ hr.list{
 	font-size: 13px;
 	color: #000;
 	background: #F6F7F8;
+	position: fixed;
+	width: 100%;
 }
 .creditrules div.content{
 	min-height: 170px;
-	padding: 20px 20px;
+	padding: 60px 20px;
 }
 .ent-dishonesty{
 	text-align:left;
@@ -545,4 +554,76 @@ hr.list{
 .colorfont{
 	font-size:13px;
 	color:#16A086;
+}
+
+/*搜索首页*/
+.index-bodybg{
+	color:#FFF;
+	background:url('/images/entbg.png') no-repeat left top;
+	background-size:cover;
+}
+.index-bodybg .main{
+	padding:80px 20px 0px 25px;
+}
+.index-bodybg .main div.sign{
+	font-weight:bold;
+	padding-bottom:10px;
+	font-size:16px;
+}
+.index-bodybg .main div.smallsign{
+	font-size:9px;
+	padding-bottom:10px;
+	color:#DBDBDC;
+}
+.form-control{
+	border-radius:0px;
+	-webkit-box-shadow:none;
+	box-shadow:none;
+	transition:none;
+	-webkit-transition:none;
+	 -webkit-appearance: none;
+}
+.input-group-addon{
+	border:0px;
+	border-radius:0px;
+	width:60px;
+	color:#FFF;
+	background-color:rgb(22,160,134);
+}
+.input-before,.input-after{
+	z-index: 30;
+	position: absolute;
+	color: #A0A0A0;
+	font-size:11px;
+}
+.input-before{
+	top: 14px;
+	left: 9px;			
+}
+.input-after {
+    top: 13px;
+    right: 70px;
+    color: #A0A0A0;
+    font-size: 16px;
+}
+.footer {
+	position: absolute;
+	bottom:20px;
+	width: 100%;
+	text-align:center;
+	height: 40px;
+}
+.footer .container div{
+	display:inline-block;	
+}
+.footer img{
+	margin-top:-15px;
+	margin-right:10px;
+}
+.footer .container .inc span{
+	font-weight:bold;
+	line-height:15px;
+}
+.footer .container .inc p{
+	font-size:10px;
 }

+ 7 - 2
core/src/web/staticres/js/entcommunity.js

@@ -235,7 +235,10 @@ function viewcontent(n){
 	var node=$(n);
 	$(".modal-backdrop").show();
 	$(".creditrules").show();
-	$(".creditrules .content").text(node.parent().find("div").text());
+	var p=node.parent().find("div").text();
+	p=p.replace(new RegExp(/(变)/g),'<br/>变');
+	p=p.replace(new RegExp(/(;)/g),';<br/>');
+	$(".creditrules .content").html(p);
 }
 hasLoadPagingJs=false
 //失信信息
@@ -339,4 +342,6 @@ function initRelation(){
 	}else{
 		$("#entrelation-limit,#entrelation-nologin").removeClass("hide");
 	}
-}
+}
+
+

+ 8 - 7
core/src/web/staticres/wxswordfish/style.css

@@ -2,6 +2,7 @@ body{
 	margin: 0px;
 	font-family: tahoma, arial, 'Hiragino Sans GB', 'Microsoft YaHei', 宋体, sans-serif;
 	-webkit-tap-highlight-color: transparent;
+	color: #000;
 }
 ul{
 	list-style: none;
@@ -63,8 +64,8 @@ img{
 .operation>.parent-node{
 	background-color: #F8F8F8;
 	width: 100%;
-	height: 54px;
-	line-height: 54px;
+	height: 40px;
+	line-height: 40px;
 	border-bottom: 1px solid #CCCCCC;
 	position: relative;
 	font-size: 16px;
@@ -84,7 +85,7 @@ img{
 }
 .operation>.parent-node>span img{
 	position: absolute;
-	top: 50%;
+	top: 40%;
 	left: 50%;
 }
 .operation>.parent-node>span{
@@ -121,7 +122,7 @@ img{
 	display: none;
 }
 .operation .child-node li{
-	border-bottom: 1px solid #ddd;
+	border-bottom: 1px solid #ccc;
 	padding: 15px 0px;
 }
 
@@ -503,7 +504,7 @@ img{
 	left: 0px;
 	right: 0px;
 	bottom: 0px;
-	height: 50px;
+	height: 40px;
 	width: 100%;
 	border-top: 1px solid #CCCCCC;
 	background-color: #F8F8F8;
@@ -511,8 +512,8 @@ img{
 .bottom-toolbar>li{
 	display: table-cell;
 	width: 33%;
-	height: 50px;
-	line-height: 50px;
+	height: 40px;
+	line-height: 40px;
 	text-align: center;
 }
 .bottom-toolbar>li img{

+ 3 - 5
core/src/web/templates/member/incmobile/alter.html

@@ -1,7 +1,6 @@
 <div class="comnav">
-	<span></span>
-	变更信息
-	<span style="float:right;font-size:11px;padding-right:10px;" data="c_alter" onclick="childrenshow(this);">{{if .T.res.EntName}}{{.T.res.EntName}}{{end}}</span>
+	<center><span class="glyphicon bofangjilu"></span>&nbsp;&nbsp;变更信息</center>
+	<span style="float:left;font-size:11px;padding-right:10px;margin-top:-19px;" data="c_alter" onclick="childrenshow(this);">&lt;&nbsp;企业信息</span>
 </div>
 <div class="ent-alterinfo">
 	<div class="ent-layout-up">
@@ -52,14 +51,13 @@
 					if($(".end").prev().length==0){
 						$(".end").remove();
 					}
-					document.write("<center>暂无变更信息<center>");
 				</script>
 				<div class="clearfix"></div>
 			</ul>
 	</div>
 	</div>
 </div>
-<div style="position: absolute;width:100%;z-index:4410;background:#FFF;bottom: 0;min-height: 270px;display:none;font-size:12px;" class="creditrules">
+<div style="position: absolute;width:100%;z-index:4410;background:#FFF;bottom: 0;min-height: 270px;display:none;font-size:12px;overflow:auto;max-height:400px;" class="creditrules">
 		<div class="title">
 			详细变更信息
 			<button class="btn btn-link navcolor " style="float:right;"onclick="$(this).parent().parent().hide();$('.modal-backdrop').hide()" >确定</button>

+ 2 - 3
core/src/web/templates/member/incmobile/baseinfo.html

@@ -1,7 +1,6 @@
 <div class="comnav">
-	<span></span>
-	基本信息
-	<span style="float:right;font-size:11px;padding-right:10px;" data="c_baseinfo" onclick="childrenshow(this);">{{if .T.res.EntName}}{{.T.res.EntName}}{{end}}</span>
+	<center><span class="glyphicon qiyehuangye"></span>&nbsp;&nbsp;基本信息</center>
+	<span style="float:left;font-size:11px;padding-right:10px;margin-top:-19px;" data="c_baseinfo" onclick="childrenshow(this);">&lt;&nbsp;企业信息</span>
 </div>
 <div class="combody baseinfo">
 	<ul>

+ 55 - 10
core/src/web/templates/member/incmobile/detailindex.html

@@ -51,9 +51,14 @@
 			border-bottom: 1px solid #e5e6e9 !important;
 			border-radius: 0px !important;
 		}
-		.entrelation svg{
-			width:1000px;
-			height:1000px;
+		#entrelation-restore,#entrelation-fullscreen{
+			display:none;
+		}
+		.entrelation-controlls{
+			top:5px;
+		}
+		.disabled{
+			color:#BCBCBC;
 		}
 	</style>
  </head>
@@ -81,7 +86,11 @@
 		</div>
 		<div class="col-xs-12 index-middle">
 			<div class="col-xs-6" style="border-right: 1px solid #16A086;" data-id="c_card" onclick="childrenshow(this);"><span class="glyphicon qiyemingpian" style="font-size:11px;"></span>&nbsp;企业名片</div>
-			<div class="col-xs-6"><span class="glyphicon weiguanwang2"></span>&nbsp;微官网</div>
+			{{if .T.res.s_microwebsite}}
+			<div class="col-xs-6" onclick="wgw();"><span class="glyphicon weiguanwang2"></span>&nbsp;微官网</a></div>
+			{{else}}
+			<div class="col-xs-6 disabled"><span class="glyphicon weiguanwang2"></span>&nbsp;微官网</a></div>
+			{{end}}
 		</div>
 		<div class="col-xs-12 index-navtable">
 			<div class="col-xs-4 content" data-id="c_baseinfo" onclick="childrenshow(this);">
@@ -113,7 +122,7 @@
 					<span class="glyphicon bofangjilu" ></span>
 				</div>
 				<div style="height:50%;" >
-					变更信息
+					变更信息(<span class="count">0</span>)
 				</div>
 			</div>
 			<div class="col-xs-4 content" data-id="c_sx" onclick="childrenshow(this);">
@@ -121,7 +130,7 @@
 					<span class="glyphicon shixinxinxi " ></span>
 				</div>
 				<div style="height:50%;" >
-					失信信息
+					失信信息(<span class="count">0</span>)
 				</div>
 			</div>
 			<div class="col-xs-4 content" data-id="c_news" onclick="childrenshow(this);">
@@ -129,12 +138,13 @@
 					<span class="glyphicon qiyexinwen " ></span>
 				</div>
 				<div style="height:50%;" >
-					企业新闻
+					企业新闻(<span class="count">0</span>)
 				</div>
 			</div>
 		</div>
 	</div>
 	<script src="/js/jquery.js"></script>
+	<script src="/js/jquery.cxselect.js"></script>
 	<script src="/js/qfw.js"></script>
 	<div id="c_baseinfo" style="clear:both;display:none;">
 			{{include "/member/incmobile/baseinfo.html"}}
@@ -163,17 +173,49 @@
 <script src="/js/bootstrap.min.js"></script>
 <script src="/js/entcommunity.js"></script>
 <script>
-	$(function(){
-			 resize();
+	$(function(){		   
+			resize();
 			mCommunity().initmemer();
-			DishonestyPaging();
 			initRelation();
+			DishonestyPaging();
+			setDisabled();
 	})
 	$(window).resize(function(){
 	 		resize();
 	});
+	function setDisabled(){
+		//企业新闻
+		var newslength=$(".newsInfo li").length;
+		if(newslength==0){
+			$("div[data-id='c_news']").addClass("disabled");
+		}else{
+			$("div[data-id='c_news'] .count").text(newslength);
+		}
+		//失信信息
+		if(dishonesty.count==0){
+			$("div[data-id='c_sx']").addClass("disabled");
+		}else{
+			$("div[data-id='c_sx'] .count").text(dishonesty.count);
+		}
+			
+		//变更信息
+		var alterlength=$(".ent-alterinfo li").length-1;
+		if(alterlength<=0){
+			$("div[data-id='c_alter']").addClass("disabled");
+		}else{
+			$("div[data-id='c_alter'] .count").text(alterlength);
+		}
+		//企业名片
+		var cardlength=$(".yellowpage li").length;
+		if(cardlength==0){
+			$(".yellowpage").addClass("disabled");
+		}
+	}
 	function childrenshow(n){
 		var node=$(n);
+		if(node.hasClass("disabled")){
+			return;
+		}
 		if (node.attr("data-id")){
 			$("#header").hide();
 			$("#"+node.attr("data-id")).show();
@@ -192,6 +234,9 @@
 				$(n).text(new Date(i).Format("yyyy-mm-dd"));
 		})
 	})
+	function wgw(){
+		window.location.href='/ent/wsite/preview/'+entId;
+	}
    var cdn = {{Msg "seo" "cdn"}};
 	var entId = {{.T.res._id}};
 	var regNo = {{.T.res.RegNo}};

+ 5 - 72
core/src/web/templates/member/incmobile/index.html

@@ -8,74 +8,6 @@
 		<link href="/css/bootstrap.min.css" rel="stylesheet">
 		<link href="/css/mobile/incmobile.css" rel="stylesheet">
 		<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
-		<style>
-			.index-bodybg{
-				color:#FFF;
-				background:url('/images/entbg.png') no-repeat left top;
-				background-size:cover;
-			}
-			.index-bodybg .main{
-				padding:80px 20px 0px 25px;
-			}
-			.index-bodybg .main div.sign{
-				font-weight:bold;
-				padding-bottom:10px;
-				font-size:16px;
-			}
-			.index-bodybg .main div.smallsign{
-				font-size:9px;
-				padding-bottom:10px;
-				color:#DBDBDC;
-			}
-			.form-control{
-				border-radius:0px;
-				-webkit-box-shadow:none;
-				box-shadow:none;
-				transition:none;
-				-webkit-transition:none;
-				 -webkit-appearance: none;
-			}
-			.input-group-addon{
-				border:0px;
-				border-radius:0px;
-				width:60px;
-				color:#FFF;
-				background-color:rgb(22,160,134);
-			}
-			.input-before{
-				z-index: 30;
-				position: absolute;
-				top: 14px;
-				left: 9px;
-				color: #A0A0A0;
-				font-size:11px;
-			}
-			.footer {
-				position: absolute;
-				bottom:20px;
-				width: 100%;
-				text-align:center;
-				height: 40px;
-			}
-			.footer .container div{
-				display:inline-block;	
-			}
-			.footer img{
-				margin-top:-15px;
-				margin-right:10px;
-			}
-			.footer .container .inc span{
-				font-weight:bold;
-				line-height:15px;
-			}
-			.footer .container .inc p{
-				font-size:10px;
-			}
-			#query{
-				height:40px;
-				padding-left:25px;
-			}
-		</style>
 <script>
 var signature = {{.T.signature}};
 var shareTitle = "企业社区";
@@ -121,6 +53,7 @@ if(typeof(signature) != "undefined" && signature != null && signature.length ==
     });
 }	
 </script>
+
 	</head>
 <body class="index-bodybg">
 		<div class="main">
@@ -131,10 +64,10 @@ if(typeof(signature) != "undefined" && signature != null && signature.length ==
 			<div style="clear:both;" class="col-sm-8">
               <form method="post"  action="/wx/search/enterprise/list.html" id="search">
 						<div class="input-group col-xs-12">
-							<i class="glyphicon glyphicon-search input-before"></i>
-                 		<input type="text" id="query" class="form-control" name="words" placeholder="找企业"  >
+                 		<input type="text" id="query" class="form-control"  style="height:40px;" name="words" placeholder="找企业"  >
 							<input type="hidden" name="i_mingpian" id="i_mingpian" value="" />
-							<span class="input-group-addon"><span class="glyphicon glyphicon-camera"></span></span>
+							<span class="glyphicon glyphicon-camera input-after" id="camera"></span>
+							<span class="input-group-addon"><span onclick="$('#search').submit();" class="glyphicon glyphicon-search"></span></span>
              		</div>
 					</form>
 			</div>
@@ -153,7 +86,7 @@ if(typeof(signature) != "undefined" && signature != null && signature.length ==
 <script src="/js/jquery.js"></script>
 <script src="/js/qfw.js"></script>
 <script>
-$(".input-group-addon").click(function(){
+$("#camera").click(function(){
 	wx.chooseImage({
 	    count: 1, // 默认9
 	    sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有

+ 94 - 2
core/src/web/templates/member/incmobile/list.html

@@ -7,6 +7,7 @@
 	<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
 	<link href="/css/bootstrap.min.css" rel="stylesheet">
  	<link href="/css/mobile/incmobile.css" rel="stylesheet">
+	<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
  </head>
  <body>
 	<div class="col-xs-12">
@@ -20,6 +21,7 @@
 			<input type="hidden" name="OpState" value="">
 			<input type="hidden" name="c_hfl" id="c_hfl" value='{{.T.querymap.c_hfl}}'>
 			<input type="hidden" name="c_zb" id="c_zb" value='{{.T.querymap.c_zb}}'>
+			<a class="searchbtn1" id="camera"><b class="glyphicon glyphicon-camera"></b></a>
 			<a class="searchbtn"><b class="glyphicon glyphicon-search"></b></a>
 			<a href="javascript:" class="searchlink">高级搜索</a>
 				<div id="immediately" class="immediately">
@@ -58,7 +60,7 @@
 			</ul>
 		</div>
 	</div>
-	<div class="bottom" style="float:left;clear:both;" >
+	<div class="bottom" style="float:left;clear:both;width:100%;" >
 		<ul class="inclist">
 				
 		</ul>
@@ -89,7 +91,7 @@
 		var i=0;
 		var data={{.T.data}}
 		var strVar = "";
-		strVar += "<li class=\"col-xs-12\"><table align=\"center\"><caption><div class=\"left\"><a href=\"/enterprise/$Id.html\">$EntName</a><\/div><b class=\"$status\">$OpStateName<\/b><\/caption><tr><td class=\"left\">注册号:<span>$RegNo<\/span><\/td><td>法定代表人:<span>$LeRep<\/span><\/td><\/tr><tr><td class=\"left\">成立时间:<span>$EstDate<\/span><\/td><td>所在地:<span>$OpLocDistrict<\/span><\/td><\/tr><tr><td colspan=\"2\"><hr class=\"list\"><\/td><\/tr><\/table><\/li>";
+		strVar += "<li class=\"col-xs-12\"><table align=\"center\"><caption><div class=\"left\"><a href=\"/enterprise/$Id.html\">$EntName</a><\/div><b class=\"$status\" style='float:right;margin-right:10px;'>$OpStateName<\/b><\/caption><tr><td class=\"left\">注册号:<span>$RegNo<\/span><\/td><td align='right'>法定代表人:<span>$LeRep<\/span><\/td><\/tr><tr><td class=\"left\">成立时间:<span>$EstDate<\/span><\/td><td align='right'>所在地:<span>$OpLocDistrict<\/span><\/td><\/tr><tr><td colspan=\"2\"><hr class=\"list\"><\/td><\/tr><\/table><\/li>";
 		
 		function loadData(){
 			var li="";
@@ -123,5 +125,95 @@
 				$(".inclist").append($(li));
 		}
 	</script>
+	<script>
+		var signature = {{.T.signature}};
+		var shareTitle = "企业社区";
+		var shareLink = "http://www.qimingxing.info/wx/search/enterprise/list.html";
+		var shareIcon = "";
+		if(typeof(signature) != "undefined" && signature != null && signature.length == 4){
+			wx.config({
+			    debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+			    appId: signature[0], // 必填,公众号的唯一标识
+			    timestamp:signature[1], // 必填,生成签名的时间戳
+			    nonceStr: signature[2], // 必填,生成签名的随机串
+			    signature: signature[3],// 必填,签名,见附录1
+			    jsApiList: ['onMenuShareTimeline','onMenuShareAppMessage',
+							'chooseImage','uploadImage','downloadImage']
+			});
+			wx.ready(function () {
+		        wx.onMenuShareTimeline({
+				    title: shareTitle, // 分享标题
+				    link: shareLink, // 分享链接
+				    imgUrl: shareIcon, // 分享图标
+				    success: function () { 
+				       //alert('分享成功');
+				    },
+				    cancel: function () { 
+				       //alert('分享失败,或用户取消了');
+				    }
+				});
+		
+				wx.onMenuShareAppMessage({
+				    title: shareTitle, // 分享标题
+				    desc: '企明星企业', // 分享描述
+				    link:  shareLink,// 分享链接
+				    imgUrl: shareIcon, // 分享图标
+				    type: 'link', // 分享类型,music、video或link,不填默认为link'
+				    dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空
+				    success: function () { 
+				        //alert('分享成功');
+				    },
+				    cancel: function () { 
+						//alert('分享失败,或用户取消了');
+				    }
+				});
+		    });
+		}	
+		$("#camera").click(function(){
+			wx.chooseImage({
+			    count: 1, // 默认9
+			    sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
+			    sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
+			    success: function (res) {
+			        var localIds = res.localIds; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
+					uploadImage(localIds[0]);
+			 	}
+			});
+		})
+		
+		function uploadImage(localId){
+			wx.uploadImage({
+			    localId: localId, // 需要上传的图片的本地ID,由chooseImage接口获得
+			    isShowProgressTips: 1, // 默认为1,显示进度提示
+			    success: function (res) {
+			        getmpname(res.serverId); // 返回图片的服务器端ID
+			 	}
+			});
+		} 
+		//获取企业名称
+		function getmpname(serverId){
+			$.ajax({ 
+		        type: 'post', 
+		        url: '/wx/search/enterprise/mingpian', 
+				data:{serverId:serverId},
+		        cache: false, 
+		        error: function(){return false;}, 
+		        success:function(obj){
+					if(obj["on"]=="y"){
+						if(obj["name"]==""){
+							alert("未匹配的对应的名称");
+						}else{
+							$("#query").val(obj["name"]);
+						 	$("#i_mingpian").val("1");
+						 	$("#search").submit();	
+						}
+					}else{
+						alert("功能调用太频繁,请稍后再试!");
+					}
+		        } 
+		    }); 
+		}
+		</script>
+
  </body>
 </html>

+ 2 - 2
core/src/web/templates/member/incmobile/member.html

@@ -1,6 +1,6 @@
 <div class="comnav">
-	主要人员
-		<span style="float:right;font-size:11px;padding-right:10px;" data="c_member" onclick="childrenshow(this);">{{if .T.res.EntName}}{{.T.res.EntName}}{{end}}</span>
+	<center><span class="glyphicon zhuyaorenyuan "></span>&nbsp;&nbsp;主要人员</center>
+	<span style="float:left;font-size:11px;padding-right:10px;margin-top:-19px;" data="c_member" onclick="childrenshow(this);">&lt;&nbsp;企业信息</span>
 </div>
 <div>
 	<div class="ent-mainperson">

+ 2 - 2
core/src/web/templates/member/incmobile/news.html

@@ -1,6 +1,6 @@
 <div class="comnav">
-	企业新闻
-		<span style="float:right;font-size:11px;padding-right:10px;" data="c_news" onclick="childrenshow(this);">{{if .T.res.EntName}}{{.T.res.EntName}}{{end}}</span>
+	<center><span class="glyphicon qiyexinwen  "></span>&nbsp;&nbsp;企业新闻</center>
+	<span style="float:left;font-size:11px;padding-right:10px;margin-top:-19px;" data="c_news" onclick="childrenshow(this);">&lt;&nbsp;企业信息</span>
 </div>
 <div class="entinfo-page" style="background:#FFF;">
 	<div class="b-right"> 

+ 2 - 3
core/src/web/templates/member/incmobile/relation.html

@@ -1,8 +1,7 @@
 <div class="comnav">
-	关系网
-	<span style="float:right;font-size:11px;padding-right:10px;" data="c_relation" onclick="childrenshow(this);">{{if .T.res.EntName}}{{.T.res.EntName}}{{end}}</span>
+	<center><span class="glyphicon guanxiwang1"></span>&nbsp;&nbsp;关系网</center>
+	<span style="float:left;font-size:11px;padding-right:10px;margin-top:-19px;" data="c_relation" onclick="childrenshow(this);">&lt;&nbsp;企业信息</span>
 </div>
-
 		<div class="entrelation" id="entrelation">
 			<div id="entrelation-infovis"></div>
 			<div id="entrelation-limit" class="hide entrelation-limit">

+ 2 - 2
core/src/web/templates/member/incmobile/sx.html

@@ -1,6 +1,6 @@
 <div class="comnav">
-	失信信息
-		<span style="float:right;font-size:11px;padding-right:10px;" data="c_sx" onclick="childrenshow(this);">{{if .T.res.EntName}}{{.T.res.EntName}}{{end}}</span>
+	<center><span class="glyphicon shixinxinxi "></span>&nbsp;&nbsp;失信信息</center>
+	<span style="float:left;font-size:11px;padding-right:10px;margin-top:-19px;" data="c_sx" onclick="childrenshow(this);">&lt;&nbsp;企业信息</span>
 </div>
 <div class="ent-dishonesty">
 	<table id="dishonestyList" class="table ent-table">

+ 21 - 11
core/src/web/templates/member/incmobile/yellowpage.html

@@ -1,7 +1,6 @@
 <div class="comnav">
-	<span></span>
-	企业黄页
-	<span style="float:right;font-size:11px;padding-right:10px;" data="c_card" onclick="childrenshow(this);">{{if .T.res.EntName}}{{.T.res.EntName}}{{end}}</span>
+	<center><span class="glyphicon zhuyaorenyuan "></span>&nbsp;&nbsp;企业名片</center>
+	<span style="float:left;font-size:11px;padding-right:10px;margin-top:-19px;" data="c_card" onclick="childrenshow(this);">&lt;&nbsp;企业信息</span>
 </div>
 <div class="combody baseinfo yellowpage">
 		<ul>
@@ -44,17 +43,28 @@
 				<span class="col-xs-11 entvar">{{.T.res.s_enturl}}</span>
 			</li>
 		{{end}}
+		{{if .T.res.i_province}}
 			<li>
 				<div class="col-xs-1 text-right">
 						<span class="glyphicon dizhi colorfont"></span>
 				</div>
-				<span class="col-xs-11 entvar">北京市海淀区北四环西路58号理想大厦1506室</span>
+				<span class="col-xs-11 entvar" id="location"></span>
 			</li>
+		<script>	
+			$(function(){
+				var p="{{.T.res.i_province}}";
+						var c="{{.T.res.i_city}}";
+						var i="{{.T.res.i_area}}";
+						var a="{{.T.res.s_address}}";
+						if(i!=""){
+						p=i;
+						}else if(c!=""){
+						p=c;
+						}
+						a=getChineseLoc(p)+a;
+						$("#location").text(a);
+			})	
+		</script>
+		{{end}}
 		</ul>
-</div>
-<script>
-var province="{{.T.res.i_province}}"
-var city="{{.T.res.i_city}}"
-var area="{{.T.res.i_area }}"
-var address="{{.T.res.s_address}}"
-</script>
+</div>

+ 10 - 2
core/src/web/templates/swordfish/searchinfolist.html

@@ -18,7 +18,12 @@ $(function(){
 	
 	var flog = {{.T.success}};
 	if (!flog){
-		$("#conlist").html('<div class="text-center"><div ><img style="width:137px;margin-top:60px;" src="/images/findnull.png"></div><div style="margin-bottom:50px;">没有找到和该关键词匹配的信息</div></div>');
+		if (s_words.length >0 ){
+			$("#conlist").html('<div class="text-center"><div ><img style="width:137px;margin-top:60px;" src="/images/findnull.png"></div><div style="margin-bottom:50px;">没有找到和该关键词匹配的信息</div></div>');
+		}else{
+			alert("000000")
+			$("#conlist").html('<div class="text-center" styl="height:300px;"></div>');
+		}
 	}else{
 		$("#searchts").removeClass("hidden");
 		var str = ""
@@ -293,7 +298,10 @@ $(function(){
 		</div>
 		<!-- 关键词提示end -->
 		<!-- 列表start -->
-		<div class="row"><div  class="col-sm-12" id="conlist"></div></div>
+		<div class="row">
+		<div  class="col-sm-12" id="conlist">
+		</div>
+		</div>
 		<!-- 列表end -->
 		<div id="more" class="hidden">
 			<div class="row">

+ 11 - 4
core/src/web/templates/swordfish/wxsearch.html

@@ -19,6 +19,10 @@
 	});
 </script>
 <style type="text/css">
+body{
+	font-size:16px !important;
+	color: #000;
+}
 .searchname{
 	background-color:#FFFFFF; 
 	border:1px solid #e5e6e9;
@@ -96,7 +100,7 @@
 }
 .searchshow{
 	border-top:1px solid #e5e6e9;
-	padding:10px 20px;
+	padding:0px 20px 10px 20px;
 }
 .wx-xhx{
 	border-top:1px solid #e5e6e9; 
@@ -107,6 +111,9 @@
 	line-height:45px;
 	cursor:hand;
 }
+.parent-node img {
+	vertical-align: sub !important;
+}
 </style>
 </head>
 <body>
@@ -116,7 +123,7 @@
 </div>
 <div class="searchshow">
 		<!--招标 start-->
-	<form action="/member/wxswordfish/searchlist" name="searchone" method="post">
+	<form action="/member/wxswordfish/searchlist" name="searchone" method="post" style="margin-bottom: auto;">
 		<div onClick="searchbiao(1)" class="searchbs" >
 		<div class="searchzhao1"><img src="{{Msg "seo" "cdn"}}/images/wxjs.png"/></div>
 		<div class="searchzhao2">查询招标公告:</div>
@@ -132,7 +139,7 @@
 		<!--招标 end-->
 		<div class="wx-xhx" ></div>
 		<!--中标 start-->
-	<form action="/member/wxswordfish/searchlist" name="searchtwo" method="post">
+	<form action="/member/wxswordfish/searchlist" name="searchtwo" method="post" style="margin-bottom: auto;">
 		<div onClick="searchbiao(2)"  class="searchbs" >
 		<div class="searchzhong1"><img src="{{Msg "seo" "cdn"}}/images/wxjs.png"/></div>
 		<div class="searchzhong2">查询中标公告:</div>
@@ -148,7 +155,7 @@
 		<!--中标 end-->
 		<div  class="wx-xhx"></div>
 		<!--企业情报 start-->
-	<form action="/member/wxswordfish/searchlist" name="searchthree" method="post">
+	<form action="/member/wxswordfish/searchlist" name="searchthree" method="post" style="margin-bottom: auto;">
 		<div onClick="searchbiao(3)"  class="searchbs" >
 		<div class="searchzhong1"><img src="{{Msg "seo" "cdn"}}/images/wxjs.png"/></div>
 		<div class="searchzhong2">查询企业情报:</div>

+ 6 - 2
core/src/web/templates/swordfish/wxsearchlist.html

@@ -137,6 +137,7 @@ $(function(){
 <style type="text/css">
 body{
 	background-color:#F0F0F0;
+	font-size:16px !important;
 }
 #ycwords>div:first-of-type{
 	display:none;
@@ -224,7 +225,7 @@ body{
     position: fixed;
     left: 0px;
     right: 0px;
-    bottom: 0px;
+    bottom: 41px;
     height: 50px;
     width: 100%;
     background-color: #37c6da;
@@ -266,6 +267,9 @@ body{
 .keyword{
 	color: #FF5A5F;
 }
+.parent-node img {
+	vertical-align: sub !important;
+}
 </style>
 </head>
 <body>
@@ -295,7 +299,7 @@ body{
 <div>没有找到和该关键词匹配的信息</div>
 </div>
 
-
+{{include "/swordfish/wxtoolbar.html"}}
 <script type="text/javascript">
 	$(".searchname").click(function(){
         window.location.href="/member/wxswordfish/search";

+ 2 - 2
core/src/web/templates/swordfish/wxtoolbar.html

@@ -1,7 +1,7 @@
 <ul class="bottom-toolbar">
 	<li class="parent-node">
 		<img src="{{Msg "seo" "cdn"}}/wxswordfish/images/sousuo.png">
-		搜索
+		信息查询
 	</li>
 	<li class="parent-node">
 		<img src="{{Msg "seo" "cdn"}}/wxswordfish/images/dingyue.png">
@@ -18,7 +18,7 @@
 			<div class="popover-arrow"></div>
 		</div>
 		<img src="{{Msg "seo" "cdn"}}/wxswordfish/images/liebiao.png">
-		列表
+		更多
 	</li>
 </ul>
 <div class="dialog share-dialog">

+ 3 - 0
weixin/src/qfw/weixin/clickhandler.go

@@ -89,6 +89,9 @@ func ClickHandler(w ResponseWriter, r *Request) {
 					UserSession[r.FromUserName] = NewUserSession("oidentify")
 				}
 			}
+		case "faq": //faq,进入机器人会话
+			UserSession[r.FromUserName] = NewUserSession("faq")
+			w.ReplyText("欢迎使用企明星智能咨询服务,请输入您要咨询的问题,输入q或Q退出咨询。")
 		case "sinfo":
 			{ //用户请求进入服务消息
 

+ 5 - 2
weixin/src/qfw/weixin/menu.go

@@ -36,7 +36,7 @@ func CreateMenu(rw http.ResponseWriter, r *http.Request) {
 		menu.Buttons[1].SubButtons[2].Key = "oidentification"
 	*/
 	menu.Buttons[2].Name = "会员服务"
-	menu.Buttons[2].SubButtons = make([]MenuButton, 4)
+	menu.Buttons[2].SubButtons = make([]MenuButton, 5)
 	menu.Buttons[2].SubButtons[0].Name = "微官网"
 	menu.Buttons[2].SubButtons[0].Type = MenuButtonTypeKey
 	menu.Buttons[2].SubButtons[0].Key = "msite" //"http://" + wf.SysConfig.Domain + "/weixin/site/edit" //微官网编辑
@@ -53,7 +53,10 @@ func CreateMenu(rw http.ResponseWriter, r *http.Request) {
 	menu.Buttons[2].SubButtons[3].Name = "我的积分/签到"
 	menu.Buttons[2].SubButtons[3].Type = MenuButtonTypeUrl
 	menu.Buttons[2].SubButtons[3].Url = fmt.Sprintf(urlstr, "signature")
-
+	//
+	menu.Buttons[2].SubButtons[4].Name = "常见问题解答"
+	menu.Buttons[2].SubButtons[4].Type = MenuButtonTypeKey ///search/enterprise/m_ent.html
+	menu.Buttons[2].SubButtons[4].Key = "faq"
 	//menu.Buttons[2].SubButtons[3].Name = "领取红包"
 	//menu.Buttons[2].SubButtons[3].Type = MenuButtonTypeUrl
 	//menu.Buttons[2].SubButtons[3].Url = "http://mp.weixin.qq.com/s?__biz=MzA5MTk0MTk5Ng==&mid=401971726&idx=1&sn=89d2470f1de7e80975223041b06c106a#rd"

+ 64 - 8
weixin/src/qfw/weixin/msgtxtchandler.go

@@ -1,9 +1,13 @@
 package weixin
 
 import (
+	"encoding/json"
 	"fmt"
+	"io/ioutil"
 	_ "log"
 	"math/rand"
+	"net"
+	"net/http"
 
 	"qfw/weixin/dao"
 	wf "qfw/weixinconfig"
@@ -12,6 +16,29 @@ import (
 	"time"
 )
 
+//图灵123机器人配置
+const (
+	APIKEY = "893b61852a7de8e3194194a0fe11917c"
+	APIURL = "http://www.tuling123.com/openapi/api"
+)
+
+var robotclient *http.Client
+
+//初始化图灵123 HttpClient加上超时
+func InitRobotHttpClient() {
+	robotclient = &http.Client{Transport: &http.Transport{
+		Dial: func(netw, addr string) (net.Conn, error) {
+			deadline := time.Now().Add(2 * time.Second)
+			c, err := net.DialTimeout(netw, addr, 2*time.Second)
+			if err != nil {
+				return nil, err
+			}
+			c.SetDeadline(deadline)
+			return c, nil
+		},
+	}}
+}
+
 //文本消息处理
 func MsgTxtHandler(w ResponseWriter, r *Request) {
 	openid := r.FromUserName
@@ -19,15 +46,12 @@ func MsgTxtHandler(w ResponseWriter, r *Request) {
 	//在会话中
 	if us, ok := UserSession[openid]; ok {
 		if r.Content == "q" || r.Content == "Q" {
-			if us.Type == "robot" {
-				w.ReplyText("再见了小主人,记得想我呦。")
+			if us.Type == "faq" {
+				w.ReplyText("您已经退出智能咨询服务。")
+			} else if us.Type == "wxadmin" {
+				w.ReplyText("您已经退出微信管理。")
 			} else {
-				if us.Type == "wxadmin" {
-					w.ReplyText("您已经退出微信管理。")
-
-				} else {
-					w.ReplyText("您已经退出企明星会员认证程序。")
-				}
+				w.ReplyText("您已经退出企明星会员认证程序。")
 			}
 			delete(UserSession, r.FromUserName)
 		}
@@ -39,6 +63,8 @@ func MsgTxtHandler(w ResponseWriter, r *Request) {
 			processOIdentifyMsgTxt(us, w, r)
 		} else if us.Type == "wxadmin" {
 			processWxAdmin(openid, r.Content, w, r)
+		} else if us.Type == "faq" {
+			processFaq(openid, r.Content, w, r)
 		}
 	} else if r.Content == "微信管理" && mids[openid] {
 		UserSession[r.FromUserName] = NewUserSession("wxadmin")
@@ -154,3 +180,33 @@ func processPIdentifyMsgTxt(us *usersession, w ResponseWriter, r *Request) {
 		w.ReplyOK()
 	}
 }
+
+//处理咨询问题
+func processFaq(userid, content string, w ResponseWriter, r *Request) {
+	rurl := fmt.Sprintf("%s?key=%s&info=%s&userid=%s", APIURL, APIKEY, content, userid)
+	resp, err1 := robotclient.Get(rurl)
+	if err1 != nil {
+		w.ReplyText("对不起,我无法理解您所咨询的问题。")
+		return
+	}
+	defer resp.Body.Close()
+	bs, err2 := ioutil.ReadAll(resp.Body)
+	if err2 != nil {
+		w.ReplyText("对不起,我无法理解您所咨询的问题。")
+		return
+	}
+	var tmp map[string]interface{}
+	err3 := json.Unmarshal(bs, &tmp)
+	if err3 != nil {
+		w.ReplyText("对不起,我无法理解您所咨询的问题。")
+		return
+	}
+	code, _ := tmp["code"].(float64)
+	if code == 100000 {
+		repl, _ := tmp["text"].(string)
+		w.ReplyText(repl)
+	} else {
+		w.ReplyText("对不起,我无法理解您所咨询的问题。")
+		return
+	}
+}

+ 1 - 1
weixin/src/qfw/weixin/weixin.go

@@ -75,7 +75,7 @@ func InitWeixinSdk() {
 	//执行其他一些初始化的动作
 	InitSSLClient()
 	util.StartSubscribeFilter(wf.SysConfig.SubscribeMonitorCyc, wf.SysConfig.SubscribeMonitorTimes)
-
+	InitRobotHttpClient()
 	//go changeMsg()
 }