From bc171cde4e74d1f4cb9147e7fc2fff34a0ec8188 Mon Sep 17 00:00:00 2001 From: jsasg <735273025@qq.com> Date: Wed, 28 May 2025 09:52:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20mobile=E6=89=B9=E9=87=8F=E8=B4=AD?= =?UTF-8?q?=E4=B9=B0=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/config/lang.php | 5 +- app/index/controller/ContactUs.php | 6 +- app/index/lang/en-us/mobile.php | 27 +- app/index/lang/en-us/validate.php | 28 ++ .../validate/ContactUsBulkBuyValidate.php | 28 +- app/index/view/mobile/contact_us/bulkbuy.html | 97 +++++ .../index/mobile/css/contactus_bulkbuy.css | 398 ++++++++++++++++++ 7 files changed, 556 insertions(+), 33 deletions(-) create mode 100644 app/index/lang/en-us/validate.php create mode 100644 app/index/view/mobile/contact_us/bulkbuy.html create mode 100755 public/static/index/mobile/css/contactus_bulkbuy.css diff --git a/app/index/config/lang.php b/app/index/config/lang.php index f5055ebb..ee8705b9 100644 --- a/app/index/config/lang.php +++ b/app/index/config/lang.php @@ -18,7 +18,10 @@ return [ 'header_var' => 'think-lang', // 扩展语言包 'extend_list' => [ - 'en-us' => app()->getAppPath() . '/lang/en-us/' . (request()->isMobile() ? 'mobile' : 'pc') . '.php', + 'en-us' => [ + app()->getAppPath() . '/lang/en-us/' . (request()->isMobile() ? 'mobile' : 'pc') . '.php', + app()->getAppPath() . '/lang/en-us/validate.php', + ], 'zh-cn' => app()->getAppPath() . '/lang/zh-cn/' . (request()->isMobile() ? 'mobile' : 'pc') . '.php', ], // Accept-Language转义为对应语言包名称 diff --git a/app/index/controller/ContactUs.php b/app/index/controller/ContactUs.php index 08167533..4da9e34a 100644 --- a/app/index/controller/ContactUs.php +++ b/app/index/controller/ContactUs.php @@ -218,9 +218,9 @@ class ContactUs extends Common 'ip' => request()->ip(), ]); if ($ret->isEmpty()) { - return error(lang('contact_bulkbuy.send_fail')); + return error(lang('信息提交失败!')); } - return success(lang('contact_bulkbuy.send_success')); + return success(lang('信息已成功提交!')); } // 获取可选产品品类配置 @@ -230,7 +230,7 @@ class ContactUs extends Common ->byName('bulk_purchase_inquiry_interested') ->find(); if (empty($config)) { - return error('当前选定语言的采购可选品类配置出错'); + return error(lang('当前选定语言的采购可选品类配置出错')); } View::assign('interested', explode(',', preg_replace('/\r?\n/', ',', $config->value))); diff --git a/app/index/lang/en-us/mobile.php b/app/index/lang/en-us/mobile.php index 7d848d68..dd3db626 100644 --- a/app/index/lang/en-us/mobile.php +++ b/app/index/lang/en-us/mobile.php @@ -80,19 +80,16 @@ return [ '请输入地址' => 'Enter Address', '留言' => 'Message', '请输入留言' => 'Enter your message', - // 成为分销商验证器提示 - '公司名称不能为空' => 'Company Name is required', - '公司名称不能超过64个字符' => 'Company Name cannot exceed 64 characters', - '邮箱不能为空' => 'Email is required', - '邮箱格式不正确' => 'Email format is incorrect', - '邮箱不能超过128个字符' => 'Email cannot exceed 128 characters', - '电话号码不能为空' => 'Phone Number is required', - '电话号码不能超过64个字符' => 'Phone Number cannot exceed 64 characters', - '业务类型不能为空' => 'Type of Business is required', - '业务类型不能超过128个字符' => 'Type of Business cannot exceed 128 characters', - '企业规模不能为空' => 'Enterprise Size is required', - '企业规模不能超过128个字符' => 'Enterprise Size cannot exceed 128 characters', - '公司地址不能为空' => 'Company Address is required', - '公司地址不能超过255个字符' => 'Company Address cannot exceed 255 characters', - '留言不能为空' => 'Message is required', + // 批量购买页面 + '批量购买' => 'Bulk Buy', + '法定营业名称' => 'Legal business name', + '官方网站' => 'Official website', + '请粘贴网址' => 'Please paste the URL', + '姓名' => 'Your Name', + '姓' => 'Last name', + '名' => 'First name', + '邮箱' => 'Email', + '电话号码' => 'Phone Number', + '您对哪个产品品类感兴趣?' => 'Products you are interested in?', + '当前选定语言的采购可选品类配置出错' => 'The procurement category configuration for the currently selected language is incorrect', ]; \ No newline at end of file diff --git a/app/index/lang/en-us/validate.php b/app/index/lang/en-us/validate.php new file mode 100644 index 00000000..9b5f1139 --- /dev/null +++ b/app/index/lang/en-us/validate.php @@ -0,0 +1,28 @@ + 'Company Name is required', + '公司名称不能超过64个字符' => 'Company Name cannot exceed 64 characters', + '邮箱不能为空' => 'Email is required', + '邮箱格式不正确' => 'Email format is incorrect', + '邮箱不能超过128个字符' => 'Email cannot exceed 128 characters', + '电话号码不能为空' => 'Phone Number is required', + '电话号码不能超过64个字符' => 'Phone Number cannot exceed 64 characters', + '业务类型不能为空' => 'Type of Business is required', + '业务类型不能超过128个字符' => 'Type of Business cannot exceed 128 characters', + '企业规模不能为空' => 'Enterprise Size is required', + '企业规模不能超过128个字符' => 'Enterprise Size cannot exceed 128 characters', + '公司地址不能为空' => 'Company Address is required', + '公司地址不能超过255个字符' => 'Company Address cannot exceed 255 characters', + '留言不能为空' => 'Message is required', + '公司名称不能超过128个字符' => 'Company name cannot exceed 128 characters', + '网址不能超过255个字符' => 'URL cannot exceed 255 characters', + '名不能为空' => 'First Name is required', + '名不能超过64个字符' => 'First name cannot exceed 64 characters', + '姓不能为空' => 'Last name is required', + '姓不能超过64个字符' => 'Last name cannot exceed 64 characters', + '电话号码不能超过32个字符' => 'Phone number cannot exceed 32 characters', + '感兴趣的产品种类不能超过255个字符' => 'Interested product categories cannot exceed 255 characters', + '留言内容不能为空' => 'Message content is required', + '留言内容不能超过1024个字符' => 'Message content cannot exceed 1024 characters', +]; \ No newline at end of file diff --git a/app/index/validate/ContactUsBulkBuyValidate.php b/app/index/validate/ContactUsBulkBuyValidate.php index df009494..00cb549b 100644 --- a/app/index/validate/ContactUsBulkBuyValidate.php +++ b/app/index/validate/ContactUsBulkBuyValidate.php @@ -31,19 +31,19 @@ class ContactUsBulkBuyValidate extends Validate * @var array */ protected $message = [ - 'corp_name.require' => 'valudate_corp_name_require', - 'corp_name.max' => 'valudate_corp_name_max', - 'url.max' => 'valudate_url_max', - 'first_name.require' => 'valudate_first_name_require', - 'first_name.max' => 'valudate_first_name_max', - 'last_name.require' => 'valudate_last_name_require', - 'last_name.max' => 'valudate_last_name_max', - 'email.require' => 'valudate_email_require', - 'email.email' => 'valudate_email_email', - 'email.max' => 'valudate_email_max', - 'phone.max' => 'valudate_phone_max', - 'interested.max' => 'valudate_interested_max' , - 'message.require' => 'valudate_message_require', - 'message.max' => 'valudate_message_max', + 'corp_name.require' => '公司名称不能为空', + 'corp_name.max' => '公司名称不能超过128个字符', + 'url.max' => '网址不能超过255个字符', + 'first_name.require' => '名不能为空', + 'first_name.max' => '名不能超过64个字符', + 'last_name.require' => '姓不能为空', + 'last_name.max' => '姓不能超过64个字符', + 'email.require' => '邮箱不能为空', + 'email.email' => '邮箱格式不正确', + 'email.max' => '邮箱不能超过128个字符', + 'phone.max' => '电话号码不能超过32个字符', + 'interested.max' => '感兴趣的产品种类不能超过255个字符', + 'message.require' => '留言内容不能为空', + 'message.max' => '留言内容不能超过1024个字符', ]; } diff --git a/app/index/view/mobile/contact_us/bulkbuy.html b/app/index/view/mobile/contact_us/bulkbuy.html new file mode 100644 index 00000000..8cefd10b --- /dev/null +++ b/app/index/view/mobile/contact_us/bulkbuy.html @@ -0,0 +1,97 @@ +{extend name="public/base" /} +{block name="style"} + +{/block} +{block name="main"} +