Commit 6c23e0a9 authored by wuwangwolihui's avatar wuwangwolihui

功能修改-lh

parent 29bfc22d
......@@ -19,7 +19,48 @@
</div>
</div>
<div class="pay_bottom">
<div class="pay_bottom" v-if="$store.state.indexIdentity == '6c6884d1c83040ee8ca17736a8d67b93'">
<div>注意事项:</div>
<div>
请参照清华大学人文学院“中国现当代文学经典研读”学分课程简章中缴费方式。
<span class="cc">汇款或扫码支付后请务必保留付款截图</span>
</div>
<div>
1、银行转账汇款时,请在附言/用途栏中注明 "21069363022 +学员姓名"。
</div>
<div>
2、扫码支付时,请在备注栏中注明“学员姓名”。
</div>
<div>
3、未满18岁的学员,缴费请由家长支付。
</div>
</div>
<div class="pay_bottom" v-else-if="$store.state.indexIdentity == '479205eb2dbf48fcbbeaee710a9b9d24'">
<div>注意事项:</div>
<div>
1、支付成功后请务必保留付款截图。
</div>
<div>
2、银行转账汇款时,请在附言/用途栏中注明“22069363005+学员姓名”。
</div>
<div>
3、未满18岁的学员,缴费请由家长支付。
</div>
<div style="margin-top: 10px;">汇款信息:</div>
<div>
收款单位:清华大学
</div>
<div>
帐号:0200004509089131550
</div>
<div>
开户行:工行北京分行海淀西区支行
</div>
<div>
附言/用途:请在附言栏中注明“22069363005+学员姓名”
</div>
</div>
<div class="pay_bottom" v-else>
<div>注意事项:</div>
<div>
1、学生支付完成后请不要立即关闭浏览器,等待支付完成返回本页面,以确认支付完成。
......
......@@ -361,7 +361,7 @@
</div>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="resultPicture" alt="" />
<img width="100%" :src="resultPicture" alt=""/>
</el-dialog>
</div>
</el-form-item>
......@@ -374,706 +374,700 @@
</template>
<script>
/* eslint-disable */
import Cookie from "js-cookie";
import {
getAccount,
getAchievementOss,
delPic,
setAccount,
getProAndCity,
getSchool,
} from "r/index/signUp";
import { upload } from "r/index/network";
import validator from "common/validator";
/* eslint-disable */
import Cookie from "js-cookie";
import {
getAccount,
getAchievementOss,
delPic,
setAccount,
getProAndCity,
getSchool,
} from "r/index/signUp";
import {upload} from "r/index/network";
import validator from "common/validator";
export default {
name: "CheckForm",
export default {
name: "CheckForm",
data() {
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();
}
};
return {
isUploading: false, // 图片上传蒙层
referForm: {
name: null,
gender: null,
id_card: null,
birthday: null,
jiguan_code: null,
nation: null,
start_school_date: null,
political_status: null,
phone: null,
email: null,
school_province: null,
school_city: null,
school: null,
school_contacts: null,
school_phone: null,
},
data() {
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();
}
};
return {
isUploading: false, // 图片上传蒙层
referForm: {
name: null,
gender: null,
id_card: null,
birthday: null,
jiguan_code: null,
nation: null,
start_school_date: null,
political_status: null,
phone: null,
email: null,
school_province: null,
school_city: null,
school: null,
school_contacts: null,
school_phone: null,
},
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" },
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"},
],
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" },
// ],
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: "请上传图片" }],
},
selectProvince: [], //省份
CityName: {}, //根据省份筛选出所有城市的对象
selectCityJiguan: [], //籍贯城市列表
selectCitySchool: [], //就读中学-城市列表
selectSchoolList: [], //就读中学-中学列表
jgProvinceCode: "", //省份id
jiguan_city: "", //城市id(和省份id拼接)
yearArrs: [], //生日涉及的近10年的年份
monthArrs: [
"01",
"02",
"03",
"04",
"05",
"06",
"07",
"08",
"09",
"10",
"11",
"12",
],
nation: [
{ required: true, message: "民族不能为空!", trigger: "change" },
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",
],
start_school_date: [
{
required: true,
message: "入学年份不能为空!",
trigger: "change",
},
bdYear: "", //选择的生日年份
bdMonth: "", //选择的生日月份
bdDay: "", //选择的生日日期
//入学年份(初中高中)
gradeArrs: [
// "初一",
// "初二",
// "初三",
// "高一",
// "高二",
// "高三",
// "大一",
// "大二",
// "大三",
// "大四",
"初中",
"高中",
"大学",
],
//选择年级
start_grade: "",
start_year: "",
// 政治面貌
political_status: [
{ required: true, message: "政治面貌不能为空!", trigger: "blur" },
],
// email: [
// { required: true, message: "电子邮箱不能为空!", trigger: "blur" },
// { validator: validator.validateEmail, trigger: "blur" },
// ],
school_province: [
{
required: true,
message: "请选择所在学校省份!",
trigger: "change",
id: 1,
name: "党员",
},
],
school_city: [
{
required: true,
message: "请选择所在学校城市!",
trigger: "change",
id: 2,
name: "团员",
},
],
school: [
{ required: true, message: "请选择所在学校!", trigger: "change" },
],
school_contacts: [
{ required: true, message: "请填写中学联系人!", trigger: "blur" },
],
school_phone: [
{
required: true,
message: "中学联系人电话(手机)不能为空!",
trigger: "blur",
id: 3,
name: "群众",
},
{ validator: validator.validatePhone, trigger: "blur" },
],
// backgroundPicture: [{ required: true, message: "请上传图片" }],
},
selectProvince: [], //省份
CityName: {}, //根据省份筛选出所有城市的对象
selectCityJiguan: [], //籍贯城市列表
selectCitySchool: [], //就读中学-城市列表
selectSchoolList: [], //就读中学-中学列表
jgProvinceCode: "", //省份id
jiguan_city: "", //城市id(和省份id拼接)
yearArrs: [], //生日涉及的近10年的年份
monthArrs: [
"01",
"02",
"03",
"04",
"05",
"06",
"07",
"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: "群众",
},
],
// 上传的图片
dialogImageUrl: "",
dialogVisible: false,
fileList: [],
resultPicture: "",
dialogVisible: false,
disabled: false, //限制输入框
};
},
mounted() {},
created() {
const code = this.$store.state.indexIdentity;
this.referForm.phone = window.localStorage.getItem("phone" + code); //本地取用户手机号
this.referForm.email = window.localStorage.getItem("email" + code); //本地取用户邮箱
console.log(this.referForm.email, " this.referForm.email");
let signUpFile = window.localStorage.getItem(
"sign_up_file_" + window.localStorage.getItem("phone" + code) + code
);
// console.log(signUpFile);
if (signUpFile && JSON.parse(signUpFile).length > 0) {
this.fileList = JSON.parse(signUpFile);
}
this.getSchool();
this.getProAndCity();
this.getTenYear();
this.getAccount(); // 页面信息个人获取
},
watch: {
referForm(val) {
// console.log(val, "val");
for (var k in val) {
if (val[k] == null || !val[k]) {
val[k] = this.referForm[k];
}
}
this.selfInfo = val;
if (val.gender && val.gender !== "") {
// console.log(val.gender)
this.referForm.gender = val.gender;
}
//出生日期
if (val.birthday && val.birthday !== "") {
this.bdYear = val.birthday.slice(0, 4); //前4位取年
this.bdMonth = val.birthday.slice(4, 6); //中2位取月
this.bdDay = val.birthday.slice(6, 8); //后2位取日
}
//入学年份
if (val.start_school_date && val.start_school_date !== "") {
this.start_year = val.start_school_date.slice(0, 4); //年份
this.start_grade = val.start_school_date.slice(5, 8); //年级
}
//籍贯
if (val.jiguan_city !== null && val.jiguan_province !== null) {
if (this.referForm.jiguan_city) {
}
this.jgProvinceCode = Number(val.jiguan_province);
this.changeProvince(1, this.jgProvinceCode, true);
this.jiguan_city = Number(val.jiguan_city);
}
// console.log(val.school_province, val.school_city, val.school);
//学校
if (
val.school_province !== null &&
val.school_city !== null &&
val.school !== null
) {
this.referForm.school_province = Number(val.school_province);
this.referForm.school_city = Number(val.school_city);
this.referForm.school = Number(val.school);
// console.log(
// this.referForm.school_province,
// this.referForm.school_city,
// this.referForm.school
// );
this.changeProvince(2, this.referForm.school_province, true);
// console.log(this.referForm.school_city, 12322);
this.changeCity(this.referForm.school_city, true);
}
// 上传的图片
dialogImageUrl: "",
dialogVisible: false,
fileList: [],
resultPicture: "",
disabled: false, //限制输入框
};
},
},
methods: {
//获取近10年的年份
getTenYear() {
let nowDate = new Date();
let currentYear = nowDate.getFullYear();
// console.log(nowDate, currentYear);
let yearArr = [];
let rxYearArr = [];
for (let i = 0; i < 42; i++) {
let year = currentYear - i;
yearArr.push(year);
}
// console.log(yearArr, "yearArr");
for (let i = 0; i < 10; i++) {
let year = currentYear - i;
rxYearArr.push(year);
mounted() {
},
created() {
const code = this.$store.state.indexIdentity;
this.referForm.phone = window.localStorage.getItem("phone" + code); //本地取用户手机号
this.referForm.email = window.localStorage.getItem("email" + code); //本地取用户邮箱
console.log(this.referForm.email, " this.referForm.email");
let signUpFile = window.localStorage.getItem(
"sign_up_file_" + window.localStorage.getItem("phone" + code) + code
);
// console.log(signUpFile);
if (signUpFile && JSON.parse(signUpFile).length > 0) {
this.fileList = JSON.parse(signUpFile);
}
this.yearArrs = yearArr;
this.rxYearArrs = rxYearArr;
this.getSchool();
this.getProAndCity();
this.getTenYear();
this.getAccount(); // 页面信息个人获取
},
// 页面信息个人获取
getAccount() {
getAccount({}).then((res) => {
// console.log(res, "getAccount");
if (res.data.code != 200) {
return this.$message.error(res.data.message);
watch: {
referForm(val) {
// console.log(val, "val");
for (var k in val) {
if (val[k] == null || !val[k]) {
val[k] = this.referForm[k];
}
}
this.referForm = res.data.info;
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();
this.selfInfo = val;
if (val.gender && val.gender !== "") {
// console.log(val.gender)
this.referForm.gender = val.gender;
}
if (res.data.info.email == null) {
const code = this.$store.state.indexIdentity;
this.referForm.email = window.localStorage.getItem("email" + code); //本地取用户邮箱
//出生日期
if (val.birthday && val.birthday !== "") {
this.bdYear = val.birthday.slice(0, 4); //前4位取年
this.bdMonth = val.birthday.slice(4, 6); //中2位取月
this.bdDay = val.birthday.slice(6, 8); //后2位取日
}
});
},
//组装出生日期
getTime() {
this.referForm.birthday =
this.bdYear.toString() +
this.bdMonth.toString() +
this.bdDay.toString();
// console.log(this.referForm.birthday);
},
//组装入学年份
getyear() {
this.referForm.start_school_date =
this.start_year.toString() + "-" + this.start_grade.toString();
},
// 获取省份城市
getProAndCity() {
getProAndCity({}).then((res) => {
// console.log(res, "getProAndCity");
if (res.data.code != 200) {
return this.$message.error(res.data.message);
//入学年份
if (val.start_school_date && val.start_school_date !== "") {
this.start_year = val.start_school_date.slice(0, 4); //年份
this.start_grade = val.start_school_date.slice(5, 8); //年级
}
this.selectProvince = res.data.province_list;
// this.CityName = res.data.city_list;
// console.log(this.selectProvince, this.CityName);
});
},
//选择籍贯省份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 = "";
//籍贯
if (val.jiguan_city !== null && val.jiguan_province !== null) {
if (this.referForm.jiguan_city) {
}
this.jgProvinceCode = Number(val.jiguan_province);
this.changeProvince(1, this.jgProvinceCode, true);
this.jiguan_city = Number(val.jiguan_city);
}
} else {
this.selectCitySchool = [];
this.selectCitySchool = this.getCurrentCityLists(val); //在此调用城市筛选列表
if (!status) {
this.referForm.school_city = "";
this.referForm.school = "";
this.selectSchoolList = []; //重新选择省份时候,学校list清空
// console.log(val.school_province, val.school_city, val.school);
//学校
if (
val.school_province !== null &&
val.school_city !== null &&
val.school !== null
) {
this.referForm.school_province = Number(val.school_province);
this.referForm.school_city = Number(val.school_city);
this.referForm.school = Number(val.school);
// console.log(
// this.referForm.school_province,
// this.referForm.school_city,
// this.referForm.school
// );
this.changeProvince(2, this.referForm.school_province, true);
// console.log(this.referForm.school_city, 12322);
this.changeCity(this.referForm.school_city, true);
}
}
},
},
methods: {
//获取近10年的年份
getTenYear() {
let nowDate = new Date();
let currentYear = nowDate.getFullYear();
// console.log(nowDate, currentYear);
let yearArr = [];
let rxYearArr = [];
for (let i = 0; i < 42; i++) {
let year = currentYear - i;
yearArr.push(year);
}
// console.log(yearArr, "yearArr");
for (let i = 0; i < 10; i++) {
let year = currentYear - i;
rxYearArr.push(year);
}
this.yearArrs = yearArr;
this.rxYearArrs = rxYearArr;
},
// 页面信息个人获取
getAccount() {
getAccount({}).then((res) => {
// console.log(res, "getAccount");
if (res.data.code != 200) {
return this.$message.error(res.data.message);
}
this.referForm = res.data.info;
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) {
const code = this.$store.state.indexIdentity;
this.referForm.email = window.localStorage.getItem("email" + code); //本地取用户邮箱
}
});
},
//组装出生日期
getTime() {
this.referForm.birthday =
this.bdYear.toString() +
this.bdMonth.toString() +
this.bdDay.toString();
// console.log(this.referForm.birthday);
},
//组装入学年份
getyear() {
this.referForm.start_school_date =
this.start_year.toString() + "-" + this.start_grade.toString();
},
// 获取省份城市
getProAndCity() {
getProAndCity({}).then((res) => {
// console.log(res, "getProAndCity");
if (res.data.code != 200) {
return this.$message.error(res.data.message);
}
this.selectProvince = res.data.province_list;
// this.CityName = res.data.city_list;
// console.log(this.selectProvince, this.CityName);
});
},
//返回当前省份下的城市列表
getCurrentCityLists(val) {
let currentCity = [];
if (
this.CityName == null ||
!this.CityName ||
Object.values(this.CityName).length == 0
) {
getProAndCity({})
.then((res) => {
// console.log(res, "getProAndCity");
if (res.data.code === 200) {
// this.selectProvince = res.data.province_list;
this.CityName = res.data.city_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清空
}
}
},
//返回当前省份下的城市列表
getCurrentCityLists(val) {
let currentCity = [];
if (
this.CityName == null ||
!this.CityName ||
Object.values(this.CityName).length == 0
) {
getProAndCity({})
.then((res) => {
// console.log(res, "getProAndCity");
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]);
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.message);
}
return currentCity;
} else {
this.$message.error(res.data.message);
})
.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]);
}
})
.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;
}
return currentCity;
},
// 籍贯城市change事件
getJiguan() {
this.referForm.jiguan_code =
this.jgProvinceCode.toString() + this.jiguan_city.toString();
},
getSchool() {
getSchool({}).then((res) => {
// console.log(res, "getSchool");
if (res.data.code != 200) {
return this.$message.error(res.data.message);
},
// 籍贯城市change事件
getJiguan() {
this.referForm.jiguan_code =
this.jgProvinceCode.toString() + this.jiguan_city.toString();
},
getSchool() {
getSchool({}).then((res) => {
// console.log(res, "getSchool");
if (res.data.code != 200) {
return this.$message.error(res.data.message);
}
this.schoolName = res.data.school_list;
});
},
// 学校城市change事件
changeCity(val, status) {
// console.log(12345333,val,status)
this.selectSchoolList = [];
this.selectSchoolList = this.getCurrentSchoolLists(val);
if (!status) {
this.referForm.school = "";
}
this.schoolName = res.data.school_list;
});
},
// 学校城市change事件
changeCity(val, status) {
// console.log(12345333,val,status)
this.selectSchoolList = [];
this.selectSchoolList = this.getCurrentSchoolLists(val);
if (!status) {
this.referForm.school = "";
}
},
// 返回当前城市下的学校列表
getCurrentSchoolLists(val) {
let currentSchool = [];
// console.log(this.schoolName);
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;
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]);
},
// 返回当前城市下的学校列表
getCurrentSchoolLists(val) {
let currentSchool = [];
// console.log(this.schoolName);
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;
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.message);
}
return currentSchool;
} else {
this.$message.error(res.data.message);
})
.catch((err) => {
this.$message.error(err);
});
} 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 {
// 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]);
}
// console.log(currentSchool, 222);
return currentSchool;
}
// 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;
},
// 图片上传成功前钩子
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) {
console.log(file, "11111111");
this.resultPicture = file.url;
this.dialogVisible = true;
},
// 文件上传中处理
handleUploadProgress(event, file, fileList) {
// console.log(fileList);
this.isUploading = true;
if (this.fileList.lenge < 10) {
return this.$message.info("chaochushuliamng");
}
},
uploadSuccess(res, file, fileList) {
// console.log(res, "res");
// console.log(file, "file");
// console.log(fileList, "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.getOssConfigs(image, params.file);
},
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) {
console.log(ress, "ress");
return this.$message.error(ress.data.message);
}
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_" +
handlePictureCardPreview(file) {
console.log(file, "11111111");
this.resultPicture = file.url;
this.dialogVisible = true;
},
// 文件上传中处理
handleUploadProgress(event, file, fileList) {
// console.log(fileList);
this.isUploading = true;
if (this.fileList.lenge < 10) {
return this.$message.info("chaochushuliamng");
}
},
uploadSuccess(res, file, fileList) {
// console.log(res, "res");
// console.log(file, "file");
// console.log(fileList, "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.getOssConfigs(image, params.file);
},
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) {
console.log(ress, "ress");
return this.$message.error(ress.data.message);
}
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("phone" + code) +
code,
JSON.stringify(this.fileList)
);
})
.catch((err) => {
this.$message.error(err);
});
} else {
this.$message.error(res.data.message);
}
})
.catch((err) => {
// console.log(err);
});
},
// 下载证明资料图片
handleDownload(file) {
// console.log(file,'file22');
window.location.href = file.url;
},
//删除图片
handleRemove(file) {
// console.log(file, "file");
this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let getfile = file.url;
// console.log(savefile.match(/^(?:[^\/]|\/\/)*/),'222222');//获取域名
let str = getfile.split(
"https://yingdi-achievement.oss-cn-beijing.aliyuncs.com/"
); //https://yingdi-achievement.oss-cn-beijing.aliyuncs.com/进行分割,
// console.log(str, "str");
let savefile = str[1];
// console.log(savefile, "savefile");
delPic({ object: savefile }).then((res) => {
// console.log(res, "delpic");
if (res.data.code != 200) {
return this.$message.error(res.data.message);
JSON.stringify(this.fileList)
);
})
.catch((err) => {
this.$message.error(err);
});
} else {
this.$message.error(res.data.message);
}
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_" +
})
.catch((err) => {
// console.log(err);
});
},
// 下载证明资料图片
handleDownload(file) {
// console.log(file,'file22');
window.location.href = file.url;
},
//删除图片
handleRemove(file) {
// console.log(file, "file");
this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let getfile = file.url;
// console.log(savefile.match(/^(?:[^\/]|\/\/)*/),'222222');//获取域名
let str = getfile.split(
"https://yingdi-achievement.oss-cn-beijing.aliyuncs.com/"
); //https://yingdi-achievement.oss-cn-beijing.aliyuncs.com/进行分割,
// console.log(str, "str");
let savefile = str[1];
// console.log(savefile, "savefile");
delPic({object: savefile}).then((res) => {
// console.log(res, "delpic");
if (res.data.code != 200) {
return this.$message.error(res.data.message);
}
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("phone" + code) +
code,
JSON.stringify(this.fileList)
);
}
JSON.stringify(this.fileList)
);
}
});
// console.log(this.fileList);
this.$message.success(res.data.message);
});
})
.catch((err) => {
this.$message({
type: "info",
message: "取消删除",
});
// console.log(this.fileList);
this.$message.success(res.data.message);
});
})
.catch((err) => {
this.$message({
type: "info",
message: "取消删除",
},
// 滚动到固定地方
scrollView(object) {
// console.log(object, "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",
});
});
},
// 滚动到固定地方
scrollView(object) {
// console.log(object, "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() {
// console.log(111);
// console.log(this.referForm.birthday);
this.$refs["referRef"].validate((valid, object) => {
// console.log(valid, "valid");
if (!valid) {
this.scrollView(object);
return false;
break; // 因为我们只需要检测一项,所以就可以跳出循环了
}
setAccount(this.referForm).then((res) => {
// console.log(res, "setAccount");
if (res.data.code != 200) {
if (res.data.code == 400068) {
this.$parent.statuss();
},
confirm() {
this.$refs["referRef"].validate((valid, object) => {
if (!valid) {
this.scrollView(object);
return false;
}
setAccount(this.referForm).then((res) => {
if (res.data.code != 200) {
if (res.data.code == 400068) {
this.$parent.statuss();
return this.$message.error(res.data.message);
}
return this.$message.error(res.data.message);
}
return this.$message.error(res.data.message);
}
// console.log(3333);
this.$emit("getstatus", res.data.status);
this.$message.success(res.data.message);
// let code = this.$store.state.indexIdentity;
// this.$router.push("/signUp/check?code=" + code);
this.referForm = res.data.data;
this.$emit("getstatus", res.data.status);
this.$message.success(res.data.message);
this.referForm = res.data.data;
});
});
});
},
},
},
};
};
</script>
<style scoped lang="scss">
@import "a/scss/btn";
@import "a/scss/SignUp/referInfo";
@import "a/scss/btn";
@import "a/scss/SignUp/referInfo";
</style>
......@@ -7,10 +7,10 @@
// export const SERVER_WS_URL = "wss://123.56.237.167:20202"; // websocket
// 正式
export const SERVER_URL = 'https://api1.testgate.cn' // 正式环境
export const DEVELOPMENT_SERVER_URL = 'https://api1.testgate.cn' // 开发环境
export const SERVER_WS_URL = 'wss://api1.testgate.cn' // websocket
// export const SERVER_URL = 'https://api1.testgate.cn' // 正式环境
// export const DEVELOPMENT_SERVER_URL = 'https://api1.testgate.cn' // 开发环境
// export const SERVER_WS_URL = 'wss://api1.testgate.cn' // websocket
// 线上测试
// export const SERVER_URL = "http://api.campcenter.cn/"; // 正式环境
// export const DEVELOPMENT_SERVER_URL = "http://api.campcenter.cn/"; //开发环境
// export const SERVER_WS_URL = "ws://api.campcenter.cn"; // websocket
export const SERVER_URL = "http://api.campcenter.cn/"; // 正式环境
export const DEVELOPMENT_SERVER_URL = "http://api.campcenter.cn/"; //开发环境
export const SERVER_WS_URL = "ws://api.campcenter.cn"; // websocket
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