From b8e7812e9cd4903a8ef18f5dd5c15fab096285eb Mon Sep 17 00:00:00 2001 From: lmj <3407000732@qq.com> Date: Wed, 14 Dec 2022 22:52:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/modules/teacher.js | 9 +++- .../Portal/course/couresinteract.vue | 2 +- src/icons/svg/Scoreicon.svg | 1 + src/views/user/Setting.vue | 43 +++++++++++++++---- 4 files changed, 44 insertions(+), 11 deletions(-) create mode 100644 src/icons/svg/Scoreicon.svg diff --git a/src/api/modules/teacher.js b/src/api/modules/teacher.js index 376f4785..7939917d 100644 --- a/src/api/modules/teacher.js +++ b/src/api/modules/teacher.js @@ -9,6 +9,11 @@ const findByName = function(name) { return ajax.get('/xboe/teacher/name?name=' + name); } + +const updateTeacher=function(data){ + return ajax.postJson('/xboe/teacher/update-teacher',data); +} + /** * 根据id得到教师的显示信息,只是几个基本的显示字段 * @param {Object} id @@ -21,6 +26,7 @@ const detailTeacher=function (id){ return ajax.get('/xboe/teacher/detail-teacher?id='+id); } + /** * 分页查询 * @param { @@ -218,5 +224,6 @@ export default { end, exports, syncUpdate, - detailTeacher + detailTeacher, + updateTeacher } diff --git a/src/components/Portal/course/couresinteract.vue b/src/components/Portal/course/couresinteract.vue index a3dda2f1..35e908b3 100644 --- a/src/components/Portal/course/couresinteract.vue +++ b/src/components/Portal/course/couresinteract.vue @@ -2,7 +2,7 @@
- + {{ data.score }}
diff --git a/src/icons/svg/Scoreicon.svg b/src/icons/svg/Scoreicon.svg new file mode 100644 index 00000000..7d51740d --- /dev/null +++ b/src/icons/svg/Scoreicon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/views/user/Setting.vue b/src/views/user/Setting.vue index 855827ad..7f865156 100644 --- a/src/views/user/Setting.vue +++ b/src/views/user/Setting.vue @@ -32,13 +32,13 @@

擅长课程

-
+
{{ teachtext.courses }}

专长

-
+
{{ teachtext.expertise }}
@@ -91,10 +91,10 @@
-->
-
+
{{sys.name}}
- + {{ch.name}}
@@ -106,7 +106,7 @@
取消 - 保存 + 保存
@@ -297,6 +297,7 @@ } }; return { + sysTypeListtear:[], teaechswich:false, props: { multiple: true }, options: [{ @@ -357,11 +358,13 @@ hideHome:false,// 是否隐藏个人主页 cities: cityOptions, checkboxGroup: [], + checkboxtearGroup: [], radio: '1', form:{ account:{} }, teachform:{ + id:'', photo:'', courses:'',//擅长课程 workExperience:'', //工作经历 @@ -415,10 +418,14 @@ } }, + Edittearch(){ + this.gettearch(); + }, // 监听"编辑按钮"事件变化 interestIsEdit(){ this.load(); this.getInfo(); + } @@ -430,18 +437,20 @@ this.hideHome = !this.userInfo.showHome; this.load(); this.getInfo(); + this.gettearch(); this.getSysTypeTree().then(rs => { this.sysTypeListMap = rs; + // console.log(rs); + this.sysTypeListtear = rs; }); this.Teacherprofile(); this.Teacherinfo(); }, methods:{ - teacherUpdata(){ - apiTeach.update(this.teachform).then(res =>{ - console.log('编辑成功') - }) + gettearch(){ + // console.log(this.checkboxtearGroup,'lmj'); }, + Teacherinfo(){ apiTeach.detailTeacher(this.userInfo.aid).then(res =>{ this.teachtext = res.result; @@ -525,6 +534,21 @@ return this.sysTypeMap.get(code); }, + teacherUpdata(){ + if(this.checkboxtearGroup.length <3 && this.checkboxtearGroup.length>=1) { + this.$message.error('至少选择三个专长!') + return; + } + console.log(this.checkboxtearGroup); + this.teachform.expertise = this.checkboxtearGroup.toString(); + console.log(this.teachform.expertise); + this.teachform.id = this.userInfo.aid; + apiTeach.updateTeacher(this.teachform).then(res =>{ + console.log('编辑成功') + }) + this.Edittearch = true + }, + // 更新用户与偏好数据 saveHobby(){ let data = [] @@ -677,6 +701,7 @@ height: 40px; width: 100%; h4{ + cursor: pointer; float: left; font-weight: 400; margin: 0;