1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- 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()
- });
- })
|