```html
<template>
  <!-- 页面布局 -->
  <div class="margin-5"></div>
  <div class="main-container wrap main-fullScreen">
    <div class="bgd-while textCenter p-20">
      <div class="font-size-30">账号注册</div>
      <div class="center">
        <!-- 表单 -->
        <el-form ref="ruleFormRef" style="max-width: 800px" :model="ruleForm" status-icon :rules="rules"
          label-width="auto" class="demo-ruleForm">
          <el-form-item label="手机号" prop="phone">
            <el-input v-model.number="ruleForm.phone" placeholder="请输入手机号" />
          </el-form-item>
          <el-form-item label="密码" prop="pass">
            <el-input v-model="ruleForm.pass" type="password" autocomplete="off" placeholder="请输入密码" />
          </el-form-item>
          <el-form-item label="确认密码" prop="checkPass">
            <el-input v-model="ruleForm.checkPass" type="password" autocomplete="off" placeholder="请再次输入密码" />
          </el-form-item>
          
          <el-form-item style="text-align: center">
            <el-button type="primary" @click="submitForm(ruleFormRef)">
              提交
            </el-button>
            <el-button @click="resetForm(ruleFormRef)">重置</el-button>
          </el-form-item>
        </el-form>
      </div>
    </div>
  </div>
  <div class="margin-5"></div>
</template>
<script lang="ts" setup>
import { ref, getCurrentInstance, ComponentInternalInstance, reactive } from 'vue';
document.title = '河南艺体考生专属VIP|' + import.meta.env.VITE_PROGRAM_TYPE;
import { ElMessage, type FormInstance, type FormRules } from 'element-plus'
import { checkPhoneAvailable, getScore } from '@/axios/api';
import { registerUser } from '@/axios/UserApi';
import { useRouter } from "vue-router";
const ruleFormRef = ref<FormInstance>()
const router = useRouter();
const checkphone = (rule: any, value: any, callback: any) => {
  if (!value) {
    return callback(new Error('请输入手机号'))
  }
  let reg = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/;
  setTimeout(async () => {
    if (!Number.isInteger(value)) {
      callback(new Error('请输入数字'))
    } else if (!reg.test(value)) {
      callback(new Error('手机号格式有误'))
    } else {
      const result =await checkPhoneAvailable(value) as any;
      if (!result) {
        callback(new Error('手机号已使用'))
      }else{
        callback()
      }
    }
  }, 600)
}

const validatePass = (rule: any, value: any, callback: any) => {
  if (value === '') {
    callback(new Error('请输入密码'))
  } else {
    if (ruleForm.checkPass !== '') {
      if (!ruleFormRef.value) return
      ruleFormRef.value.validateField('checkPass')
    }
    callback()
  }
}
const validatePass2 = (rule: any, value: any, callback: any) => {
  if (value === '') {
    callback(new Error('请再次输入密码'))
  } else if (value !== ruleForm.pass) {
    callback(new Error("两次输入不一致"))
  } else {
    callback()
  }
}

const ruleForm = reactive({
  pass: '',
  checkPass: '',
  phone: '',
})

const rules = reactive<FormRules<typeof ruleForm>>({
  pass: [{ validator: validatePass, trigger: 'blur' }],
  checkPass: [{ validator: validatePass2, trigger: 'blur' }],
  phone: [{ validator: checkphone, trigger: 'blur' }],
})

const submitForm = (formEl: FormInstance | undefined) => {
  if (!formEl) return
  formEl.validate(async (valid) => {
    if (valid) {
      const data =await registerUser({phone:ruleForm.phone,password:ruleForm.pass,programType: import.meta.env.VITE_PROGRAM_TYPE})
      console.log(data)
      if(data.success){
        //将 用户数据保存到缓存中
          localStorage.setItem('vipInfo', JSON.stringify(data.result.vipInfo))
          localStorage.setItem('userInfo', JSON.stringify(data.result.userInfo))
          localStorage.setItem("X-Access-Token", data.result.token);
          ElMessage.success('注册成功');
          setTimeout(function () {
            getScore()
            router.push({
              path: "/index"
            });
            setTimeout(function () {
              window.location.reload()
            }, 500);
          }, 1000);
        
      }else{
        ElMessage.error(data.message);
      }
    }
  })
}

const resetForm = (formEl: FormInstance | undefined) => {
  if (!formEl) return
  formEl.resetFields()
}
</script>
<style scoped lang="scss">
.center {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 20em; /* 可根据需要调整高度 */
}
.wrap {
  width: 1210px
}
</style>
```