Browse Source

微信版企业社区列表

wangshan 9 năm trước cách đây
mục cha
commit
6c53f46147
2 tập tin đã thay đổi với 73 bổ sung12 xóa
  1. 1 1
      core/src/timetask.json
  2. 72 11
      core/src/web/templates/member/incmobile/list.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-06-07 16:42:59"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-06-07 16:42:59"}},"marketisstart":true,"marketrate":300}
+{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-06-07 16:58:11"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-06-07 16:58:11"}},"marketisstart":true,"marketrate":300}

+ 72 - 11
core/src/web/templates/member/incmobile/list.html

@@ -1,4 +1,4 @@
-<!DOCTYPE HTML>
+<!DOCTYPE HTML> 
 <html>
  <head>
   <title> 企业社区-列表</title>
@@ -8,6 +8,19 @@
 	{{include "/common/inc.html"}}
  	<link href="{{Msg "seo" "cdn"}}/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>
+	.tipAssembly{
+		position: absolute;
+	    width: 160px;
+	    border: 1px solid #999;
+	    text-align: center;
+	    height: 50px;
+	    line-height: 50px;
+	    border-radius: 10px;
+		background-color: #ccc;
+    	color: #fff;
+	}
+	</style>
  </head>
  <body>
 	<div class="col-xs-12">
@@ -69,7 +82,7 @@
 		</strong></h6>
 	</div>
 	</div>
-	<center style="clear:both;"><a class="loadmore btn btn-link hides"  onclick="loadData();">加载更多</a></center>
+	<center style="clear:both;"><a style="line-height: 36px;" class="loadmore btn btn-link hides"  onclick="loadData();">加载更多</a></center>
 	<center class="nomore hides"><div style="margin:20px;">没有搜索到?尝试更精确的搜索条件!</div></center>
 	</div>
 	<script src="{{Msg "seo" "cdn"}}/js/jquery.js"></script>
@@ -298,23 +311,71 @@
 			$.get("/member/enterprise/isFollowed?entId="+id,function(r){
 				if (r.status=="n"){
 					$.get("/member/enterprise/follow?entId="+id+"&flag=false",function(rs){
-						TipAssembly.show("已关注");
-						me.find("i").attr("class","glyphicon yiguanzhu");
-						me.find("span").text("已关注");
-						
+						if (rs.status == "y"){
+							TipAssembly.show("已关注");
+							me.find("i").attr("class","glyphicon yiguanzhu");
+							me.find("span").text("已关注");
+						}else if(rs.status == "n"){
+							TipAssembly.show("关注失败!");
+						}else if(rs.status == "m"){
+							TipAssembly.show("您最多关注10家企业!");
+						}
 					});
 				}else{
 					$.get("/member/enterprise/follow?entId="+id+"&flag=true",function(rs){
-						
-						TipAssembly.show("已取消<br>关注");
-						me.find("i").attr("class","glyphicon weiguanzhu");
-						me.find("span").text("关注");
+						if (rs.status == "y"){
+							TipAssembly.show("已取消关注");
+							me.find("i").attr("class","glyphicon weiguanzhu");
+							me.find("span").text("关注");
+						}else if(rs.status == "n"){
+							TipAssembly.show("取消关注失败!");
+						}
 					})	;
 				}
 			})
 			  event.stopPropagation();
 		}
-		</script>
+		
+		
+//提示框
+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;
+		},1000);
+		$("body").append('<div class="tipAssembly" id="tipAssembly">'+text+'</div>');
+		if(typeof(css) != "undefined"){
+			$("#tipAssembly").css(css);
+		}
+		var height=document.body.scrollHeight
+		$("#tipAssembly").css({"left":($(window).width()-140)/2});
+		$("#tipAssembly").css({"top":(height+200)/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>
 
  </body>
 </html>