| 
					
				 | 
			
			
				@@ -4,8 +4,10 @@ import ColHeader from '@/components/col-header' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import request from '@/helpers/request'
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import { verifyIdCard } from '@/helpers/toolsValidate'
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import { state } from '@/state'
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import { Button, CellGroup, Field, Form, Toast } from 'vant'
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { Button, CellGroup, Checkbox, Field, Form, Icon, Toast } from 'vant'
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import { defineComponent } from 'vue'
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import activeButtonIcon from '@common/images/icon_checkbox.png'
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import inactiveButtonIcon from '@common/images/icon_checkbox_default.png'
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import styles from './index.module.less'
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 export default defineComponent({
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -15,6 +17,10 @@ export default defineComponent({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       // 实名成功
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       type: Function,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       default: () => {}
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    },
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    exists: {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      type: Boolean,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      default: false
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   },
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   data() {
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -22,16 +28,29 @@ export default defineComponent({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       form: {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         realName: '',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         idCardNo: ''
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      },
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      checked: false
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   },
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  mounted() {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // exists
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    this.checked = this.checked || this.exists
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  },
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   methods: {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     async onSubmit() {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       try {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        await request.post('/api-auth/user/realNameAuth', {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (!this.checked) {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          Toast('请先阅读并同意《用户注册协议》')
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          return
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const url =
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          state.platformType === 'STUDENT'
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ? '/api-student/student/realNameAuth'
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            : '/api-teacher/teacher/realNameAuth'
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        await request.post(url, {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           data: {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             ...this.form,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            save: true
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            contract: true
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         })
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Toast('实名成功')
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -41,6 +60,18 @@ export default defineComponent({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           this.onSuccess()
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }, 500)
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } catch {}
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    },
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    getContractDetail() {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // 查看协议
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      const client = state.platformType === 'STUDENT' ? 'student' : 'teacher'
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      postMessage({
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        api: 'openWebView',
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        content: {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          url: `${location.origin}/${client}/#/previewProtocol`,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          orientation: 1,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          isHideTitle: false
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      })
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   },
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   render() {
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -73,7 +104,28 @@ export default defineComponent({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             />
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           </ColField>
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </ColFieldGroup>
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <div class={styles.colProtocol}>
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          {!this.exists && (
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <Checkbox
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              v-model={this.checked}
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              v-slots={{
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                icon: (props: any) => (
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                  <Icon
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    class={styles.boxStyle}
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    name={props.checked ? activeButtonIcon : inactiveButtonIcon}
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    size="15"
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                  />
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                )
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              }}
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            >
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              我已阅读并同意
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </Checkbox>
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          )}
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          {this.exists && <>查看</>}
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <span onClick={this.getContractDetail} class={styles.protocolText}>
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            《用户注册协议》
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          </span>
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </div>
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <div class={['btnGroup']}>
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           <Button block round type="primary" native-type="submit">
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             确定
 
			 |