mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2024-11-30 10:59:47 +08:00
问答系统页面优化
This commit is contained in:
parent
c1fcc7bf7b
commit
b51785b0ad
@ -79,9 +79,11 @@
|
||||
<tr>
|
||||
<th>姓名</th>
|
||||
<th>电话</th>
|
||||
<th>内容</th>
|
||||
<th>标题</th>
|
||||
<th class="am-hide-sm-only">内容</th>
|
||||
<th class="am-hide-sm-only">回复</th>
|
||||
<th class="am-hide-sm-only">是否显示</th>
|
||||
<th class="am-hide-sm-only">回复时间</th>
|
||||
<th class="am-hide-sm-only">时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -91,7 +93,8 @@
|
||||
<tr>
|
||||
<td>{{$v.name}}</td>
|
||||
<td>{{$v.tel}}</td>
|
||||
<td class="reply-content">{{$v.content}}</td>
|
||||
<td>{{$v.title}}</td>
|
||||
<td class="am-hide-sm-only reply-content">{{$v.content}}</td>
|
||||
<td class="am-hide-sm-only reply-content">
|
||||
{{if $v['is_reply'] eq 1}}
|
||||
{{$v.reply}}
|
||||
@ -100,6 +103,7 @@
|
||||
{{/if}}
|
||||
</td>
|
||||
<td class="am-hide-sm-only">{{$v.is_show_text}}</td>
|
||||
<td class="am-hide-sm-only">{{$v.reply_time}}</td>
|
||||
<td class="am-hide-sm-only">{{$v.add_time}}</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
|
@ -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(
|
||||
|
@ -15,20 +15,24 @@
|
||||
<!-- content start -->
|
||||
<div class="am-g am-container plugins-answers plugins-answers-detail">
|
||||
<!-- 幻灯片 -->
|
||||
<div class="am-u-md-8 answers-slider">
|
||||
<div class="am-u-md-8">
|
||||
{{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'])}}
|
||||
<h2>{{$plugins_answers_detail.data.title}}</h2>
|
||||
{{/if}}
|
||||
<div class="base-content">
|
||||
<p>{{$plugins_answers_detail.data.content}}</p>
|
||||
<p class="base-date gray-text">{{$plugins_answers_detail.data.add_time_date}}</p>
|
||||
</div>
|
||||
<div class="am-panel base {{if isset($plugins_answers_detail['data']['is_reply']) and $plugins_answers_detail['data']['is_reply'] eq 1}} am-panel-success{{else /}} am-panel-default{{/if}}">
|
||||
<div class="am-panel base {{if isset($plugins_answers_detail['data']['is_reply']) and $plugins_answers_detail['data']['is_reply'] eq 1}} am-panel-success{{else /}} am-panel-warning{{/if}}">
|
||||
<div class="am-panel-bd">
|
||||
{{if isset($plugins_answers_detail['data']['is_reply']) and $plugins_answers_detail['data']['is_reply'] eq 1}}
|
||||
<span class="am-badge am-radius am-badge-success">已回答</span>
|
||||
{{$plugins_answers_detail.data.reply}}
|
||||
<span class="am-badge am-radius am-badge-success">管理员已回答</span>
|
||||
<p class="reply-content">{{$plugins_answers_detail.data.reply}}</p>
|
||||
<p class="base-date gray-text">{{$plugins_answers_detail.data.reply_time_date}}</p>
|
||||
{{else /}}
|
||||
<span class="am-badge am-radius">待回答</span>
|
||||
<span class="am-badge am-radius">管理员待回复</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
@ -64,7 +68,13 @@
|
||||
<ul class="am-list">
|
||||
{{foreach $plugins_answers_rc_list as $answers}}
|
||||
<li class="am-g am-list-item-dated">
|
||||
<a href="{{:PluginsHomeUrl('answers', 'index', 'detail', ['id'=>$answers['id']])}}" target="_blank" class="am-list-item-hd ">{{$answers.content}}</a>
|
||||
<a href="{{:PluginsHomeUrl('answers', 'index', 'detail', ['id'=>$answers['id']])}}" target="_blank" class="am-list-item-hd">
|
||||
{{if empty($answers['title'])}}
|
||||
{{$answers.content}}
|
||||
{{else /}}
|
||||
{{$answers.title}}
|
||||
{{/if}}
|
||||
</a>
|
||||
<span class="am-list-date">{{$answers.add_time_date}}</span>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
|
@ -61,7 +61,13 @@
|
||||
<ul class="am-list">
|
||||
{{foreach $plugins_answers_rc_list as $answers}}
|
||||
<li class="am-g am-list-item-dated">
|
||||
<a href="{{:PluginsHomeUrl('answers', 'index', 'detail', ['id'=>$answers['id']])}}" target="_blank" class="am-list-item-hd ">{{$answers.content}}</a>
|
||||
<a href="{{:PluginsHomeUrl('answers', 'index', 'detail', ['id'=>$answers['id']])}}" target="_blank" class="am-list-item-hd">
|
||||
{{if empty($answers['title'])}}
|
||||
{{$answers.content}}
|
||||
{{else /}}
|
||||
{{$answers.title}}
|
||||
{{/if}}
|
||||
</a>
|
||||
<span class="am-list-date">{{$answers.add_time_date}}</span>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
@ -98,7 +104,13 @@
|
||||
<ul class="am-list">
|
||||
{{foreach $plugins_answers_middle_answer_list as $answers}}
|
||||
<li class="am-g am-list-item-dated">
|
||||
<a href="{{:PluginsHomeUrl('answers', 'index', 'detail', ['id'=>$answers['id']])}}" target="_blank" class="am-list-item-hd ">{{$answers.content}}</a>
|
||||
<a href="{{:PluginsHomeUrl('answers', 'index', 'detail', ['id'=>$answers['id']])}}" target="_blank" class="am-list-item-hd">
|
||||
{{if empty($answers['title'])}}
|
||||
{{$answers.content}}
|
||||
{{else /}}
|
||||
{{$answers.title}}
|
||||
{{/if}}
|
||||
</a>
|
||||
<span class="am-list-date">{{$answers.add_time_date}}</span>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
|
@ -8,15 +8,19 @@
|
||||
<form class="am-form form-validation-plugins-answer-ask view-save" action="{{:PluginsHomeUrl('answers', 'index', 'answer')}}" method="POST" request-type="ajax-reload">
|
||||
<div class="am-form-group">
|
||||
<label>姓名<span class="am-form-group-label-tips">选填</span></label>
|
||||
<input type="text" name="name" placeholder="姓名" data-validation-message="请填写姓名" class="am-radius" />
|
||||
<input type="text" name="name" placeholder="姓名" maxlength="30" data-validation-message="联系人最多30个字符" class="am-radius" />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>电话<span class="am-form-group-label-tips">选填</span></label>
|
||||
<input type="text" name="tel" placeholder="电话" data-validation-message="请填写电话" class="am-radius" />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>标题<span class="am-form-group-label-tips">必填</span></label>
|
||||
<input type="text" name="title" placeholder="标题" maxlength="60" data-validation-message="标题最多60个字符" class="am-radius" required />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>内容<span class="am-form-group-label-tips">必填</span></label>
|
||||
<textarea class="am-radius am-validate" name="content" rows="5" minlength="5" maxlength="300" placeholder="内容至少5个字" data-validation-message="内容格式 5~300 个字符之间" required></textarea>
|
||||
<textarea class="am-radius am-validate" name="content" rows="5" minlength="5" maxlength="230" placeholder="内容至少5个字" data-validation-message="内容格式 5~230 个字符之间" required></textarea>
|
||||
</div>
|
||||
<div class="am-form-group am-form-group-refreshing">
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">提交</button>
|
||||
|
@ -160,7 +160,7 @@
|
||||
</legend>
|
||||
<div class="am-form-group am-form-group-refreshing">
|
||||
<label>姓名</label>
|
||||
<input type="text" name="name" placeholder="姓名" data-validation-message="请填写姓名" class="am-radius" required />
|
||||
<input type="text" name="name" placeholder="姓名" maxlength="30" data-validation-message="联系人最多30个字符" class="am-radius" required />
|
||||
</div>
|
||||
<div class="am-form-group am-form-group-refreshing">
|
||||
<label>电话</label>
|
||||
@ -168,7 +168,7 @@
|
||||
</div>
|
||||
<div class="am-form-group am-form-group-refreshing">
|
||||
<label>内容</label>
|
||||
<textarea class="am-radius am-validate" name="content" rows="3" minlength="5" maxlength="300" placeholder="内容至少5个字" data-validation-message="内容格式 5~300 个字符之间" required></textarea>
|
||||
<textarea class="am-radius am-validate" name="content" rows="3" minlength="5" maxlength="230" placeholder="内容格式 5~230 个字符之间" data-validation-message="内容格式 5~300 个字符之间" required></textarea>
|
||||
</div>
|
||||
<div class="am-form-group am-form-group-refreshing">
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100" data-am-loading="{loadingText:'处理中...'}">提交</button>
|
||||
|
@ -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(),
|
||||
];
|
||||
@ -317,6 +335,7 @@ class AnswerService
|
||||
$data = [
|
||||
'reply' => $params['reply'],
|
||||
'is_reply' => 1,
|
||||
'reply_time' => time(),
|
||||
'upd_time' => time()
|
||||
];
|
||||
if(Db::name('Answer')->where($where)->update($data))
|
||||
|
@ -113,3 +113,16 @@
|
||||
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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user