Browse Source

其他的工单列表页

develop
shuixiang 4 years ago
parent
commit
66ae1fe06b
  1. 73
      resources/views/admin/pages/guide-index.blade.php
  2. 2
      resources/views/admin/pages/index.blade.php
  3. 73
      resources/views/admin/pages/supplier-index.blade.php

73
resources/views/admin/pages/guide-index.blade.php

@ -1,43 +1,51 @@
<style> <style>
.chat-container { padding: 20px 40px; }
.chat-container { padding: 20px 40px; height: calc(100vh - 160px) }
.msg-chat { .msg-chat {
position: relative; background-color: white; padding: 40px 20px;
border-top-right-radius: 8px; border-bottom-right-radius: 8px;
position: relative; background-color: white; padding: 40px 20px 50px 20px;
border-top-right-radius: 8px; border-bottom-right-radius: 8px; height: 100%;
} }
.msg-chat-list { min-height: 800px; max-height: 800px; overflow-y: auto; overflow-x: hidden; }
.msg-chat-list { height: 100%; overflow-y: auto; overflow-x: hidden; padding-bottom: 20px; }
.msg-user { margin: 5px 0px; line-height: 30px; } .msg-user { margin: 5px 0px; line-height: 30px; }
.msg-name { display: inline-block; font-size: 14px; font-weight: bold; padding: 0px 5px; } .msg-name { display: inline-block; font-size: 14px; font-weight: bold; padding: 0px 5px; }
.msg-avatar { display: inline-block; } .msg-avatar { display: inline-block; }
.msg-avatar img { width: 30px; height: 30px; border-radius: 50%; } .msg-avatar img { width: 30px; height: 30px; border-radius: 50%; }
.msg-content { display: inline-block; background-color: #f4f4f4; padding: 20px; border-radius: 10px; } .msg-content { display: inline-block; background-color: #f4f4f4; padding: 20px; border-radius: 10px; }
.msg-content-image { max-width: 120px; max-height: 120px; } .msg-content-image { max-width: 120px; max-height: 120px; }
.msg-send { position: absolute; bottom: 0; left: 0; z-index: 999; }
.msg-send { position: absolute; bottom: 0; left: 0; z-index: 999; height: 50px; }
.msg-send .input-group-addon { width: 40px; border: none; line-height: 2.7; background-color: #dbe3e6; cursor: pointer; } .msg-send .input-group-addon { width: 40px; border: none; line-height: 2.7; background-color: #dbe3e6; cursor: pointer; }
.msg-send .input-group-addon.msg-text { background-color: #586cb1; color: white; padding: 5px 10px; width: 60px; line-height: 2.8; } .msg-send .input-group-addon.msg-text { background-color: #586cb1; color: white; padding: 5px 10px; width: 60px; line-height: 2.8; }
.msg-time { padding: 0 5px; color: gray; font-size: 12px; margin: 5px 0; } .msg-time { padding: 0 5px; color: gray; font-size: 12px; margin: 5px 0; }
.msg-list { .msg-list {
position: relative; background-color: white; position: relative; background-color: white;
border-top-left-radius: 5px; border-bottom-left-radius: 5px; min-height: 900px;
max-height: 1000px; border-right: 1px solid #dbe3e6; overflow-y: auto;
border-top-left-radius: 5px; border-bottom-left-radius: 5px;
height: 100%; border-right: 1px solid #dbe3e6; overflow-y: auto;
padding: 20px 10px; padding: 20px 10px;
} }
.msg-list-item { position: relative; border: 1px solid #dbe3e6; padding: 10px; border-radius: 5px; margin-bottom: 1px; cursor: pointer; } .msg-list-item { position: relative; border: 1px solid #dbe3e6; padding: 10px; border-radius: 5px; margin-bottom: 1px; cursor: pointer; }
.msg-list-item:hover { border-color: green; } .msg-list-item:hover { border-color: green; }
.msg-list-item.active { border: 2px solid green; box-shadow: 0px 0px 4px green; }
.msg-list-title { font-weight: bold; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; border-radius: 5px; padding: 2px 5px; overflow: hidden; text-overflow: ellipsis; margin-bottom: 5px; } .msg-list-title { font-weight: bold; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; border-radius: 5px; padding: 2px 5px; overflow: hidden; text-overflow: ellipsis; margin-bottom: 5px; }
.msg-list-content { color: gray; background-color: #f4f4f4; border-radius: 5px; padding: 2px 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .msg-list-content { color: gray; background-color: #f4f4f4; border-radius: 5px; padding: 2px 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.msg-list-badge { .msg-list-badge {
position: absolute; right: 5px; top: 5px; position: absolute; right: 5px; top: 5px;
width: 10px; height: 10px; border-radius: 10px; width: 10px; height: 10px; border-radius: 10px;
} }
/*.background-red { background-color: red; }*/
.background-red { background-color: red; }
.background-gray { background-color: gray; } .background-gray { background-color: gray; }
</style> </style>
<div class="row chat-container"> <div class="row chat-container">
<div class="col-lg-3 col-md-4 msg-list"> <div class="col-lg-3 col-md-4 msg-list">
@if(empty($user_list))
<div class="text-center">暂无工单数据</div>
@else
@foreach($user_list as $key => $item) @foreach($user_list as $key => $item)
@if($workorder['workorder_id']==$item['workorder_id'])
<div class="msg-list-item active" onclick="window.location.href = '?workorder_id={{$item['workorder_id']}}'">
@else
<div class="msg-list-item" onclick="window.location.href = '?workorder_id={{$item['workorder_id']}}'"> <div class="msg-list-item" onclick="window.location.href = '?workorder_id={{$item['workorder_id']}}'">
@endif
<div class="msg-user"> <div class="msg-user">
<div class="msg-avatar"> <div class="msg-avatar">
<img src="{{$item['avatar']}}" alt="头像" title="头像" /> <img src="{{$item['avatar']}}" alt="头像" title="头像" />
@ -55,17 +63,20 @@
<div class="msg-time"> <div class="msg-time">
{{$item['last_message_time']}} {{$item['last_message_time']}}
</div> </div>
@if($item['unread'] == true)
<div class="msg-list-badge background-red"></div>
@else
<div class="msg-list-badge background-gray"></div>
@endif
{{--@if($item['unread'] == true)--}}
{{--<div class="msg-list-badge background-red"></div>--}}
{{--@else--}}
{{--<div class="msg-list-badge background-gray"></div>--}}
{{--@endif--}}
</div> </div>
@endforeach @endforeach
@endif
</div> </div>
<div class="col-lg-9 col-md-8 msg-chat"> <div class="col-lg-9 col-md-8 msg-chat">
@if(empty($msg_list))
<div class="text-center">暂无工单数据</div>
@else
<div class="input-group input-group-lg msg-send"> <div class="input-group input-group-lg msg-send">
<input name="msg-input" type="text" class="form-control" style="border-radius: 0; border-color: #dbe3e6; text-align: center;"> <input name="msg-input" type="text" class="form-control" style="border-radius: 0; border-color: #dbe3e6; text-align: center;">
<div class="input-group-addon msg-image"><span class="fa fa-picture-o"></span></div> <div class="input-group-addon msg-image"><span class="fa fa-picture-o"></span></div>
@ -91,12 +102,12 @@
@if($item['it_type'] == 1) @if($item['it_type'] == 1)
{{$item['content']}} {{$item['content']}}
@elseif($item['it_type'] == 2) @elseif($item['it_type'] == 2)
<img class="msg-content-image" src="{{$item['content']}}" alt="图片" title="图片" />
<img class="msg-content-image" onclick="viewImage(this)" src="{{$item['content']}}" alt="图片" title="图片" />
@endif @endif
</div> </div>
<div class="msg-time"> <div class="msg-time">
2021-01-01 12:02:03
{{$item['created_at_text']}}
</div> </div>
</div> </div>
</div> </div>
@ -116,19 +127,19 @@
@if($item['it_type'] == 1) @if($item['it_type'] == 1)
{{$item['content']}} {{$item['content']}}
@elseif($item['it_type'] == 2) @elseif($item['it_type'] == 2)
<img class="msg-content-image" src="{{$item['content']}}" alt="图片" title="图片" />
<img class="msg-content-image" onclick="viewImage(this)" src="{{$item['content']}}" alt="图片" title="图片" />
@endif @endif
</div> </div>
<div class="msg-time"> <div class="msg-time">
2021-01-01 12:02:03
{{$item['created_at_text']}}
</div> </div>
</div> </div>
</div> </div>
@endif @endif
@endforeach @endforeach
</div> </div>
@endif
</div> </div>
<div class="hidden-forms"> <div class="hidden-forms">
@ -162,7 +173,7 @@
{{$user->name}} {{$user->name}}
</div> </div>
<div class="msg-avatar"> <div class="msg-avatar">
<img src="{{$user->avatar}}" alt="头像" title="头像" />
<img src="{{\Illuminate\Support\Facades\Storage::url($user->avatar)}}" alt="头像" title="头像" />
</div> </div>
</div> </div>
<div class="msg-content text-left">#contents</div> <div class="msg-content text-left">#contents</div>
@ -171,8 +182,24 @@
</div> </div>
</div> </div>
<div class="modal fade" tabindex="-1" role="dialog" id="viewImage">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<img src="" style="width: 100%; height: 100%;" />
</div>
</div>
</div>
<script src="js/helper.js" type="application/javascript"></script>
<script> <script>
Dcat.ready(function() { Dcat.ready(function() {
// 获取元素距离父级元素顶部的距离
let offsetTop = $('.msg-list-item.active').position().top
$(".msg-list").animate({ scrollTop: offsetTop - 20}, 1)
$(".msg-chat-list").animate({ scrollTop: $(".msg-chat-list")[0].scrollHeight - $('.msg-chat-list').height() + 600 }, 1)
$('.msg-image').on('click', function (e) { $('.msg-image').on('click', function (e) {
$('.image').click(); $('.image').click();
}); });
@ -190,14 +217,14 @@
contentType: false, contentType: false,
dataType: 'json', dataType: 'json',
success: function(res) { success: function(res) {
let imageUrl = 'https://hainan.lanzulive.com/'+res.data.content
let imageUrl = res.data.content
let msgTime = res.data.created_at let msgTime = res.data.created_at
let templateHtml = $('.template-my').html() let templateHtml = $('.template-my').html()
let imgDoc = '<img class="msg-content-image" src="'+imageUrl+'" alt="图片" title="图片" />'
let imgDoc = '<img class="msg-content-image" onclick="viewImage(this)" src="'+imageUrl+'" alt="图片" title="图片" />'
templateHtml = templateHtml.replace('#contents', imgDoc) templateHtml = templateHtml.replace('#contents', imgDoc)
templateHtml = templateHtml.replace('#times', msgTime) templateHtml = templateHtml.replace('#times', msgTime)
$(".msg-chat-list").append(templateHtml) $(".msg-chat-list").append(templateHtml)
$(".msg-chat-list").animate({ scrollTop: $(".msg-chat-list")[0].scrollHeight - $('.msg-chat-list').height() }, 1)
$(".msg-chat-list").animate({ scrollTop: $(".msg-chat-list")[0].scrollHeight - $('.msg-chat-list').height() + 600 }, 1)
}, },
error: function (error) { error: function (error) {
console.log(error) console.log(error)

2
resources/views/admin/pages/index.blade.php

@ -217,7 +217,7 @@
contentType: false, contentType: false,
dataType: 'json', dataType: 'json',
success: function(res) { success: function(res) {
let imageUrl = 'https://hainan.lanzulive.com/'+res.data.content
let imageUrl = res.data.content
let msgTime = res.data.created_at let msgTime = res.data.created_at
let templateHtml = $('.template-my').html() let templateHtml = $('.template-my').html()
let imgDoc = '<img class="msg-content-image" onclick="viewImage(this)" src="'+imageUrl+'" alt="图片" title="图片" />' let imgDoc = '<img class="msg-content-image" onclick="viewImage(this)" src="'+imageUrl+'" alt="图片" title="图片" />'

73
resources/views/admin/pages/supplier-index.blade.php

@ -1,43 +1,51 @@
<style> <style>
.chat-container { padding: 20px 40px; }
.chat-container { padding: 20px 40px; height: calc(100vh - 160px) }
.msg-chat { .msg-chat {
position: relative; background-color: white; padding: 40px 20px;
border-top-right-radius: 8px; border-bottom-right-radius: 8px;
position: relative; background-color: white; padding: 40px 20px 50px 20px;
border-top-right-radius: 8px; border-bottom-right-radius: 8px; height: 100%;
} }
.msg-chat-list { min-height: 800px; max-height: 800px; overflow-y: auto; overflow-x: hidden; }
.msg-chat-list { height: 100%; overflow-y: auto; overflow-x: hidden; padding-bottom: 20px; }
.msg-user { margin: 5px 0px; line-height: 30px; } .msg-user { margin: 5px 0px; line-height: 30px; }
.msg-name { display: inline-block; font-size: 14px; font-weight: bold; padding: 0px 5px; } .msg-name { display: inline-block; font-size: 14px; font-weight: bold; padding: 0px 5px; }
.msg-avatar { display: inline-block; } .msg-avatar { display: inline-block; }
.msg-avatar img { width: 30px; height: 30px; border-radius: 50%; } .msg-avatar img { width: 30px; height: 30px; border-radius: 50%; }
.msg-content { display: inline-block; background-color: #f4f4f4; padding: 20px; border-radius: 10px; } .msg-content { display: inline-block; background-color: #f4f4f4; padding: 20px; border-radius: 10px; }
.msg-content-image { max-width: 120px; max-height: 120px; } .msg-content-image { max-width: 120px; max-height: 120px; }
.msg-send { position: absolute; bottom: 0; left: 0; z-index: 999; }
.msg-send { position: absolute; bottom: 0; left: 0; z-index: 999; height: 50px; }
.msg-send .input-group-addon { width: 40px; border: none; line-height: 2.7; background-color: #dbe3e6; cursor: pointer; } .msg-send .input-group-addon { width: 40px; border: none; line-height: 2.7; background-color: #dbe3e6; cursor: pointer; }
.msg-send .input-group-addon.msg-text { background-color: #586cb1; color: white; padding: 5px 10px; width: 60px; line-height: 2.8; } .msg-send .input-group-addon.msg-text { background-color: #586cb1; color: white; padding: 5px 10px; width: 60px; line-height: 2.8; }
.msg-time { padding: 0 5px; color: gray; font-size: 12px; margin: 5px 0; } .msg-time { padding: 0 5px; color: gray; font-size: 12px; margin: 5px 0; }
.msg-list { .msg-list {
position: relative; background-color: white; position: relative; background-color: white;
border-top-left-radius: 5px; border-bottom-left-radius: 5px; min-height: 900px;
max-height: 1000px; border-right: 1px solid #dbe3e6; overflow-y: auto;
border-top-left-radius: 5px; border-bottom-left-radius: 5px;
height: 100%; border-right: 1px solid #dbe3e6; overflow-y: auto;
padding: 20px 10px; padding: 20px 10px;
} }
.msg-list-item { position: relative; border: 1px solid #dbe3e6; padding: 10px; border-radius: 5px; margin-bottom: 1px; cursor: pointer; } .msg-list-item { position: relative; border: 1px solid #dbe3e6; padding: 10px; border-radius: 5px; margin-bottom: 1px; cursor: pointer; }
.msg-list-item:hover { border-color: green; } .msg-list-item:hover { border-color: green; }
.msg-list-item.active { border: 2px solid green; box-shadow: 0px 0px 4px green; }
.msg-list-title { font-weight: bold; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; border-radius: 5px; padding: 2px 5px; overflow: hidden; text-overflow: ellipsis; margin-bottom: 5px; } .msg-list-title { font-weight: bold; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; border-radius: 5px; padding: 2px 5px; overflow: hidden; text-overflow: ellipsis; margin-bottom: 5px; }
.msg-list-content { color: gray; background-color: #f4f4f4; border-radius: 5px; padding: 2px 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .msg-list-content { color: gray; background-color: #f4f4f4; border-radius: 5px; padding: 2px 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.msg-list-badge { .msg-list-badge {
position: absolute; right: 5px; top: 5px; position: absolute; right: 5px; top: 5px;
width: 10px; height: 10px; border-radius: 10px; width: 10px; height: 10px; border-radius: 10px;
} }
/*.background-red { background-color: red; }*/
.background-red { background-color: red; }
.background-gray { background-color: gray; } .background-gray { background-color: gray; }
</style> </style>
<div class="row chat-container"> <div class="row chat-container">
<div class="col-lg-3 col-md-4 msg-list"> <div class="col-lg-3 col-md-4 msg-list">
@if(empty($user_list))
<div class="text-center">暂无工单数据</div>
@else
@foreach($user_list as $key => $item) @foreach($user_list as $key => $item)
@if($workorder['workorder_id']==$item['workorder_id'])
<div class="msg-list-item active" onclick="window.location.href = '?workorder_id={{$item['workorder_id']}}'">
@else
<div class="msg-list-item" onclick="window.location.href = '?workorder_id={{$item['workorder_id']}}'"> <div class="msg-list-item" onclick="window.location.href = '?workorder_id={{$item['workorder_id']}}'">
@endif
<div class="msg-user"> <div class="msg-user">
<div class="msg-avatar"> <div class="msg-avatar">
<img src="{{$item['avatar']}}" alt="头像" title="头像" /> <img src="{{$item['avatar']}}" alt="头像" title="头像" />
@ -55,17 +63,20 @@
<div class="msg-time"> <div class="msg-time">
{{$item['last_message_time']}} {{$item['last_message_time']}}
</div> </div>
@if($item['unread'] == true)
<div class="msg-list-badge background-red"></div>
@else
<div class="msg-list-badge background-gray"></div>
@endif
{{--@if($item['unread'] == true)--}}
{{--<div class="msg-list-badge background-red"></div>--}}
{{--@else--}}
{{--<div class="msg-list-badge background-gray"></div>--}}
{{--@endif--}}
</div> </div>
@endforeach @endforeach
@endif
</div> </div>
<div class="col-lg-9 col-md-8 msg-chat"> <div class="col-lg-9 col-md-8 msg-chat">
@if(empty($msg_list))
<div class="text-center">暂无工单数据</div>
@else
<div class="input-group input-group-lg msg-send"> <div class="input-group input-group-lg msg-send">
<input name="msg-input" type="text" class="form-control" style="border-radius: 0; border-color: #dbe3e6; text-align: center;"> <input name="msg-input" type="text" class="form-control" style="border-radius: 0; border-color: #dbe3e6; text-align: center;">
<div class="input-group-addon msg-image"><span class="fa fa-picture-o"></span></div> <div class="input-group-addon msg-image"><span class="fa fa-picture-o"></span></div>
@ -91,12 +102,12 @@
@if($item['it_type'] == 1) @if($item['it_type'] == 1)
{{$item['content']}} {{$item['content']}}
@elseif($item['it_type'] == 2) @elseif($item['it_type'] == 2)
<img class="msg-content-image" src="{{$item['content']}}" alt="图片" title="图片" />
<img class="msg-content-image" onclick="viewImage(this)" src="{{$item['content']}}" alt="图片" title="图片" />
@endif @endif
</div> </div>
<div class="msg-time"> <div class="msg-time">
2021-01-01 12:02:03
{{$item['created_at_text']}}
</div> </div>
</div> </div>
</div> </div>
@ -116,19 +127,19 @@
@if($item['it_type'] == 1) @if($item['it_type'] == 1)
{{$item['content']}} {{$item['content']}}
@elseif($item['it_type'] == 2) @elseif($item['it_type'] == 2)
<img class="msg-content-image" src="{{$item['content']}}" alt="图片" title="图片" />
<img class="msg-content-image" onclick="viewImage(this)" src="{{$item['content']}}" alt="图片" title="图片" />
@endif @endif
</div> </div>
<div class="msg-time"> <div class="msg-time">
2021-01-01 12:02:03
{{$item['created_at_text']}}
</div> </div>
</div> </div>
</div> </div>
@endif @endif
@endforeach @endforeach
</div> </div>
@endif
</div> </div>
<div class="hidden-forms"> <div class="hidden-forms">
@ -162,7 +173,7 @@
{{$user->name}} {{$user->name}}
</div> </div>
<div class="msg-avatar"> <div class="msg-avatar">
<img src="{{$user->avatar}}" alt="头像" title="头像" />
<img src="{{\Illuminate\Support\Facades\Storage::url($user->avatar)}}" alt="头像" title="头像" />
</div> </div>
</div> </div>
<div class="msg-content text-left">#contents</div> <div class="msg-content text-left">#contents</div>
@ -171,8 +182,24 @@
</div> </div>
</div> </div>
<div class="modal fade" tabindex="-1" role="dialog" id="viewImage">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<img src="" style="width: 100%; height: 100%;" />
</div>
</div>
</div>
<script src="js/helper.js" type="application/javascript"></script>
<script> <script>
Dcat.ready(function() { Dcat.ready(function() {
// 获取元素距离父级元素顶部的距离
let offsetTop = $('.msg-list-item.active').position().top
$(".msg-list").animate({ scrollTop: offsetTop - 20}, 1)
$(".msg-chat-list").animate({ scrollTop: $(".msg-chat-list")[0].scrollHeight - $('.msg-chat-list').height() + 600 }, 1)
$('.msg-image').on('click', function (e) { $('.msg-image').on('click', function (e) {
$('.image').click(); $('.image').click();
}); });
@ -190,14 +217,14 @@
contentType: false, contentType: false,
dataType: 'json', dataType: 'json',
success: function(res) { success: function(res) {
let imageUrl = 'https://hainan.lanzulive.com/'+res.data.content
let imageUrl = res.data.content
let msgTime = res.data.created_at let msgTime = res.data.created_at
let templateHtml = $('.template-my').html() let templateHtml = $('.template-my').html()
let imgDoc = '<img class="msg-content-image" src="'+imageUrl+'" alt="图片" title="图片" />'
let imgDoc = '<img class="msg-content-image" onclick="viewImage(this)" src="'+imageUrl+'" alt="图片" title="图片" />'
templateHtml = templateHtml.replace('#contents', imgDoc) templateHtml = templateHtml.replace('#contents', imgDoc)
templateHtml = templateHtml.replace('#times', msgTime) templateHtml = templateHtml.replace('#times', msgTime)
$(".msg-chat-list").append(templateHtml) $(".msg-chat-list").append(templateHtml)
$(".msg-chat-list").animate({ scrollTop: $(".msg-chat-list")[0].scrollHeight - $('.msg-chat-list').height() }, 1)
$(".msg-chat-list").animate({ scrollTop: $(".msg-chat-list")[0].scrollHeight - $('.msg-chat-list').height() + 600 }, 1)
}, },
error: function (error) { error: function (error) {
console.log(error) console.log(error)

Loading…
Cancel
Save