咨询师端接口调用

master
Lee-1203 2022-03-05 19:23:25 +08:00
parent 990d9f7536
commit 4c74ce1119
5 changed files with 343 additions and 124 deletions

View File

@ -2106,6 +2106,11 @@ textarea::-webkit-input-placeholder{
width: 4rem;
height: 3rem;
border: .02rem dashed #dedede;
overflow: hidden;
}
.cover-img img{
width: 4rem;
min-height: 3rem;
}
.cover-btn{
width: 1.5rem;
@ -2117,6 +2122,19 @@ textarea::-webkit-input-placeholder{
color: #FFFFFF;
text-align: center;
margin-left: .5rem;
position: relative;
}
.cover-btn>input{
display: block;
width: 1.5rem;
height: .6rem;
opacity: 0;
border-radius: .1rem;
position: absolute;
left: 0;
top: 0;
z-index: 1;
}
.case-msg{
padding: .2rem .25rem;
@ -2190,6 +2208,11 @@ textarea::-webkit-input-placeholder{
width: 4rem;
height: 4.25rem;
border: .02rem dashed #dedede;
overflow: hidden;
}
.personal-photo img{
width: 4rem;
min-height: 4.25rem;
}
.personal-photo>span{
display: block;
@ -2208,6 +2231,18 @@ textarea::-webkit-input-placeholder{
border-radius: .1rem;
text-align: center;
color: #FFFFFF;
position: relative;
}
.edit-btn input{
display: block;
width: 1.5rem;
height: .6rem;
border-radius: .1rem;
opacity: 0;
position: absolute;
left: 0;
top: 0;
z-index: 1;
}
.personal-item .left{
display: flex;

View File

@ -1,100 +1,213 @@
<template>
<div class="content my-content">
<div class="content my-content">
<!-- 头部 -->
<div :class="{'header':true,'scroll white':isScrollTop,'white':true}">
<div class="back" @click="$router.go(-1)"><img src="../../assets/images/home/expert/back.png" alt=""></div>
<div class="header-title">我的案例</div>
<div class="header-title">{{title}}</div>
</div>
<div class="case pull-content">
<div class="case-cover">
<p>封面图</p>
<div class="cover-img">
<img v-if="myAvatar" :src="host + myAvatar">
<img v-else-if="headImg" :src="host + headImg">
</div>
<div class="cover-btn">上传</div>
<button class="cover-btn" @change="imgIny($event)">
<input class="inputB" @change="imgIny($event)" type="file" />
上传
</button>
</div>
<ul class="case-msg">
<li>
<p>标题</p>
<input type="text" v-model="gName" placeholder="请输入标题"/>
<input type="text" v-model="caseTitle" placeholder="请输入标题" />
</li>
<li>
<p>学生姓名</p>
<input type="text" v-model="gPhone" placeholder="请输入学生姓名"/>
<input type="text" v-model="student_name" placeholder="请输入学生姓名" />
</li>
<li>
<p>是否主案例</p>
<div class="course-list key-list">
<span :class="{'checked':index==checkedIndex}" v-for="(item,index) in caseData" :key="index" @click="changeCase(index)">{{item.title}}</span>
<span :class="{'checked':isIndex==1}" @click="isIndex=1"></span>
<span :class="{'checked':isIndex!==1}" @click="isIndex=0"></span>
</div>
</li>
<li>
<p>录取结果</p>
<textarea placeholder="请输入录取结果"></textarea>
<textarea v-model="result_remarks" placeholder="请输入录取结果"></textarea>
</li>
<li>
<p>专业定位</p>
<textarea placeholder="请输入专业定位"></textarea>
<textarea v-model="location_remarks" placeholder="请输入专业定位"></textarea>
</li>
<li>
<p>其他说明</p>
<textarea placeholder="请输入其他说明"></textarea>
<textarea v-model="other_remarks" placeholder="请输入其他说明"></textarea>
</li>
<li>
<p>客户反馈</p>
<textarea placeholder="请输入客户反馈"></textarea>
<textarea v-model="account_remarks" placeholder="请输入客户反馈"></textarea>
</li>
</ul>
<div class="case-btn"></div>
<div class="case-btn" @click="addCase()"></div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "case",
data(){
return {
export default {
name: "case",
data() {
return {
isScrollTop: false,
title: '',
myAvatar: '',
gName: '',
gPhone: '',
caseData: [
{title:'是'},
{title:'否'}
caseData: [{
title: '是'
},
{
title: '否'
}
],
checkedIndex: 0,
}
headImg: '', //
caseTitle: '', //
student_name: '', //100
result_remarks: '', //
location_remarks: '', //
other_remarks: '', //
account_remarks: '', //
isIndex: 1, //01
id: '' //id
}
},
created() {
this.isScroll = true;
window.addEventListener("scroll", this.eventScrollTop);
},
methods:{
//
changeCase(index){
this.checkedIndex = index
mounted() {
let anliObj = (JSON.parse(localStorage.getItem("anliObj")));
console.log(anliObj, 1234)
if (anliObj) {
this.id = anliObj.id,
this.isIndex = anliObj.is_main,
this.caseTitle = anliObj.title,
this.headImg = anliObj.cover,
this.student_name = anliObj.student_name,
this.result_remarks = anliObj.result_remarks,
this.location_remarks = anliObj.location_remarks,
this.other_remarks = anliObj.other_remarks,
this.account_remarks = anliObj.account_remarks,
this.title = '编辑案例'
} else {
this.title = '新增案例'
}
},
methods: {
//
imgIny(e) {
let that = this;
const files = e.target.files;
console.log(files[0]);
console.log({
image: files[0]
});
var fromdata = new FormData();
fromdata.append("image", files[0]);
this.axios
.post(this.HOME + "/api/file/upload/image", fromdata, {
headers: {
"Content-Type": "multipart/form-data",
},
})
.then(function(res) {
that.myAvatar = res.data.data.src;
console.log(that.myAvatar, 123);
})
.catch(function(error) {
console.log(error);
});
},
//
goPage(path){
this.$router.push(path);
//
editEv() {
let that = this;
that.headImg = that.myAvatar;
this.axios
.post(this.HOME + "/api/expert/edit-expert-case", {
id: that.id, // ID
title: that.caseTitle, //
cover: that.headImg, //250
is_main: that.isIndex, //01
student_name: that.student_name, //100
result_remarks: that.result_remarks, //
location_remarks: that.location_remarks, //
other_remarks: that.other_remarks, //
account_remarks: that.account_remarks //
})
.then(function(res) {
alert("编辑案例成功");
that.$router.push('/consultant');
console.log(res);
})
.catch(function(error) {
console.log(error);
});
},
//
eventScrollTop() {
let scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
if (scrollTop >= 5) {
if (this.isScroll) {
this.isScroll = false;
this.isScrollTop = true;
}
//
addCase() {
let that = this;
if (that.id) {
that.editEv();
} else {
if (!this.isScroll) {
this.isScroll = true;
this.isScrollTop = false;
}
that.headImg = that.myAvatar;
this.axios
.post(this.HOME + "/api/expert/add-expert-case", {
title: that.caseTitle, //
cover: that.headImg, //250
is_main: that.isIndex, //01
student_name: that.student_name, //100
result_remarks: that.result_remarks, //
location_remarks: that.location_remarks, //
other_remarks: that.other_remarks, //
account_remarks: that.account_remarks //
})
.then(function(res) {
alert("新增案例成功");
that.$router.push('/consultant');
console.log(res);
})
.catch(function(error) {
console.log(error);
});
}
}
},
destroyed() {
},
//
eventScrollTop() {
let scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
if (scrollTop >= 5) {
if (this.isScroll) {
this.isScroll = false;
this.isScrollTop = true;
}
} else {
if (!this.isScroll) {
this.isScroll = true;
this.isScrollTop = false;
}
}
},
destroyed() {
window.removeEventListener("scroll", this.eventScrollTop);
},
//keep-alive
@ -106,9 +219,9 @@
deactivated() {
window.removeEventListener("scroll", this.eventScrollTop);
}
}
}
</script>
<style scoped>
</style>
</style>

View File

@ -8,18 +8,22 @@
<div class="edit pull-content">
<div class="edit-list">
<div class="personal-item">
<p>姓名<span>李四</span></p>
<p>等级<span>金牌咨询师</span></p>
<p>姓名<span>{{name}}</span></p>
<p>等级<span>{{tags_text}}</span></p>
</div>
<!-- 形象照 -->
<div class="personal-item">
<p>形象照</p>
<div class="personal-txt">
<div class="personal-photo">
<span>上传图片的区域照片必须使用固定的宽高比16:17比如宽400像素高425像素或其它同等比例</span>
<!-- <img src="" alt=""> -->
<img v-if="myAvatar" :src="host + myAvatar">
<img v-else-if="handImg" :src="host + handImg">
<span v-else>使16:17400425</span>
</div>
<div class="edit-btn">
<input class="inputB" @change="imgIny($event)" type="file" />
上传
</div>
<div class="edit-btn">上传</div>
</div>
</div>
<!-- 关键特征 -->
@ -241,6 +245,8 @@
data(){
return {
isScrollTop: false,
name:'',
tags_text: '',
sloganData: '',
bodyData: '',
explainData: '',
@ -297,13 +303,44 @@
isPrice4: false, //
priceIndex4: 0,
priceValue4:'', //
handImg: '' ,//
myAvatar: ''
}
},
created() {
this.isScroll = true;
window.addEventListener("scroll", this.eventScrollTop);
},
mounted() {
this.checkExperInfo();
},
methods:{
//
imgIny(e) {
let that = this;
const files = e.target.files;
console.log(files[0]);
console.log({
image: files[0]
});
var fromdata = new FormData();
fromdata.append("image", files[0]);
this.axios
.post(this.HOME + "/api/file/upload/image", fromdata, {
headers: {
"Content-Type": "multipart/form-data",
},
})
.then(function(res) {
that.myAvatar = res.data.data.src;
console.log(that.myAvatar, 123);
})
.catch(function(error) {
console.log(error);
});
},
//
openCity1(){
this.isCity1=!this.isCity1;
@ -363,10 +400,30 @@
this.isPrice4=false;
},
//
checkExperInfo(){
let that =this;
this.axios
.post(this.HOME + "/api/user/center-info", {
})
.then(function(res) {
let newArray = res.data.data.expert;
that.handImg = newArray.avatar;
that.name = newArray.name;
that.tags_text = newArray.tags_text;
that.sloganData = newArray.slogan;
console.log(res.data.data.expert,123);
});
},
//
goPage(path){
this.$router.push(path);
},
//
eventScrollTop() {
let scrollTop = document.body.scrollTop || document.documentElement.scrollTop;

View File

@ -1,5 +1,5 @@
<template>
<div class="content my-content">
<div class="content my-content">
<!-- 头部 -->
<div :class="{'header':true,'scroll white':isScrollTop,'white':true}">
<div class="back"></div>
@ -38,7 +38,9 @@
</li>
<li v-for="(item,index) in expertCase" :key="index">
<span><img :src="host + item.cover"></span>
<span><p>{{item.title}}</p></span>
<span>
<p>{{item.title}}</p>
</span>
<span>{{item.is_main==1?"是":"否"}}</span>
<span>
<ins>
@ -49,23 +51,23 @@
</li>
</ul>
</div>
</div>
</div>
</template>
<script>
export default {
name: "consultant",
data(){
return {
export default {
name: "consultant",
data() {
return {
isScrollTop: false,
id: '',
page: 1,//
size: 10,//
is_main: -1,//
allowLoad:true,//
experObj: [],//
expertCase: [],//
}
page: 1, //
size: 10, //
is_main: -1, //
allowLoad: true, //
experObj: [], //
expertCase: [], //
}
},
created() {
this.isScroll = true;
@ -74,85 +76,97 @@
mounted() {
this.checkExperInfo();
},
methods:{
methods: {
//
checkExperInfo(){
let that = this;
this.axios
.post(this.HOME + "/api/user/center-info", {
})
.then(function(res) {
console.log(res,123)
checkExperInfo() {
let that = this;
this.axios
.post(this.HOME + "/api/user/center-info", {})
.then(function(res) {
console.log(res, 123)
that.experObj = res.data.data.expert
// that.id = that.experObj.id;
that.id = that.experObj.id;
//
that.getExpertCase(that.id)
});
},
});
},
//
getExpertCase(id){
getExpertCase(id) {
let that = this;
let anId = id;
this.axios
.post(this.HOME + "/api/expert/get-expert-case-list", {
page: that.page,
size: that.size,
expert_id: anId,
is_main: that.is_main
size: that.size,
expert_id: anId,
is_main: that.is_main
})
.then(function(res) {
let list = res.data.data.list;
let newArray = [];
that.expertCase = [];
list.forEach(item=>{
let obj = {
id:item.id,
cover: item.cover,
title: item.title,
result_remarks: item.result_remarks,
location_remarks: item.location_remarks,
other_remarks: item.other_remarks,
account_remarks: item.account_remarks,
is_main:item.is_main,
student_name:item.student_name
}
newArray.push(obj);
list.forEach(item => {
let obj = {
id: item.id,
cover: item.cover,
title: item.title,
result_remarks: item.result_remarks,
location_remarks: item.location_remarks,
other_remarks: item.other_remarks,
account_remarks: item.account_remarks,
is_main: item.is_main,
student_name: item.student_name
}
newArray.push(obj);
})
that.expertCase = that.expertCase.concat(newArray);
});
},
//
editCase(index){
let editIndex = index;
localStorage.anliObj = JSON.stringify(editIndex);
this.$router.push('/case');
},
//
deleteCase(idk){
let that = this;
editCase(index) {
let editIndex = index;
localStorage.anliObj = JSON.stringify(this.expertCase[editIndex]);
this.$router.push('/case');
},
//
deleteCase(idk) {
let that = this;
let anId = idk;
this.axios
.post(this.HOME + "/api/expert/get-expert-case-list", {
ids:anId
})
.then(function(res) {
console.log(res,2525)
this.axios
.post(this.HOME + "/api/expert/delete-expert-case", {
ids: anId
})
.then(function(res) {
console.log(res, 2525)
alert('删除成功');
that.getExpertCase(that.id);
});
},
that.getExpertCase(that.id);
});
},
//
editInformation(){
editInformation() {
this.$router.push('/edit');
},
//
addCase() {
localStorage.anliObj = JSON.stringify("");
this.$router.push({
path: '/case',
name: 'case',
query: {
id: this.id
},
});
},
//
goPage(path){
this.$router.push(path);
goPage(path) {
this.$router.push(path);
},
//
eventScrollTop() {
@ -169,7 +183,7 @@
}
}
}
},
},
destroyed() {
window.removeEventListener("scroll", this.eventScrollTop);
},
@ -182,9 +196,9 @@
deactivated() {
window.removeEventListener("scroll", this.eventScrollTop);
}
}
}
</script>
<style scoped>
</style>
</style>

View File

@ -355,7 +355,7 @@
//
setStudentInfo() {
let that =this;
if(this.temporaryCode.length != this.addrData[this.addrIndex].subject_max){
if(that.temporaryCode.length != that.addrData[that.addrIndex].subject_max){
console.log('弹框提示,必须选择多少个科目');
} else {
let data = {
@ -363,7 +363,7 @@
student_gender: that.sexIndex==0 ? 1 : 2,//
student_native: that.addrData[that.addrIndex].code, //
student_native_str: that.addrData[that.addrIndex].name,//
// student_subject: this.temporaryCode.join(','),//ID
student_subject: that.temporaryCode.join(','),//ID
student_exam_year: that.dateValue,//
is_art: that.dateIndex==1?1:0,//
is_PE:that.dateIndex==2?1:0,//
@ -371,7 +371,7 @@
province_ranking: that.provinceRanking,///
achievement_high: '',//-1-1
}
console.log(data)
console.log(data,2525)
}
// let that = this;
// this.axios