feat: mobile批量购买留言页

This commit is contained in:
2025-05-28 09:52:34 +08:00
parent fd28af12ed
commit 40852fcea4
7 changed files with 556 additions and 33 deletions

View File

@@ -18,7 +18,10 @@ return [
'header_var' => 'think-lang', 'header_var' => 'think-lang',
// 扩展语言包 // 扩展语言包
'extend_list' => [ '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', 'zh-cn' => app()->getAppPath() . '/lang/zh-cn/' . (request()->isMobile() ? 'mobile' : 'pc') . '.php',
], ],
// Accept-Language转义为对应语言包名称 // Accept-Language转义为对应语言包名称

View File

@@ -218,9 +218,9 @@ class ContactUs extends Common
'ip' => request()->ip(), 'ip' => request()->ip(),
]); ]);
if ($ret->isEmpty()) { 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') ->byName('bulk_purchase_inquiry_interested')
->find(); ->find();
if (empty($config)) { if (empty($config)) {
return error('当前选定语言的采购可选品类配置出错'); return error(lang('当前选定语言的采购可选品类配置出错'));
} }
View::assign('interested', explode(',', preg_replace('/\r?\n/', ',', $config->value))); View::assign('interested', explode(',', preg_replace('/\r?\n/', ',', $config->value)));

View File

@@ -80,19 +80,16 @@ return [
'请输入地址' => 'Enter Address', '请输入地址' => 'Enter Address',
'留言' => 'Message', '留言' => 'Message',
'请输入留言' => 'Enter your message', '请输入留言' => 'Enter your message',
// 成为分销商验证器提示 // 批量购买页面
'公司名称不能为空' => 'Company Name is required', '批量购买' => 'Bulk Buy',
'公司名称不能超过64个字符' => 'Company Name cannot exceed 64 characters', '法定营业名称' => 'Legal business name',
'邮箱不能为空' => 'Email is required', '官方网站' => 'Official website',
'邮箱格式不正确' => 'Email format is incorrect', '请粘贴网址' => 'Please paste the URL',
'邮箱不能超过128个字符' => 'Email cannot exceed 128 characters', '姓名' => 'Your Name',
'电话号码不能为空' => 'Phone Number is required', '' => 'Last name',
'电话号码不能超过64个字符' => 'Phone Number cannot exceed 64 characters', '名' => 'First name',
'业务类型不能为空' => 'Type of Business is required', '邮箱' => 'Email',
'业务类型不能超过128个字符' => 'Type of Business cannot exceed 128 characters', '电话号码' => 'Phone Number',
'企业规模不能为空' => 'Enterprise Size is required', '您对哪个产品品类感兴趣?' => 'Products you are interested in?',
'企业规模不能超过128个字符' => 'Enterprise Size cannot exceed 128 characters', '当前选定语言的采购可选品类配置出错' => 'The procurement category configuration for the currently selected language is incorrect',
'公司地址不能为空' => 'Company Address is required',
'公司地址不能超过255个字符' => 'Company Address cannot exceed 255 characters',
'留言不能为空' => 'Message is required',
]; ];

View File

@@ -0,0 +1,28 @@
<?php
return [
'公司名称不能为空' => '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',
];

View File

@@ -31,19 +31,19 @@ class ContactUsBulkBuyValidate extends Validate
* @var array * @var array
*/ */
protected $message = [ protected $message = [
'corp_name.require' => 'valudate_corp_name_require', 'corp_name.require' => '公司名称不能为空',
'corp_name.max' => 'valudate_corp_name_max', 'corp_name.max' => '公司名称不能超过128个字符',
'url.max' => 'valudate_url_max', 'url.max' => '网址不能超过255个字符',
'first_name.require' => 'valudate_first_name_require', 'first_name.require' => '名不能为空',
'first_name.max' => 'valudate_first_name_max', 'first_name.max' => '名不能超过64个字符',
'last_name.require' => 'valudate_last_name_require', 'last_name.require' => '姓不能为空',
'last_name.max' => 'valudate_last_name_max', 'last_name.max' => '姓不能超过64个字符',
'email.require' => 'valudate_email_require', 'email.require' => '邮箱不能为空',
'email.email' => 'valudate_email_email', 'email.email' => '邮箱格式不正确',
'email.max' => 'valudate_email_max', 'email.max' => '邮箱不能超过128个字符',
'phone.max' => 'valudate_phone_max', 'phone.max' => '电话号码不能超过32个字符',
'interested.max' => 'valudate_interested_max' , 'interested.max' => '感兴趣的产品种类不能超过255个字符',
'message.require' => 'valudate_message_require', 'message.require' => '留言内容不能为空',
'message.max' => 'valudate_message_max', 'message.max' => '留言内容不能超过1024个字符',
]; ];
} }

View File

@@ -0,0 +1,97 @@
{extend name="public/base" /}
{block name="style"}
<link rel="stylesheet" type="text/css" href="__CSS__/contactus_bulkbuy.css" />
{/block}
{block name="main"}
<div class="oricoEGapp">
<div class="bdpage" style="background: #fff;border-radius: 8px;padding-top: 50px;">
<div class="bd_main bd_main1 bd_main2">
<h1 class="t1 sfbt1">{:lang('批量购买')}</h1>
<form action="" method="post" autocomplete="off">
<!--内容-->
<div class="bd_ct ">
<div class="bd_from" style="padding: 0 16px;">
<div class="theit">
<div class="bditem">
<label class="itlable">{:lang('公司名称')}<span class="redtag">*</span></label>
<input type="text" name="corp_name" class="form-control itinp companyName" placeholder="{:lang('法定营业名称')}">
</div>
</div>
<div class="theit">
<div class="bditem">
<label class="itlable">{:lang('官方网站')}</label>
<input type="text" name="url" class="form-control itinp url" placeholder="{:lang('请粘贴网址')}">
</div>
</div>
<div class="theit">
<div class="bditem">
<label class="itlable">{:lang('姓名')}<span class="redtag">*</span></label>
<input type="text" name="first_name" class="form-control itinp firstname" placeholder="{:lang('名')}">
<input type="text" name="last_name" class="form-control itinp lastname" placeholder="{:lang('姓')}" style="margin-top: 8px;">
</div>
</div>
<div class="theit">
<div class="bditem">
<label class="itlable">{:lang('邮箱')}<span class="redtag">*</span></label>
<input type="text" name="email" class="form-control itinp email" placeholder="{:lang('请输入邮箱')}">
</div>
</div>
<div class="theit">
<div class="bditem bditem1">
<label class="itlable">{:lang('电话号码')}</label>
<input type="text" name="phone" class="form-control itinp phone" placeholder="{:lang('请输入电话号码')}">
</div>
</div>
<div class="theit">
<div class="bditem bditem1">
<label class="itlable">{:lang('您对哪个产品品类感兴趣?')}</label>
<div class="sfbchecks">
{notempty name="interested"}
{volist name="interested" id="it"}
<label class="cit">
<input name="interested" type="checkbox" value="{$it}" class="sfbcheckboxit" />{$it}
</label>
{/volist}
{/notempty}
</div>
</div>
</div>
<div class="theit">
<div class="bditem bditem1">
<label class="itlable">{:lang('留言')}<span class="redtag">*</span></label>
<textarea name="message" class="ittextarea ittextarea2 message" placeholder="{:lang('请输入留言')}"></textarea>
</div>
</div>
</div>
</div>
<!-- 提交-->
<div class="bttj" id="send">{:lang('提交')}</div>
</form>
</div>
</div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
$(function(){
$("#send").click(function(){
var form = $(this).parents("form");
$.ajax({
url: "{:url('contactus/bulkbuy')}",
type: "post",
dataType: "json",
data: form.serialize(),
success: function(r){
if(r.code == 0){
form.get(0).reset();
}
alert(r.msg);
},
error: function(e){
console.error(e);
}
})
})
})
</script>
{/block}

View File

@@ -0,0 +1,398 @@
.cooperapp_bdpage {
width: 100%;
background: #f2f2f2;
position: relative;
}
.cooperapp_bd_main {
background: #fff;
border-radius: 8px;
padding: 24px 16px;
margin: 20px;
margin-top: 70px;
}
.cooperapp_t1 {
font-size: 18px;
color: #004bfa;
text-align: left;
font-family: Montserrat-Bold, Montserrat;
font-weight: 700;
margin-top: 0;
margin-bottom: 12px;
}
.cooperapp_s1 {
font-size: 12px;
color: #707070;
text-align: center;
text-align: left;
font-family: Montserrat-Medium, Montserrat;
font-weight: 500;
}
.bd_ct {
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
}
.cooperapp_bd_ct {
width: 100%;
flex-direction: column;
}
.cooperapp_bdimg {
width: 100%;
}
.thimg {
margin-top: 12px;
width: 100%;
margin-bottom: 24px;
}
.bdimg {
width: 100%;
height: 100%;
}
.bd_from {
display: flex;
flex: 1;
flex-direction: column;
}
.theit {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-bottom: 20px;
}
.bditem {
display: flex;
flex-direction: column;
flex: 1;
}
.bditem1 {
width: 100%;
}
.itlable {
font-size: 12.5px;
font-family: Montserrat-Medium, Montserrat;
color: #000000;
font-weight: bold;
padding-bottom: 5px;
width: fit-content;
position: relative;
}
.redtag {
position: absolute;
right: -10px;
top: 0px;
color: #ee2f53;
}
.itinp {
font-size: 16px;
background: #f2f2f2;
/*border: none !important;*/
border-radius: 8px;
height: 48px;
border: none;
box-shadow: none;
font-family: Montserrat-Regular, Montserrat;
}
.itselectopen {
width: 100%;
height: 48px;
display: flex;
background: #f2f2f2;
border: none !important;
border-radius: 8px;
box-shadow: none;
align-items: center;
justify-content: space-between;
}
.dropdown-menu {
width: 100%;
}
.ittextarea {
height: 100px;
padding: 15px;
background: #f2f2f2;
border-radius: 8px;
font-family: Montserrat-Regular, Montserrat;
}
.bttj {
font-size: 14px;
font-family: Montserrat-Bold, Montserrat;
font-weight: bold;
width: 212px;
/* height: 48px; */
padding: 15px 60px;
background: #004bfa;
border-radius: 28px;
color: #fff;
text-align: center;
margin: 0 auto;
margin-top: 10px;
}
.iotbpage {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
position: relative;
overflow: auto;
padding-top: 50px;
}
.iotb_bgw {
width: 100%;
background-color: #fff;
display: flex;
flex-direction: column;
align-items: center;
}
.bdimg1 {
width: 100%;
}
.iotbt1 {
font-size: 18px;
font-family: Montserrat-Bold, Montserrat;
padding-bottom: 24px;
padding-top: 40px;
font-weight: 700;
color: #000;
}
.iotb_part1 {
padding: 0 20px;
display: flex;
flex-direction: row;
justify-content: space-between;
flex-wrap: wrap;
padding-bottom: 40px;
align-items: baseline;
}
.iotb_p1_item {
width: 45%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.iotb_p1_item img {
width: 72px;
height: 72px;
}
.iotbic1 {
width: 120px;
height: 120px;
}
.iotbtp1 {
font-size: 14px;
font-family: Montserrat-Bold, Montserrat;
font-weight: bold;
padding-bottom: 11px;
word-break: break-word;
}
.iotbts1 {
text-align: center;
font-size: 12px;
font-family: Montserrat-Medium, Montserrat;
color: #9e9e9f;
word-break: break-word;
}
.iotb_part2 {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.fdimgs {
padding-bottom: 60px;
margin: 0 auto;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.iotb_part3 {
width: 100%;
padding-bottom: 81px;
display: flex;
background-color: #fff;
flex-direction: column;
}
.odmmain {
width: 70%;
margin: 0 auto;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
.odmconten {
width: 81%;
margin: 0 auto;
display: flex;
flex-direction: row;
justify-content: space-between;
flex-wrap: wrap;
}
.odmitem {
width: 41%;
display: flex;
flex-direction: column;
align-items: center;
padding-bottom: 24px;
}
.appodmimg {
width: 72px;
height: 72px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
box-shadow: 0px 2px 5px rgba(124, 162, 207, 0.2);
}
.odms1 {
color: #202020;
font-size: 14px;
padding-top: 12px;
text-align: center;
font-family: Montserrat-Medium, Montserrat;
overflow-wrap: break-word;
word-break: break-word;
}
.appcoofootimg {
width: 100%;
}
.sfbt1 {
text-align: center;
font-size: 18px;
font-family: Montserrat-Bold, Montserrat;
font-weight: bold;
padding-bottom: 24px;
padding-top: 24px;
color: #000;
}
.sfbchecks {
display: flex;
flex-direction: column;
}
.sfbcheckboxlist {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.sfbcheckboxit {
margin: 0 !important;
border: 1px solid #ccc;
width: 16px !important;
height: 16px !important;
border-radius: 2px !important;
margin-right: 10px !important;
}
.cit {
width: 100%;
font-size: 14px;
font-family: Montserrat-Regular, Montserrat;
color: #000;
display: flex;
flex-direction: row;
align-items: center;
margin-bottom: 12px;
font-weight: 400;
}
.bd_main1 {
max-height: none;
}
.ittextarea2 {
height: 200px;
border: 0;
}
.bditem select {
border: 1px solid #f2f2f2;
}
.bd_from .form-control {
display: block;
/*width: 100%;*/
padding: 2px 12px;
font-size: 14px;
line-height: 1.42857143;
color: #555;
transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
}
.wcu_list {
display: flex;
flex-direction: column;
padding: 0 20px;
}
.wcu_ltem {
width: 100%;
margin-bottom: 12px;
background: #fff;
border-radius: 8px;
display: flex;
flex-direction: column;
/*padding: 0 20px;*/
}
.wcu_ltem .fbit {
width: 100%;
}
.wcu_s1 {
color: #000;
font-size: 16px;
font-family: Montserrat-Medium, Montserrat;
font-weight: 500;
padding: 20px 24px;
}
.bd_main2 {
padding-bottom: 75px;
}