123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- @extends('mobile.module.layouts.content')
- @push('meta')
- <meta name="csrf-token" content="{{ csrf_token() }}">
- @endpush
- @push('css')
- <link href="{{ theme_asset('mobile/css/company.css') }}" rel="stylesheet">
- @endpush
- @push('js')
- <script src="{{ theme_asset('mobile/js/dropload.min.js') }}"></script>
- @endpush
- @section('content')
- @if($company)
- <div class="pmslist-img for-event last" onClick="javascript:location.href='{{ route($sub_site.'mobile.jobs.company',['id'=>$company->id]) }}'">
- <div class="pic">
- <img src="{{ upload_asset($company->logo) }}">
- </div>
- <div class="describe font12">
- <div class="tit font14 substring">{{ $company->companyname }}<span class="font12">( {{ get_category($company->nature) }} | {{ get_category($company->scale) }} | {{ get_category($company->trade) }} )</span>
- </div>
- <div class="txt substring">{{ $company->address }}</div>
- </div>
- <div class="arrow"></div>
- <div class="clear"></div>
- </div>
- @endif
- <div class="split-block"></div>
- <div class="drop_content">
- <div class="add_data">
- @if($msg->total())
- @foreach($msg as $key =>$val)
- @if($val->from_uid==auth('web-member')->user()->id)
- <div class="pmsshow-right">
- <div class="txt">{!! $val->message !!}
- <div class="times font10">{{ $val->created_at }}</div>
- <div class="arrow"></div>
- </div>
- <div class="pic">
- <img id="person_images" src="{{ upload_asset($val->memberInfo->images) }}">
- </div>
- <div class="clear"></div>
- </div>
- @else
- <div class="pmsshow-left">
- <div class="pic">
- <img src="{{ upload_asset($val->company->logo) }}">
- </div>
- <div class="txt">{!! $val->message !!}
- <div class="times font10">{{ $val->created_at }}</div>
- <div class="arrow"></div>
- </div>
- <div class="clear"></div>
- </div>
- @endif
- <div class="split-block"></div>
- @endforeach
- <input id="parent_id" type="hidden" value="{{ $company->parent_id or '' }}">
- <input id="to_uid" type="hidden" value="{{ $company->to_uid or '' }}">
- @else
- <img id="person_images" src="">
- @endif
- </div>
- </div>
- <div id="send" class="pmsreply">
- <div class="replybox">
- <div class="inputbox">
- <input id="J_val" type="text" placeholder="请输入咨询内容">
- </div>
- <div class="btnbox">
- <div id="J_btn" class="qs-btn qs-btn-medium qs-btn-blue">发送</div>
- </div>
- </div>
- <div class="clear"></div>
- </div>
- @endsection
- @section('script')
- <script src="{{ theme_asset('mobile/js/qscrollTo.js') }}"></script>
- <script type="text/javascript">
- var parent_id = $("#parent_id").val();
- $(function () {
- var page = 1;
- $('.drop_content').dropload({
- scrollArea : window,
- loadDownFn : function(me){
- page++;
- $.ajax({
- type: 'GET',
- url: '{{ route($sub_site.'mobile.person.msg') }}?parent_id='+parent_id+'&page='+page,
- dataType: 'json',
- success: function(result){
- if (result.status ==1) {
- $('.add_data').append(result.data);
- } else {
- // 锁定
- me.lock();
- // 无数据
- me.noData();
- }
- me.resetload();
- },
- error: function(xhr, type){
- alert('Ajax error!');
- // 即使加载出错,也得重置
- me.resetload();
- }
- });
- },
- threshold : 50
- });
- })
- $('#J_btn').on('click',function(){
- var perosn_images = $("#person_images").val();
- var t = $.trim($('#J_val').val()),
- parent_id = $("#parent_id").val(),
- to_uid = $("#to_uid").val();
- if(t == ''){
- qsToast({type:2,context:'回复内容不能为空'});
- return false;
- }
- if(parent_id == '' || to_uid==''){
- qsToast({type:2,context:'请等待该企业的回复!'});
- return false;
- }
- $.ajax({
- headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')},
- url: "{{ route($sub_site.'mobile.person.msg_send') }}",
- type: 'POST',
- dataType: 'json',
- data: {parent_id:parent_id,to_uid:to_uid,message:t},
- success: function (result) {
- var h = '<div class="pmsshow-right"><div class="txt">'+t+'<div class="times font10">刚刚</div><div class="arrow"></div></div><div class="pic"><img src="'+perosn_images+'"></div><div class="clear"></div></div><div class="split-block"></div>';
- $('html,body').animate({'scrollTop':$(document).height()},500);
- $('#send').before(h);
- $('#J_val').val('');
- $('body').scrollTo({
- toT : $('body').height(),
- durTime: 500
- })
- qsToast({type:1,context: '留言成功!'});
- },
- error: function (errorData) {
- if (errorData.status==422) {//验证错误
- $.each(JSON.parse(errorData.response).errors,function (key,val) {
- qsToast({type:2,context: val[0]});
- return false;
- });
- }
- else if(errorData.status==400) {//业务错误
- qsToast({type:2,context: JSON.parse(errorData.response).message});
- return false;
- }
- }
- })
- });
- </script>
- @endsection
|