Commit 31ac18b2 authored by ‘yangmengxue’'s avatar ‘yangmengxue’

电子邮箱

parent 4397589f
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
"version": "0.1.0", "version": "0.1.0",
"dependencies": { "dependencies": {
"axios": "^0.21.4", "axios": "^0.21.4",
"caniuse-lite": "^1.0.30001617",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"cos-js-sdk-v5": "^1.4.20", "cos-js-sdk-v5": "^1.4.20",
"default-passive-events": "^2.0.0", "default-passive-events": "^2.0.0",
...@@ -4453,21 +4454,9 @@ ...@@ -4453,21 +4454,9 @@
} }
}, },
"node_modules/caniuse-lite": { "node_modules/caniuse-lite": {
"version": "1.0.30001260", "version": "1.0.30001617",
"integrity": "sha512-Fhjc/k8725ItmrvW5QomzxLeojewxvqiYCKeFcfFEhut28IVLdpHU19dneOmltZQIE5HNbawj1HYD+1f2bM1Dg==", "resolved": "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001617.tgz",
"dev": true, "integrity": "sha512-mLyjzNI9I+Pix8zwcrpxEbGlfqOkF9kM3ptzmKNw5tizSyYwMe+nGLTqMK9cO+0E+Bh6TsBxNAaHWEM8xwSsmA=="
"dependencies": {
"nanocolors": "^0.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/browserslist"
}
},
"node_modules/caniuse-lite/node_modules/nanocolors": {
"version": "0.1.12",
"integrity": "sha512-2nMHqg1x5PU+unxX7PGY7AuYxl2qDx7PSrTRjizr8sxdd3l/3hBuWWaki62qmtYm2U5i4Z5E7GbjlyDFhs9/EQ==",
"dev": true
}, },
"node_modules/case-sensitive-paths-webpack-plugin": { "node_modules/case-sensitive-paths-webpack-plugin": {
"version": "2.4.0", "version": "2.4.0",
...@@ -18787,19 +18776,9 @@ ...@@ -18787,19 +18776,9 @@
} }
}, },
"caniuse-lite": { "caniuse-lite": {
"version": "1.0.30001260", "version": "1.0.30001617",
"integrity": "sha512-Fhjc/k8725ItmrvW5QomzxLeojewxvqiYCKeFcfFEhut28IVLdpHU19dneOmltZQIE5HNbawj1HYD+1f2bM1Dg==", "resolved": "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001617.tgz",
"dev": true, "integrity": "sha512-mLyjzNI9I+Pix8zwcrpxEbGlfqOkF9kM3ptzmKNw5tizSyYwMe+nGLTqMK9cO+0E+Bh6TsBxNAaHWEM8xwSsmA=="
"requires": {
"nanocolors": "^0.1.0"
},
"dependencies": {
"nanocolors": {
"version": "0.1.12",
"integrity": "sha512-2nMHqg1x5PU+unxX7PGY7AuYxl2qDx7PSrTRjizr8sxdd3l/3hBuWWaki62qmtYm2U5i4Z5E7GbjlyDFhs9/EQ==",
"dev": true
}
}
}, },
"case-sensitive-paths-webpack-plugin": { "case-sensitive-paths-webpack-plugin": {
"version": "2.4.0", "version": "2.4.0",
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
}, },
"dependencies": { "dependencies": {
"axios": "^0.21.4", "axios": "^0.21.4",
"caniuse-lite": "^1.0.30001617",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"cos-js-sdk-v5": "^1.4.20", "cos-js-sdk-v5": "^1.4.20",
"default-passive-events": "^2.0.0", "default-passive-events": "^2.0.0",
......
...@@ -156,7 +156,6 @@ ...@@ -156,7 +156,6 @@
ref="id_card" ref="id_card"
size="small" size="small"
v-model="referForm.id_card" v-model="referForm.id_card"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -497,7 +496,6 @@ ...@@ -497,7 +496,6 @@
> >
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- 选科情况 --> <!-- 选科情况 -->
...@@ -530,10 +528,13 @@ ...@@ -530,10 +528,13 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<!--已选科--> <!--已选科-->
<el-col :span="12" v-if="configJson.electSubjectSituation == 1&& showSubject == 1"> <el-col
:span="12"
v-if="configJson.electSubjectSituation == 1 && showSubject == 1"
>
<el-form-item <el-form-item
:rules=" :rules="
showSubject == 1 showSubject == 1
? referInfoRules.chooseSubject ? referInfoRules.chooseSubject
: [{ required: false }] : [{ required: false }]
" "
...@@ -564,7 +565,8 @@ ...@@ -564,7 +565,8 @@
<el-col :span="12" v-show="configJson.pastMedicalHistory == 1"> <el-col :span="12" v-show="configJson.pastMedicalHistory == 1">
<el-form-item <el-form-item
:rules=" :rules="
(configJson.pastMedicalHistory == 1?true:false)&&isOffline==true (configJson.pastMedicalHistory == 1 ? true : false) &&
isOffline == true
? referInfoRules.pastMedicalHistory ? referInfoRules.pastMedicalHistory
: [{ required: false }] : [{ required: false }]
" "
...@@ -585,7 +587,7 @@ ...@@ -585,7 +587,7 @@
<el-col :span="12" v-show="configJson.noteOther == 1"> <el-col :span="12" v-show="configJson.noteOther == 1">
<el-form-item <el-form-item
:rules=" :rules="
(configJson.noteOther == 1?true:false)&&isOffline==true (configJson.noteOther == 1 ? true : false) && isOffline == true
? referInfoRules.noteOther ? referInfoRules.noteOther
: [{ required: false }] : [{ required: false }]
" "
...@@ -606,7 +608,7 @@ ...@@ -606,7 +608,7 @@
<el-col :span="12" v-show="configJson.clothesSize == 1"> <el-col :span="12" v-show="configJson.clothesSize == 1">
<el-form-item <el-form-item
:rules=" :rules="
(configJson.clothesSize == 1?true:false)&&isOffline==true (configJson.clothesSize == 1 ? true : false) && isOffline == true
? referInfoRules.clothesSize ? referInfoRules.clothesSize
: [{ required: false }] : [{ required: false }]
" "
...@@ -633,12 +635,7 @@ ...@@ -633,12 +635,7 @@
</el-col> </el-col>
<!-- 邀请码 --> <!-- 邀请码 -->
<el-col :span="12" v-show="configJson.code == 1"> <el-col :span="12" v-show="configJson.code == 1">
<el-form-item <el-form-item label="邀请码" prop="code" style="height: 73px">
label="邀请码"
prop="code"
style="height: 73px"
>
<el-input <el-input
:disabled="isCode" :disabled="isCode"
clearable clearable
...@@ -648,21 +645,19 @@ ...@@ -648,21 +645,19 @@
v-model="referForm.code" v-model="referForm.code"
/> />
</el-form-item> </el-form-item>
<div class="tipsMsg"> <div class="tipsMsg">每个邀请码仅能绑定一个用户</div>
每个邀请码仅能绑定一个用户
</div>
</el-col> </el-col>
<!-- 自我介绍 --> <!-- 自我介绍 -->
<el-col :span="12" v-show="configJson.introduceMyself == 1"> <el-col :span="12" v-show="configJson.introduceMyself == 1">
<el-form-item <el-form-item
:rules=" :rules="
configJson.introduceMyself == 1 configJson.introduceMyself == 1
? referInfoRules.introduceMyself ? referInfoRules.introduceMyself
: [{ required: false }] : [{ required: false }]
" "
label="自我介绍" label="自我介绍"
prop="introduce" prop="introduce"
style="height:100%" style="height: 100%"
> >
<el-input <el-input
:rows="6" :rows="6"
...@@ -673,7 +668,8 @@ ...@@ -673,7 +668,8 @@
show-word-limit show-word-limit
size="small" size="small"
type="textarea" type="textarea"
v-model="referForm.introduce"/> v-model="referForm.introduce"
/>
</el-form-item> </el-form-item>
<div class="tipsMsg"> <div class="tipsMsg">
用清晰、简洁的语言介绍自己对科学和创新的兴趣、经验和动机,以及为什么希望参加“强国有我”复旦大学信息科学与工程学院青少年科学营 用清晰、简洁的语言介绍自己对科学和创新的兴趣、经验和动机,以及为什么希望参加“强国有我”复旦大学信息科学与工程学院青少年科学营
...@@ -683,8 +679,8 @@ ...@@ -683,8 +679,8 @@
<el-col :span="12" v-show="configJson.class == 1"> <el-col :span="12" v-show="configJson.class == 1">
<el-form-item <el-form-item
:rules=" :rules="
configJson.class == 1 configJson.class == 1
? referInfoRules.class ? referInfoRules.class
: [{ required: false }] : [{ required: false }]
" "
label="班级" label="班级"
...@@ -702,22 +698,17 @@ ...@@ -702,22 +698,17 @@
</el-col> </el-col>
</el-row> </el-row>
<!-- 紧急联系人--> <!-- 紧急联系人-->
<div <div v-show="configJson.emergency == 1 || configJson.emergencyPhone == 1">
v-show="
configJson.emergency == 1 ||
configJson.emergencyPhone == 1
"
>
<div class="cont_title">紧急联系人</div> <div class="cont_title">紧急联系人</div>
<el-row :gutter="20"> <el-row :gutter="20">
<!-- 紧急联系人 --> <!-- 紧急联系人 -->
<el-col :span="12" v-show="configJson.emergency == 1"> <el-col :span="12" v-show="configJson.emergency == 1">
<el-form-item <el-form-item
:rules=" :rules="
configJson.emergency == 1 configJson.emergency == 1
? referInfoRules.emergency ? referInfoRules.emergency
: [{ required: false }] : [{ required: false }]
" "
label="紧急联系人" label="紧急联系人"
prop="emergency" prop="emergency"
> >
...@@ -734,10 +725,10 @@ ...@@ -734,10 +725,10 @@
<el-col :span="12" v-show="configJson.emergencyPhone == 1"> <el-col :span="12" v-show="configJson.emergencyPhone == 1">
<el-form-item <el-form-item
:rules=" :rules="
configJson.emergencyPhone == 1 configJson.emergencyPhone == 1
? referInfoRules.emergency_phone ? referInfoRules.emergency_phone
: [{ required: false }] : [{ required: false }]
" "
label="紧急联系人电话" label="紧急联系人电话"
prop="emergency_phone" prop="emergency_phone"
> >
...@@ -929,7 +920,6 @@ ...@@ -929,7 +920,6 @@
list-type="picture-card" list-type="picture-card"
name="multipartFile" name="multipartFile"
ref="imgUrl" ref="imgUrl"
> >
<i class="el-icon-circle-plus" style="font-size: 44px"> </i> <i class="el-icon-circle-plus" style="font-size: 44px"> </i>
<!-- <div class="text">上传材料</div> --> <!-- <div class="text">上传材料</div> -->
...@@ -968,7 +958,7 @@ ...@@ -968,7 +958,7 @@
</div> </div>
<el-dialog :visible.sync="dialogVisible"> <el-dialog :visible.sync="dialogVisible">
<img :src="resultPicture" alt="" width="100%"/> <img :src="resultPicture" alt="" width="100%" />
</el-dialog> </el-dialog>
</div> </div>
</el-form-item> </el-form-item>
...@@ -984,908 +974,927 @@ ...@@ -984,908 +974,927 @@
</template> </template>
<script> <script>
/* eslint-disable */ /* eslint-disable */
import {delPic, getAccount, getProAndCity, getSchool, setAccount} from "r/index/signUp"; import {
import COS from "cos-js-sdk-v5"; delPic,
import {achievementCallBack, cosSignature} from "r/index/cosUpload"; getAccount,
import validator from "common/validator"; getProAndCity,
import area from "config/area"; getSchool,
import cueDialog from "c/index/cueDialog"; setAccount,
} from "r/index/signUp";
export default { import COS from "cos-js-sdk-v5";
name: "referInfo", import { achievementCallBack, cosSignature } from "r/index/cosUpload";
props: {invitation_code: String}, import validator from "common/validator";
components: {cueDialog}, import area from "config/area";
data() { import cueDialog from "c/index/cueDialog";
const validateContent = (rule, value, callback) => {
if (!this.referForm.birthday) {
callback(new Error("出生日期不能为空!"));
} else {
callback();
}
};
const validateContents = (rule, value, callback) => {
if (!this.referForm.jiguan_code) {
callback(new Error("籍贯不能为空!"));
} else {
callback();
}
};
const validateSubject = (rule, value, callback) => {
if (!this.elect_subject_situation) {
callback(new Error("选科不能为空!"));
} else {
callback();
}
};
return {
cueDialogVisible: false,
msg: null,
configJson: {},
isUploading: false, // 图片上传蒙层
isCode: false, // 邀请码是否禁用
showSubject: 0,//是否展示选科(多选)
subjectState: '',
elect_subject_situation: null,
referForm: {
name: null,
gender: null,
age: null,
id_card: null,
education: null,
birthday: null,
jiguan_code: null,
address: null,
country: null,
nation: null,
start_school_date: null,
political_status: null,
phone: null,
grade: null,
unit_and_identity: null,
email: null,
recommend: null,
subjectState: null,
chooseSubject: [],
past_medical_history: null,
note_other: null,
clothes_size: null,
class: null,
emergency: null,
emergency_phone: null,
introduce: null,
school_province: null,
school_city: null,
school: null,
school_contacts: null,
school_phone: null,
code: null
},
// doubt_code: window.localStorage.getItem(
// "doubt_code" + this.$store.state.indexIdentity
// ),//是否填写邀请码
schoolName: {},
referInfoRules: {
name: [{required: true, message: "姓名不能为空!", trigger: "blur"}],
gender: [
{required: true, message: "性别不能为空!", trigger: "change"},
],
id_card: [
// { required: true, message: "身份证号不能为空!", trigger: "blur" },
{validator: validator.validateid_card, trigger: "blur"},
],
birthday: [
{
required: true,
validator: validateContent,
trigger: "change",
},
],
jiguan_code: [
{required: true, validator: validateContents, trigger: "change"},
],
nation: [
{required: true, message: "民族不能为空!", trigger: "change"},
],
country: [
{
required: true,
message: "国籍不能为空!",
trigger: "change",
},
],
start_school_date: [
{
required: true,
message: "入学年份不能为空!",
trigger: "change",
},
],
political_status: [
{required: true, message: "政治面貌不能为空!", trigger: "blur"},
],
email: [
{required: true, message: "电子邮箱不能为空!", trigger: "blur"},
{validator: validator.validateEmail, trigger: "blur"},
],
grade: [
{required: true, message: "在读年级不能为空!", trigger: "blur"},
],
age: [
{required: true, message: "年龄不能为空!", trigger: "blur"},
{validator: validator.validateNumber, trigger: "blur"},
],
education: [
{required: true, message: "学历不能为空!", trigger: "change"},
],
idCard: [
{
required: true,
message: "身份证号不能为空!",
trigger: "blur",
},
{validator: validator.validateid_card, trigger: "blur"},
], export default {
// address: [ name: "referInfo",
// { required: true, message: "详细地址不能为空!", trigger: "blur" }, props: { invitation_code: String },
// ], components: { cueDialog },
unit_and_identity: [ data() {
{ const validateContent = (rule, value, callback) => {
required: true, if (!this.referForm.birthday) {
message: "单位名称及身份不能为空!", callback(new Error("出生日期不能为空!"));
trigger: "blur", } else {
}, callback();
], }
subjectState: [ };
{ const validateContents = (rule, value, callback) => {
required: true, if (!this.referForm.jiguan_code) {
message: "选科情况不能为空!", callback(new Error("籍贯不能为空!"));
trigger: "change", } else {
}, callback();
], }
phone: [ };
{ const validateSubject = (rule, value, callback) => {
required: true, if (!this.elect_subject_situation) {
message: "手机号不能为空!", callback(new Error("选科不能为空!"));
trigger: "blur", } else {
}, callback();
{validator: validator.validatePhone, trigger: "blur"}, }
], };
chooseSubject: [ return {
{ cueDialogVisible: false,
required: true, msg: null,
validator: validateSubject, configJson: {},
trigger: "change", isUploading: false, // 图片上传蒙层
}, isCode: false, // 邀请码是否禁用
], showSubject: 0, //是否展示选科(多选)
past_medical_history: [ subjectState: "",
{ elect_subject_situation: null,
required: true, referForm: {
message: "既往病史或过敏史不能为空!", name: null,
trigger: "blur", gender: null,
}, age: null,
], id_card: null,
note_other: [ education: null,
{ birthday: null,
required: true, jiguan_code: null,
message: "备注或其它不能为空!", address: null,
trigger: "blur", country: null,
}, nation: null,
], start_school_date: null,
class: [ political_status: null,
{ phone: null,
required: true, grade: null,
message: "班级不能为空!", unit_and_identity: null,
trigger: "blur", email: null,
}, recommend: null,
], subjectState: null,
emergency: [ chooseSubject: [],
{ past_medical_history: null,
required: true, note_other: null,
message: "紧急联系人不能为空!", clothes_size: null,
trigger: "blur", class: null,
}, emergency: null,
], emergency_phone: null,
emergency_phone: [ introduce: null,
{ school_province: null,
required: true, school_city: null,
message: "紧急联系人电话不能为空!", school: null,
trigger: "blur", school_contacts: null,
}, school_phone: null,
{validator: validator.validatePhone, trigger: "blur"}, code: null,
], },
clothesSize: [ // doubt_code: window.localStorage.getItem(
{ // "doubt_code" + this.$store.state.indexIdentity
required: true, // ),//是否填写邀请码
message: "衣服尺码不能为空!", schoolName: {},
trigger: "change", referInfoRules: {
}, name: [{ required: true, message: "姓名不能为空!", trigger: "blur" }],
], gender: [
introduce: [ { required: true, message: "性别不能为空!", trigger: "change" },
{
required: true,
message: "自我介绍不能为空!",
trigger: "blur",
},
],
school_province: [
{
required: true,
message: "请选择所在学校省份!",
trigger: "change",
},
],
school_city: [
{
required: true,
message: "请选择所在学校城市!",
trigger: "change",
},
],
school: [
{required: true, message: "请选择所在学校!", trigger: "change"},
],
school_contacts: [
{required: true, message: "请填写中学联系人!", trigger: "blur"},
],
school_phone: [
{
required: true,
message: "中学联系人电话(手机)不能为空!",
trigger: "blur",
},
{validator: validator.validatePhone, trigger: "blur"},
],
// backgroundPicture: [{ required: true, message: "请上传图片" }],
},
countryList: area.country, //国籍
selectProvince: [], //省份
CityName: {}, //根据省份筛选出所有城市的对象
selectCityJiguan: [], //籍贯城市列表
selectCitySchool: [], //就读中学-城市列表
selectSchoolList: [], //就读中学-中学列表
jgProvinceCode: "", //省份id
jiguan_city: "", //城市id(和省份id拼接)
electSubjectArrs: ["未选科", "已选科", "文科", '理科'],
SubjectArrs: ["物理", "历史", "化学", "地理", "生物", "政治",],
EducationArrs: ["初中", "高中", "大学", "硕士", "博士"],
yearArrs: [], //生日涉及的近10年的年份
monthArrs: [
"01",
"02",
"03",
"04",
"05",
"06",
"07",
"08",
"09",
"10",
"11",
"12",
], ],
dayArrs: [ id_card: [
"01", // { required: true, message: "身份证号不能为空!", trigger: "blur" },
"02", { validator: validator.validateid_card, trigger: "blur" },
"03",
"04",
"05",
"06",
"07",
"08",
"09",
"10",
"11",
"12",
"13",
"14",
"15",
"16",
"17",
"18",
"19",
"20",
"21",
"22",
"23",
"24",
"25",
"26",
"27",
"28",
"29",
"30",
"31",
], ],
bdYear: "", //选择的生日年份 birthday: [
bdMonth: "", //选择的生日月份
bdDay: "", //选择的生日日期
//入学年份(初中高中)
gradeArrs: ["初一", "初二", "初三", "高一", "高二", "高三"],
//选择年级
start_grade: "",
start_year: "",
// 政治面貌
political_status: [
{ {
id: 1, required: true,
name: "中共党员", validator: validateContent,
trigger: "change",
}, },
],
jiguan_code: [
{ required: true, validator: validateContents, trigger: "change" },
],
nation: [
{ required: true, message: "民族不能为空!", trigger: "change" },
],
country: [
{ {
id: 2, required: true,
name: "中共预备党员", message: "国籍不能为空!",
trigger: "change",
}, },
],
start_school_date: [
{ {
id: 3, required: true,
name: "共青团员", message: "入学年份不能为空!",
trigger: "change",
}, },
],
political_status: [
{ required: true, message: "政治面貌不能为空!", trigger: "blur" },
],
email: [
{ required: true, message: "电子邮箱不能为空!", trigger: "blur" },
{ validator: validator.validateEmail, trigger: "blur" },
],
grade: [
{ required: true, message: "在读年级不能为空!", trigger: "blur" },
],
age: [
{ required: true, message: "年龄不能为空!", trigger: "blur" },
{ validator: validator.validateNumber, trigger: "blur" },
],
education: [
{ required: true, message: "学历不能为空!", trigger: "change" },
],
idCard: [
{ {
id: 4, required: true,
name: "民革党员", message: "身份证号不能为空!",
trigger: "blur",
}, },
{ validator: validator.validateid_card, trigger: "blur" },
],
// address: [
// { required: true, message: "详细地址不能为空!", trigger: "blur" },
// ],
unit_and_identity: [
{ {
id: 5, required: true,
name: "民盟盟员", message: "单位名称及身份不能为空!",
trigger: "blur",
}, },
],
subjectState: [
{ {
id: 6, required: true,
name: "民建会员", message: "选科情况不能为空!",
trigger: "change",
}, },
],
phone: [
{ {
id: 7, required: true,
name: "民进会员", message: "手机号不能为空!",
trigger: "blur",
}, },
{ validator: validator.validatePhone, trigger: "blur" },
],
chooseSubject: [
{ {
id: 8, required: true,
name: "农工党党员", validator: validateSubject,
trigger: "change",
}, },
],
past_medical_history: [
{ {
id: 9, required: true,
name: "致公党党员", message: "既往病史或过敏史不能为空!",
trigger: "blur",
}, },
],
note_other: [
{ {
id: 10, required: true,
name: "九三学社社员", message: "备注或其它不能为空!",
trigger: "blur",
}, },
],
class: [
{ {
id: 11, required: true,
name: "台盟盟员", message: "班级不能为空!",
trigger: "blur",
}, },
],
emergency: [
{ {
id: 12, required: true,
name: "无党派人士", message: "紧急联系人不能为空!",
trigger: "blur",
}, },
],
emergency_phone: [
{ {
id: 13, required: true,
name: "群众", message: "紧急联系人电话不能为空!",
trigger: "blur",
}, },
{ validator: validator.validatePhone, trigger: "blur" },
], ],
//衣服尺码
clothesSize: [ clothesSize: [
{ {
id: 1, required: true,
name: "S", message: "衣服尺码不能为空!",
}, trigger: "change",
{
id: 2,
name: "M",
},
{
id: 3,
name: "L",
}, },
],
introduce: [
{ {
id: 4, required: true,
name: "XL", message: "自我介绍不能为空!",
trigger: "blur",
}, },
],
school_province: [
{ {
id: 5, required: true,
name: "XXL", message: "请选择所在学校省份!",
trigger: "change",
}, },
],
school_city: [
{ {
id: 6, required: true,
name: "XXXL", message: "请选择所在学校城市!",
trigger: "change",
}, },
],
school: [
{ required: true, message: "请选择所在学校!", trigger: "change" },
],
school_contacts: [
{ required: true, message: "请填写中学联系人!", trigger: "blur" },
],
school_phone: [
{ {
id: 7, required: true,
name: "XXXXL", message: "中学联系人电话(手机)不能为空!",
trigger: "blur",
}, },
{ validator: validator.validatePhone, trigger: "blur" },
], ],
// 中学(模糊搜索) // backgroundPicture: [{ required: true, message: "请上传图片" }],
// timeout: null, },
// school: "", countryList: area.country, //国籍
// 上传的图片 selectProvince: [], //省份
dialogImageUrl: "", CityName: {}, //根据省份筛选出所有城市的对象
dialogVisible: false, selectCityJiguan: [], //籍贯城市列表
fileList: [], selectCitySchool: [], //就读中学-城市列表
resultPicture: "", selectSchoolList: [], //就读中学-中学列表
disabled: false, //限制输入框 jgProvinceCode: "", //省份id
isOffline: false, //活动形式是否包含线下字段 jiguan_city: "", //城市id(和省份id拼接)
hideUpload: false electSubjectArrs: ["未选科", "已选科", "文科", "理科"],
}; SubjectArrs: ["物理", "历史", "化学", "地理", "生物", "政治"],
}, EducationArrs: ["初中", "高中", "大学", "硕士", "博士"],
created() { yearArrs: [], //生日涉及的近10年的年份
const code = this.$store.state.indexIdentity; monthArrs: [
this.referForm.phone = window.localStorage.getItem("index-phone-all"); //本地取用户手机号 "01",
let signUpFile = window.localStorage.getItem( "02",
"sign_up_file_" + window.localStorage.getItem("index-phone-all") + code "03",
); "04",
// console.log(signUpFile); "05",
if (signUpFile && JSON.parse(signUpFile).length > 0) { "06",
this.fileList = JSON.parse(signUpFile); "07",
this.hideUpload = this.fileList.length >= 10; "08",
"09",
"10",
"11",
"12",
],
dayArrs: [
"01",
"02",
"03",
"04",
"05",
"06",
"07",
"08",
"09",
"10",
"11",
"12",
"13",
"14",
"15",
"16",
"17",
"18",
"19",
"20",
"21",
"22",
"23",
"24",
"25",
"26",
"27",
"28",
"29",
"30",
"31",
],
bdYear: "", //选择的生日年份
bdMonth: "", //选择的生日月份
bdDay: "", //选择的生日日期
//入学年份(初中高中)
gradeArrs: ["初一", "初二", "初三", "高一", "高二", "高三"],
//选择年级
start_grade: "",
start_year: "",
// 政治面貌
political_status: [
{
id: 1,
name: "中共党员",
},
{
id: 2,
name: "中共预备党员",
},
{
id: 3,
name: "共青团员",
},
{
id: 4,
name: "民革党员",
},
{
id: 5,
name: "民盟盟员",
},
{
id: 6,
name: "民建会员",
},
{
id: 7,
name: "民进会员",
},
{
id: 8,
name: "农工党党员",
},
{
id: 9,
name: "致公党党员",
},
{
id: 10,
name: "九三学社社员",
},
{
id: 11,
name: "台盟盟员",
},
{
id: 12,
name: "无党派人士",
},
{
id: 13,
name: "群众",
},
],
//衣服尺码
clothesSize: [
{
id: 1,
name: "S",
},
{
id: 2,
name: "M",
},
{
id: 3,
name: "L",
},
{
id: 4,
name: "XL",
},
{
id: 5,
name: "XXL",
},
{
id: 6,
name: "XXXL",
},
{
id: 7,
name: "XXXXL",
},
],
// 中学(模糊搜索)
// timeout: null,
// school: "",
// 上传的图片
dialogImageUrl: "",
dialogVisible: false,
fileList: [],
resultPicture: "",
disabled: false, //限制输入框
isOffline: false, //活动形式是否包含线下字段
hideUpload: false,
};
},
created() {
const code = this.$store.state.indexIdentity;
this.referForm.phone = window.localStorage.getItem("index-phone-all"); //本地取用户手机号
let signUpFile = window.localStorage.getItem(
"sign_up_file_" + window.localStorage.getItem("index-phone-all") + code
);
// console.log(signUpFile);
if (signUpFile && JSON.parse(signUpFile).length > 0) {
this.fileList = JSON.parse(signUpFile);
this.hideUpload = this.fileList.length >= 10;
}
// this.getSchool();
this.getTenYear();
this.getAccount(); // 页面信息个人获取
this.configJson = this.$store.state.configJson;
if (this.configJson.jiguanCity == 1 || this.configJson.school == 1) {
this.getProAndCity();
}
//若线下形式(既往病史或过敏史,备注或其它,衣服尺码)为必填项,否则为选填。
let multiform = JSON.parse(window.localStorage.getItem("multiform" + code));
let multiform_id = window.localStorage.getItem("multiform_id" + code);
if (multiform != "[]") {
multiform.forEach((i) => {
if (i.id == multiform_id) {
let reg = /[\u7ebf][\u4e0b]/;
this.isOffline = reg.test(i.multiform_name);
}
});
}
console.log(this.isOffline);
},
watch: {
referForm(val) {
for (let k in val) {
if (val[k] == null || !val[k]) {
val[k] = this.referForm[k];
}
} }
// this.getSchool(); this.selfInfo = val;
this.getTenYear(); if (val.gender && val.gender !== "") {
this.getAccount(); // 页面信息个人获取 // console.log(val.gender)
this.configJson = this.$store.state.configJson; this.referForm.gender = val.gender;
if (this.configJson.jiguanCity == 1 || this.configJson.school == 1) {
this.getProAndCity();
} }
; //出生日期
//若线下形式(既往病史或过敏史,备注或其它,衣服尺码)为必填项,否则为选填。 if (val.birthday && val.birthday !== "") {
let multiform = JSON.parse(window.localStorage.getItem("multiform" + code)); this.bdYear = val.birthday.slice(0, 4); //前4位取年
let multiform_id = window.localStorage.getItem("multiform_id" + code); this.bdMonth = val.birthday.slice(4, 6); //中2位取月
if (multiform != '[]') { this.bdDay = val.birthday.slice(6, 8); //后2位取日
multiform.forEach((i) => {
if (i.id == multiform_id) {
let reg = /[\u7ebf][\u4e0b]/
this.isOffline = reg.test(i.multiform_name)
}
})
} }
console.log(this.isOffline) //入学年份
}, if (val.start_school_date && val.start_school_date !== "") {
watch: { this.start_year = val.start_school_date.slice(0, 4); //年份
referForm(val) { this.start_grade = val.start_school_date.slice(5, 8); //年级
for (let k in val) { }
if (val[k] == null || !val[k]) { //籍贯
val[k] = this.referForm[k]; if (
} val.jiguan_city !== null &&
val.jiguan_province !== null &&
this.configJson.jiguanCity == 1
) {
if (this.referForm.jiguan_city) {
} }
this.selfInfo = val; this.jgProvinceCode = Number(val.jiguan_province);
if (val.gender && val.gender !== "") { this.changeProvince(1, this.jgProvinceCode, true);
// console.log(val.gender) this.jiguan_city = Number(val.jiguan_city);
this.referForm.gender = val.gender; }
//学校
if (
val.school_province !== null &&
val.school_city !== null &&
val.school !== null &&
this.configJson.school == 1
) {
this.referForm.school_province = Number(val.school_province);
this.referForm.school_city = Number(val.school_city);
this.referForm.school = Number(val.school);
this.changeProvince(2, this.referForm.school_province, true);
this.changeCity(this.referForm.school_city, true);
}
if (
val.elect_subject_situation == "文科" ||
val.elect_subject_situation == "理科"
) {
this.referForm.subjectState = val.elect_subject_situation;
this.showSubject = 0;
} else if (
val.elect_subject_situation != null &&
val.elect_subject_situation !== "" &&
val.elect_subject_situation !== "-"
) {
this.referForm.subjectState = "已选科";
this.showSubject = 1;
this.referForm.chooseSubject = val.elect_subject_situation.split("#");
this.elect_subject_situation = val.elect_subject_situation;
} else {
this.referForm.subjectState = "未选科";
this.showSubject = 0;
this.elect_subject_situation = "-";
this.referForm.chooseSubject = [];
}
if (this.invitation_code != null) {
this.referForm.code = this.invitation_code;
this.isCode = true;
}
//自我介绍
let introduce = this.$store.state.signUpInfo.introduce;
if (introduce != null) {
this.referForm.introduce = introduce;
}
},
},
mounted() {},
methods: {
// 页面信息个人获取
getAccount() {
getAccount({}).then((res) => {
// console.log(res, "getAccount");
if (res.data.code != 200) {
return this.$message.error(res.data.msg);
} }
//出生日期 let info = res.data.info;
if (val.birthday && val.birthday !== "") { info["code"] = null;
this.bdYear = val.birthday.slice(0, 4); //前4位取年 let referForm = {
this.bdMonth = val.birthday.slice(4, 6); //中2位取月 name: null,
this.bdDay = val.birthday.slice(6, 8); //后2位取日 gender: null,
age: null,
id_card: null,
education: null,
birthday: null,
jiguan_code: null,
address: null,
country: null,
nation: null,
start_school_date: null,
political_status: null,
phone: null,
grade: null,
unit_and_identity: null,
email: null,
recommend: null,
subjectState: null,
chooseSubject: [],
past_medical_history: null,
note_other: null,
clothes_size: null,
class: null,
emergency: null,
emergency_phone: null,
introduce: null,
school_province: null,
school_city: null,
school: null,
school_contacts: null,
school_phone: null,
code: null,
};
for (let k in info) {
referForm[k] = info[k];
} }
//入学年份 this.referForm = referForm;
if (val.start_school_date && val.start_school_date !== "") { if (res.data.info.jiguan_province && res.data.info.jiguan_city) {
this.start_year = val.start_school_date.slice(0, 4); //年份 this.referForm.jiguan_code =
this.start_grade = val.start_school_date.slice(5, 8); //年级 res.data.info.jiguan_province.toString() +
res.data.info.jiguan_city.toString();
} }
//籍贯 console.log(typeof window.localStorage.getItem("index-email-all"));
if ( if (res.data.info.email == null) {
val.jiguan_city !== null && let email = window.localStorage.getItem("index-email-all");
val.jiguan_province !== null && if (email == 'null') {
this.configJson.jiguanCity == 1 this.referForm.email = null
) { } else {
if (this.referForm.jiguan_city) { this.referForm.email =
window.localStorage.getItem("index-email-all"); //本地取用户邮箱
} }
this.jgProvinceCode = Number(val.jiguan_province);
this.changeProvince(1, this.jgProvinceCode, true);
this.jiguan_city = Number(val.jiguan_city);
} }
//学校 });
if (
val.school_province !== null &&
val.school_city !== null &&
val.school !== null &&
this.configJson.school == 1
) {
this.referForm.school_province = Number(val.school_province);
this.referForm.school_city = Number(val.school_city);
this.referForm.school = Number(val.school);
this.changeProvince(2, this.referForm.school_province, true);
this.changeCity(this.referForm.school_city, true);
}
if (val.elect_subject_situation == '文科' || val.elect_subject_situation == '理科') {
this.referForm.subjectState = val.elect_subject_situation;
this.showSubject = 0;
} else if (val.elect_subject_situation != null &&
val.elect_subject_situation !== '' &&
val.elect_subject_situation !== '-') {
this.referForm.subjectState = '已选科';
this.showSubject = 1;
this.referForm.chooseSubject = val.elect_subject_situation.split('#');
this.elect_subject_situation = val.elect_subject_situation;
} else {
this.referForm.subjectState = '未选科';
this.showSubject = 0;
this.elect_subject_situation = '-';
this.referForm.chooseSubject = [];
}
if (this.invitation_code != null) {
this.referForm.code = this.invitation_code;
this.isCode = true;
}
//自我介绍
let introduce = this.$store.state.signUpInfo.introduce
if (introduce != null) {
this.referForm.introduce = introduce
}
},
}, },
mounted() { //获取近10年的年份
getTenYear() {
let nowDate = new Date();
let currentYear = nowDate.getFullYear();
// console.log(nowDate, currentYear);
let yearArr = [];
let rxYearArr = [];
for (let i = 0; i < 73; i++) {
let year = currentYear - i;
yearArr.push(year);
}
// console.log(yearArr, "yearArr");
this.yearArrs = yearArr;
}, },
methods: { //组装出生日期
// 页面信息个人获取 getTime() {
getAccount() { this.referForm.birthday =
getAccount({}).then((res) => { this.bdYear.toString() +
// console.log(res, "getAccount"); this.bdMonth.toString() +
if (res.data.code != 200) { this.bdDay.toString();
return this.$message.error(res.data.msg); },
} // 国籍
let info = res.data.info; //组装入学年份
info['code'] = null getyear() {
let referForm = { this.referForm.start_school_date = this.start_year.toString();
name: null, // + "-" +
gender: null, // this.start_grade.toString();
age: null, },
id_card: null, // 选科情况
education: null, changeSubjectState(val) {
birthday: null, // this.referForm.subjectState = val
jiguan_code: null, if (val == "已选科") {
address: null, this.referForm.subjectState = val;
country: null, this.showSubject = 1;
nation: null, this.elect_subject_situation = "";
start_school_date: null, // console.log(this.elect_subject_situation)
political_status: null, } else if (val == "未选科") {
phone: null, this.showSubject = 0;
grade: null, this.referForm.subjectState = val;
unit_and_identity: null, this.elect_subject_situation = "-";
email: null, // console.log(this.referForm.subjectState)
recommend: null, } else {
subjectState: null, //文科理科
chooseSubject: [], this.elect_subject_situation = val;
past_medical_history: null, this.showSubject = 0;
note_other: null, }
clothes_size: null, },
class: null, changeSubjectList(val) {
emergency: null, this.referForm.chooseSubject = val;
emergency_phone: null, this.elect_subject_situation = val.join("#");
introduce: null, this.$forceUpdate();
school_province: null, },
school_city: null, //自我介绍
school: null, changeIntroduce(val) {
school_contacts: null, this.referForm.introduce = val;
school_phone: null, },
code: null // 获取省份城市
} getProAndCity() {
for (let k in info) { getProAndCity({}).then((res) => {
referForm[k] = info[k]; // console.log(res, "getProAndCity");
} if (res.data.code != 200) {
this.referForm = referForm; return this.$message.error(res.data.msg);
if (res.data.info.jiguan_province && res.data.info.jiguan_city) {
this.referForm.jiguan_code =
res.data.info.jiguan_province.toString() +
res.data.info.jiguan_city.toString();
}
if (res.data.info.email == null) {
this.referForm.email = window.localStorage.getItem("index-email-all"); //本地取用户邮箱
}
});
},
//获取近10年的年份
getTenYear() {
let nowDate = new Date();
let currentYear = nowDate.getFullYear();
// console.log(nowDate, currentYear);
let yearArr = [];
let rxYearArr = [];
for (let i = 0; i < 73; i++) {
let year = currentYear - i;
yearArr.push(year);
}
// console.log(yearArr, "yearArr");
this.yearArrs = yearArr;
},
//组装出生日期
getTime() {
this.referForm.birthday =
this.bdYear.toString() +
this.bdMonth.toString() +
this.bdDay.toString();
},
// 国籍
//组装入学年份
getyear() {
this.referForm.start_school_date = this.start_year.toString();
// + "-" +
// this.start_grade.toString();
},
// 选科情况
changeSubjectState(val) {
// this.referForm.subjectState = val
if (val == '已选科') {
this.referForm.subjectState = val
this.showSubject = 1;
this.elect_subject_situation = '';
// console.log(this.elect_subject_situation)
} else if (val == '未选科') {
this.showSubject = 0
this.referForm.subjectState = val
this.elect_subject_situation = '-'
// console.log(this.referForm.subjectState)
} else {
//文科理科
this.elect_subject_situation = val
this.showSubject = 0
}
},
changeSubjectList(val) {
this.referForm.chooseSubject = val;
this.elect_subject_situation = val.join("#");
this.$forceUpdate();
},
//自我介绍
changeIntroduce(val) {
this.referForm.introduce = val
},
// 获取省份城市
getProAndCity() {
getProAndCity({}).then((res) => {
// console.log(res, "getProAndCity");
if (res.data.code != 200) {
return this.$message.error(res.data.msg);
}
this.selectProvince = res.data.province_list;
});
},
//选择籍贯省份change事件
changeProvince(type, val, status) {
// console.log(type, val);
if (type == 1) {
this.selectCityJiguan = [];
this.selectCityJiguan = this.getCurrentCityLists(val);
if (!status) {
this.jiguan_city = "";
this.referForm.jiguan_code = "";
}
} else {
this.selectCitySchool = [];
this.selectCitySchool = this.getCurrentCityLists(val); //在此调用城市筛选列表
if (!status) {
this.referForm.school_city = "";
this.referForm.school = "";
this.selectSchoolList = []; //重新选择省份时候,学校list清空
}
} }
}, this.selectProvince = res.data.province_list;
//返回当前省份下的城市列表 });
getCurrentCityLists(val) { },
let currentCity = []; //选择籍贯省份change事件
if ( changeProvince(type, val, status) {
this.CityName == null || // console.log(type, val);
!this.CityName || if (type == 1) {
Object.values(this.CityName).length == 0 this.selectCityJiguan = [];
) { this.selectCityJiguan = this.getCurrentCityLists(val);
getProAndCity({}) if (!status) {
.then((res) => { this.jiguan_city = "";
// console.log(res, "getProAndCity"); this.referForm.jiguan_code = "";
if (res.data.code === 200) {
// this.selectProvince = res.data.province_list;
this.CityName = res.data.city_list;
for (let key in this.CityName) {
if (this.CityName[key].parent_id == val) {
currentCity.push(this.CityName[key]);
}
}
return currentCity;
} else {
this.$message.error(res.data.msg);
}
})
.catch((err) => {
this.$message.error(err);
});
} else {
for (let key in this.CityName) {
if (this.CityName[key].parent_id == val) {
currentCity.push(this.CityName[key]);
}
}
return currentCity;
} }
return currentCity; } else {
}, this.selectCitySchool = [];
// 籍贯城市change事件 this.selectCitySchool = this.getCurrentCityLists(val); //在此调用城市筛选列表
getJiguan() {
this.referForm.jiguan_code =
this.jgProvinceCode.toString() + this.jiguan_city.toString();
},
// getSchool() {
// console.log('getSchool')
// getSchool({}).then((res) => {
// // console.log(res, "getSchool");
// if (res.data.code != 200) {
// return this.$message.error(res.data.msg);
// }
// this.schoolName = res.data.school_list;
// });
// },
// 学校城市change事件
changeCity(val, status) {
// console.log(12345333,val,status)
this.selectSchoolList = [];
this.selectSchoolList = this.getCurrentSchoolLists(val);
if (!status) { if (!status) {
this.referForm.school_city = "";
this.referForm.school = ""; this.referForm.school = "";
this.selectSchoolList = []; //重新选择省份时候,学校list清空
} }
// let data = this.selectSchoolList.map((item) => { }
// return { },
// name: item.id, //返回当前省份下的城市列表
// value: item.name, getCurrentCityLists(val) {
// }; let currentCity = [];
// }); if (
// this.restaurants = data; //中学(模糊搜索) this.CityName == null ||
}, !this.CityName ||
// 返回当前城市下的学校列表 Object.values(this.CityName).length == 0
getCurrentSchoolLists(val) { ) {
let currentSchool = []; getProAndCity({})
let baseSchool = this.$store.state.baseSchool; .then((res) => {
if (baseSchool && baseSchool == 1) { // console.log(res, "getProAndCity");
currentSchool.unshift({ if (res.data.code === 200) {
id: 0, // this.selectProvince = res.data.province_list;
name: "其他", this.CityName = res.data.city_list;
}); for (let key in this.CityName) {
} if (this.CityName[key].parent_id == val) {
// console.log(this.schoolName); currentCity.push(this.CityName[key]);
if (
this.schoolName == null ||
!this.schoolName ||
Object.values(this.schoolName).length == 0
) {
getSchool({})
.then((res) => {
// console.log(res)
if (res.data.code === 200) {
this.schoolName = res.data.school_list;
// console.log( this.schoolName)
let code = this.$store.state.indexIdentity;
window.localStorage.setItem("schoolName" + code,
JSON.stringify(res.data.list)
);
for (let key in this.schoolName) {
if (this.schoolName[key].city_id == val) {
currentSchool.push(this.schoolName[key]);
}
} }
return currentSchool;
} else {
this.$message.error(res.data.msg);
} }
}) return currentCity;
.catch((err) => { } else {
this.$message.error(err); this.$message.error(res.data.msg);
});
} else {
// console.log(this.schoolName, 111);
for (let key in this.schoolName) {
// console.log(key, this.schoolName[key]);
if (this.schoolName[key].city_id == val) {
currentSchool.push(this.schoolName[key]);
} }
})
.catch((err) => {
this.$message.error(err);
});
} else {
for (let key in this.CityName) {
if (this.CityName[key].parent_id == val) {
currentCity.push(this.CityName[key]);
} }
// console.log(currentSchool, 222);
return currentSchool;
}
return currentSchool;
},
// 图片上传成功前钩子
beforeAvatarUpload(file) {
// console.log(file, "beforeImage");
const isJPG = file.type === "image/jpg";
const isPng = file.type === "image/png";
const isJPEG = file.type === "image/jpeg";
const isLt10M = file.size / 1024 / 1024 < 10;
// console.log(isLt10M)
if (!isJPG && !isPng && !isJPEG) {
this.$message.info("上传图片只能是 JPG,JPEG或png 格式!");
}
if (!isLt10M) {
this.$message.info("上传图片大小不能超过 10MB!");
} }
return (isJPG || isPng || isJPEG) && isLt10M; return currentCity;
}, }
handlePictureCardPreview(file) { return currentCity;
this.resultPicture = file.url; },
this.dialogVisible = true; // 籍贯城市change事件
}, getJiguan() {
uploadSuccess(res, file, fileList) { this.referForm.jiguan_code =
this.referForm.achievementPath = res; this.jgProvinceCode.toString() + this.jiguan_city.toString();
this.fileList = { },
name: file.name, // getSchool() {
url: res, // console.log('getSchool')
}; // getSchool({}).then((res) => {
this.$refs["imgUrl"].clearFiles(); //上传成功之后清除历史记录 // // console.log(res, "getSchool");
}, // if (res.data.code != 200) {
uploadPicture(params) { // return this.$message.error(res.data.msg);
// console.log("已经准备好上传图片", params); // }
this.file = params.file; // this.schoolName = res.data.school_list;
let raw = params.file; // });
let image = { // },
name: raw.name, // 学校城市change事件
size: raw.size, changeCity(val, status) {
type: raw.type, // console.log(12345333,val,status)
}; this.selectSchoolList = [];
this.getCosConfigs(image, params.file); this.selectSchoolList = this.getCurrentSchoolLists(val);
}, if (!status) {
ChangeImage(fileList) { this.referForm.school = "";
this.hideUpload = fileList.length >= 10; }
}, // let data = this.selectSchoolList.map((item) => {
// cos上传 // return {
async getCosConfigs(image, file) { // name: item.id,
console.log(file) // value: item.name,
this.loading = true; // };
await cosSignature({image: image, index: '1'}) // });
// this.restaurants = data; //中学(模糊搜索)
},
// 返回当前城市下的学校列表
getCurrentSchoolLists(val) {
let currentSchool = [];
let baseSchool = this.$store.state.baseSchool;
if (baseSchool && baseSchool == 1) {
currentSchool.unshift({
id: 0,
name: "其他",
});
}
// console.log(this.schoolName);
if (
this.schoolName == null ||
!this.schoolName ||
Object.values(this.schoolName).length == 0
) {
getSchool({})
.then((res) => { .then((res) => {
console.log(res, "开始上传图片"); // console.log(res)
let resData = res.data.data
if (res.data.code === 200) { if (res.data.code === 200) {
const cos = new COS({ this.schoolName = res.data.school_list;
// 必选参数 // console.log( this.schoolName)
getAuthorization: (options, callback) => { let code = this.$store.state.indexIdentity;
callback({ window.localStorage.setItem(
TmpSecretId: resData.credentials.credential.credentials.tmpSecretId, "schoolName" + code,
TmpSecretKey: resData.credentials.credential.credentials.tmpSecretKey, JSON.stringify(res.data.list)
XCosSecurityToken: resData.credentials.credential.credentials.sessionToken,
StartTime: resData.credentials.credential.startTime, // 时间戳,单位秒,如:1580000000
ExpiredTime: resData.credentials.credential.expiredTime, // 时间戳,单位秒,如:1580000900
});
},
});
console.log(resData)
cos.putObject({
Bucket: resData.credentials.bucket,
Region: resData.credentials.region,
Key: resData.key,
Body: file,
onProgress: (progressData) => {
console.log("上传进度:" + JSON.stringify(progressData));
},
},
(err, data) => {
console.log(data);
if (err) {
console.log(err);
this.loading = false;
this.$message.error('上传失败!')
} else {
console.log(data);
this.signUploadSuccess('http://' + data.Location, resData);
}
}
); );
for (let key in this.schoolName) {
if (this.schoolName[key].city_id == val) {
currentSchool.push(this.schoolName[key]);
}
}
return currentSchool;
} else { } else {
this.$message.error(resData.msg); this.$message.error(res.data.msg);
} }
}) })
.catch((err) => { .catch((err) => {
console.log(err); this.$message.error(err);
// this.getIdCardPic();
}); });
}, } else {
// cos上传-告诉后端上传成功 // console.log(this.schoolName, 111);
async signUploadSuccess(path, resData) { for (let key in this.schoolName) {
await achievementCallBack({key: resData.key, index: 1}).then(res => { // console.log(key, this.schoolName[key]);
if (this.schoolName[key].city_id == val) {
currentSchool.push(this.schoolName[key]);
}
}
// console.log(currentSchool, 222);
return currentSchool;
}
return currentSchool;
},
// 图片上传成功前钩子
beforeAvatarUpload(file) {
// console.log(file, "beforeImage");
const isJPG = file.type === "image/jpg";
const isPng = file.type === "image/png";
const isJPEG = file.type === "image/jpeg";
const isLt10M = file.size / 1024 / 1024 < 10;
// console.log(isLt10M)
if (!isJPG && !isPng && !isJPEG) {
this.$message.info("上传图片只能是 JPG,JPEG或png 格式!");
}
if (!isLt10M) {
this.$message.info("上传图片大小不能超过 10MB!");
}
return (isJPG || isPng || isJPEG) && isLt10M;
},
handlePictureCardPreview(file) {
this.resultPicture = file.url;
this.dialogVisible = true;
},
uploadSuccess(res, file, fileList) {
this.referForm.achievementPath = res;
this.fileList = {
name: file.name,
url: res,
};
this.$refs["imgUrl"].clearFiles(); //上传成功之后清除历史记录
},
uploadPicture(params) {
// console.log("已经准备好上传图片", params);
this.file = params.file;
let raw = params.file;
let image = {
name: raw.name,
size: raw.size,
type: raw.type,
};
this.getCosConfigs(image, params.file);
},
ChangeImage(fileList) {
this.hideUpload = fileList.length >= 10;
},
// cos上传
async getCosConfigs(image, file) {
console.log(file);
this.loading = true;
await cosSignature({ image: image, index: "1" })
.then((res) => {
console.log(res, "开始上传图片");
let resData = res.data.data;
if (res.data.code === 200) {
const cos = new COS({
// 必选参数
getAuthorization: (options, callback) => {
callback({
TmpSecretId:
resData.credentials.credential.credentials.tmpSecretId,
TmpSecretKey:
resData.credentials.credential.credentials.tmpSecretKey,
XCosSecurityToken:
resData.credentials.credential.credentials.sessionToken,
StartTime: resData.credentials.credential.startTime, // 时间戳,单位秒,如:1580000000
ExpiredTime: resData.credentials.credential.expiredTime, // 时间戳,单位秒,如:1580000900
});
},
});
console.log(resData);
cos.putObject(
{
Bucket: resData.credentials.bucket,
Region: resData.credentials.region,
Key: resData.key,
Body: file,
onProgress: (progressData) => {
console.log("上传进度:" + JSON.stringify(progressData));
},
},
(err, data) => {
console.log(data);
if (err) {
console.log(err);
this.loading = false;
this.$message.error("上传失败!");
} else {
console.log(data);
this.signUploadSuccess("http://" + data.Location, resData);
}
}
);
} else {
this.$message.error(resData.msg);
}
})
.catch((err) => {
console.log(err);
// this.getIdCardPic();
});
},
// cos上传-告诉后端上传成功
async signUploadSuccess(path, resData) {
await achievementCallBack({ key: resData.key, index: 1 })
.then((res) => {
if (res.data.code != 200) { if (res.data.code != 200) {
this.loading = false; this.loading = false;
return this.$message.error('上传失败!'); return this.$message.error("上传失败!");
} }
this.loading = false; this.loading = false;
this.$message.success('上传成功!'); this.$message.success("上传成功!");
this.resultPicture = path + "?t=" + Date.parse(new Date()); this.resultPicture = path + "?t=" + Date.parse(new Date());
this.$forceUpdate(); this.$forceUpdate();
let obj = { let obj = {
...@@ -1893,275 +1902,276 @@ ...@@ -1893,275 +1902,276 @@
}; };
this.fileList.push(obj); this.fileList.push(obj);
let code = this.$store.state.indexIdentity; let code = this.$store.state.indexIdentity;
window.localStorage.setItem("sign_up_file_" + window.localStorage.setItem(
+window.localStorage.getItem("index-phone-all") + "sign_up_file_" +
code, +window.localStorage.getItem("index-phone-all") +
code,
JSON.stringify(this.fileList) JSON.stringify(this.fileList)
); );
this.ChangeImage(this.fileList) this.ChangeImage(this.fileList);
}).catch(err => {
this.loading = false;
})
},
// async getOssConfigs(image, file) {
// let obj = {
// url: "",
// savefile: "",
// };
// await getAchievementOss({image: image})
// .then((res) => {
// // console.log(res, "开始上传图片");
// if (res.data.code === 200) {
// let oss_url = res.data.config.host;
// let filename = res.data.config.file;
// let formData = new FormData();
// formData.append("OSSAccessKeyId", res.data.config.accessid);
// formData.append("policy", res.data.config.policy);
// formData.append("signature", res.data.config.signature);
// formData.append("filename", res.data.config.file);
// formData.append("key", res.data.config.savefile);
// formData.append("callback", res.data.config.callback);
// formData.append("success_action_status", 200);
// formData.append("file", file);
// // console.log(formData);
// upload(oss_url, formData)
// .then((ress) => {
// // console.log(ress, "ress");
// if (ress.data.code != 200) {
// return this.$message.error(ress.data.msg);
// }
// this.resultPicture = filename + "?t=" + Date.parse(new Date());
// this.$forceUpdate();
// this.$message.success("上传成功");
// obj = {
// url: ress.data.picture_path,
// savefile: res.data.config.savefile,
// };
// this.fileList.push(obj);
// let code = this.$store.state.indexIdentity;
// window.localStorage.setItem("sign_up_file_" +
// +window.localStorage.getItem("index-phone-all") +
// code,
// JSON.stringify(this.fileList)
// );
// })
// .catch((err) => {
// this.$message.error(err);
// });
// } else {
// this.$message.error(res.data.msg);
// }
// })
// .catch((err) => {
// // console.log(err);
// });
// },
// 下载证明资料图片
handleDownload(file) {
// console.log(file,'file22');
window.location.href = file.url;
},
//删除图片
handleRemove(file) {
this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}) })
.then(() => { .catch((err) => {
let getfile = file.url; this.loading = false;
let str = getfile.split( });
"https://yingdi-achievement-1320656968.cos.ap-beijing.myqcloud.com/" },
); //https://yingdi-achievement-1320656968.cos.ap-beijing.myqcloud.com/进行分割, // async getOssConfigs(image, file) {
let savefile = str[1].split('?')[0]; // let obj = {
delPic({object: savefile}).then((res) => { // url: "",
// console.log(res, "delpic"); // savefile: "",
if (res.data.code != 200) { // };
return this.$message.error(res.data.msg); // await getAchievementOss({image: image})
} // .then((res) => {
this.fileList.forEach((item, idx) => { // // console.log(res, "开始上传图片");
// console.log(item.url == file.url); // if (res.data.code === 200) {
if (item.url == file.url) { // let oss_url = res.data.config.host;
this.fileList.splice(idx, 1); // let filename = res.data.config.file;
let code = this.$store.state.indexIdentity; // let formData = new FormData();
window.localStorage.setItem("sign_up_file_" + // formData.append("OSSAccessKeyId", res.data.config.accessid);
// formData.append("policy", res.data.config.policy);
// formData.append("signature", res.data.config.signature);
// formData.append("filename", res.data.config.file);
// formData.append("key", res.data.config.savefile);
// formData.append("callback", res.data.config.callback);
// formData.append("success_action_status", 200);
// formData.append("file", file);
// // console.log(formData);
// upload(oss_url, formData)
// .then((ress) => {
// // console.log(ress, "ress");
// if (ress.data.code != 200) {
// return this.$message.error(ress.data.msg);
// }
// this.resultPicture = filename + "?t=" + Date.parse(new Date());
// this.$forceUpdate();
// this.$message.success("上传成功");
// obj = {
// url: ress.data.picture_path,
// savefile: res.data.config.savefile,
// };
// this.fileList.push(obj);
// let code = this.$store.state.indexIdentity;
// window.localStorage.setItem("sign_up_file_" +
// +window.localStorage.getItem("index-phone-all") +
// code,
// JSON.stringify(this.fileList)
// );
// })
// .catch((err) => {
// this.$message.error(err);
// });
// } else {
// this.$message.error(res.data.msg);
// }
// })
// .catch((err) => {
// // console.log(err);
// });
// },
// 下载证明资料图片
handleDownload(file) {
// console.log(file,'file22');
window.location.href = file.url;
},
//删除图片
handleRemove(file) {
this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let getfile = file.url;
let str = getfile.split(
"https://yingdi-achievement-1320656968.cos.ap-beijing.myqcloud.com/"
); //https://yingdi-achievement-1320656968.cos.ap-beijing.myqcloud.com/进行分割,
let savefile = str[1].split("?")[0];
delPic({ object: savefile }).then((res) => {
// console.log(res, "delpic");
if (res.data.code != 200) {
return this.$message.error(res.data.msg);
}
this.fileList.forEach((item, idx) => {
// console.log(item.url == file.url);
if (item.url == file.url) {
this.fileList.splice(idx, 1);
let code = this.$store.state.indexIdentity;
window.localStorage.setItem(
"sign_up_file_" +
window.localStorage.getItem("index-phone-all") + window.localStorage.getItem("index-phone-all") +
code, code,
JSON.stringify(this.fileList) JSON.stringify(this.fileList)
); );
} }
});
this.ChangeImage(this.fileList)
this.$message.success(res.data.msg);
});
})
.catch((err) => {
this.$message({
type: "info",
message: "取消删除",
}); });
this.ChangeImage(this.fileList);
this.$message.success(res.data.msg);
}); });
}, })
// 滚动到固定地方 .catch((err) => {
scrollView(object) { this.$message({
for (let i in object) { type: "info",
if (!i) { message: "取消删除",
continue;
}
let dom = this.$refs[i];
// console.log(i, dom);
if (!dom) {
continue;
}
// 这里是针对遍历的情况(多个输入框),取值为数组
if (Object.prototype.toString.call(dom) !== "[object Object]") {
dom = dom[0];
}
// 第一种方法(包含动画效果)
dom.$el.scrollIntoView({
// 滚动到指定节点
// 值有start,center,end,nearest,当前显示在视图区域中间
block: "center",
// 值有auto、instant,smooth,缓动动画(当前是慢速的)
behavior: "smooth",
}); });
break; // 因为我们只需要检测一项,所以就可以跳出循环了 });
},
// 滚动到固定地方
scrollView(object) {
for (let i in object) {
if (!i) {
continue;
}
let dom = this.$refs[i];
// console.log(i, dom);
if (!dom) {
continue;
}
// 这里是针对遍历的情况(多个输入框),取值为数组
if (Object.prototype.toString.call(dom) !== "[object Object]") {
dom = dom[0];
}
// 第一种方法(包含动画效果)
dom.$el.scrollIntoView({
// 滚动到指定节点
// 值有start,center,end,nearest,当前显示在视图区域中间
block: "center",
// 值有auto、instant,smooth,缓动动画(当前是慢速的)
behavior: "smooth",
});
break; // 因为我们只需要检测一项,所以就可以跳出循环了
}
},
confirm() {
this.$refs["referRef"].validate((valid, object) => {
if (!valid) {
this.scrollView(object);
return false;
}
let _this = this;
let obj = {};
if (_this.configJson.name == 1) {
obj.name = _this.referForm.name;
}
if (_this.configJson.gender == 1) {
obj.gender = _this.referForm.gender;
}
if (_this.configJson.idCard == 1) {
obj.id_card = _this.referForm.id_card;
}
if (_this.configJson.age == 1) {
obj.age = _this.referForm.age;
}
if (_this.configJson.education == 1) {
obj.education = _this.referForm.education;
}
if (_this.configJson.postAddress == 1) {
obj.address = _this.referForm.address;
}
if (_this.configJson.country == 1) {
obj.country = _this.referForm.country;
}
if (_this.configJson.nation == 1) {
obj.nation = _this.referForm.nation;
}
if (_this.configJson.startSchoolDate == 1) {
obj.start_school_date = _this.start_year;
}
if (_this.configJson.politicalStatus == 1) {
obj.political_status = _this.referForm.political_status;
}
if (_this.configJson.phone == 1) {
obj.phone = _this.referForm.phone;
}
if (_this.configJson.grade == 1) {
obj.grade = _this.referForm.grade;
}
if (_this.configJson.unitandIdentity == 1) {
obj.unit_and_identity = _this.referForm.unit_and_identity;
}
if (_this.configJson.email == 1) {
obj.email = _this.referForm.email;
}
if (_this.configJson.jiguanCity == 1) {
obj.jiguan_code = _this.referForm.jiguan_code;
}
if (_this.configJson.recommend == 1) {
obj.recommend = _this.referForm.recommend;
}
if (_this.configJson.start_school_date == 1) {
obj.start_school_date = _this.referForm.start_school_date;
} }
},
confirm() {
this.$refs["referRef"].validate((valid, object) => {
if (!valid) {
this.scrollView(object);
return false;
}
let _this = this;
let obj = {};
if (_this.configJson.name == 1) {
obj.name = _this.referForm.name;
}
if (_this.configJson.gender == 1) {
obj.gender = _this.referForm.gender;
}
if (_this.configJson.idCard == 1) {
obj.id_card = _this.referForm.id_card;
}
if (_this.configJson.age == 1) {
obj.age = _this.referForm.age;
}
if (_this.configJson.education == 1) {
obj.education = _this.referForm.education;
}
if (_this.configJson.postAddress == 1) {
obj.address = _this.referForm.address;
}
if (_this.configJson.country == 1) {
obj.country = _this.referForm.country;
}
if (_this.configJson.nation == 1) {
obj.nation = _this.referForm.nation;
}
if (_this.configJson.startSchoolDate == 1) {
obj.start_school_date = _this.start_year;
}
if (_this.configJson.politicalStatus == 1) {
obj.political_status = _this.referForm.political_status;
}
if (_this.configJson.phone == 1) {
obj.phone = _this.referForm.phone;
}
if (_this.configJson.grade == 1) {
obj.grade = _this.referForm.grade;
}
if (_this.configJson.unitandIdentity == 1) {
obj.unit_and_identity = _this.referForm.unit_and_identity;
}
if (_this.configJson.email == 1) {
obj.email = _this.referForm.email;
}
if (_this.configJson.jiguanCity == 1) {
obj.jiguan_code = _this.referForm.jiguan_code;
}
if (_this.configJson.recommend == 1) {
obj.recommend = _this.referForm.recommend;
}
if (_this.configJson.start_school_date == 1) {
obj.start_school_date = _this.referForm.start_school_date;
}
if (_this.configJson.birthday == 1) { if (_this.configJson.birthday == 1) {
obj.birthday = _this.referForm.birthday; obj.birthday = _this.referForm.birthday;
} }
if (_this.configJson.electSubjectSituation == 1) { if (_this.configJson.electSubjectSituation == 1) {
obj.elect_subject_situation = _this.elect_subject_situation; obj.elect_subject_situation = _this.elect_subject_situation;
} }
if (_this.configJson.pastMedicalHistory == 1) { if (_this.configJson.pastMedicalHistory == 1) {
obj.past_medical_history = _this.referForm.past_medical_history; obj.past_medical_history = _this.referForm.past_medical_history;
} }
if (_this.configJson.noteOther == 1) { if (_this.configJson.noteOther == 1) {
obj.note_other = _this.referForm.note_other; obj.note_other = _this.referForm.note_other;
} }
if (_this.configJson.class == 1) { if (_this.configJson.class == 1) {
obj.class = _this.referForm.class; obj.class = _this.referForm.class;
} }
if (_this.configJson.emergency == 1) { if (_this.configJson.emergency == 1) {
obj.emergency = _this.referForm.emergency; obj.emergency = _this.referForm.emergency;
} }
if (_this.configJson.emergencyPhone == 1) { if (_this.configJson.emergencyPhone == 1) {
obj.emergency_phone = _this.referForm.emergency_phone; obj.emergency_phone = _this.referForm.emergency_phone;
} }
//衣服尺码 //衣服尺码
if (_this.configJson.clothesSize == 1) { if (_this.configJson.clothesSize == 1) {
obj.clothes_size = _this.referForm.clothes_size; obj.clothes_size = _this.referForm.clothes_size;
} }
//自我介绍 //自我介绍
if (_this.configJson.introduceMyself == 1) { if (_this.configJson.introduceMyself == 1) {
obj.introduce = _this.referForm.introduce; obj.introduce = _this.referForm.introduce;
} }
if (_this.configJson.school == 1) { if (_this.configJson.school == 1) {
obj.school_province = _this.referForm.school_province; obj.school_province = _this.referForm.school_province;
obj.school_city = _this.referForm.school_city; obj.school_city = _this.referForm.school_city;
obj.school = _this.referForm.school; obj.school = _this.referForm.school;
} }
if (_this.configJson.schoolContacts == 1) { if (_this.configJson.schoolContacts == 1) {
obj.school_contacts = _this.referForm.school_contacts; obj.school_contacts = _this.referForm.school_contacts;
} }
if (_this.configJson.schoolPhone == 1) { if (_this.configJson.schoolPhone == 1) {
obj.school_phone = _this.referForm.school_phone; obj.school_phone = _this.referForm.school_phone;
} }
//是否需要填写邀请码 //是否需要填写邀请码
// if (_this.doubt_code == 1 && _this.code != '') { // if (_this.doubt_code == 1 && _this.code != '') {
if (_this.configJson.code == 1) { if (_this.configJson.code == 1) {
obj.code = _this.referForm.code; obj.code = _this.referForm.code;
} }
console.log(obj) console.log(obj);
setAccount(obj).then((res) => { setAccount(obj).then((res) => {
console.log(res) console.log(res);
if (res.data.code != 200) { if (res.data.code != 200) {
if (res.data.code == 400068) { if (res.data.code == 400068) {
_this.$parent.statuss(); _this.$parent.statuss();
return _this.$message.error(res.data.msg);
}
return _this.$message.error(res.data.msg); return _this.$message.error(res.data.msg);
} }
if (res.data.code == 4000346 || res.data.code == 4000347) { return _this.$message.error(res.data.msg);
_this.dialogVisible = true; }
_this.msg = res.data.msg if (res.data.code == 4000346 || res.data.code == 4000347) {
return; _this.dialogVisible = true;
} _this.msg = res.data.msg;
_this.$emit("getstatus", res.data.status); return;
_this.$message.success(res.data.msg); }
// _this.referForm = res.data.data; _this.$emit("getstatus", res.data.status);
}); _this.$message.success(res.data.msg);
// _this.referForm = res.data.data;
}); });
}, });
}, },
}; },
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "a/scss/btn"; @import "a/scss/btn";
@import "a/scss/SignUp/referInfo"; @import "a/scss/SignUp/referInfo";
</style> </style>
...@@ -22,11 +22,11 @@ ...@@ -22,11 +22,11 @@
// export const SERVER_WS_URL = "wss://tgwapi.campcenter.cn"; // websocket // export const SERVER_WS_URL = "wss://tgwapi.campcenter.cn"; // websocket
// 正式 // 正式
// export const SERVER_URL = "https://gwapi.campcenter.cn/modules-campsite"; // 正式环境 export const SERVER_URL = "https://gwapi.campcenter.cn/modules-campsite"; // 正式环境
// export const DEVELOPMENT_SERVER_URL = "https://gwapi.campcenter.cn/modules-campsite"; //开发环境 export const DEVELOPMENT_SERVER_URL = "https://gwapi.campcenter.cn/modules-campsite"; //开发环境
// export const SERVER_WS_URL = "wss://gwapi.campcenter.cn"; // websocket export const SERVER_WS_URL = "wss://gwapi.campcenter.cn"; // websocket
// 测试 // 测试
export const SERVER_URL = "http:// 8088/modules-campsite"; // 正式环境 // export const SERVER_URL = "http:// 8088/modules-campsite"; // 正式环境
export const DEVELOPMENT_SERVER_URL = "http://43.143.166.79:8088/modules-campsite"; //开发环境 // export const DEVELOPMENT_SERVER_URL = "http://43.143.166.79:8088/modules-campsite"; //开发环境
export const SERVER_WS_URL = "wss://43.143.166.79:8088"; // websocket // export const SERVER_WS_URL = "wss://43.143.166.79:8088"; // websocket
...@@ -350,7 +350,7 @@ ...@@ -350,7 +350,7 @@
.title_top { .title_top {
display: flex; display: flex;
justify-content: end; justify-content: flex-end;
} }
.normal { .normal {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment