diff --git a/src/api/optimize.js b/src/api/optimize.js index 2805ace..e384b03 100644 --- a/src/api/optimize.js +++ b/src/api/optimize.js @@ -3,7 +3,9 @@ import request from '@/config/request_java'; export const APIOptimize = { getExpertList, // 获取专家列表 getTalkList, // 获取养育话题列表 - addTalkLabels // 新增养育话题标签 + addTalkLabels, // 新增养育话题标签 + getCampList, // 获取训练营列表 + getCampRecommendList // 获取训练营推荐列表 }; export default APIOptimize; @@ -32,4 +34,21 @@ function addTalkLabels(params) { method: 'post', data: params }); - } \ No newline at end of file + } + +// 获取训练营列表 +function getCampList(id) { + return request({ + url: `/java_api/optimize/getCampList`, + method: 'get', + params: { id } + }); +} + +// 获取训练营推荐列表 +function getCampRecommendList() { + return request({ + url: `/java_api/optimize/getCampRecommendList`, + method: 'get' + }); +} \ No newline at end of file diff --git a/src/views/optimize/index.vue b/src/views/optimize/index.vue index d7e00e8..8203d42 100644 --- a/src/views/optimize/index.vue +++ b/src/views/optimize/index.vue @@ -35,24 +35,13 @@
-

黛建松

- 清华大学心理学教授 +

{{psychologyInfo.name}}

+ {{psychologyInfo.title}}
-

700人次咨询从业8年

+ +

{{psychologyInfo.seek}}

- 郴州市苏仙区 + {{psychologyInfo.address}}
-

¥2480

+

¥{{psychologyInfo.price}}

@@ -144,7 +107,9 @@ export default { data() { return { expertList: [], - talkList: [] + talkList: [], + campList: [], + psychologyInfo: {} }; }, created() { @@ -157,6 +122,8 @@ export default { APIOptimize.getExpertList(0) .then(res => { this.expertList = res.data.data + this.psychologyInfo = this.expertList[0] + this.psychologyInfo.labels = this.psychologyInfo.labels.split('|'); }) .catch(e => { console.log(e); @@ -169,6 +136,14 @@ export default { .catch(e => { console.log(e); }) + // 训练营列表 + APIOptimize.getCampList(0) + .then(res => { + this.campList = res.data.data + }) + .catch(e => { + console.log(e); + }) }, goExperts(id) { this.$router.push({ @@ -193,6 +168,12 @@ export default { id: id } }); + }, + switchPsychology(id) { + this.psychologyInfo = this.expertList.find(item => item.id == id); + if ( typeof this.psychologyInfo.labels == 'string' ) { + this.psychologyInfo.labels = this.psychologyInfo.labels.split('|'); + } } } }; diff --git a/src/views/optimize/scss/trainingcamp.scss b/src/views/optimize/scss/trainingcamp.scss index 7ac32b9..dda97de 100644 --- a/src/views/optimize/scss/trainingcamp.scss +++ b/src/views/optimize/scss/trainingcamp.scss @@ -144,6 +144,7 @@ display: block; font-size: 28px; color: grey; + margin-top: 10px; } } } diff --git a/src/views/optimize/trainingcamp.vue b/src/views/optimize/trainingcamp.vue index 0669647..13943b4 100644 --- a/src/views/optimize/trainingcamp.vue +++ b/src/views/optimize/trainingcamp.vue @@ -20,99 +20,37 @@