HEX
Server: Apache/2.4.59 (Debian)
System: Linux keymana 4.19.0-21-cloud-amd64 #1 SMP Debian 4.19.249-2 (2022-06-30) x86_64
User: lijunjie (1003)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/dk/wp-content/themes/food/page-contact_form.php
<?php
/* Template Name: contact_form */

get_header('food');

$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();

?>
<style>
    .clearfix {
        font-family: Arial;
        font-weight: bold;
        opacity: 1;
    }

    .clearfix::after {
        content: '';
        clear: both;
        display: block;
    }

    .bmain {
        display: flex;
        justify-content: space-evenly;
        align-items: center;
    }


</style>
<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]" action="#" method="POST" v-on:submit.prevent>
                        <h2 class="text-gray-900 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 text-gray-900" 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 text-gray-900" 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 text-gray-900" 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 text-gray-900" 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 text-gray-900" 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 text-gray-900" 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 text-gray-900" 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"
                                class="text-white bg-main-color border-0 py-0.5  focus:outline-none hover:bg-indigo-600 rounded-[0.05rem] text-[0.2rem]">
                            發佈
                        </button>
                    </form>
                    <!--                    <div class=" mb-[0.2rem]">-->
                    <!--                                            <button type="submit" @click="login_func(true)"-->
                    <!--                                                    class="h-[0.61rem] text-[0.23rem] leading-[0.6rem] group relative flex py-1 px-2 justify-center bg-main-color font-semibold text-white hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600">-->
                    <!--                                                立即登錄-->
                    <!--                                            </button>-->
                    <!--                    </div>-->

                </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.vue?v=5') ?>'),
            'yq-footer': httpVueLoader('<?php showFoodAppPath('components/yq-footer.vue?v=2') ?>'),
        },
        created() {
        },
        data: {
            c_name: '',
            area: '',
            phone: '',
            email: '',
            industry: '',
            company: '',

            remark: '',
        },
        methods: {
            async login_func(isPhone = true) {
                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: 1,
                        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'); ?>