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/food-app/components/yq-login_modal_mmc.vue
<template>
  <div  v-if="show" style="z-index:1000; background: rgba(51,51,51,0.39);" class=" fixed top-0 left-0 right-0 bottom-0">
    <yq-modal v-if="show" :class="showOc?' opacity-100':' opacity-0'" class=" transition-opacity duration-600 fixed flex items-center justify-center top-0 left-0 right-0 bottom-0 z-[999] bg-modal-mock">
      <div class=" w-[6rem] px-[0.6rem] py-[0.4rem] bg-white rounded-[0.2rem]" >
        <div class=" font-f-arial text-[0.24rem] leading-[0.24rem] font-bold text-333">Mall Mall Channel</div>
<!--        <div class=" font-f-arial mt-[0.05rem] text-[0.16rem] leading-[0.16rem] text-666">(Integrity Group Limited)</div>-->

        <div class=" mt-[0.6rem] w-[4.8rem] h-[0.6rem] rounded-full border-[0.02rem] border-e6 px-[0.3rem]">
          <input v-model="loginName" class=" w-full text-[0.2rem] text-333 leading-[0.56rem] outline-none" placeholder="賬號/電子郵箱/手機號" type="text">
        </div>

        <div class=" mt-[0.26rem] w-[4.8rem] h-[0.6rem] rounded-full border-[0.02rem] border-e6 px-[0.3rem]">
          <input v-model="loginPass" class=" w-full text-[0.2rem] text-333 leading-[0.56rem] outline-none" placeholder="密碼" type="password">
        </div>

        <div @click="defaultLogin()" class=" mt-[0.26rem] flex items-center justify-center w-[4.8rem] h-[0.6rem] rounded-full bg-main-color">
          <div class=" text-[0.2rem] cursor-pointer text-white leading-[0.2rem]">登入</div>
        </div>


        <div @click="changeShow()" class=" mt-[0.26rem] flex items-center justify-center w-[4.8rem] h-[0.6rem] rounded-full border-[0.02rem] border-MMC-main-color" style="border:1px solid #1DBAFF;">
          <div class=" text-[0.2rem] cursor-pointer text-MMC-main-color leading-[0.2rem]">取消</div>
        </div>

        <div @click="goRegisterPage()" class=" mt-[0.26rem] flex items-center justify-center w-[4.8rem] h-[0.6rem] rounded-full border-[0.02rem] border-sky-500/50">
          <div class=" text-[0.2rem] cursor-pointer text-sky-500/50 leading-[0.2rem]">註冊</div>
        </div>
      </div>
    </yq-modal>
  </div>
</template>

<script>
module.exports = {
  props: {
    title: {
      type: String,
      default: 'Congratulations random Interner user!'
    },
    content: {
      type: String,
      default: 'You\'ve been selected for a chance to get one year of subscription to use Wikipedia for free!'
    }
  },
  data() {
    return {
      show: false,
      showOc: false,
      loginName: "",
      loginPass: ""
    }
  },
  methods: {
    changeShow() {
      if(this.show) {
        this.showOc = false
        setTimeout(() => {
          this.show = this.showOc
        }, 600);
      }else {
        this.show = true
        setTimeout(() => {
          this.showOc = this.show
        }, 0);
      }
    },
    defaultLogin() {
        if(!this.loginName || !this.loginPass) {
            antd.notification.open({
                message: '提示',
                description: '請檢查賬戶密碼是否正確'
            });
        }else {
            this.loginAPI({
                'user_login_name': this.loginName,
                'user_pass': this.loginPass
            })
        }
    },
    loginAPI($params) {
        let postForm = document.createElement("form");

        postForm.method = "post";
        postForm.action = "";
        postForm.style = "display:none";

        let a_param_key = [
            'user_login_name', 'user_pass'
        ];

        let actionInput = document.createElement("input");
        actionInput.setAttribute("name", 'action');
        actionInput.setAttribute("value", 'login');
        postForm.appendChild(actionInput);

        for (const key in a_param_key) {
            let value = a_param_key[key]
            let idInput = document.createElement("input");
            idInput.setAttribute("name", value);
            idInput.setAttribute("value", $params[value]);
            postForm.appendChild(idInput);
        }

        document.body.appendChild(postForm);
        postForm.submit();
    },

    goRegisterPage() {
        window.open('/register', '_self');
    },
  }
}
</script>