dengzhiguo 7 years ago
parent
commit
1f214466bc
2 changed files with 43 additions and 15 deletions
  1. 1 1
      src/css/thinkTank/thinkerDetail.css
  2. 42 14
      src/js/thinkTank/thinkerDetail.js

+ 1 - 1
src/css/thinkTank/thinkerDetail.css

@@ -38,7 +38,7 @@
 .right_text>div{width:445px;height:30px;}
 .right_text>div>h5{display: inline-block;font-weight: bold;font-size: 16px;width:100px;
     color:#3A3A3A;}
-.right_text>div>p{display: inline-block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}
+.right_text>div>p{display: inline-block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;width:330px;}
 .right_btn{width:445px;height:50px;}
 .right_btn>div{width:150px;height:50px;line-height: 50px;
     text-align: center;border: 1px solid #D7D5D5;display: inline-block;

+ 42 - 14
src/js/thinkTank/thinkerDetail.js

@@ -6,8 +6,9 @@ import '../../css/thinkTank/thinkerDetail.css';
 import {
     message
 } from '../tools.js';
-
+console.log(111);
 var addConsultorder = function () {
+
     let userId = $('#userId').val();
     $.ajax({
         method: "post",
@@ -24,7 +25,7 @@ var addConsultorder = function () {
                 message('提交会员服务订单成功!');
                 setTimeout("window.location.href = globalConfig.context + '/user/account/index.html#consultList'", 3000);
             };
-        }.bind(this),
+        }.bind(this)
     });
 };
 var consultClick = function () {
@@ -44,19 +45,46 @@ var consultClick = function () {
 };
 
 $(function () {
-    $('#consultBtn').click(function () {
-        if (userData && userData.mobile) {
-            if (userData.lvl > 0) {
-                consultClick()
-            } else {
-                message('请先进行实名认证,通过以后才能申请高级会员!');
-                setTimeout("window.location.href = globalConfig.context + '/user/account/index.html#normal'", 3000);
-            }
-        } else {
-            $('.login').fadeIn(800)
-        }
-    });
+    //$('#consultBtn').click(function () {
+    //    if (userData && userData.mobile) {
+    //        if (userData.lvl > 0) {
+    //            consultClick()
+    //        } else {
+    //            message('请先进行实名认证,通过以后才能申请高级会员!');
+    //            setTimeout("window.location.href = globalConfig.context + '/user/account/index.html#normal'", 3000);
+    //        }
+    //    } else {
+    //        $('.login').fadeIn(800)
+    //    }
+    //});
     $('#submitOrder').click(function () {
         addConsultorder()
     });
+    $("#consultBtn").click(function(){
+        var isLogin=$("#isLogin").attr("islogin");
+        if(isLogin=="true"){
+            $(".head_login").click();
+        }else{
+            var theId = $(".right_btn").attr('val');
+            $.ajax({
+                method: "post",
+                dataType: "json",
+                url: globalConfig.context + "/api/user/consultorder/add",
+                data: {
+                    toUserId:theId
+                },
+                success: function (data) {
+                    if (data.error && data.error.length) {
+                        $('#msg').val(data.error[0].message);
+                        msg();
+                    }else if(data.error==""){
+                        window.open(globalConfig.context+ '/user/account/index.html#consultList');
+                    }else{
+                        return;
+                    }
+                }
+            });
+        }
+
+    });
 })