diff --git a/application/index/view/default/answer/index.html b/application/index/view/default/answer/index.html index c46df43a5..3643834b0 100755 --- a/application/index/view/default/answer/index.html +++ b/application/index/view/default/answer/index.html @@ -79,9 +79,11 @@ 姓名 电话 - 内容 + 标题 + 内容 回复 是否显示 + 回复时间 时间 @@ -91,7 +93,8 @@ {{$v.name}} {{$v.tel}} - {{$v.content}} + {{$v.title}} + {{$v.content}} {{if $v['is_reply'] eq 1}} {{$v.reply}} @@ -100,6 +103,7 @@ {{/if}} {{$v.is_show_text}} + {{$v.reply_time}} {{$v.add_time}} {{/foreach}} diff --git a/application/plugins/answers/Service.php b/application/plugins/answers/Service.php index c5a3c63e3..e62f6c55e 100644 --- a/application/plugins/answers/Service.php +++ b/application/plugins/answers/Service.php @@ -338,7 +338,7 @@ class Service } // 字段 - $field = empty($params['field']) ? 'id,name,content,reply,is_reply,add_time' : $params['field']; + $field = empty($params['field']) ? 'id,name,title,content,reply,is_reply,reply_time,add_time' : $params['field']; // 获取列表 $data_params = array( @@ -373,7 +373,7 @@ class Service ]; // 字段 - $field = 'content,reply,is_reply,add_time'; + $field = 'title,content,reply,is_reply,reply_time,add_time'; // 获取列表 $data_params = array( diff --git a/application/plugins/view/answers/index/detail.html b/application/plugins/view/answers/index/detail.html index 00b31b773..cfef4c142 100644 --- a/application/plugins/view/answers/index/detail.html +++ b/application/plugins/view/answers/index/detail.html @@ -15,20 +15,24 @@
-
+
{{if isset($plugins_answers_detail['code']) and $plugins_answers_detail['code'] eq 0}} {{if !empty($plugins_answers_detail['data']['content'])}} + {{if !empty($plugins_answers_detail['data']['title'])}} +

{{$plugins_answers_detail.data.title}}

+ {{/if}}

{{$plugins_answers_detail.data.content}}

{{$plugins_answers_detail.data.add_time_date}}

-
+
{{if isset($plugins_answers_detail['data']['is_reply']) and $plugins_answers_detail['data']['is_reply'] eq 1}} - 已回答 - {{$plugins_answers_detail.data.reply}} + 管理员已回答 +

{{$plugins_answers_detail.data.reply}}

+

{{$plugins_answers_detail.data.reply_time_date}}

{{else /}} - 待回答 + 管理员待回复 {{/if}}
@@ -64,7 +68,13 @@
    {{foreach $plugins_answers_rc_list as $answers}}
  • - {{$answers.content}} + + {{if empty($answers['title'])}} + {{$answers.content}} + {{else /}} + {{$answers.title}} + {{/if}} + {{$answers.add_time_date}}
  • {{/foreach}} diff --git a/application/plugins/view/answers/index/index.html b/application/plugins/view/answers/index/index.html index 0ea11c573..b76e47c86 100644 --- a/application/plugins/view/answers/index/index.html +++ b/application/plugins/view/answers/index/index.html @@ -61,7 +61,13 @@
      {{foreach $plugins_answers_rc_list as $answers}}
    • - {{$answers.content}} + + {{if empty($answers['title'])}} + {{$answers.content}} + {{else /}} + {{$answers.title}} + {{/if}} + {{$answers.add_time_date}}
    • {{/foreach}} @@ -98,7 +104,13 @@
        {{foreach $plugins_answers_middle_answer_list as $answers}}
      • - {{$answers.content}} + + {{if empty($answers['title'])}} + {{$answers.content}} + {{else /}} + {{$answers.title}} + {{/if}} + {{$answers.add_time_date}}
      • {{/foreach}} diff --git a/application/plugins/view/answers/index/popup.html b/application/plugins/view/answers/index/popup.html index 018c5d95b..a0bc9a029 100644 --- a/application/plugins/view/answers/index/popup.html +++ b/application/plugins/view/answers/index/popup.html @@ -8,15 +8,19 @@
        - +
        +
        + + +
        - +
        diff --git a/application/plugins/view/commonrightnavigation/index/content.html b/application/plugins/view/commonrightnavigation/index/content.html index 9814b2bf1..e222e2939 100755 --- a/application/plugins/view/commonrightnavigation/index/content.html +++ b/application/plugins/view/commonrightnavigation/index/content.html @@ -160,7 +160,7 @@
        - +
        @@ -168,7 +168,7 @@
        - +
        diff --git a/application/service/AnswerService.php b/application/service/AnswerService.php index 92345b88c..c5d03ab11 100755 --- a/application/service/AnswerService.php +++ b/application/service/AnswerService.php @@ -77,12 +77,20 @@ class AnswerService $v['is_show_text'] = $common_is_show_list[$v['is_show']]['name']; } + // 回复时间 + if(isset($v['reply_time'])) + { + $reply_time = $v['reply_time']; + $v['reply_time'] = empty($reply_time) ? '' : date('Y-m-d H:i:s', $reply_time); + $v['reply_time_date'] = empty($reply_time) ? '' : date('Y-m-d', $reply_time); + } + // 创建时间 if(isset($v['add_time'])) { $add_time = $v['add_time']; - $v['add_time'] = date('Y-m-d H:i:s', $add_time); - $v['add_time_date'] = date('Y-m-d', $add_time); + $v['add_time'] = empty($add_time) ? '' : date('Y-m-d H:i:s', $add_time); + $v['add_time_date'] = empty($add_time) ? '' : date('Y-m-d', $add_time); } // 更新时间 @@ -167,15 +175,24 @@ class AnswerService // 参数校验 $p = [ [ - 'checked_type' => 'isset', + 'checked_type' => 'length', 'key_name' => 'name', - 'error_msg' => '联系人有误', + 'checked_data' => '30', + 'is_checked' => 1, + 'error_msg' => '联系人最多30个字符', ], [ 'checked_type' => 'isset', 'key_name' => 'tel', 'error_msg' => '联系电话有误', ], + [ + 'checked_type' => 'length', + 'key_name' => 'title', + 'checked_data' => '60', + 'is_checked' => 1, + 'error_msg' => '标题最多60个字符', + ], [ 'checked_type' => 'empty', 'key_name' => 'content', @@ -193,6 +210,7 @@ class AnswerService 'user_id' => isset($params['user']['id']) ? intval($params['user']['id']) : 0, 'name' => isset($params['name']) ? $params['name'] : '', 'tel' => isset($params['tel']) ? $params['tel'] : '', + 'title' => isset($params['title']) ? $params['title'] : '', 'content' => $params['content'], 'add_time' => time(), ]; @@ -315,9 +333,10 @@ class AnswerService } // 更新问答 $data = [ - 'reply' => $params['reply'], - 'is_reply' => 1, - 'upd_time' => time() + 'reply' => $params['reply'], + 'is_reply' => 1, + 'reply_time' => time(), + 'upd_time' => time() ]; if(Db::name('Answer')->where($where)->update($data)) { diff --git a/public/static/plugins/css/answers/index.css b/public/static/plugins/css/answers/index.css index d83089144..9997f4284 100644 --- a/public/static/plugins/css/answers/index.css +++ b/public/static/plugins/css/answers/index.css @@ -112,4 +112,17 @@ margin-top: 10px; box-shadow: none; -webkit-box-shadow: none; +} +.plugins-answers-detail .am-panel-warning { + background: #fff7ef; +} +.plugins-answers-detail .am-panel-success { + background: #f2fff1; +} +.plugins-answers-detail h2 { + margin-bottom: 5px; + font-weight: 500; +} +.plugins-answers-detail .base .reply-content { + margin-top: 5px; } \ No newline at end of file