File: /var/www/dk/wp-content/themes/food/page-contact_form_BizRoadShow.php
<?php
/* Template Name: contact_form_BizRoadShow */
get_header('BizRoadShow');
$index_post = 81;
//獲取預設info
$home_info = new stdClass;
$home_info->cate1 = get_post_meta($index_post, "cate1", true);
$home_info->part2_m_url = get_post_meta($index_post, "part2_m_url", true);
$home_info->part2_pc_url = get_post_meta($index_post, "part2_pc_url", true);
$home_info->part2_cate = get_post_meta($index_post, "part2_cate", true);
$home_info->about_company_url = get_post_meta($index_post, "about_company_url", true);
$home_info->about_content = get_post_meta($index_post, "about_content", true);
$home_info->about_phone = get_post_meta($index_post, "about_phone", true);
$home_info->about_call = get_post_meta($index_post, "about_call", true);
$home_info->about_fax = get_post_meta($index_post, "about_fax", true);
$home_info->about_addr = get_post_meta($index_post, "about_addr", true);
$home_info->about_addr_en = get_post_meta($index_post, "about_addr_en", true);
$home_info->payme_url = get_post_meta($index_post, "payme_url", true);
$vueVersion = time();
?>
<app id="app" >
<yq-header></yq-header>
<div id="main_bg">
<main class=" w-100 py-[0.2rem] md:w-[768px] md:mx-auto xl:w-[1280px]">
<div class="w-auto p-1 lg:mt-0 lg:flex-shrink-0 " style="border: 1px solid #cccccc;">
<div class="w-auto max-w-md flex-auto overflow-hidden text-[0.26rem] p-1">
<form class="mt-[0.51rem] text-white" action="#" method="POST" v-on:submit.prevent>
<h2 class="text-white text-[0.24rem] mb-[0.2rem] title-font">我要參展</h2>
<div class="relative mb-1">
<div class="flex border-gray-200 py-1">
<span class="ml-auto " style="width: 150px"><span
style="color: #EA6908">*</span> 姓名</span>
<input type="text" id="c_name" name="c_name" v-model.trim="c_name"
class="w-full py-[0.1rem] px-[0.2rem] leading-[0.2rem] bg-white rounded-[0.05rem] border border-gray-300 focus:border-indigo-500 focus:ring-1 focus:ring-indigo-200 text-[0.2rem] outline-none text-gray-700 transition-colors duration-200 ease-in-out">
</div>
</div>
<div class="relative mb-1">
<div class="flex border-gray-200 py-1">
<span class="ml-auto " style="width: 150px"><span
style="color: #EA6908">*</span> 國家/地區</span>
<input type="text" id="area" name="area" v-model.trim="area"
class="w-full py-[0.1rem] px-[0.2rem] leading-[0.2rem] bg-white rounded-[0.05rem] border border-gray-300 focus:border-indigo-500 focus:ring-1 focus:ring-indigo-200 text-[0.2rem] outline-none text-gray-700 transition-colors duration-200 ease-in-out">
</div>
</div>
<div class="relative mb-1">
<div class="flex border-gray-200 py-1">
<span class="ml-auto " style="width: 150px"><span
style="color: #EA6908">*</span> 公司名</span>
<input type="text" id="company" name="company" v-model.trim="company"
class="w-full py-[0.1rem] px-[0.2rem] leading-[0.2rem] bg-white rounded-[0.05rem] border border-gray-300 focus:border-indigo-500 focus:ring-1 focus:ring-indigo-200 text-[0.2rem] outline-none text-gray-700 transition-colors duration-200 ease-in-out">
</div>
</div>
<div class="relative mb-1">
<div class="flex border-gray-200 py-1">
<span class="ml-auto " style="width: 150px"><span
style="color: #EA6908">*</span> 從事行業</span>
<input type="text" id="industry" name="industry" v-model.trim="industry"
class="w-full py-[0.1rem] px-[0.2rem] leading-[0.2rem] bg-white rounded-[0.05rem] border border-gray-300 focus:border-indigo-500 focus:ring-1 focus:ring-indigo-200 text-[0.2rem] outline-none text-gray-700 transition-colors duration-200 ease-in-out">
</div>
</div>
<div class="relative mb-1">
<div class="flex border-gray-200 py-1">
<span class="ml-auto " style="width: 150px"><span
style="color: #EA6908">*</span> 公司/個人電郵</span>
<input type="text" id="email" name="email" v-model.trim="email"
class="w-full py-[0.1rem] px-[0.2rem] leading-[0.2rem] bg-white rounded-[0.05rem] border border-gray-300 focus:border-indigo-500 focus:ring-1 focus:ring-indigo-200 text-[0.2rem] outline-none text-gray-700 transition-colors duration-200 ease-in-out">
</div>
</div>
<div class="relative mb-1">
<div class="flex border-gray-200 py-1">
<span class="ml-auto " style="width: 150px"><span
style="color: #EA6908">*</span> 聯繫電話</span>
<input type="text" id="phone" name="phone" v-model.trim="phone"
class="w-full py-[0.1rem] px-[0.2rem] leading-[0.2rem] bg-white rounded-[0.05rem] border border-gray-300 focus:border-indigo-500 focus:ring-1 focus:ring-indigo-200 text-[0.2rem] outline-none text-gray-700 transition-colors duration-200 ease-in-out">
</div>
</div>
<div class="relative mb-1">
<div class="flex border-gray-200 py-1">
<span class="ml-auto " style="width: 150px">備註</span>
<textarea rows="5" id="remark" name="remark" v-model.trim="remark"
class="w-full bg-white rounded-[0.05rem] border border-gray-300 focus:border-indigo-500 focus:ring-2 focus:ring-indigo-200 text-[0.2rem] outline-none text-gray-700 py-[0.1rem] px-[0.2rem] leading-[0.2rem] transition-colors duration-200 ease-in-out"></textarea>
</div>
</div>
<button type="submit" @click="login_func(true)" style="width: 200px;background-color: #FF6D00"
class="text-white border-0 py-0.5 focus:outline-none hover:bg-indigo-600 rounded-[0.05rem] text-[0.2rem]">
發佈
</button>
</form>
</div>
</div>
</div>
<!--login end-->
</main>
</div>
<yq-footer></yq-footer>
</app>
<script>
const local_url = '<?php echo $local_url ?>'
const home_info = JSON.parse('<?php echo json_encode($home_info) ?>')
new Vue({
el: "#app",
components: {
'yq-header': httpVueLoader('<?php showFoodAppPath('components/yq-header-bizroadshow.vue?v='.time()) ?>'),
'yq-footer': httpVueLoader('<?php showFoodAppPath('components/yq-footer-bizroadshow.vue?v=2') ?>'),
},
created() {
},
data: {
c_name: '',
area: '',
phone: '',
email: '',
industry: '',
company: '',
remark: '',
},
methods: {
async login_func() {
const hide = antd.message.loading('加載中...');
console.log('c_name -> ' + this.c_name);
console.log('area -> ' + this.area);
console.log('phone -> ' + this.phone);
console.log('email -> ' + this.email);
console.log('industry -> ' + this.industry);
console.log('company -> ' + this.company);
console.log('remark -> ' + this.remark);
let res = await axios({
method: 'post',
url: '/api/',
data: Qs.stringify({
module: 'contact_form',
action: 'u_contact_form',
id: 0,
type: 2,
c_name: this.c_name,
company_name: this.company,
email: this.email,
area: this.area,
phone: this.phone,
remark: this.remark,
industry: this.industry,
// ...this.submit_info
})
});
hide();
if (res.status == 200) {
let data = res.data;
if (data.rc == 0) {
antd.message.info('登記成功');
// window.open('/' , '_self');
} else {
antd.message.error(data.msg);
}
} else {
antd.message.error('登記失敗');
}
},
}
})
</script>
<?php get_footer('food'); ?>