dengzhiguo 7 years ago
parent
commit
5f8c73fce4
1 changed files with 52 additions and 2 deletions
  1. 52 2
      src/js/thinkTank/thinkerDetail.js

+ 52 - 2
src/js/thinkTank/thinkerDetail.js

@@ -6,9 +6,8 @@ import '../../css/thinkTank/thinkerDetail.css';
 import {
     message
 } from '../tools.js';
-console.log(111);
-var addConsultorder = function () {
 
+var addConsultorder = function () {
     let userId = $('#userId').val();
     $.ajax({
         method: "post",
@@ -87,4 +86,55 @@ $(function () {
         }
 
     });
+    $(".achieve_cont>a>div>span").click(function(){
+		var biaozhi=$(this).attr("val");
+		if(!biaozhi){
+			var p_width=$(this).siblings("p").height();
+			$(this).addClass("active").attr("val","yes").parent().animate({"height":p_width},500);
+		}else if(biaozhi=="yes"){
+			$(this).removeClass("active").attr("val","").parent().animate({"height":45},500);
+		}
+	});
+	//点击感兴趣
+    var t=0;
+    $('.basic .loves').click(function(){
+        var theId=$("#demand_id").attr("val");
+        var islogin=$("#isLogin").attr("islogin");
+        if(islogin=="true"){
+            $(".head_login").click();
+        }
+    	if($(this).find('span:first-child').hasClass('box_love')&&islogin=="false"){
+    		t=$('.dem_number').text();            		
+    	    $('.dem_number').text(parseInt(t)+1);
+    	    $(this).find('span:first-child').addClass('bj_love').removeClass('box_love');
+            $.ajax({
+                method: "post",
+                dataType: "json",
+                url: globalConfig.context + "/api/user/portal/demandInterest",
+                data: {
+                    id:theId
+                },
+                success: function (data) {
+
+                }
+            });
+    	    return false;
+    	}   	    	
+    	if($(this).find('span:first-child').hasClass('bj_love')&&islogin=="false"){
+    		t=$('.dem_number').text();         		
+    	    $('.dem_number').text(parseInt(t)-1)
+    	    $(this).find('span:first-child').addClass('box_love').removeClass('bj_love')
+            $.ajax({
+                method: "post",
+                dataType: "json",
+                url: globalConfig.context + "/api/user/portal/demandCancelInterest",
+                data: {
+                    id:theId
+                },
+                success: function (data) {
+
+                }
+            });
+    	}    	   	
+    })
 })