feat: 添加关于我们
parent
2f325fce8d
commit
786291dc4a
|
@ -176,6 +176,7 @@ class Basic extends AdminBase
|
|||
'service' => ConfigServer::get('policy', 'service'),
|
||||
'privacy' => ConfigServer::get('policy', 'privacy'),
|
||||
'after_sale' => ConfigServer::get('policy', 'after_sale'),
|
||||
'about_us' => ConfigServer::get('policy', 'about_us'),
|
||||
];
|
||||
return view('', ['config' => $config]);
|
||||
}
|
||||
|
@ -187,6 +188,7 @@ class Basic extends AdminBase
|
|||
ConfigServer::set('policy', 'service', $post['service']);
|
||||
ConfigServer::set('policy', 'privacy', $post['privacy']);
|
||||
ConfigServer::set('policy', 'after_sale', $post['after_sale']);
|
||||
ConfigServer::set('policy', 'about_us', $post['about_us']);
|
||||
return JsonServer::success('修改成功');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
<li class="layui-this">服务协议</li>
|
||||
<li>隐私政策</li>
|
||||
<li>售后保障</li>
|
||||
<li>关于我们</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content">
|
||||
<div class="layui-tab-item layui-show">
|
||||
|
@ -43,6 +44,13 @@
|
|||
<textarea name="after_sale" id="after_sale" lay-verify="content" class="field-content">{$config.after_sale}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-tab-item">
|
||||
<label class="layui-form-label" style="white-space: nowrap;">内容:</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="about_us" id="about_us" lay-verify="content" class="field-content">{$config.about_us}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
|
@ -77,11 +85,13 @@
|
|||
var likeedit_service = likeedit.build('service');
|
||||
var likeedit_privacy = likeedit.build('privacy');
|
||||
var likeedit_after_sale = likeedit.build('after_sale');
|
||||
var likeedit_about_us = likeedit.build('about_us');
|
||||
form.verify({
|
||||
content: function () {
|
||||
likeedit.sync(likeedit_service);
|
||||
likeedit.sync(likeedit_privacy);
|
||||
likeedit.sync(likeedit_after_sale);
|
||||
likeedit.sync(likeedit_about_us);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -89,6 +99,7 @@
|
|||
data.field['service'] = likeedit.getContent(likeedit_service);
|
||||
data.field['privacy'] = likeedit.getContent(likeedit_privacy);
|
||||
data.field['after_sale'] = likeedit.getContent(likeedit_after_sale);
|
||||
data.field['about_us'] = likeedit.getContent(likeedit_about_us);
|
||||
like.ajax({
|
||||
url: "{:url('setting.basic/setPolicy')}",
|
||||
data: data.field,
|
||||
|
|
|
@ -7,8 +7,8 @@ use app\common\server\JsonServer;
|
|||
|
||||
class Policy extends Api
|
||||
{
|
||||
|
||||
public $like_not_need_login = ['service', 'privacy', 'aftersale'];
|
||||
|
||||
public $like_not_need_login = ['service', 'privacy', 'aftersale', 'aboutUs'];
|
||||
|
||||
/**
|
||||
* 服务协议
|
||||
|
@ -36,4 +36,13 @@ class Policy extends Api
|
|||
$data = PolicyLogic::afterSale();
|
||||
return JsonServer::success('获取成功', ['content' => $data]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 关于我们
|
||||
*/
|
||||
public function aboutUs()
|
||||
{
|
||||
$data = PolicyLogic::aboutUs();
|
||||
return JsonServer::success('获取成功', ['content' => $data]);
|
||||
}
|
||||
}
|
|
@ -33,4 +33,13 @@ class PolicyLogic extends Logic
|
|||
$res = preg_replace($preg, '<img src="' . $local_url . '${1}" />', $after_sale);
|
||||
return $res;
|
||||
}
|
||||
|
||||
public static function aboutUs()
|
||||
{
|
||||
$after_sale = ConfigServer::get('policy', 'about_us', '');
|
||||
$preg = '/<img.*?src="((?!(https|http)).*?)".*?\/?>/i';
|
||||
$local_url = UrlServer::getFileUrl();
|
||||
$res = preg_replace($preg, '<img src="' . $local_url . '${1}" />', $after_sale);
|
||||
return $res;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue