|
@@ -0,0 +1,98 @@
|
|
|
+import { Cell, CellGroup, Col, DatetimePicker, Field, Popup, Row } from "vant"
|
|
|
+import { defineComponent } from "vue";
|
|
|
+import dayjs from "dayjs";
|
|
|
+import { teacherState } from "./teacherState";
|
|
|
+import styles from './certOne.module.less';
|
|
|
+
|
|
|
+export default defineComponent({
|
|
|
+ name: 'certOne',
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ maxDate: new Date(),
|
|
|
+ popupShow: false,
|
|
|
+ popupDate: new Date(),
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ onConfirm(_date: any) {
|
|
|
+ teacherState.teacherCert.birthday = dayjs(this.popupDate).format('YYYY-MM-DD')
|
|
|
+ this.popupShow = false;
|
|
|
+ },
|
|
|
+ formatter(type: any, val: any) {
|
|
|
+ if (type === 'year') {
|
|
|
+ return `${val}年`;
|
|
|
+ }
|
|
|
+ if (type === 'month') {
|
|
|
+ return `${val}月`;
|
|
|
+ }
|
|
|
+ if (type === 'day') {
|
|
|
+ return `${val}日`;
|
|
|
+ }
|
|
|
+ return val;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ render() {
|
|
|
+ return (
|
|
|
+ <div class={styles.certOne}>
|
|
|
+ <CellGroup border={false}>
|
|
|
+ <Row style={{ marginBottom: '16px' }}>
|
|
|
+ <Col span={24} class={styles.formTitle}>真实姓名</Col>
|
|
|
+ <Col span={24} class="van-hairline--bottom">
|
|
|
+ <Field
|
|
|
+ v-model={teacherState.teacherCert.username}
|
|
|
+ name="真实姓名"
|
|
|
+ placeholder="请输入您的真实姓名"
|
|
|
+ type="tel"
|
|
|
+ maxlength={11}
|
|
|
+ />
|
|
|
+ </Col>
|
|
|
+ </Row>
|
|
|
+ <Row style={{ marginBottom: '16px' }}>
|
|
|
+ <Col span={24} class={styles.formTitle}>身份证号</Col>
|
|
|
+ <Col span={24} class="van-hairline--bottom">
|
|
|
+ <Field
|
|
|
+ v-model={teacherState.teacherCert.idCard}
|
|
|
+ name="身份证号"
|
|
|
+ placeholder="请输入您的身份证号码"
|
|
|
+ type="tel"
|
|
|
+ maxlength={11}
|
|
|
+ />
|
|
|
+ </Col>
|
|
|
+ </Row>
|
|
|
+ <Row style={{ marginBottom: '16px' }}>
|
|
|
+ <Col span={24} class={styles.formTitle}>性别</Col>
|
|
|
+ <Col span={24} class={styles.radioGroup}>
|
|
|
+ <div onClick={() => teacherState.teacherCert.sex = 1 } class={[styles.radio, teacherState.teacherCert.sex === 1 ? styles.active : null]}>男</div>
|
|
|
+ <div onClick={() => teacherState.teacherCert.sex = 0 } class={[styles.radio,teacherState.teacherCert.sex === 0 ? styles.active : null]}>女</div>
|
|
|
+ </Col>
|
|
|
+ </Row>
|
|
|
+ <Row>
|
|
|
+ <Col span={24} class={styles.formTitle}>出生日期</Col>
|
|
|
+ <Col span={24} class="van-hairline--bottom">
|
|
|
+ <Field
|
|
|
+ v-model={teacherState.teacherCert.birthday}
|
|
|
+ name="出生日期"
|
|
|
+ onClick-input={() => this.popupShow = true}
|
|
|
+ readonly
|
|
|
+ isLink
|
|
|
+ placeholder="请选择您的出生日期"
|
|
|
+ />
|
|
|
+ </Col>
|
|
|
+ </Row>
|
|
|
+ </CellGroup>
|
|
|
+
|
|
|
+ <Popup show={this.popupShow} position="bottom" round>
|
|
|
+ <DatetimePicker
|
|
|
+ v-model={this.popupDate}
|
|
|
+ type="date"
|
|
|
+ close-on-popstate={true}
|
|
|
+ maxDate={this.maxDate}
|
|
|
+ onCancel={() => this.popupShow = false}
|
|
|
+ onConfirm={this.onConfirm}
|
|
|
+ formatter={this.formatter}>
|
|
|
+ </DatetimePicker>
|
|
|
+ </Popup>
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }
|
|
|
+})
|