|
@@ -0,0 +1,63 @@
|
|
|
+<template>
|
|
|
+ <div id="registered">
|
|
|
+ <van-row>
|
|
|
+ <van-col class="title" :span="24">请填写以下注册信息</van-col>
|
|
|
+ <van-form @submit="onSubmit" v-model="form" :show-error-message="false">
|
|
|
+ <van-field required v-model="form.name" name="name" placeholder="请填写用户名" :rules="[{ required: true, message: '请填写用户名' }]" />
|
|
|
+ <van-field required v-model="form.phone" name="phone" placeholder="请填写手机号" :rules="[{ required: true, message: '请填写手机号' }]" />
|
|
|
+ <van-field v-model="form.hosname" name="hosname" placeholder="请填写医院名称" />
|
|
|
+ <van-field v-model="form.deptname" name="deptname" placeholder="请填写机构名称" />
|
|
|
+ <van-field v-model="form.level" name="level" placeholder="请填写职务" />
|
|
|
+ <van-field v-model="form.title" name="title" placeholder="请填写个人简介" type="textarea" rows="2" autosize maxlength="500" show-word-limit />
|
|
|
+ <van-field v-model="form.remark" name="remark" placeholder="请填写备注" type="textarea" rows="2" autosize maxlength="500" show-word-limit />
|
|
|
+ <div style="margin: 16px;">
|
|
|
+ <van-button round block type="info" native-type="submit">
|
|
|
+ 注册
|
|
|
+ </van-button>
|
|
|
+ </div>
|
|
|
+ </van-form>
|
|
|
+ </van-row>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { mapState, mapMutations, createNamespacedHelpers } from 'vuex';
|
|
|
+import Vue from 'vue';
|
|
|
+import { Toast } from 'vant';
|
|
|
+Vue.use(Toast);
|
|
|
+const { mapActions: user } = createNamespacedHelpers('onliveUser');
|
|
|
+export default {
|
|
|
+ name: 'registered',
|
|
|
+ props: {},
|
|
|
+ components: {},
|
|
|
+ data: () => ({
|
|
|
+ form: {},
|
|
|
+ }),
|
|
|
+ created() {},
|
|
|
+ computed: {},
|
|
|
+ methods: {
|
|
|
+ ...user(['register']),
|
|
|
+ async onSubmit(form) {
|
|
|
+ form.role = '4';
|
|
|
+ const res = await this.register(form);
|
|
|
+ console.log(res);
|
|
|
+ if (res.errcode === 0) {
|
|
|
+ this.$toast('注册成功');
|
|
|
+ } else {
|
|
|
+ this.$toast('注册失败');
|
|
|
+ }
|
|
|
+ console.log(form);
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+.title {
|
|
|
+ font-size: 25px;
|
|
|
+ margin: 60px 10px 20px 20px;
|
|
|
+}
|
|
|
+/deep/.van-field__control {
|
|
|
+ margin: 5px 10px;
|
|
|
+}
|
|
|
+</style>
|