|  | @@ -1,6 +1,17 @@
 | 
											
												
													
														|  | -import { state } from '@/state'
 |  | 
 | 
											
												
													
														|  | -import { ElButton, ElCol, ElRow } from 'element-plus'
 |  | 
 | 
											
												
													
														|  | 
 |  | +import { checkIDCard } from '@/helpers/validate'
 | 
											
												
													
														|  | 
 |  | +import {
 | 
											
												
													
														|  | 
 |  | +  ElButton,
 | 
											
												
													
														|  | 
 |  | +  ElRadioGroup,
 | 
											
												
													
														|  | 
 |  | +  ElForm,
 | 
											
												
													
														|  | 
 |  | +  ElFormItem,
 | 
											
												
													
														|  | 
 |  | +  ElInput,
 | 
											
												
													
														|  | 
 |  | +  ElDatePicker,
 | 
											
												
													
														|  | 
 |  | +  ElRadioButton,
 | 
											
												
													
														|  | 
 |  | +  ElCheckbox,
 | 
											
												
													
														|  | 
 |  | +  ElLink
 | 
											
												
													
														|  | 
 |  | +} from 'element-plus'
 | 
											
												
													
														|  |  import { defineComponent } from 'vue'
 |  |  import { defineComponent } from 'vue'
 | 
											
												
													
														|  | 
 |  | +import { teacherState } from '../../teacherState'
 | 
											
												
													
														|  |  import styles from './index.module.less'
 |  |  import styles from './index.module.less'
 | 
											
												
													
														|  |  export const getAssetsHomeFile = (fileName: string) => {
 |  |  export const getAssetsHomeFile = (fileName: string) => {
 | 
											
												
													
														|  |    const path = `../../../images/${fileName}`
 |  |    const path = `../../../images/${fileName}`
 | 
											
										
											
												
													
														|  | @@ -8,113 +19,178 @@ export const getAssetsHomeFile = (fileName: string) => {
 | 
											
												
													
														|  |    return modules[path].default
 |  |    return modules[path].default
 | 
											
												
													
														|  |  }
 |  |  }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +// checkIDCard
 | 
											
												
													
														|  |  export default defineComponent({
 |  |  export default defineComponent({
 | 
											
												
													
														|  |    name: 'cert-info',
 |  |    name: 'cert-info',
 | 
											
												
													
														|  | -  computed: {
 |  | 
 | 
											
												
													
														|  | -    auth() {
 |  | 
 | 
											
												
													
														|  | -      // 音乐人审核状态 UNPAALY、未申请 DOING、审核中 PASS、通过 UNPASS、不通过,可用值:UNPAALY,DOING,PASS,UNPASS
 |  | 
 | 
											
												
													
														|  | -      let auth = state.user.data?.entryStatus
 |  | 
 | 
											
												
													
														|  | -      let obj = {
 |  | 
 | 
											
												
													
														|  | -        text: '立即认证',
 |  | 
 | 
											
												
													
														|  | -        status: false
 |  | 
 | 
											
												
													
														|  | -      }
 |  | 
 | 
											
												
													
														|  | -      switch (auth) {
 |  | 
 | 
											
												
													
														|  | -        case 'DOING':
 |  | 
 | 
											
												
													
														|  | -          obj.text = '审核中'
 |  | 
 | 
											
												
													
														|  | -          obj.status = true
 |  | 
 | 
											
												
													
														|  | -          break
 |  | 
 | 
											
												
													
														|  | -        case 'PASS':
 |  | 
 | 
											
												
													
														|  | -          obj.text = '已认证'
 |  | 
 | 
											
												
													
														|  | -          obj.status = true
 |  | 
 | 
											
												
													
														|  | -      }
 |  | 
 | 
											
												
													
														|  | -      return obj
 |  | 
 | 
											
												
													
														|  | -    }
 |  | 
 | 
											
												
													
														|  | -  },
 |  | 
 | 
											
												
													
														|  |    data() {
 |  |    data() {
 | 
											
												
													
														|  |      return {
 |  |      return {
 | 
											
												
													
														|  | -      list: [
 |  | 
 | 
											
												
													
														|  | -        {
 |  | 
 | 
											
												
													
														|  | -          logo: getAssetsHomeFile('o1.png'),
 |  | 
 | 
											
												
													
														|  | -          num: getAssetsHomeFile('num1.png'),
 |  | 
 | 
											
												
													
														|  | -          title: '线上授课',
 |  | 
 | 
											
												
													
														|  | -          desc: '认证成为酷乐秀老师后,可设置您的空闲时间为平台中的求学者进行1对1的线上课程指导。'
 |  | 
 | 
											
												
													
														|  | -        },
 |  | 
 | 
											
												
													
														|  | -        {
 |  | 
 | 
											
												
													
														|  | -          logo: getAssetsHomeFile('o2.png'),
 |  | 
 | 
											
												
													
														|  | -          num: getAssetsHomeFile('num2.png'),
 |  | 
 | 
											
												
													
														|  | -          title: '个人风采展示',
 |  | 
 | 
											
												
													
														|  | -          desc: '可发布自己的专业经历、获奖记录及音视频资料对求学者展示,让学员更加深入的了解您的专业技能,从而提高约课率。'
 |  | 
 | 
											
												
													
														|  | -        },
 |  | 
 | 
											
												
													
														|  | -        {
 |  | 
 | 
											
												
													
														|  | -          logo: getAssetsHomeFile('o3.png'),
 |  | 
 | 
											
												
													
														|  | -          num: getAssetsHomeFile('num3.png'),
 |  | 
 | 
											
												
													
														|  | -          title: '曲谱上传',
 |  | 
 | 
											
												
													
														|  | -          desc: '可上传您制作的MIDI乐谱为求学者提供学习曲目的途径,并从中获得收益。'
 |  | 
 | 
											
												
													
														|  | -        },
 |  | 
 | 
											
												
													
														|  | -        {
 |  | 
 | 
											
												
													
														|  | -          logo: getAssetsHomeFile('o4.png'),
 |  | 
 | 
											
												
													
														|  | -          num: getAssetsHomeFile('num4.png'),
 |  | 
 | 
											
												
													
														|  | -          title: '收益提现',
 |  | 
 | 
											
												
													
														|  | -          desc: '在您授课及上传曲谱销售后,经过平台核算,将您获得的收益发放至您的个人账户下,您可随时将自己获得的收益提现。'
 |  | 
 | 
											
												
													
														|  | 
 |  | +      agreeStatus: false
 | 
											
												
													
														|  | 
 |  | +    }
 | 
											
												
													
														|  | 
 |  | +  },
 | 
											
												
													
														|  | 
 |  | +  methods: {
 | 
											
												
													
														|  | 
 |  | +    onIdCardValidate() {
 | 
											
												
													
														|  | 
 |  | +      const idCardNo = teacherState.teacherCert.idCardNo
 | 
											
												
													
														|  | 
 |  | +      // 判断是否有身份证号
 | 
											
												
													
														|  | 
 |  | +      if (!idCardNo) {
 | 
											
												
													
														|  | 
 |  | +        return
 | 
											
												
													
														|  | 
 |  | +      }
 | 
											
												
													
														|  | 
 |  | +      if (!checkIDCard(idCardNo || '')) {
 | 
											
												
													
														|  | 
 |  | +        return false
 | 
											
												
													
														|  | 
 |  | +      }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +      console.log(this.getSex(idCardNo))
 | 
											
												
													
														|  | 
 |  | +      teacherState.teacherCert.birthdate = this.getBirth(idCardNo)
 | 
											
												
													
														|  | 
 |  | +      teacherState.teacherCert.gender = this.getSex(idCardNo)
 | 
											
												
													
														|  | 
 |  | +    },
 | 
											
												
													
														|  | 
 |  | +    getBirth(idCard: string | null) {
 | 
											
												
													
														|  | 
 |  | +      let birthday = ''
 | 
											
												
													
														|  | 
 |  | +      if (idCard != null && idCard != '') {
 | 
											
												
													
														|  | 
 |  | +        if (idCard.length == 15) {
 | 
											
												
													
														|  | 
 |  | +          birthday = '19' + idCard.slice(6, 12)
 | 
											
												
													
														|  | 
 |  | +        } else if (idCard.length == 18) {
 | 
											
												
													
														|  | 
 |  | +          birthday = idCard.slice(6, 14)
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  | -      ]
 |  | 
 | 
											
												
													
														|  | 
 |  | +        birthday = birthday.replace(/(.{4})(.{2})/, '$1-$2-')
 | 
											
												
													
														|  | 
 |  | +      }
 | 
											
												
													
														|  | 
 |  | +      return birthday
 | 
											
												
													
														|  | 
 |  | +    },
 | 
											
												
													
														|  | 
 |  | +    getSex(idCard: string | null): number {
 | 
											
												
													
														|  | 
 |  | +      let sex = 1
 | 
											
												
													
														|  | 
 |  | +      if (idCard && parseInt(idCard.slice(-2, -1)) % 2 == 1) {
 | 
											
												
													
														|  | 
 |  | +        sex = 1
 | 
											
												
													
														|  | 
 |  | +      } else {
 | 
											
												
													
														|  | 
 |  | +        sex = 0
 | 
											
												
													
														|  | 
 |  | +      }
 | 
											
												
													
														|  | 
 |  | +      return sex
 | 
											
												
													
														|  | 
 |  | +    },
 | 
											
												
													
														|  | 
 |  | +    onSubmit() {
 | 
											
												
													
														|  | 
 |  | +      ;(this as any).$refs.certForm.validate(async (_: boolean) => {
 | 
											
												
													
														|  | 
 |  | +        console.log(_)
 | 
											
												
													
														|  | 
 |  | +        if (_) {
 | 
											
												
													
														|  | 
 |  | +          teacherState.active = 1
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +      })
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |    },
 |  |    },
 | 
											
												
													
														|  |    render() {
 |  |    render() {
 | 
											
												
													
														|  |      return (
 |  |      return (
 | 
											
												
													
														|  | -      <div class={[styles.musicAuth, 'px-[138px]']}>
 |  | 
 | 
											
												
													
														|  | -        <div class="w-[388px] pt-24 pb-28">
 |  | 
 | 
											
												
													
														|  | -          <div class="text-[28px] font-semibold pb-5">酷乐秀基本介绍</div>
 |  | 
 | 
											
												
													
														|  | -          <p class={[styles.txt]}>
 |  | 
 | 
											
												
													
														|  | -            酷乐秀是一款为器乐学习者提供智能陪练及线上授课撮
 |  | 
 | 
											
												
													
														|  | -          </p>
 |  | 
 | 
											
												
													
														|  | -          <p class={[styles.txt]}>
 |  | 
 | 
											
												
													
														|  | -            合的乐器教学平台,器乐老师可通过自身的专业知识为
 |  | 
 | 
											
												
													
														|  | -          </p>
 |  | 
 | 
											
												
													
														|  | -          <p class={[styles.txt, 'inline-block']}>
 |  | 
 | 
											
												
													
														|  | -            自己带来<span class="font-medium">授课及曲谱销售收益</span>。
 |  | 
 | 
											
												
													
														|  | -          </p>
 |  | 
 | 
											
												
													
														|  | -        </div>
 |  | 
 | 
											
												
													
														|  | -        <div class="pb-20">
 |  | 
 | 
											
												
													
														|  | -          <h2 class="text-2xl pb-11 text-center font-semibold">认证权益</h2>
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -          <ElRow class="mb-24" gutter={28}>
 |  | 
 | 
											
												
													
														|  | -            {this.list.map((item: any) => (
 |  | 
 | 
											
												
													
														|  | -              <ElCol span={6} class="pr-3 !flex">
 |  | 
 | 
											
												
													
														|  | -                <div class={[styles.col, 'flex items-center flex-col p-4']}>
 |  | 
 | 
											
												
													
														|  | -                  <img class="w-[94px] h-[87px]" src={item.logo} />
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -                  <div class="flex items-center font-[18px] font-medium pb-3 pt-5">
 |  | 
 | 
											
												
													
														|  | -                    <img class="w-[30px] h-[22px] mr-1" src={item.num} />
 |  | 
 | 
											
												
													
														|  | -                    {item.title}
 |  | 
 | 
											
												
													
														|  | -                  </div>
 |  | 
 | 
											
												
													
														|  | -                  <p class="text-[14px] text-[#666] leading-6 text-justify">
 |  | 
 | 
											
												
													
														|  | -                    {item.desc}
 |  | 
 | 
											
												
													
														|  | -                  </p>
 |  | 
 | 
											
												
													
														|  | -                </div>
 |  | 
 | 
											
												
													
														|  | -              </ElCol>
 |  | 
 | 
											
												
													
														|  | -            ))}
 |  | 
 | 
											
												
													
														|  | -          </ElRow>
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -          <h2 class="text-2xl pb-10 text-center font-semibold">
 |  | 
 | 
											
												
													
														|  | -            酷乐秀欢迎您的加入
 |  | 
 | 
											
												
													
														|  | -          </h2>
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -          <p class="text-lg text-center mb-10">
 |  | 
 | 
											
												
													
														|  | -            在艺术的殿堂中,为他人照亮前进的道路,用自己的经验和点拨,传播艺术的种子,获取硕果。
 |  | 
 | 
											
												
													
														|  | -          </p>
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -          <div class="text-center">
 |  | 
 | 
											
												
													
														|  | 
 |  | +      <ElForm
 | 
											
												
													
														|  | 
 |  | +        ref={'certForm'}
 | 
											
												
													
														|  | 
 |  | +        class={[styles.form, 'mx-4 mt-7']}
 | 
											
												
													
														|  | 
 |  | +        size="large"
 | 
											
												
													
														|  | 
 |  | +        model={teacherState.teacherCert}
 | 
											
												
													
														|  | 
 |  | +        labelPosition="left"
 | 
											
												
													
														|  | 
 |  | +      >
 | 
											
												
													
														|  | 
 |  | +        <ElFormItem
 | 
											
												
													
														|  | 
 |  | +          label="真实姓名"
 | 
											
												
													
														|  | 
 |  | +          labelWidth={'90px'}
 | 
											
												
													
														|  | 
 |  | +          prop="realName"
 | 
											
												
													
														|  | 
 |  | +          rules={[
 | 
											
												
													
														|  | 
 |  | +            {
 | 
											
												
													
														|  | 
 |  | +              required: true,
 | 
											
												
													
														|  | 
 |  | +              message: '请输入真实姓名'
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  | 
 |  | +          ]}
 | 
											
												
													
														|  | 
 |  | +        >
 | 
											
												
													
														|  | 
 |  | +          <ElInput
 | 
											
												
													
														|  | 
 |  | +            v-model={teacherState.teacherCert.realName}
 | 
											
												
													
														|  | 
 |  | +            placeholder="请输入您的真实姓名"
 | 
											
												
													
														|  | 
 |  | +          />
 | 
											
												
													
														|  | 
 |  | +        </ElFormItem>
 | 
											
												
													
														|  | 
 |  | +        <ElFormItem
 | 
											
												
													
														|  | 
 |  | +          label="身份证号"
 | 
											
												
													
														|  | 
 |  | +          labelWidth={'90px'}
 | 
											
												
													
														|  | 
 |  | +          prop="idCardNo"
 | 
											
												
													
														|  | 
 |  | +          rules={[
 | 
											
												
													
														|  | 
 |  | +            {
 | 
											
												
													
														|  | 
 |  | +              required: true,
 | 
											
												
													
														|  | 
 |  | +              message: '请输入身份证号'
 | 
											
												
													
														|  | 
 |  | +            },
 | 
											
												
													
														|  | 
 |  | +            {
 | 
											
												
													
														|  | 
 |  | +              pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
 | 
											
												
													
														|  | 
 |  | +              message: '请输入正确的身份证号',
 | 
											
												
													
														|  | 
 |  | +              trigger: 'blur'
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  | 
 |  | +          ]}
 | 
											
												
													
														|  | 
 |  | +        >
 | 
											
												
													
														|  | 
 |  | +          <ElInput
 | 
											
												
													
														|  | 
 |  | +            v-model={teacherState.teacherCert.idCardNo}
 | 
											
												
													
														|  | 
 |  | +            onBlur={this.onIdCardValidate}
 | 
											
												
													
														|  | 
 |  | +            placeholder="请输入您的身份证号码"
 | 
											
												
													
														|  | 
 |  | +          />
 | 
											
												
													
														|  | 
 |  | +        </ElFormItem>
 | 
											
												
													
														|  | 
 |  | +        <ElFormItem
 | 
											
												
													
														|  | 
 |  | +          label="性别"
 | 
											
												
													
														|  | 
 |  | +          labelWidth={'90px'}
 | 
											
												
													
														|  | 
 |  | +          prop="gender"
 | 
											
												
													
														|  | 
 |  | +          rules={[
 | 
											
												
													
														|  | 
 |  | +            {
 | 
											
												
													
														|  | 
 |  | +              required: true,
 | 
											
												
													
														|  | 
 |  | +              message: '请选择性别'
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  | 
 |  | +          ]}
 | 
											
												
													
														|  | 
 |  | +        >
 | 
											
												
													
														|  | 
 |  | +          <ElRadioGroup v-model={teacherState.teacherCert.gender} disabled>
 | 
											
												
													
														|  | 
 |  | +            <ElRadioButton label={1} class="mr-3 w-24">
 | 
											
												
													
														|  | 
 |  | +              男
 | 
											
												
													
														|  | 
 |  | +            </ElRadioButton>
 | 
											
												
													
														|  | 
 |  | +            <ElRadioButton label={0} class="w-24">
 | 
											
												
													
														|  | 
 |  | +              女
 | 
											
												
													
														|  | 
 |  | +            </ElRadioButton>
 | 
											
												
													
														|  | 
 |  | +          </ElRadioGroup>
 | 
											
												
													
														|  | 
 |  | +        </ElFormItem>
 | 
											
												
													
														|  | 
 |  | +        <ElFormItem
 | 
											
												
													
														|  | 
 |  | +          label="出生日期"
 | 
											
												
													
														|  | 
 |  | +          labelWidth={'90px'}
 | 
											
												
													
														|  | 
 |  | +          prop="birthdate"
 | 
											
												
													
														|  | 
 |  | +          rules={[
 | 
											
												
													
														|  | 
 |  | +            {
 | 
											
												
													
														|  | 
 |  | +              required: true,
 | 
											
												
													
														|  | 
 |  | +              message: '请选择出生日期'
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  | 
 |  | +          ]}
 | 
											
												
													
														|  | 
 |  | +        >
 | 
											
												
													
														|  | 
 |  | +          <ElDatePicker
 | 
											
												
													
														|  | 
 |  | +            disabled
 | 
											
												
													
														|  | 
 |  | +            v-model={teacherState.teacherCert.birthdate}
 | 
											
												
													
														|  | 
 |  | +            type="date"
 | 
											
												
													
														|  | 
 |  | +            class="!h-[38px] !w-full"
 | 
											
												
													
														|  | 
 |  | +            placeholder="请选择出生日期"
 | 
											
												
													
														|  | 
 |  | +          />
 | 
											
												
													
														|  | 
 |  | +        </ElFormItem>
 | 
											
												
													
														|  | 
 |  | +        <ElFormItem>
 | 
											
												
													
														|  | 
 |  | +          <div class="text-center w-full">
 | 
											
												
													
														|  | 
 |  | +            <div class="text-[14px] text-[#999] flex items-center justify-center">
 | 
											
												
													
														|  | 
 |  | +              <div
 | 
											
												
													
														|  | 
 |  | +                class="flex items-center justify-center cursor-pointer"
 | 
											
												
													
														|  | 
 |  | +                onClick={() => {
 | 
											
												
													
														|  | 
 |  | +                  this.agreeStatus = !this.agreeStatus
 | 
											
												
													
														|  | 
 |  | +                }}
 | 
											
												
													
														|  | 
 |  | +              >
 | 
											
												
													
														|  | 
 |  | +                <ElCheckbox
 | 
											
												
													
														|  | 
 |  | +                  v-model={this.agreeStatus}
 | 
											
												
													
														|  | 
 |  | +                  class="!mr-2 rounded-full overflow-hidden"
 | 
											
												
													
														|  | 
 |  | +                />
 | 
											
												
													
														|  | 
 |  | +                我已阅读并同意
 | 
											
												
													
														|  | 
 |  | +                <a
 | 
											
												
													
														|  | 
 |  | +                  href="https://dev.colexiu.com/student/#/registerProtocol"
 | 
											
												
													
														|  | 
 |  | +                  class="text-[#2DC7AA]"
 | 
											
												
													
														|  | 
 |  | +                  target="_blank"
 | 
											
												
													
														|  | 
 |  | +                >
 | 
											
												
													
														|  | 
 |  | +                  《酷乐秀平台服务协议》
 | 
											
												
													
														|  | 
 |  | +                </a>
 | 
											
												
													
														|  | 
 |  | +              </div>
 | 
											
												
													
														|  | 
 |  | +            </div>
 | 
											
												
													
														|  |              <ElButton
 |  |              <ElButton
 | 
											
												
													
														|  |                type="primary"
 |  |                type="primary"
 | 
											
												
													
														|  | -              class="rounded w-40 !h-[38px]"
 |  | 
 | 
											
												
													
														|  | -              disabled={this.auth.status}
 |  | 
 | 
											
												
													
														|  | 
 |  | +              class="!w-40 !h-[38px]"
 | 
											
												
													
														|  | 
 |  | +              onClick={this.onSubmit}
 | 
											
												
													
														|  |              >
 |  |              >
 | 
											
												
													
														|  | -              {this.auth.text}
 |  | 
 | 
											
												
													
														|  | 
 |  | +              下一步
 | 
											
												
													
														|  |              </ElButton>
 |  |              </ElButton>
 | 
											
												
													
														|  |            </div>
 |  |            </div>
 | 
											
												
													
														|  | -        </div>
 |  | 
 | 
											
												
													
														|  | -      </div>
 |  | 
 | 
											
												
													
														|  | 
 |  | +        </ElFormItem>
 | 
											
												
													
														|  | 
 |  | +      </ElForm>
 | 
											
												
													
														|  |      )
 |  |      )
 | 
											
												
													
														|  |    }
 |  |    }
 | 
											
												
													
														|  |  })
 |  |  })
 |