咨询师端接口调用

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; width: 4rem;
height: 3rem; height: 3rem;
border: .02rem dashed #dedede; border: .02rem dashed #dedede;
overflow: hidden;
}
.cover-img img{
width: 4rem;
min-height: 3rem;
} }
.cover-btn{ .cover-btn{
width: 1.5rem; width: 1.5rem;
@ -2117,6 +2122,19 @@ textarea::-webkit-input-placeholder{
color: #FFFFFF; color: #FFFFFF;
text-align: center; text-align: center;
margin-left: .5rem; 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{ .case-msg{
padding: .2rem .25rem; padding: .2rem .25rem;
@ -2190,6 +2208,11 @@ textarea::-webkit-input-placeholder{
width: 4rem; width: 4rem;
height: 4.25rem; height: 4.25rem;
border: .02rem dashed #dedede; border: .02rem dashed #dedede;
overflow: hidden;
}
.personal-photo img{
width: 4rem;
min-height: 4.25rem;
} }
.personal-photo>span{ .personal-photo>span{
display: block; display: block;
@ -2208,6 +2231,18 @@ textarea::-webkit-input-placeholder{
border-radius: .1rem; border-radius: .1rem;
text-align: center; text-align: center;
color: #FFFFFF; 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{ .personal-item .left{
display: flex; display: flex;

View File

@ -3,49 +3,55 @@
<!-- 头部 --> <!-- 头部 -->
<div :class="{'header':true,'scroll white':isScrollTop,'white':true}"> <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="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>
<div class="case pull-content"> <div class="case pull-content">
<div class="case-cover"> <div class="case-cover">
<p>封面图</p> <p>封面图</p>
<div class="cover-img"> <div class="cover-img">
<img v-if="myAvatar" :src="host + myAvatar">
<img v-else-if="headImg" :src="host + headImg">
</div> </div>
<div class="cover-btn">上传</div>
<button class="cover-btn" @change="imgIny($event)">
<input class="inputB" @change="imgIny($event)" type="file" />
上传
</button>
</div> </div>
<ul class="case-msg"> <ul class="case-msg">
<li> <li>
<p>标题</p> <p>标题</p>
<input type="text" v-model="gName" placeholder="请输入标题"/> <input type="text" v-model="caseTitle" placeholder="请输入标题" />
</li> </li>
<li> <li>
<p>学生姓名</p> <p>学生姓名</p>
<input type="text" v-model="gPhone" placeholder="请输入学生姓名"/> <input type="text" v-model="student_name" placeholder="请输入学生姓名" />
</li> </li>
<li> <li>
<p>是否主案例</p> <p>是否主案例</p>
<div class="course-list key-list"> <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> </div>
</li> </li>
<li> <li>
<p>录取结果</p> <p>录取结果</p>
<textarea placeholder="请输入录取结果"></textarea> <textarea v-model="result_remarks" placeholder="请输入录取结果"></textarea>
</li> </li>
<li> <li>
<p>专业定位</p> <p>专业定位</p>
<textarea placeholder="请输入专业定位"></textarea> <textarea v-model="location_remarks" placeholder="请输入专业定位"></textarea>
</li> </li>
<li> <li>
<p>其他说明</p> <p>其他说明</p>
<textarea placeholder="请输入其他说明"></textarea> <textarea v-model="other_remarks" placeholder="请输入其他说明"></textarea>
</li> </li>
<li> <li>
<p>客户反馈</p> <p>客户反馈</p>
<textarea placeholder="请输入客户反馈"></textarea> <textarea v-model="account_remarks" placeholder="请输入客户反馈"></textarea>
</li> </li>
</ul> </ul>
<div class="case-btn"></div> <div class="case-btn" @click="addCase()"></div>
</div> </div>
</div> </div>
</template> </template>
@ -56,28 +62,135 @@
data() { data() {
return { return {
isScrollTop: false, isScrollTop: false,
title: '',
myAvatar: '',
gName: '', gName: '',
gPhone: '', gPhone: '',
caseData: [ caseData: [{
{title:'是'}, title: '是'
{title:'否'} },
{
title: '否'
}
], ],
checkedIndex: 0, checkedIndex: 0,
headImg: '', //
caseTitle: '', //
student_name: '', //100
result_remarks: '', //
location_remarks: '', //
other_remarks: '', //
account_remarks: '', //
isIndex: 1, //01
id: '' //id
} }
}, },
created() { created() {
this.isScroll = true; this.isScroll = true;
window.addEventListener("scroll", this.eventScrollTop); window.addEventListener("scroll", this.eventScrollTop);
}, },
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: { methods: {
// //
changeCase(index){ imgIny(e) {
this.checkedIndex = index 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",
}, },
// })
goPage(path){ .then(function(res) {
this.$router.push(path); that.myAvatar = res.data.data.src;
console.log(that.myAvatar, 123);
})
.catch(function(error) {
console.log(error);
});
}, },
//
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);
});
},
//
addCase() {
let that = this;
if (that.id) {
that.editEv();
} else {
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);
});
}
}
},
// //
eventScrollTop() { eventScrollTop() {
let scrollTop = document.body.scrollTop || document.documentElement.scrollTop; let scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
@ -92,8 +205,8 @@
this.isScrollTop = false; this.isScrollTop = false;
} }
} }
}
}, },
destroyed() { destroyed() {
window.removeEventListener("scroll", this.eventScrollTop); window.removeEventListener("scroll", this.eventScrollTop);
}, },

View File

@ -8,18 +8,22 @@
<div class="edit pull-content"> <div class="edit pull-content">
<div class="edit-list"> <div class="edit-list">
<div class="personal-item"> <div class="personal-item">
<p>姓名<span>李四</span></p> <p>姓名<span>{{name}}</span></p>
<p>等级<span>金牌咨询师</span></p> <p>等级<span>{{tags_text}}</span></p>
</div> </div>
<!-- 形象照 --> <!-- 形象照 -->
<div class="personal-item"> <div class="personal-item">
<p>形象照</p> <p>形象照</p>
<div class="personal-txt"> <div class="personal-txt">
<div class="personal-photo"> <div class="personal-photo">
<span>上传图片的区域照片必须使用固定的宽高比16:17比如宽400像素高425像素或其它同等比例</span> <img v-if="myAvatar" :src="host + myAvatar">
<!-- <img src="" alt=""> --> <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>
<div class="edit-btn">上传</div>
</div> </div>
</div> </div>
<!-- 关键特征 --> <!-- 关键特征 -->
@ -241,6 +245,8 @@
data(){ data(){
return { return {
isScrollTop: false, isScrollTop: false,
name:'',
tags_text: '',
sloganData: '', sloganData: '',
bodyData: '', bodyData: '',
explainData: '', explainData: '',
@ -297,13 +303,44 @@
isPrice4: false, // isPrice4: false, //
priceIndex4: 0, priceIndex4: 0,
priceValue4:'', // priceValue4:'', //
handImg: '' ,//
myAvatar: ''
} }
}, },
created() { created() {
this.isScroll = true; this.isScroll = true;
window.addEventListener("scroll", this.eventScrollTop); window.addEventListener("scroll", this.eventScrollTop);
}, },
mounted() {
this.checkExperInfo();
},
methods:{ 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(){ openCity1(){
this.isCity1=!this.isCity1; this.isCity1=!this.isCity1;
@ -363,10 +400,30 @@
this.isPrice4=false; 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){ goPage(path){
this.$router.push(path); this.$router.push(path);
}, },
// //
eventScrollTop() { eventScrollTop() {
let scrollTop = document.body.scrollTop || document.documentElement.scrollTop; let scrollTop = document.body.scrollTop || document.documentElement.scrollTop;

View File

@ -38,7 +38,9 @@
</li> </li>
<li v-for="(item,index) in expertCase" :key="index"> <li v-for="(item,index) in expertCase" :key="index">
<span><img :src="host + item.cover"></span> <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>{{item.is_main==1?"是":"否"}}</span>
<span> <span>
<ins> <ins>
@ -79,12 +81,11 @@
checkExperInfo() { checkExperInfo() {
let that = this; let that = this;
this.axios this.axios
.post(this.HOME + "/api/user/center-info", { .post(this.HOME + "/api/user/center-info", {})
})
.then(function(res) { .then(function(res) {
console.log(res, 123) console.log(res, 123)
that.experObj = res.data.data.expert that.experObj = res.data.data.expert
// that.id = that.experObj.id; that.id = that.experObj.id;
// //
that.getExpertCase(that.id) that.getExpertCase(that.id)
}); });
@ -126,7 +127,7 @@
// //
editCase(index) { editCase(index) {
let editIndex = index; let editIndex = index;
localStorage.anliObj = JSON.stringify(editIndex); localStorage.anliObj = JSON.stringify(this.expertCase[editIndex]);
this.$router.push('/case'); this.$router.push('/case');
}, },
@ -136,7 +137,7 @@
let that = this; let that = this;
let anId = idk; let anId = idk;
this.axios this.axios
.post(this.HOME + "/api/expert/get-expert-case-list", { .post(this.HOME + "/api/expert/delete-expert-case", {
ids: anId ids: anId
}) })
.then(function(res) { .then(function(res) {
@ -150,6 +151,19 @@
editInformation() { editInformation() {
this.$router.push('/edit'); this.$router.push('/edit');
}, },
//
addCase() {
localStorage.anliObj = JSON.stringify("");
this.$router.push({
path: '/case',
name: 'case',
query: {
id: this.id
},
});
},
// //
goPage(path) { goPage(path) {
this.$router.push(path); this.$router.push(path);

View File

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