Browse Source

修改了一些bug
1.改成:未匹配到企业名称
2.列表中所在地取到市即可,以免折行
3.变更详细信息,页面改成不固定。
4.企业概况,注册资本的图标改成一摞硬币
5.详细首页注销 颜色没有改变

李广朋 9 years ago
parent
commit
acbdaf236a

+ 7 - 3
core/src/qfw/search/wxsearchservice.go

@@ -7,7 +7,6 @@ import (
 	"github.com/go-xweb/xweb"
 	"github.com/p/mahonia"
 	"html/template"
-	"log"
 	"qfw/coreutil"
 	"qfw/mobile"
 	. "qfw/util"
@@ -35,7 +34,7 @@ func (n *Wxsearch) WxgetEnterpriseList(reqType, param /*参数*/ string) error {
 		//请求是表单提交,走的查询
 		//拼装查询对象
 		querymap := map[string]string{ //"words": n.GetString("s_value"),
-			"perPage":     n.GetString("perPage"),
+			"perPage":     "20",
 			"currentPage": n.GetString("currentPage"),
 			"query":       n.GetString("words"),
 			"city":        n.GetString("city"),
@@ -55,6 +54,9 @@ func (n *Wxsearch) WxgetEnterpriseList(reqType, param /*参数*/ string) error {
 		}
 		rs := FormatData(data)
 		querymap["entcard"] = n.GetString("mingpian")
+		if n.GetString("currentPage") != "" {
+			return n.Write(rs)
+		}
 		n.Render("/member/incmobile/list.html", &xweb.T{"data": rs, "querymap": querymap})
 	} else {
 		//反转生成map
@@ -71,8 +73,10 @@ func (n *Wxsearch) WxgetEnterpriseList(reqType, param /*参数*/ string) error {
 
 func FormatData(data *[]map[string]interface{}) string {
 	entinfos := make([]map[string]string, 0)
+	if data == nil {
+		return ""
+	}
 	for _, v := range *data {
-		log.Println(v)
 		tmp := map[string]string{
 			"_id":           fmt.Sprint(v["_id"]),
 			"EntName":       fmt.Sprint(v["EntName"]),

+ 0 - 1
core/src/web/staticres/css/mobile/incmobile.css

@@ -535,7 +535,6 @@ hr.list{
 	width: 100%;
 }
 .creditrules div.content{
-	height: 380px;
 	overflow-y: scroll;
 	padding: 10px 20px;
 }

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

@@ -14,7 +14,7 @@
 						<div>
 							<span onclick="viewcontent(this);">查看详情</span>
 							<div class="hides content">
-							变更前:{{$v.AltBe}}打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方打发第三方<br>变更后:{{$v.AltAf}}
+							变更前:{{$v.AltBe}}<br>变更后:{{$v.AltAf}}
 							</div>
 						</div>
 						<a></a>
@@ -57,7 +57,7 @@
 	</div>
 	</div>
 </div>
-<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 style="position: absolute;width:100%;z-index:4410;background:#FFF;bottom: 0;display:none;font-size:12px;overflow:auto;min-height:150px;" class="creditrules">
 		<div class="title">
 			详细变更信息
 			<button class="btn btn-link navcolor " style="float:right;"onclick="$(this).parent().parent().hide();$('.modal-backdrop').hide()" >确定</button>

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

@@ -36,7 +36,7 @@
 		{{if and .T.res.RegCap .T.res.EntType}}
 			{{if and (ne .T.res.EntType "9600") (ne .T.res.EntType "5810") (ne .T.res.EntType "4540") (ne .T.res.EntType "4533")}}
 				<div class="col-xs-4">
-					<img src="/images/entcommunity/ziben.png"  width=14 />
+					<img src="/images/entcommunity/zhuceziben.png"  width=14 />
 					<span class="ent">注册资本</span>
 				</div>
 				<span class="col-xs-8 entvar">

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

@@ -71,13 +71,21 @@
 			</div > 
 			<div class="col-xs-12" style="text-align:center;clear:both;">
 				<div  class="type">{{.T.res.EntTypeName}}</div>
-				<div class="taupe {{if eq .T.res.OpStateName "注销" "吊销" "吊销未注销"}}ent-status-r{{else}}ent-status-g{{end}}">
+				<div class="taupe" id="opstate">
 				<script>
 					var OpStateName = {{.T.res.OpStateName}};
+					var node=document.getElementById("opstate")
 					if(OpStateName.length > 2){
 						OpStateName = OpStateName.substring(0,2);
 					}
-					document.write(OpStateName);
+					if(OpStateName=="注销" || OpStateName=="吊销"){
+						node.className=node.className+" ent-status-r"
+						document.write(OpStateName);
+					}else{
+						node.className=node.className+" ent-status-g"
+						document.write("存续");
+					}
+					
 				</script>
 				</div>
 			<!--	<div  class="abn" >经营异常</div>-->

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

@@ -118,12 +118,12 @@ function getmpname(serverId){
         success:function(obj){
 			if(obj["on"]=="y"){
 				if(obj["names"]==""){
-					alert("未匹配的对应的名称");
+					alert("未匹配到企业名称");
 				}else{
 					if (obj["names"].length>0){
 						$("#query").val(obj["names"][0]);
 						$("#i_mingpian").val("1");
-						$("#mingpian").val(obj.join(","));
+						$("#mingpian").val(obj["names"].join(","));
 						$("#search").submit();	
 					}else{
 						alert("没有成功识别!");

+ 33 - 7
core/src/web/templates/member/incmobile/list.html

@@ -100,7 +100,6 @@
 							tip=tip.replace(flag,"”<a>"+cards[i]+"</a>”");
 						}
 					}
-					console.log(tip);
 				$("#case2 strong").append(tip);
 				$("#finderror a").click(function(n){
 					$("#query").val($(n.target).text());
@@ -119,7 +118,7 @@
 		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="";
+			   var li="";
 				var len=i+5;
 				if (data.length<5 || data.length-i<5){
 					len=data.length;
@@ -129,6 +128,10 @@
 					if (data[i]["OpStateName"].indexOf("在营")>-1){
 						data[i]["OpStateName"]="存续";
 					}
+					var	loc=data[i]["OpLocDistrict"];
+					if(loc.length>6){
+						data[i]["OpLocDistrict"]=loc.substr(0,loc.lastIndexOf(" "));
+					}
 					var tmp=strVar.replace("$EntName",data[i]["EntName"])
 											 .replace("$RegNo",data[i]["RegNo"])
 											 .replace("$LeRep",data[i]["LeRep"])
@@ -144,8 +147,7 @@
 					li=li+tmp;
 				}
 				if(i==data.length){
-					$(".loadmore").hide();
-					$(".nomore").show();
+					ajaxFrom();
 				}
 				$(".inclist").append($(li));
 		}
@@ -155,6 +157,7 @@
 		var shareTitle = "企业社区";
 		var shareLink = "http://www.qimingxing.info/wx/search/enterprise/list.html";
 		var shareIcon = "";
+		var currentPage=1;
 		if(typeof(signature) != "undefined" && signature != null && signature.length == 4){
 			wx.config({
 			    debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
@@ -226,12 +229,12 @@
 	        success:function(obj){
 				if(obj["on"]=="y"){
 					if(obj["names"]==""){
-						alert("未匹配的对应的名称");
+						alert("未匹配到企业名称");
 					}else{
 						if (obj["names"].length>0){
 							$("#query").val(obj["names"][0]);
 							$("#i_mingpian").val("1");
-							$("#mingpian").val(obj.join(","));
+							$("#mingpian").val(obj["names"].join(","));
 							$("#search").submit();	
 						}else{
 							alert("没有成功识别!");
@@ -243,7 +246,30 @@
 	        } 
 	    }); 
 	}
-	
+	function ajaxFrom(){
+			var query={
+				"words":$("#query").val(),
+				"city":$("#citys").val(),
+				"c_hfl":$("#c_hfl").val(),
+				"c_zb":$("#c_zb").val(),
+				"currentPage":++currentPage
+			};
+			$.ajax({
+				url:"/wx/search/enterprise/list.html",
+				data:query,
+				type:"post",
+				dataType:"json",
+				success:function(r){
+					if (typeof(r)=="object"){
+							data=data.concat(r);
+							
+					}else{
+						$(".loadmore").hide();
+						$(".nomore").show();
+					}
+				}
+			});
+		}
 		</script>
 
  </body>

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

@@ -8,7 +8,7 @@
     <div class="b-adver-content newsInfo">
      <ul>
 			{{range $k,$v := .T.relevantNews}}
-				<li>
+				<li onclick="hreflink(this);">
 					<script>
 						var l_comeintime = {{$v.l_comeintime}};
 						l_comeintime = new Date(Number(l_comeintime+"000")).Format("yyyy-MM-dd hh:mm:ss");
@@ -26,4 +26,10 @@
     </div> 
    </div> 
   </div>
-</div>
+</div>
+<script>
+	function hreflink(me){
+		var link=$(me).find("a").attr("href");
+		window.location.href=link;
+	}
+</script>