123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- import '../../css/bootstrap.less';
- import 'bootstrap/dist/js/bootstrap.js';
- import '../../css/public.css';
- import '../../js/public.js';
- import '../../css/thinkTank/thinkerDetail.css';
- import {
- message
- } from '../tools.js';
- var addConsultorder = function () {
- let userId = $('#userId').val();
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/user/consultorder/add',
- data: {
- toUserId: userId
- },
- success: function (data) {
- if (data.error && data.error.length) {
- message(data.error[0].message);
- } else {
- message('提交会员服务订单成功!');
- setTimeout("window.location.href = globalConfig.context + '/user/account/index.html#consultList'", 3000);
- };
- }.bind(this)
- });
- };
- var consultClick = function () {
- $.ajax({
- method: "get",
- dataType: "json",
- url: globalConfig.context + "/api/user/consultorder/price"
- }).done(function (data) {
- if (data.error && data.error.length) {
- message(data.error[0].message);
- } else {
- $('#modal-content').empty();
- $('#modal-content').append("预约该专家的线下咨询需要支付 " + data.data + " 元的咨询费,是否确认提交预约订单?");
- $('#myModal').modal('show');
- }
- });
- };
- $(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)
- // }
- //});
- $('#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;
- }
- }
- });
- }
- });
- $(".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 isIntereste=$("#isInterester").attr("isInterester");
- if(isIntereste==0){
- $(".loves>span:nth-child(3)").removeClass("box_love").addClass("bj_love");
- }else if(isIntereste==1){
- $(".loves>span:nth-child(3)").removeClass("bj_love").addClass("box_love");
- }
- var t=0;
- $('.box_dianji').click(function(){
- var theId=$("#demand_id").attr("val");
- var islogin=$("#isLogin").attr("islogin");
- if(islogin=="true"){
- $(".head_login").click();
- }
- if($(this).find('.loves>span:nth-child(3)').hasClass('box_love')&&islogin=="false"){
- t=$('.dem_number').text();
- $('.dem_number').text(parseInt(t)+1);
- $(this).find('.loves>span:nth-child(3)').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('.loves>span:nth-child(3)').hasClass('bj_love')&&islogin=="false"){
- t=$('.dem_number').text();
- $('.dem_number').text(parseInt(t)-1)
- $(this).find('.loves>span:nth-child(3)').addClass('box_love').removeClass('bj_love')
- $.ajax({
- method: "post",
- dataType: "json",
- url: globalConfig.context + "/api/user/portal/demandCancelInterest",
- data: {
- id:theId
- },
- success: function (data) {
- }
- });
- }
- })
- })
|