detail.html 4.3 KB
{extend name="layout/default"}
{block name='title'}专家在线-问答{/block}
{block name="content"}
<style>
    .swiper-container {
        margin: 0 0.4rem;
        box-sizing: border-box;
    }

    .swiper-button-next,
    .swiper-button-prev {
        width: 0.24rem;
        height: 0.24rem;
        background-size: 0.24rem 0.24rem;
        top: 0.88rem;
    }

    .swiper-button-next {
        right: 0.1rem;
        background-image: url('/static/image/you_img.png');
    }

    .swiper-button-prev {
        left: 0.1rem;
        background-image: url('/static/image/zuo_img.png');
    }
</style>
<div class="Box">
    <!-- 专家在线 -->
    <div class="exports_Mask">
        <div class="exports_Con">
            <div class="exports_ConTxt">向{$news.name}提问</div>

            <div class="export_ConLi">
                <p class="exports_ConTxt2">*</p>
                <textarea id="ex_textarea" placeholder="请输入问题" name="question" id="" cols="30" rows="10"></textarea>
            </div>
            <div class="export_ConLi" style="margin-top:0.32rem;">
                <div class="export_ConLi2">
                    <p class="exports_ConTxt2">*</p>
                    <input id="ex_name " name="expert_id" value="{$news.id}" type="hidden" class="experts_input1">
                    <input type="text" name="name" placeholder="请输入姓名">
                </div>
                <div class="export_ConLi3">
                    <p class="exports_ConTxt2">*</p>
                    <input id="ex_phone" type="text" name="tel" placeholder="请输入手机号">
                </div>
            </div>
            <div class="release_btn experts_maskBtn" style="margin:0.98rem auto 0rem;">提交</div>
        </div>
    </div>
    <!-- 内容 -->
    <div class="list_DBox">
        <div class="experts_dBox">
            <h1 class="list_DTit">{$news.name}</h1>

            <div class="experts_Box2">
                <div class="experts_Img2"><img src="/static/image/zaixianhuida_icon.png" alt=""></div>
                <p>在线回答</p>
            </div>
        </div>
        <!-- 富文本 -->
        <div class="list_Dtext">
            {$news.content}
        </div>
        <!-- 图片 -->
        <div class="list_DImg">
            <img src="{$news.image}" alt="">
        </div>

        <!-- 轮播 -->
        <div class="world_Dbox">
            <div class="swiper-container">
                <div class="swiper-wrapper">
                    {foreach(:explode(",",$news['images']) as $image)}
                    <div class="swiper-slide">
                        <div class="world_DImg"><img src="{$image}" alt=""></div>
                    </div>
                    {/foreach}
                </div>
            </div>
            <div class="swiper-button-next"></div>
            <div class="swiper-button-prev"></div>
        </div>
    </div>
</div>
<script>
    var swiper = new Swiper('.swiper-container', {
        pagination: '.swiper-pagination',
        nextButton: '.swiper-button-next',
        prevButton: '.swiper-button-prev',
        slidesPerView:3.5,
        paginationClickable: true,
        spaceBetween: 4,
    });

    $('.experts_Box2').click(function() {
        $('.exports_Mask').show();
    });


    $('.exports_Mask').click(function() {
        $('.exports_Mask').hide();
    });
    $('.exports_Con').click(function(event) {
        event.stopPropagation();
        if ($('.exports_Con').css('display') == "block") {
            $('.exports_Mask').show();
        } else {
            $('.exports_Mask').hide();
        }
    });
    $('.experts_btn').click(function () {
        $(".experts_mask").show();
    });
    $(".experts_maskCon").click(function(event) {
        event.stopPropagation(); //不在派发事件
        $('.experts_mask').show();
    });
    $('.experts_mask').click(function () {
        $('.experts_mask').hide();
    });
    //    提交
    $('.experts_maskBtn').click(function () {
        var data=$("#myform").serialize();
        if($('#ex_textarea').val() == ''){
            w('请输入问题')
        }else if($('#ex_name').val() ==''){
            w('请输入姓名')
        }else if($('#ex_phone').val() ==''){
            w('请输入手机号')
        }else{
            ajax("/index/experts/save",data,"post",function (res) {
                w(res.msg);
            },"");
        }
    })
</script>
{/block}