From cc254aca2570380e62f6af014dbde104ad4c8f74 Mon Sep 17 00:00:00 2001 From: jsasg <735273025@qq.com> Date: Thu, 29 May 2025 10:45:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20mobile=20=E8=81=94=E7=B3=BB=E6=88=91?= =?UTF-8?q?=E4=BB=AC=E7=95=99=E8=A8=80=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/index/common.php | 25 ++- app/index/controller/ContactUs.php | 4 +- app/index/lang/en-us/mobile.php | 12 ++ app/index/view/mobile/contact_us/message.html | 102 ++++++++++++ .../index/mobile/css/contactus_message.css | 156 ++++++++++++++++++ 5 files changed, 294 insertions(+), 5 deletions(-) create mode 100644 app/index/view/mobile/contact_us/message.html create mode 100755 public/static/index/mobile/css/contactus_message.css diff --git a/app/index/common.php b/app/index/common.php index 0610181f..81d86119 100644 --- a/app/index/common.php +++ b/app/index/common.php @@ -99,8 +99,7 @@ if (!function_exists('thumb')) { } } -if (!function_exists('get_path_from_img_tag')) -{ +if (!function_exists('get_path_from_img_tag')) { /** * 从img标签中获取图片路径 * @param string $img @@ -115,4 +114,24 @@ if (!function_exists('get_path_from_img_tag')) return ''; } -} \ No newline at end of file +} + +if (!function_exists('lang_i18n')) { + /** + * 获取国际化语言包 + * 根据请求页面path获取分组语言对应值 + * + * @param string $name 语言包名称 + * @param array $vars 替换变量 + * @param string $lang 语言标识 + * @return string + */ + function lang_i18n(string $name, array $vars = [], string $lang = '') { + if (is_null($name)) { + return ''; + } + $path = strtolower(request()->controller() . '/' . request()->action()); + $name = $path . '.' . $name; + return lang($name, $vars, $lang); + } +} diff --git a/app/index/controller/ContactUs.php b/app/index/controller/ContactUs.php index 4da9e34a..17a6addf 100644 --- a/app/index/controller/ContactUs.php +++ b/app/index/controller/ContactUs.php @@ -89,10 +89,10 @@ class ContactUs extends Common 'user_agent' => request()->header('user-agent'), ]); if ($msg->isEmpty()) { - return error(lang('contact_message.send_fail')); + return error(lang('信息提交失败!')); } - return success(lang('contact_message.send_success')); + return success(lang('信息已成功提交!')); } $focus_image = []; diff --git a/app/index/lang/en-us/mobile.php b/app/index/lang/en-us/mobile.php index 9caf1bbc..4ea52811 100644 --- a/app/index/lang/en-us/mobile.php +++ b/app/index/lang/en-us/mobile.php @@ -71,4 +71,16 @@ return [ '电话号码' => 'Phone Number', '您对哪个产品品类感兴趣?' => 'Products you are interested in?', '当前选定语言的采购可选品类配置出错' => 'The procurement category configuration for the currently selected language is incorrect', + + // 联系我们留言页 + 'contactus/message' => [ + '我们的信息' => 'Our Information', + '姓名' => 'Your name', + '电子邮箱' => 'Your email', + '您的问题' => 'Your message', + '提交您的问题' => 'Send Us Your Question', + '请输入内容...' => 'This is your placeholder text', + '发送' => 'SEND', + '成为经销商' => 'Become a Distributor', + ], ]; \ No newline at end of file diff --git a/app/index/view/mobile/contact_us/message.html b/app/index/view/mobile/contact_us/message.html new file mode 100644 index 00000000..87343d90 --- /dev/null +++ b/app/index/view/mobile/contact_us/message.html @@ -0,0 +1,102 @@ +{extend name="public/base" /} +{block name="style"} + +{/block} +{block name="main"} +