From c974adf9b93cb66d6431e1c452ddedd560401bbc Mon Sep 17 00:00:00 2001
From: jsasg <735273025@qq.com>
Date: Fri, 6 Jun 2025 16:10:51 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20mobile=E6=96=87=E7=AB=A0=E8=AF=A6?=
=?UTF-8?q?=E6=83=85=E9=A1=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/index/controller/Article.php | 14 +-
app/index/lang/en-us/mobile.php | 15 ++
app/index/view/mobile/article/detail.html | 149 ++++++++++++++
.../index/mobile/css/article_detail.css | 189 ++++++++++++++++++
public/static/index/mobile/images/1line.webp | Bin 0 -> 202 bytes
5 files changed, 361 insertions(+), 6 deletions(-)
create mode 100644 app/index/view/mobile/article/detail.html
create mode 100644 public/static/index/mobile/css/article_detail.css
create mode 100644 public/static/index/mobile/images/1line.webp
diff --git a/app/index/controller/Article.php b/app/index/controller/Article.php
index 23660acc..7ed9fe64 100644
--- a/app/index/controller/Article.php
+++ b/app/index/controller/Article.php
@@ -129,12 +129,14 @@ class Article extends Common
// 验证字段
$validate = Validate::rule([
- 'name' => 'max:64',
- 'email' => 'email'
+ 'name' => 'require|max:64',
+ 'email' => 'require|email'
])
->message([
- 'name.max' => '姓名不能超过64个字符',
- 'email' => '请输入正确的邮箱'
+ 'name.require' => '姓名不能为空',
+ 'name.max' => '姓名不能超过:rule个字符',
+ 'email.require' => '邮箱不能为空',
+ 'email.email' => '邮箱格式不正确'
]);
if (!$validate->check($post)) {
return error($validate->getError());
@@ -148,9 +150,9 @@ class Article extends Common
]);
$ret = ArticleLeaveMessageModel::create($data);
if ($ret->isEmpty()) {
- return error('留言提交失败');
+ return error(lang('留言提交失败'));
}
- return success('留言提交成功');
+ return success(lang('留言提交成功'));
}
}
diff --git a/app/index/lang/en-us/mobile.php b/app/index/lang/en-us/mobile.php
index b7e110f2..9701e9fe 100644
--- a/app/index/lang/en-us/mobile.php
+++ b/app/index/lang/en-us/mobile.php
@@ -15,6 +15,8 @@ return [
'提交失败' => 'fail',
'信息已成功提交!' => 'Add Success!',
'信息提交失败!' => 'Add Fail!',
+ '留言提交失败' => 'Message submit failed',
+ '留言提交成功' => 'Message submit success',
'当前选定语言的采购可选品类配置出错' => 'Current language configuration of purchase optional categories is incorrect',
// 首页
@@ -29,6 +31,19 @@ return [
'客服团队的工作时间:周一到周五,早9点到晚6点 平均应答时间:24小时内' => 'Our customer support is available Monday to Friday: 9am-6:00pm. Average answer time: 24h',
],
+ // 文章详情页
+ 'article/detail' => [
+ '分享' => 'SHARE',
+ '留言' => 'Leave a Reply',
+ '名称' => 'Name',
+ '电子邮箱' => 'Email',
+ '您的电子邮件地址不会被公开' => 'Your email address will not be pulished.',
+ '留言内容' => 'Comment',
+ '提交留言' => 'POST COMMENT',
+ '你可能还喜欢' => 'Recommended for you',
+ '链接复制成功' => 'Link copied successfully',
+ ],
+
// 产品分类
'product/category' => [
'查看全部' => 'View All',
diff --git a/app/index/view/mobile/article/detail.html b/app/index/view/mobile/article/detail.html
new file mode 100644
index 00000000..1decf523
--- /dev/null
+++ b/app/index/view/mobile/article/detail.html
@@ -0,0 +1,149 @@
+{extend name="public/base" /}
+{block name="title"}
+ {notempty name="detail.seo_title"}
{$detail.seo_title}{else /}{__BLOCK__}{/notempty}
+{/block}
+{block name="seo"}
+ {notempty name="detail.seo_keywords"}
+
+
+ {else /}
+ {__BLOCK__}
+ {/notempty}
+{/block}
+{block name="style"}
+
+{/block}
+{block name="main"}
+
+
+
+
+
+
+
{$detail.title}
+
{$detail.release_time}
+
+
{$detail.content|raw}
+
+
+ {notempty name="share_config"}
+
+ {/notempty}
+
+ {notempty name="$recommends"}
+
+
+
{:lang_i18n('你可能还喜欢')}
+

+
+
+
+ {volist name="recommends" id="vo"}
+
+ {/volist}
+
+
+
+
+
+ {/notempty}
+
+
+
+
+{/block}
+{block name="script"}
+
+{/block}
\ No newline at end of file
diff --git a/public/static/index/mobile/css/article_detail.css b/public/static/index/mobile/css/article_detail.css
new file mode 100644
index 00000000..3e0ac54e
--- /dev/null
+++ b/public/static/index/mobile/css/article_detail.css
@@ -0,0 +1,189 @@
+.oricoEGapp-articledetail {
+ display: flex;
+ flex-direction: column;
+ background: #fff;
+}
+
+.oricoEGapp-articledetail .content {
+ margin-top: 3.75rem;
+ width: 90%;
+ margin: 2.5rem auto;
+ margin-top: 4.6rem;
+}
+
+.oricoEGapp-articledetail .content .blog_detail {
+ height: auto;
+ background: #ffffff;
+ border: 1px solid #e8e8e8;
+}
+
+.oricoEGapp-articledetail .content .blog_detail .blog_title {
+ margin: 1rem;
+ border-bottom: 1px solid #e8e8e8;
+ padding-bottom: 1rem;
+}
+
+.oricoEGapp-articledetail .content .blog_detail .blog_content {
+ margin: 1rem;
+}
+
+.oricoEGapp-articledetail .content .blog_detail .blog_content img {
+ max-width: 100%;
+}
+
+.oricoEGapp-articledetail .content .blog_detail .blog_content p {
+ font-size: 0.875rem;
+ font-weight: 400;
+ line-height: 1.5rem;
+ color: #252525;
+ margin-bottom: 0.625rem;
+ overflow: hidden;
+ max-width: 100%;
+ text-indent: 0 !important;
+}
+
+.oricoEGapp-articledetail .content .blog_detail .blog_content p span {
+ font-size: 0.875rem;
+ line-height: 1rem;
+}
+
+.oricoEGapp-articledetail .content .blog_detail .blog_content p img {
+ width: 100%;
+ height: auto;
+ margin-bottom: 0.5rem;
+}
+
+.oricoEGapp-articledetail .content .share_box {
+ width: 100%;
+}
+
+.oricoEGapp-articledetail .content .share_box .blog_share {
+ width: 100%;
+ height: auto;
+ background: #ffffff;
+ border: 1px solid #e8e8e8;
+ margin: 1rem 0;
+}
+
+.oricoEGapp-articledetail .content .share_box .blog_share h3 {
+ font-size: 1rem;
+ line-height: 2.125rem;
+ color: #959595;
+ font-weight: bold;
+ padding: 0.25rem 1.875rem 0.75rem;
+ border-bottom: 1px solid #e8e8e8;
+}
+
+.oricoEGapp-articledetail .content .share_box .blog_share .share_list {
+ padding: 1.875rem;
+}
+
+.oricoEGapp-articledetail .content .share_box .blog_share .share_list::after {
+ content: "";
+ display: block;
+ clear: both;
+}
+
+.oricoEGapp-articledetail .content .share_box .blog_share .share_list li {
+ position: relative;
+ width: 21%;
+ height: auto;
+ margin-right: 0.5rem;
+ float: left;
+}
+
+.oricoEGapp-articledetail .content .share_box .blog_share .share_list .wechat .wechat_code {
+ display: none;
+ left: 3.8rem;
+ margin-top: 10px;
+ background-color: #fff;
+ color: #fff;
+ box-shadow: 0px 5px 20px 0px rgba(119, 123, 128, 0.5);
+ line-height: 24px;
+ padding: 20px 25px;
+ z-index: 999;
+ position: absolute;
+ font-size: 14px;
+ color: #333;
+}
+
+.oricoEGapp-articledetail .content .share_box .blog_share .share_list .wechat img {
+ vertical-align: middle;
+}
+
+.oricoEGapp-articledetail .content .share_box .comment {
+ background: #ffffff;
+ width: 100%;
+ padding-bottom: 1.875rem;
+ border: 1px solid #e8e8e8;
+}
+
+.oricoEGapp-articledetail .content .share_box .comment h3 {
+ font-size: 1rem;
+ line-height: 1rem;
+ color: #959595;
+ font-weight: bold;
+ padding: 1rem 1.25rem;
+ border-bottom: 1px solid #e8e8e8;
+}
+
+.oricoEGapp-articledetail .content .share_box .comment .comment_form {
+ padding: 1rem 1.25rem;
+}
+
+.oricoEGapp-articledetail .content .share_box .comment .comment_form .comment_form div {
+ font-size: 0.825rem;
+ color: #252525;
+ float: left;
+ width: 100%;
+}
+
+.oricoEGapp-articledetail .content .share_box .comment .itinp {
+ background: #f2f2f2;
+ /* border: none !important; */
+ border-radius: 8px;
+ height: 48px;
+ box-shadow: none;
+ font-family: Montserrat-Regular, Montserrat;
+}
+
+.oricoEGapp-articledetail .content .share_box .comment .comment_form>div input {
+ width: 100%;
+ height: 1.75rem;
+ border: 1px solid #dbdbdb;
+ margin-top: 0.5rem;
+}
+
+.oricoEGapp-articledetail .mblove {
+ width: 100%;
+ background: #f1f1f1;
+}
+
+.oricoEGapp-articledetail .mblove .mianct {
+ margin-top: 5%;
+}
+
+.oricoEGapp-articledetail .mblove .mianct .thtitle,
+.oricoEGapp-articledetail .mblove .mianct p {
+ font-size: 1.5em;
+ color: #333;
+ font-weight: bold;
+ text-align: center;
+}
+
+.oricoEGapp-articledetail .mblove .mianct .thtitle img,
+.oricoEGapp-articledetail .mblove .mianct p img {
+ width: 100%;
+ display: block;
+}
+
+.oricoEGapp-articledetail .mblove .mianct p:nth-child(2) {
+ margin-top: 2.4%;
+}
+
+.oricoEGapp-articledetail .share_list .triggered_qrcode {
+ display: none;
+ position: absolute;
+ left: 50%;
+ transform: translateX(-50%);
+}
\ No newline at end of file
diff --git a/public/static/index/mobile/images/1line.webp b/public/static/index/mobile/images/1line.webp
new file mode 100644
index 0000000000000000000000000000000000000000..99bdc98208d28ba2acb473726c4404452c341a0c
GIT binary patch
literal 202
zcmWIYbaOkzz`zjh>J$(bU=hIuWD5ZCdKLy&1_no;01smzk5ODfz@zC_d~R{*Wz^ch
z!p2}X(PN>{(k04DiXIFbgg7(v9u^cZ95+fiIa$qTCY0h0ysWp6a|!3oaAqBt7)VNv
lf#KhuRShgAu7
{:lang_i18n('留言')}
+ +