修改:帮助中心设置修改,分为基本设置和分享设置两栏
添加:帮助中心基本基本设置添加客服电话和意见反馈、用户问卷的自定义表单关联。
This commit is contained in:
parent
1fcdbb7aea
commit
982c559a92
|
|
@ -401,6 +401,8 @@ class ComponentService
|
|||
['name' => '带货直播列表', 'mini_url' => '/packageD/directSeeding/liveList/liveList', 'url' => 'liveList', 'plugin_name' => 'room'],
|
||||
['name' => '拼团列表', 'mini_url' => '/packageB/member/group/GroupList/GroupList', 'url' => 'group_list', 'plugin_name' => 'fight-groups'],
|
||||
['name' => '我的拼团', 'mini_url' => '/packageB/member/group/MyGroups/MyGroups', 'url' => 'mygroups', 'plugin_name' => 'fight-groups'],
|
||||
['name' => '帮助中心(旧)', 'mini_url' => '', 'url' => 'member/helpcenter'],
|
||||
['name' => '帮助中心(新)', 'mini_url' => '', 'url' => 'member/new_help/index'],
|
||||
['name' => '典藏室', 'mini_url' => '', 'url' => 'member/collection_room'],
|
||||
['name' => '关于我们', 'mini_url' => '', 'url' => 'member/tool/about_us'],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,91 +1,32 @@
|
|||
<?php
|
||||
|
||||
namespace Yunshop\HelpCenter\admin;
|
||||
|
||||
use app\backend\modules\uploadVerificate\UploadVerificationBaseController;
|
||||
use app\common\components\BaseController;
|
||||
use Yunshop\Diyform\models\DiyformTypeModel;
|
||||
use Yunshop\HelpCenter\services\HelpCenterService;
|
||||
use app\common\facades\Setting;
|
||||
use Yunshop\HelpCenter\models\HelpCenterSetModel;
|
||||
use app\common\helpers\Url;
|
||||
use Illuminate\Http\Request;
|
||||
use Yunshop\HelpCenter\services\SetService;
|
||||
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Administrator
|
||||
* Date: 2018/3/29 0029
|
||||
* Time: 下午 1:58
|
||||
*/
|
||||
class HelpCenterSetController extends UploadVerificationBaseController
|
||||
{
|
||||
// public function index1()
|
||||
// {
|
||||
//
|
||||
// $helpCenterService = new HelpCenterService();
|
||||
//
|
||||
// $set = Setting::get('plugin.help_center');
|
||||
//
|
||||
// $helpCenterModel = new HelpCenterSetModel();
|
||||
//
|
||||
// $requestData = \Yunshop::request()->setdata;
|
||||
//
|
||||
// $url = Url::absoluteWeb('plugin.help-center.admin.help-center-set.index');
|
||||
//
|
||||
// if ($requestData) {
|
||||
// //将数据赋值到model
|
||||
// $helpCenterModel->fill($requestData);
|
||||
// //字段检测
|
||||
// $validator = $helpCenterModel->validator();
|
||||
// if ($validator->fails()) {
|
||||
// //验证失败
|
||||
// $this->error($validator->messages());
|
||||
// } else {
|
||||
// //保存数据
|
||||
// if ($helpCenterModel->save()) {
|
||||
// //显示信息并跳转
|
||||
// return $this->message('保存成功',$url);
|
||||
// } else {
|
||||
// $this->error('保存失败');
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// $pluginName = $helpCenterService->get('plugin_name');
|
||||
//
|
||||
// return view('Yunshop\HelpCenter::admin.set', [
|
||||
// 'pluginName' => $pluginName,
|
||||
// 'set' => $set,
|
||||
// ])->render();
|
||||
// }
|
||||
|
||||
public function index()
|
||||
{
|
||||
$helpCenterService = new HelpCenterService();
|
||||
$set = Setting::get('help-center.status');
|
||||
|
||||
$pluginName = $helpCenterService->get('plugin_name');
|
||||
|
||||
$data_title = Setting::get('help-center.title');
|
||||
$data_icon = Setting::get('help-center.icon');
|
||||
$data_description = Setting::get('help-center.description');
|
||||
|
||||
$share_data['title'] = $data_title;
|
||||
$share_data['icon'] = yz_tomedia($data_icon);
|
||||
$share_data['description'] = $data_description;
|
||||
class HelpCenterSetController extends UploadVerificationBaseController{
|
||||
|
||||
public function index(){
|
||||
$requestData = \YunShop::request()->setdata;
|
||||
if($requestData){
|
||||
\Setting::set('help-center', $requestData);
|
||||
|
||||
if ($requestData) {
|
||||
$result = SetService::storeSet($requestData);
|
||||
if ($result === true) {
|
||||
return $this->message('保存设置成功', Url::absoluteWeb('plugin.help-center.admin.help-center-set.index'));
|
||||
return $this->message('保存设置成功',Url::absoluteWeb('plugin.help-center.admin.help-center-set.index'));
|
||||
}
|
||||
$this->error($result);
|
||||
}
|
||||
return view('Yunshop\HelpCenter::admin.set', [
|
||||
// 获取信息
|
||||
$helpCenterService = new HelpCenterService();
|
||||
$set = Setting::get('help-center');
|
||||
$pluginName = $helpCenterService->get('plugin_name');
|
||||
$formList = DiyformTypeModel::getDiyformList()->select(['id','title'])->orderBy('id', 'desc')->get()->toArray();
|
||||
|
||||
return view('Yunshop\HelpCenter::admin.set',[
|
||||
'set' => $set,
|
||||
'pluginName' => $pluginName,
|
||||
'share_data' => $share_data,
|
||||
'form_list' => $formList,
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -13,9 +13,10 @@ use app\common\components\ApiController;
|
|||
use app\common\facades\Setting;
|
||||
use app\frontend\modules\member\controllers\ServiceController;
|
||||
use Yunshop\HelpCenter\models\HelpCenterAddModel;
|
||||
use Yunshop\HelpCenter\services\HelpCenterService;
|
||||
|
||||
class ContentController extends ApiController{
|
||||
|
||||
class ContentController extends ApiController
|
||||
{
|
||||
public function info()
|
||||
{
|
||||
$set_data = HelpCenterAddModel::select('title', 'content')->uniacid()->orderBy('sort')->get()->toarray();
|
||||
|
|
@ -39,4 +40,38 @@ class ContentController extends ApiController
|
|||
|
||||
return $this->successJson('ok', ['set_data' => $set_data, 'customer_service' => $customer_service]);
|
||||
}
|
||||
/**
|
||||
* Common: 获取基本配置信息
|
||||
* Author: wu-hui
|
||||
* Time: 2023/10/26 17:03
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function homeInfo(){
|
||||
$set = Setting::get('help-center');
|
||||
$set['plugin_name'] = (new HelpCenterService())->get('plugin_name');
|
||||
|
||||
return $this->successJson('ok',$set);
|
||||
}
|
||||
/**
|
||||
* Common: 获取问题列表
|
||||
* Author: wu-hui
|
||||
* Time: 2023/10/26 17:08
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function questionList(){
|
||||
// 参数获取
|
||||
$searchText = request()->input('search_text');
|
||||
// 列表获取
|
||||
$list = HelpCenterAddModel::uniacid()
|
||||
->select(['id','title','content'])
|
||||
->when(!empty($searchText),function($query) use ($searchText){
|
||||
$query->where('title','like',"%{$searchText}%");
|
||||
})
|
||||
->orderBy('sort','DESC')
|
||||
->get()
|
||||
->toArray();
|
||||
|
||||
return $this->successJson('ok',$list);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,23 +2,30 @@
|
|||
|
||||
@section('content')
|
||||
@section('title', trans($pluginName))
|
||||
|
||||
{{--<script type="text/javascript">--}}
|
||||
{{--window.optionchanged = false;--}}
|
||||
{{--require(['bootstrap'], function () {--}}
|
||||
{{--$('#myTab a').click(function (e) {--}}
|
||||
{{--e.preventDefault();--}}
|
||||
{{--$(this).tab('show');--}}
|
||||
{{--})--}}
|
||||
{{--});--}}
|
||||
{{--</script>--}}
|
||||
|
||||
<script type="text/javascript">
|
||||
window.optionchanged = false;
|
||||
require(['bootstrap'], function () {
|
||||
$('#myTab a').click(function (e) {
|
||||
e.preventDefault();
|
||||
$(this).tab('show');
|
||||
})
|
||||
});
|
||||
</script>
|
||||
<section class="content">
|
||||
<div class="rightlist">
|
||||
<div class="panel panel-info">
|
||||
<ul class="add-shopnav" id="myTab">
|
||||
<li class="active"><a href="#tab_base">基础设置</a></li>
|
||||
<li><a href="#tab_share">分享设置</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<section>
|
||||
<form id="setform" action="" method="post" class="form-horizontal form" enctype="multipart/form-data">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
|
||||
<div><b>基础设置:</b></div>
|
||||
|
||||
<div class="tab-content">
|
||||
{{--基本设置--}}
|
||||
<div class="tab-pane active" id="tab_base">
|
||||
<div class="form-group">
|
||||
<label class="col-xs-12 col-sm-3 col-md-2 control-label">{{ $pluginName }}启用</label>
|
||||
<div class="col-sm-9 col-xs-12">
|
||||
|
|
@ -30,30 +37,59 @@
|
|||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div><b>分享设置:</b></div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">客服电话</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="setdata[customer_service_tel]" value="{{ $set['customer_service_tel'] }}" placeholder="请输入客服电话"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">意见反馈</label>
|
||||
<div class="col-sm-8">
|
||||
<select name='setdata[feedback_id]' class='form-control' placeholder="请选择表单">
|
||||
@foreach($form_list as $formItem)
|
||||
<option value="{{ $formItem['id'] }}" @if($set['feedback_id'] == $formItem['id']) selected @endif>
|
||||
{{$formItem['title']}}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">用户问卷</label>
|
||||
<div class="col-sm-8">
|
||||
<select name='setdata[questionnaire_id]' class='form-control' placeholder="请选择表单">
|
||||
@foreach($form_list as $formItem)
|
||||
<option value="{{ $formItem['id'] }}" @if($set['questionnaire_id'] == $formItem['id']) selected @endif>
|
||||
{{$formItem['title']}}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{--分享设置--}}
|
||||
<div class="tab-pane" id="tab_share">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">分享标题</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="setdata[title]" value="{{ $share_data['title'] }}" placeholder="不填写默认商城名称"/>
|
||||
<input class="form-control" type="text" name="setdata[title]" value="{{ $set['title'] }}" placeholder="不填写默认商城名称"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">分享图标</label>
|
||||
<div class="col-sm-7">
|
||||
{!! app\common\helpers\ImageHelper::tplFormFieldImage('setdata[icon]', $share_data['icon']) !!}
|
||||
{!! app\common\helpers\ImageHelper::tplFormFieldImage('setdata[icon]', $set['icon']) !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">分享描述</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea class="form-control" name="setdata[description]" rows="10" placeholder="请输入具体描述........">{{ $share_data['description'] }}</textarea>
|
||||
<textarea class="form-control" name="setdata[description]" rows="10" placeholder="请输入具体描述........">{{ $set['description'] }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label"></label>
|
||||
<div class="col-sm-2">
|
||||
|
|
@ -61,7 +97,10 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</section><!-- /.content -->
|
||||
</section>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue