Skip to content

Commit

Permalink
fix: 系统通知,举报被后台处理后,在通知列表显示空白内容 #775
Browse files Browse the repository at this point in the history
  • Loading branch information
boxshadow committed Jul 2, 2019
1 parent dc8d19d commit 54c221c
Showing 1 changed file with 153 additions and 46 deletions.
199 changes: 153 additions & 46 deletions packages/zhiyicx-plus-pc/resources/views/message/notifications.blade.php
Original file line number Diff line number Diff line change
@@ -1,114 +1,221 @@
@php
use function Zhiyi\Component\ZhiyiPlus\PlusComponentPc\getTime;
@endphp
@if (!empty($notifications))
@if (count($notifications) > 0)
<ul class="tz-cont">
@foreach($notifications as $noti)
@php
$ref = $noti['data'];
@endphp
<li>
<div class="tz-content">
@switch($ref['type'])
@switch($noti['data']['type'] ?? '0')
@case('reward')
<a href="{{route('pc:mine', ['user' => $ref['sender']['id']])}}">
{{ $ref['sender']['name'] }}打赏了你
<a href="{{route('pc:mine', ['user' => $noti['data']['sender']['id']])}}">
{{ $noti['data']['sender']['name'] }}打赏了你
</a>
@break
@case('pinned:feeds')
<a href="{{route('pc:feedread', ['feed' => $noti['data']['feed']['id']])}}">
@if($noti['data']['state'] === 'passed')
你的动态已经成功置顶
@else
管理员拒绝了你的动态置顶申请
@endif
</a>
@break
@case('reward:feeds')
<a href="{{route('pc:feedread', ['feed'=>$ref['feed_id']])}}">
{{ $ref['sender']['name'] }}打赏了你的动态
<a href="{{route('pc:feedread', ['feed'=>$noti['data']['feed_id']])}}">
{{ $noti['data']['sender']['name'] }}打赏了你的动态
</a>
@break
@case('group:report-post')
<a href="{{route('pc:groupreport', ['group_id'=>$noti['data']['group']['id']])}}">
{{ $noti['data']['sender']['name'] }} 举报了帖子「{{$noti['data']['post']['title']}}
</a>
@break
@case('group:report')
你举报的内容已{{$noti['data']['state'] === 'rejected' ? '被驳回' : '通过'}}
@break
@case('group:audit')
<a href="{{route('pc:groupread', ['group_id'=>$noti['data']['group']['id']])}}">
你创建的圈子「{{ $noti['data']['group']['name'] }}」已通过审核
</a>
@break
@case('group:exit')
<a href="{{route('pc:groupread', ['group_ic' => $noti['data']['group']['id']])}}">
{{ $noti['data']['user']['name'] }}退出了圈子「{{ $noti['data']['group']['name'] }}
</a>
@break
@case('news:audit')
<a href="{{route('pc:newsread', ['news'=>$noti['data']['news']['id']])}}">
{{ $noti['data']['contents'] ?? ''}}
</a>
@break
@case('news:reject')
<a href="{{route('pc:newsrelease', ['news_id'=>$noti['data']['news']['id']])}}">
{{ $noti['data']['contents'] ?? ''}}
</a>
@break
@case('reward:news')
<a href="{{route('pc:newsread', ['news'=>$ref['news']['id']])}}">
你的资讯《{{ $ref['news']['title'] }}》被{{ $ref['sender']['name'] }}
打赏了{{ $ref['amount'].$ref['unit'] }}
<a href="{{route('pc:newsread', ['news'=>$noti['data']['news']['id']])}}">
你的资讯《{{ $noti['data']['news']['title'] }}》被{{ $noti['data']['sender']['name'] }}
打赏了{{ $noti['data']['amount'].$noti['data']['unit'] }}
</a>
@break
@case('group:post-reward')
<a href="{{route('pc:grouppost', ['group_id'=>$ref['group_id'], ''=>$ref['post']['id']])}}">
你的帖子「{{ $ref['post']['title'] }}」被{{ $ref['sender']['name'] }}打赏了
<a href="{{route('pc:grouppost', ['group_id' => $noti['data']['group_id'], 'post_id' => $noti['data']['post']['id']])}}">
你的帖子「{{ $noti['data']['post']['title'] }}」被{{ $noti['data']['sender']['name'] }}打赏了
</a>
@break
@case('group:join')
@if($ref['state'] ?? 'accept'== 'rejected')
<a href="{{route('pc:groupread', ['group_id'=>$ref['group']['id']])}}">
拒绝用户加入「{{ $ref['group']['name'] }}」圈子
@if(isset($noti['data']['state']) && $noti['data']['state'] && $noti['data']['state'] === 'rejected')
<a href="{{route('pc:groupread', ['group_id'=>$noti['data']['group']['id']])}}">
你被拒绝加入「{{ $noti['data']['group']['name'] }}」圈子
</a>
@elseif(isset($noti['data']['state']) && $noti['data']['state'] && $noti['data']['state'] === 'passed')
<a href="{{route('pc:groupread', ['group_id'=>$noti['data']['group']['id']])}}">
你被同意加入「{{ $noti['data']['group']['name'] }}」圈子
</a>
@else
<a href="{{route('pc:groupread', ['group_id'=>$ref['group']['id']])}}">
{{ $ref['user'] ? $ref['user']['name'] : ''}}请求加入圈子「{{ $ref['group']['name'] }}
<a href="{{route('pc:groupread', ['group_id'=>$noti['data']['group']['id']])}}">
{{ $noti['data']['user'] ? $noti['data']['user']['name'] : ''}}
请求加入圈子「{{ $noti['data']['group']['name'] }}
</a>
@endif
@break
@case('user-certification')

<a href="{{route('pc:authenticate')}}">
@if($ref['state'] === 'rejected')
你申请的身份认证已被驳回,驳回理由:{{ $ref['contents'] }}
@if($noti['data']['state'] === 'rejected')
你申请的身份认证已被驳回,驳回理由:{{ $noti['data']['contents'] }}
@else
你申请的身份认证已通过
@endif
</a>
@break
@case('qa:answer-adoption')
@case('question:answer')
<a href="{{route('pc:answeread', ['question'=>$ref['question']['id'],'answer'=>$ref['answer']['id']])}}">
<a href="{{route('pc:answeread', ['question'=>$noti['data']['question']['id'],'answer'=>$noti['data']['answer']['id']])}}">
你提交的问题回答被采纳
</a>
@break
@case('question:answer')
<a href="{{route('pc:answeread', ['question'=> $noti['data']['question']['id'], 'answer' => $noti['data']['answer']['id']])}}">
{{$noti['data']['sender']['name']}} 回答了你的问题「{{$noti['data']['question']['subject']}}
</a>
@break
@case('qa:reward')
<a href="{{route('pc:answeread', ['question'=>$ref['answer']['question_id'],'answer'=>$ref['answer']['id']])}}">
{{ $ref['sender']['name'] }}打赏了你的回答
<a href="{{route('pc:answeread', ['question'=>$noti['data']['answer']['question_id'],'answer'=>$noti['data']['answer']['id']])}}">
{{ $noti['data']['sender']['name'] }}打赏了你的回答
</a>
@break
@case('qa:question-excellent:accept')
<a href="{{route('pc:questionread', ['question'=>$noti['data']['application']['question']['id']])}}">
你的问题「{{ $noti['data']['application']['question']['subject'] }}」申请精华的请求已被通过
</a>
@break
@case('qa:question-excellent:reject')
<a href="{{route('pc:questionread', ['question'=>$noti['data']['application']['question']['id']])}}">
你的问题「{{ $noti['data']['application']['question']['subject'] }}」申请精华的请求已被拒绝
</a>
@break
@case('qa:invitation')
<a href="{{route('pc:questionread', ['question'=>$ref['question']['id']])}}">
{{ $ref['sender']['name'] }}邀请你回答问题「{{ $ref['question']['subject'] }}
<a href="{{route('pc:questionread', ['question'=>$noti['data']['question']['id']])}}">
{{ $noti['data']['sender']['name'] }}邀请你回答问题「{{ $noti['data']['question']['subject'] }}
</a>
@break
@case('qa:question-topic:passed')
<a href="{{route('pc:topicinfo', ['topic'=>$noti['data']['topic_application']['id']])}}">
你的专题「{{ $noti['data']['topic_application']['name'] }}」申请已通过!
</a>
@break
@case('qa:question-topic:reject')
你的专题「{{ $noti['data']['topic_application']['name'] }}」申请已被拒绝!
@break
@case('pinned:feed/comment')
<a href="{{route('pc:feedread', ['feed'=>$ref['feed']['id']])}}">
@if($ref['state'] ?? 'accept' == 'rejected')
拒绝用户动态评论{{ $ref['comment']['contents'] }}的置顶请求
<a href="{{route('pc:feedread', ['feed'=>$noti['data']['feed']['id']])}}">
@if($noti['data']['state'] === 'rejected' )
你的动态评论{{ $noti['data']['comment']['contents'] }}已被拒绝置顶
@else
同意用户动态评论{{ $ref['comment']['contents'] }}的置顶请求
你的动态评论{{ $noti['data']['comment']['contents'] }}已置顶
@endif
</a>
@break
@case('pinned:news/comment')
<a href="{{route('pc:newsread', ['news'=>$ref['news']['id']])}}">
@if($ref['state'] ?? 'accept' == 'rejected')
拒绝用户关于资讯《{{ $ref['news']['title'] }}》评论「{{ $ref['comment']['contents'] }}」的置顶请求
<a href="{{route('pc:newsread', ['news'=>$noti['data']['news']['id']])}}">
@if($noti['data']['state'] === 'rejected')
资讯《{{ $noti['data']['news']['title'] }}
》评论「{{ $noti['data']['comment']['contents'] }}」已被拒绝置顶
@else
同意用户关于资讯《{{ $ref['news']['title'] }}》评论「{{ $ref['comment']['contents'] }}」的置顶请求
资讯《{{ $noti['data']['news']['title'] }}
》评论「{{ $noti['data']['comment']['contents'] }}」已置顶
@endif
</a>
@break
@case('group:comment-pinned')
@case('group:send-comment-pinned')
<a href="{{route('pc:grouppost', ['group_id'=>$ref['group_id'], ''=>$ref['post']['id']])}}">
@if($ref['state'] ?? 'accept' == 'rejected')
拒绝帖子{{ $ref['post']['title']}}的评论置顶请求
<a href="{{route('pc:grouppost', ['group_id'=>$noti['data']['group_id'], 'post_id'=>$noti['data']['post']['id']])}}">
@if($noti['data']['state'] === 'rejected')
帖子{{ $noti['data']['post']['title']}}的评论已被拒绝置顶
@else
同意帖子{{ $ref['post']['title']}}的评论置顶请求
帖子{{ $noti['data']['post']['title']}}的评论已置顶
@endif
</a>
@break
@case('group:post-pinned')
<a href="{{route('pc:grouppost', ['group_id'=>$ref['group_id'], ''=>$ref['post']['id']])}}">
@if($ref['state'] ?? 'accept' == 'rejected')
拒绝用于帖子{{ $ref['post']['title']}}的置顶请求
<a href="{{route('pc:grouppost', ['group_id'=>$noti['data']['group_id'], 'post_id'=>$noti['data']['post']['id']])}}">
@if($noti['data']['state'] === 'rejected')
你的帖子{{ $noti['data']['post']['title']}}已被拒绝置顶
@else
同意用于帖子{{ $ref['post']['title']}}的置顶请求
你的帖子{{ $noti['data']['post']['title']}}已置顶
@endif
</a>
@break
@case('group:pinned-admin')
<a href="{{route('pc:grouppost', ['group_id'=>$ref['group_id'], ''=>$ref['post']['id']])}}">
你的帖子「{{ $ref['post']['title'] }}」被管理员置顶
<a href="{{route('pc:grouppost', ['group_id'=>$noti['data']['group_id'], 'post_id'=>$noti['data']['post']['id']])}}">
你的帖子「{{ $noti['data']['post']['title'] }}」被管理员置顶
</a>
@break
@case('user-currency:cash')
@if($noti['data']['state'] === 'rejected')
你的积分提现申请已被拒绝,理由:{{$noti['data']['contents']}}
@else
你的积分提现申请已通过申请
@endif
@break
@case('delete:feed/comment')
<a href="{{route('pc:feedread',['feed' => $noti['data']['feed']['id']])}}">
你的评论「{{$noti['data']['comment']['contents']}}」已被管理员删除
</a>
@break
@case('report')
@switch($noti['data']['resource']['type'])
@case('groups')
<a href="{{route('pc:groupread',['group_id' => $noti['data']['resource']['id']])}}">
你举报的圈子「{{$noti['data']['subject']}}
」平台已{{$noti['data']['state'] === 'rejected' ? '驳回' : '处理'}},
备注: {{$noti['data']['resource']['mark'] ?? ''}}
</a>
@break
@case('feeds')
<a href="{{route('pc:feedread',['feed' => $noti['data']['resource']['id']])}}">
你举报的「{{$noti['data']['subject']}}
」平台已{{$noti['data']['state'] === 'rejected' ? '驳回' : '处理'}},
备注: {{$noti['data']['resource']['mark'] ?? ''}}
</a>
@break
@case('news')
<a href="{{route('pc:newsread',['news' => $noti['data']['resource']['id']])}}">
你举报的「{{$noti['data']['subject']}}
」平台已{{$noti['data']['state'] === 'rejected' ? '驳回' : '处理'}},
备注: {{$noti['data']['resource']['mark'] ?? ''}}
</a>
@break
@case('comments')
<a href="javascript:void(0)">
你举报的「{{$noti['data']['subject']}}
」平台已{{$noti['data']['state'] === 'rejected' ? '驳回' : '处理'}},
备注: {{$noti['data']['resource']['mark'] ?? ''}}
</a>
@break
@endswitch
@break
@endswitch
</div>
<div class="tz-date">{{ getTime($noti['created_at']) }}</div>
Expand Down

0 comments on commit 54c221c

Please sign in to comment.