feat: 完善后台

main
yin5th 2024-11-20 10:27:50 +08:00
parent 0b6117f41c
commit 0c91666d4c
16 changed files with 277 additions and 6 deletions

View File

@ -143,6 +143,7 @@ class Article extends Base
if($this->request->isPost()){
$item = input('post.item/a');
$img = input('post.img');
$imgEn = input('post.img_en');
$id = input('post.id/d');
$article = MArticle::getById($id);
if (empty($article)) {
@ -151,6 +152,9 @@ class Article extends Base
if(!empty($img)){
$item['src'] = $img;
}
if(!empty($imgEn)){
$item['src_en'] = $imgEn;
}
try {
validate(VArticle::class)->check($item);
$auth = session('auth');
@ -184,9 +188,13 @@ class Article extends Base
if($this->request->isPost()){
$item = input('post.item/a');
$img = input('post.img');
$imgEn = input('post.img_en');
if(!empty($img)){
$item['src'] = $img;
}
if(!empty($imgEn)){
$item['src_en'] = $imgEn;
}
try {
validate(VArticle::class)->check($item);
$content = $item['content'] ?? '';

View File

@ -112,7 +112,9 @@ class Slide extends Base
if($this->request->isPost()){
$item = input('post.item');
$img = input('post.img_pc');
$imgEn = input('post.img_pc_en');
$imgMobile = input('post.img_mobile');
$imgMobileEn = input('post.img_mobile_en');
$id = input('post.id/d');
if(is_numeric($id) && $id > 0) {
@ -123,9 +125,15 @@ class Slide extends Base
if(!empty($imgMobile)){
$item['src_mobile'] = $imgMobile;
}
if(!empty($imgMobileEn)){
$item['src_mobile_en'] = $imgMobileEn;
}
if(!empty($img)){
$item['src'] = $img;
}
if(!empty($imgEn)){
$item['src_en'] = $imgEn;
}
try {
validate(VSlide::class)->check($item);
MSlide::updateById($id, $item);
@ -134,7 +142,7 @@ class Slide extends Base
} catch (ValidateException $e) {
return $this->json(3, $e->getError());
}
}
}
return $this->json(1, '参数错误,请核对之后再操作!');
}else{
$id = input('param.id/d');
@ -148,11 +156,13 @@ class Slide extends Base
//添加
public function add()
{
{
if($this->request->isPost()){
$item = input('post.item');
$img = input('post.img_pc');
$imgEn = input('post.img_pc_en');
$imgMobile = input('post.img_mobile');
$imgMobileEn = input('post.img_mobile_en');
if (empty($item)) {
return $this->json(1, '参数错误,请核对之后再操作!');
@ -163,6 +173,12 @@ class Slide extends Base
if(!empty($imgMobile)){
$item['src_mobile'] = $imgMobile;
}
if(!empty($imgEn)){
$item['src_en'] = $imgEn;
}
if(!empty($imgMobileEn)){
$item['src_mobile_en'] = $imgMobileEn;
}
try {
validate(VSlide::class)->check($item);
$slide = MSlide::create($item);
@ -183,7 +199,7 @@ class Slide extends Base
* @return Slide
*/
public function index()
{
{
$items = MSlide::getList();
$this->data['items'] = $items;
return $this->view();

View File

@ -12,7 +12,7 @@
<div class="all-center-box">
<div class="about-box1 w-100 center-center" id="about1">
<div class="w-1200 disFlex">
<div class="pull-left"><img class="imgH" src="{$blocks['company_en']['img']['value'] ?? ''}" ></div>
<div class="pull-left"><img class="imgH" src="{$blocks['company']['img_en']['value'] ?? ''}" ></div>
<div class="pull-right">
<div class="all-title-box2 w-100"><span>{$blocks['company']['title_en']['value'] ?? ''}</span><p>{$blocks['company']['subtitle_en']['value'] ?? ''}</p></div>
<div class="box-info w-100">{:nl2br($blocks['company']['description_en']['value'] ?? '')}</div>

View File

@ -31,7 +31,7 @@
</div>
<div class="service-box3 w-100" id="service3">
<div class="w-1200">
<div class="all-title-box2 w-100"><span>After-sales Technical Services</span><p>After sales technology service</p></div>
<div class="all-title-box2 w-100"><span>{$blocks['after']['title_en']['value'] ?? ''}</span><p>{$blocks['after']['subtitle_en']['value'] ?? ''}</p></div>
<div class="box-info w-100">
<div class="pull-right">
<img src="{$blocks['after']['img_en']['value'] ?? ''}" >

View File

@ -13,6 +13,15 @@
</div>
</div>
</div>
<div class="layui-form-itemBox3 between">
<div class="layui-form-item">
<label class="layui-form-label">业绩标题-英文<em>*</em></label>
<div class="layui-input-block">
<input class="layui-input" type="text" name="item[title_en]" maxlength="60" />
<p class="layui-form-mid layui-word-aux">标题请勿超过60个字符</p>
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">业绩概述</label>
<div class="layui-input-block">
@ -20,6 +29,13 @@
<p class="layui-form-mid layui-word-aux">请勿超过300个字符</p>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">业绩概述-英文</label>
<div class="layui-input-block">
<textarea class="layui-textarea" name="item[summary_en]" maxlength="300" onkeyup="limitContentLength(this, 300)"></textarea>
<p class="layui-form-mid layui-word-aux">请勿超过300个字符</p>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">业绩状态</label>
<div class="layui-inline">

View File

@ -13,6 +13,15 @@
</div>
</div>
</div>
<div class="layui-form-itemBox3 between">
<div class="layui-form-item">
<label class="layui-form-label">业绩标题-英文<em>*</em></label>
<div class="layui-input-block">
<input class="layui-input" type="text" name="item[title_en]" maxlength="60" value="{$item['title_en']}"/>
<p class="layui-form-mid layui-word-aux">标题请勿超过60个字符</p>
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">业绩概述</label>
<div class="layui-input-block">
@ -20,6 +29,13 @@
<p class="layui-form-mid layui-word-aux">请勿超过300个字符</p>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">业绩概述-英文</label>
<div class="layui-input-block">
<textarea class="layui-textarea" name="item[summary_en]" maxlength="300" onkeyup="limitContentLength(this, 300)">{$item['summary_en']}</textarea>
<p class="layui-form-mid layui-word-aux">请勿超过300个字符</p>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">业绩状态</label>
<div class="layui-inline">

View File

@ -13,6 +13,15 @@
</div>
</div>
</div>
<div class="layui-form-itemBox3 between">
<div class="layui-form-item">
<label class="layui-form-label">项目名称-英文<em>*</em></label>
<div class="layui-input-block">
<input class="layui-input" name="item[title_en]" maxlength="60" />
<p class="layui-form-mid layui-word-aux">请勿超过60个字符</p>
</div>
</div>
</div>
<div class="layui-form-itemBox3 between">
<div class="layui-form-item">
<label class="layui-form-label">订货单位<em>*</em></label>
@ -22,6 +31,15 @@
</div>
</div>
</div>
<div class="layui-form-itemBox3 between">
<div class="layui-form-item">
<label class="layui-form-label">订货单位-英文<em>*</em></label>
<div class="layui-input-block">
<input class="layui-input" name="item[order_company_en]" maxlength="100" />
<p class="layui-form-mid layui-word-aux">请勿超过100个字符</p>
</div>
</div>
</div>
<div class="layui-form-itemBox3 between">
<div class="layui-form-item">
<label class="layui-form-label">货物名称<br/>及型号规格<em>*</em></label>

View File

@ -13,6 +13,15 @@
</div>
</div>
</div>
<div class="layui-form-itemBox3 between">
<div class="layui-form-item">
<label class="layui-form-label">项目名称-英文<em>*</em></label>
<div class="layui-input-block">
<input class="layui-input" name="item[title_en]" maxlength="60" value="{$item.title_en}"/>
<p class="layui-form-mid layui-word-aux">请勿超过60个字符</p>
</div>
</div>
</div>
<div class="layui-form-itemBox3 between">
<div class="layui-form-item">
<label class="layui-form-label">订货单位<em>*</em></label>
@ -22,6 +31,15 @@
</div>
</div>
</div>
<div class="layui-form-itemBox3 between">
<div class="layui-form-item">
<label class="layui-form-label">订货单位-英文<em>*</em></label>
<div class="layui-input-block">
<input class="layui-input" name="item[order_company_en]" maxlength="100" value="{$item.order_company_en}" />
<p class="layui-form-mid layui-word-aux">请勿超过100个字符</p>
</div>
</div>
</div>
<div class="layui-form-itemBox3 between">
<div class="layui-form-item">
<label class="layui-form-label">货物名称及型号规格<em>*</em></label>

View File

@ -9,6 +9,12 @@
<input class="layui-input" type="text" name="item[title]" maxlength="60" />
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">标题-英文<em>*</em></label>
<div class="layui-input-block">
<input class="layui-input" type="text" name="item[title_en]" maxlength="60" />
</div>
</div>
<div class="layui-form-itemBox2 between">
<div class="layui-form-item">
<label class="layui-form-label">链接</label>
@ -26,6 +32,12 @@
{:widget('manager.upload/image',['imgSize' => $imgSize])}
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">封面图-英文</label>
<div class="layui-input-block">
{:widget('manager.upload/image',['imgSize' => $imgSize,'append'=>'_en'])}
</div>
</div>
<div class="layui-form-itemBox2 between">
<div class="layui-form-item">
<label class="layui-form-label">摘要</label>
@ -35,6 +47,15 @@
</div>
<div class="layui-form-item"><div class="layui-form-mid layui-word-aux">摘要请勿超过60个字符</div></div>
</div>
<div class="layui-form-itemBox2 between">
<div class="layui-form-item">
<label class="layui-form-label">摘要-英文</label>
<div class="layui-input-block">
<input class="layui-input" type="text" name="item[summary_en]" maxlength="60" />
</div>
</div>
<div class="layui-form-item"><div class="layui-form-mid layui-word-aux">摘要请勿超过60个字符</div></div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">属性</label>
<div class="layui-inline">
@ -73,6 +94,13 @@
<textarea name="item[content]" class="layui-textarea layui-hide"></textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">内容-英文</label>
<div class="layui-input-block editor-text">
<div class="editor"></div>
<textarea name="item[content_en]" class="layui-textarea layui-hide"></textarea>
</div>
</div>
<!-- SEO 添加内容区域 -->
<div class="layui-form-itemBox3 between">
<div class="layui-form-item">
@ -83,6 +111,15 @@
</div>
<div class="layui-form-item"><div class="layui-form-mid layui-word-aux">内容字符长度为60</div></div>
</div>
<div class="layui-form-itemBox3 between">
<div class="layui-form-item">
<label class="layui-form-label">keywords-英文</label>
<div class="layui-input-block">
<textarea class="layui-textarea" name="item[seo_keywords_en]" placeholder="请在此填写英文站的SEO keywords 内容"></textarea>
</div>
</div>
<div class="layui-form-item"><div class="layui-form-mid layui-word-aux">内容字符长度为60</div></div>
</div>
<div class="layui-form-itemBox3 between">
<div class="layui-form-item">
<label class="layui-form-label">description</label>
@ -92,6 +129,15 @@
</div>
<div class="layui-form-item"><div class="layui-form-mid layui-word-aux">内容字符长度为60</div></div>
</div>
<div class="layui-form-itemBox3 between">
<div class="layui-form-item">
<label class="layui-form-label">description-英文</label>
<div class="layui-input-block">
<textarea class="layui-textarea" name="item[seo_description_en]" placeholder="请在此填写英文版SEO description 内容"></textarea>
</div>
</div>
<div class="layui-form-item"><div class="layui-form-mid layui-word-aux">内容字符长度为60</div></div>
</div>
<!-- SEO 添加内容区域 -->
<div class="layui-form-itemBox2 between">
<div class="layui-form-item">

View File

@ -12,6 +12,15 @@
</div>
<div class="layui-form-item"><div class="layui-form-mid layui-word-aux">标题请勿超过60个字符</div></div>
</div>
<div class="layui-form-itemBox3 between">
<div class="layui-form-item">
<label class="layui-form-label">标题-英文<em>*</em></label>
<div class="layui-input-block">
<input type="text" class="layui-input" name="item[title_en]" value="{$item.title_en??''}" maxlength="60"/>
</div>
</div>
<div class="layui-form-item"><div class="layui-form-mid layui-word-aux">标题请勿超过60个字符</div></div>
</div>
<div class="layui-form-itemBox3 between">
<div class="layui-form-item">
<label class="layui-form-label">链接</label>
@ -29,6 +38,12 @@
{:widget('manager.upload/image',['src' => $item.src??'', 'imgSize' => $imgSize])}
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">封面图-英文</label>
<div class="layui-input-block">
{:widget('manager.upload/image',['src' => $item.src_en??'', 'imgSize' => $imgSize, 'append'=>'_en'])}
</div>
</div>
<div class="layui-form-itemBox3 between">
<div class="layui-form-item">
<label class="layui-form-label">摘要</label>
@ -38,6 +53,15 @@
</div>
<div class="layui-form-item"><div class="layui-form-mid layui-word-aux">摘要请勿超过60个字符</div></div>
</div>
<div class="layui-form-itemBox3 between">
<div class="layui-form-item">
<label class="layui-form-label">摘要-英文</label>
<div class="layui-input-block">
<input type="text" class="layui-input" name="item[summary_en]" value="{$item.summary_en??''}" maxlength="60" />
</div>
</div>
<div class="layui-form-item"><div class="layui-form-mid layui-word-aux">摘要请勿超过60个字符</div></div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">属性</label>
<div class="layui-inline">
@ -76,6 +100,13 @@
<textarea name="item[content]" class="layui-textarea layui-hide">{$item.content??''}</textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">内容-英文</label>
<div class="layui-input-block editor-text">
<div class="editor"></div>
<textarea name="item[content_en]" class="layui-textarea layui-hide">{$item.content_en??''}</textarea>
</div>
</div>
<!-- SEO 添加内容区域 -->
<div class="layui-form-itemBox3 between">
<div class="layui-form-item">
@ -86,6 +117,15 @@
</div>
<div class="layui-form-item"><div class="layui-form-mid layui-word-aux">内容字符长度为60</div></div>
</div>
<div class="layui-form-itemBox3 between">
<div class="layui-form-item">
<label class="layui-form-label">keywords-英文</label>
<div class="layui-input-block">
<textarea class="layui-textarea" name="item[seo_keywords_en]" placeholder="请在此填写英文版SEO keywords 内容">{$item['seo_keywords_en']??''}</textarea>
</div>
</div>
<div class="layui-form-item"><div class="layui-form-mid layui-word-aux">内容字符长度为60</div></div>
</div>
<div class="layui-form-itemBox3 between">
<div class="layui-form-item">
<label class="layui-form-label">description</label>
@ -95,8 +135,17 @@
</div>
<div class="layui-form-item"><div class="layui-form-mid layui-word-aux">内容字符长度为60</div></div>
</div>
<div class="layui-form-itemBox3 between">
<div class="layui-form-item">
<label class="layui-form-label">description-英文</label>
<div class="layui-input-block">
<textarea class="layui-textarea" name="item[seo_description_en]" placeholder="请在此填写英文版SEO description 内容">{$item['seo_description_en']??''}</textarea>
</div>
</div>
<div class="layui-form-item"><div class="layui-form-mid layui-word-aux">内容字符长度为60</div></div>
</div>
<!-- SEO 添加内容区域 -->
<div class="layui-form-itemBox2 between">
<div class="layui-form-item">
<label class="layui-form-label">来源</label>

View File

@ -13,6 +13,15 @@
</div>
<div class="layui-form-item"><div class="layui-form-mid layui-word-aux">标题请勿超过60个字符</div></div>
</div>
<div class="layui-form-itemBox3 between">
<div class="layui-form-item">
<label class="layui-form-label">标题-英文<em>*</em></label>
<div class="layui-input-block">
<input class="layui-input" type="text" name="item[title_en]" maxlength="60" />
</div>
</div>
<div class="layui-form-item"><div class="layui-form-mid layui-word-aux">标题请勿超过60个字符</div></div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">状态</label>
<div class="layui-inline">

View File

@ -13,6 +13,15 @@
</div>
</div>
</div>
<div class="layui-form-itemBox3 between">
<div class="layui-form-item">
<label class="layui-form-label">事例概述-英文<em>*</em></label>
<div class="layui-input-block">
<textarea class="layui-textarea" name="item[title_en]" maxlength="200" onkeyup="limitContentLength(this, 200)"></textarea>
<p class="layui-form-mid layui-word-aux">事例概述请勿超过200个字符</p>
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">状态</label>
<div class="layui-inline">

View File

@ -13,6 +13,15 @@
</div>
<div class="layui-form-item"><div class="layui-form-mid layui-word-aux">标题请勿超过60个字符</div></div>
</div>
<div class="layui-form-itemBox3 between">
<div class="layui-form-item">
<label class="layui-form-label">标题-英文<em>*</em></label>
<div class="layui-input-block">
<input class="layui-input" type="text" name="item[title_en]" maxlength="60" value="{$item.title_en}" />
</div>
</div>
<div class="layui-form-item"><div class="layui-form-mid layui-word-aux">标题请勿超过60个字符</div></div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">状态</label>
<div class="layui-inline new-inline">

View File

@ -13,6 +13,15 @@
</div>
</div>
</div>
<div class="layui-form-itemBox3 between">
<div class="layui-form-item">
<label class="layui-form-label">事例概述-英文<em>*</em></label>
<div class="layui-input-block">
<textarea class="layui-textarea" name="item[title_en]" maxlength="200" onkeyup="limitContentLength(this, 200)">{$item.title_en}</textarea>
<p class="layui-form-mid layui-word-aux">事例概述请勿超过200个字符</p>
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">状态</label>
<div class="layui-inline">

View File

@ -8,18 +8,36 @@
<textarea class="layui-textarea" name="item[title]" maxlength="200" onkeyup="limitContentLength(this, 200)" placeholder="200字以内"></textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">标题-英文</label>
<div class="layui-input-block">
<textarea class="layui-textarea" name="item[title_en]" maxlength="200" onkeyup="limitContentLength(this, 200)" placeholder="200字以内"></textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">轮播图[pc]</label>
<div class="layui-input-block">
{:widget('manager.upload/image', ['append' => '_pc','img_size' => $img_size['slide_size']??''])}
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">轮播图[pc]-英文</label>
<div class="layui-input-block">
{:widget('manager.upload/image', ['append' => '_pc_en','img_size' => $img_size['slide_size']??''])}
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">轮播图[移动]</label>
<div class="layui-input-block">
{:widget('manager.upload/image',['append' => '_mobile', 'img_size' => $img_size['slide_mobile_size']??''])}
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">轮播图[移动]-英文</label>
<div class="layui-input-block">
{:widget('manager.upload/image',['append' => '_mobile_en', 'img_size' => $img_size['slide_mobile_size']??''])}
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">URL</label>
<div class="layui-input-block">
@ -32,6 +50,12 @@
<textarea class="layui-textarea" name="item[description]" maxlength="500" onkeyup="limitContentLength(this, 500)" placeholder="500字以内"></textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">简介-英文</label>
<div class="layui-input-block">
<textarea class="layui-textarea" name="item[description_en]" maxlength="500" onkeyup="limitContentLength(this, 500)" placeholder="500字以内"></textarea>
</div>
</div>
<div class="layui-clear"></div>
<hr style="margin: 30px 0;">
<div class="layui-form-item">

View File

@ -8,12 +8,24 @@
<textarea class="layui-textarea" name="item[title]" maxlength="200" onkeyup="limitContentLength(this, 200)" placeholder="200字以内">{$item.title??''}</textarea>
</div>
</div>
<div class="layui-form-item ">
<label class="layui-form-label">标题-英文</label>
<div class="layui-input-block">
<textarea class="layui-textarea" name="item[title_en]" maxlength="200" onkeyup="limitContentLength(this, 200)" placeholder="200字以内">{$item.title_en??''}</textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">轮播图[pc]</label>
<div class="layui-input-block">
{:widget('manager.upload/image',['src' => $item['src'], 'append' => '_pc', 'img_size' => $img_size['slide_size']??''])}
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">轮播图[pc]-英文</label>
<div class="layui-input-block">
{:widget('manager.upload/image',['src' => $item['src_en'], 'append' => '_pc_en', 'img_size' => $img_size['slide_size']??''])}
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">轮播图[移动]</label>
@ -21,6 +33,12 @@
{:widget('manager.upload/image',['src' => $item['src_mobile'], 'append' => '_mobile', 'img_size' => $img_size['slide_mobile_size']??''])}
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">轮播图[移动]-英文</label>
<div class="layui-input-block">
{:widget('manager.upload/image',['src' => $item['src_mobile_en'], 'append' => '_mobile_en', 'img_size' => $img_size['slide_mobile_size']??''])}
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">URL</label>
@ -34,6 +52,12 @@
<textarea class="layui-textarea" name="item[description]" onkeyup="limitContentLength(this, 200)" placeholder="200字以内">{$item.description}</textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">简介-英文</label>
<div class="layui-input-block">
<textarea class="layui-textarea" name="item[description_en]" onkeyup="limitContentLength(this, 200)" placeholder="200字以内">{$item.description_en}</textarea>
</div>
</div>
<div class="layui-clear"></div>
<hr style="margin: 30px 0;">
<div class="layui-form-item">