解决冲突

master
Lee-1203 2022-03-06 14:20:40 +08:00
parent 9c52c4c578
commit 2e3bf35c82
1 changed files with 231 additions and 216 deletions

View File

@ -1,243 +1,258 @@
<template> <template>
<div class="content my-content"> <div class="content my-content">
<!-- 头部 --> <!-- 头部 -->
<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)"> <div class="back" @click="$router.go(-1)">
<img src="../../assets/images/home/expert/back.png" alt="" /> <img src="../../assets/images/home/expert/back.png" alt="" />
</div> </div>
<div class="header-title">列表预览</div> <div class="header-title">列表预览</div>
<!-- 咨询师列表 --> <!-- 咨询师列表 -->
</div>
<div class="expert-list-all section"> <div class="expert-list-all section">
<ul class="expert-list"> <ul class="expert-list">
<li v-for="(item,index) in expertData" :key="index"> <li>
<div class="expert-list-con" @click="goPage('/expert/detail')"> <div class="expert-list-con">
<div class="expert-list-img"><img src="../../assets/images/home/index/expert.png" alt=""></div> <div class="expert-list-img">
<img :src="this.host+userData.avatar" alt="" />
</div>
<div class="expert-list-txt"> <div class="expert-list-txt">
<div class="title"> <div class="title">
<h2>{{item.name}}</h2> <h2>{{ userData.name }}</h2>
<span v-if="item.title">{{item.title}}</span> <span v-if="userData.title">{{ userData.title }}</span>
</div> </div>
<div class="integral"> <div class="integral">
<span>公益积分{{item.integral}}</span> <span>公益积分{{ userData.score }}</span>
<span>好评度{{item.score}}</span> <span>好评度{{ userData.comment_score }}</span>
</div> </div>
<div class="honor"> <div class="honor">
<span v-for="(itemk,indexk) in item.honor" :key="indexk">{{itemk.title}}</span> <span v-for="(itemk, indexk) in userData.keywords_list" :key="indexk">{{ itemk }}</span>
</div> </div>
<div class="slogan">{{item.slogan}}</div> <div class="slogan">{{ userData.summary }}</div>
</div> </div>
</div> </div>
<div class="expert-list-btns"> <div class="expert-list-btns">
<div :class="{'btn':true}">向TA提问</div> <div :class="{ btn: true }">向TA提问</div>
<div class="btn">查看详情</div> <div class="btn">查看详情</div>
</div> </div>
</li> </li>
</ul> </ul>
</div> </div>
>>>>>>> 31ac1df69ae7462dac9a9171cb8e6856291e7c2a </div>
</div>
<!-- 咨询师列表 -->
<div class="expert-list-all section">
<ul class="expert-list">
<li>
<div class="expert-list-con">
<div class="expert-list-img">
<img :src="this.host+userData.avatar" alt="" />
</div>
<div class="expert-list-txt">
<div class="title">
<h2>{{ userData.name }}</h2>
<span v-if="userData.title">{{ userData.title }}</span>
</div>
<div class="integral">
<span>公益积分{{ userData.score }}</span>
<span>好评度{{ userData.comment_score }}</span>
</div>
<div class="honor">
<span
v-for="(itemk, indexk) in userData.keywords_list"
:key="indexk"
>{{ itemk }}</span
>
</div>
<div class="slogan">{{ userData.summary }}</div>
</div>
</div>
<div class="expert-list-btns">
<div :class="{ btn: true }">向TA提问</div>
<div class="btn">查看详情</div>
</div>
</li>
</ul>
</div>
</div>
</template> </template>
<script> <script>
export default { export default {
name: "edit-list", name: "edit-list",
data() { data() {
return { return {
isScrollTop: false, isScrollTop: false,
isReceive: 1, // isReceive: 1, //
current: 0, current: 0,
isConfirm: false, isConfirm: false,
userData:{}, userData: {},
expertData: [ expertData: [{
{ name: "赵晓",
name: "赵晓", title: "金牌咨询师",
title: "金牌咨询师", imgsrc: "../../assets/images/home/index/expert.png",
imgsrc: "../../assets/images/home/index/expert.png", integral: "985",
integral: "985", score: "8.5",
score: "8.5", honor: [{
honor: [ title: "中科院心理科"
{ title: "中科院心理科" }, },
{ title: "硕士" }, {
{ title: "从业5年" }, title: "硕士"
{ title: "熟悉高考" }, },
], {
slogan: "一所好的大学,是年轻人的家,是他 们度过人生最好时光的地方!", title: "从业5年"
}, },
{ {
name: "赵晓", title: "熟悉高考"
title: "专家咨询师", },
imgsrc: "../../assets/images/home/index/expert.png", ],
integral: "985", slogan: "一所好的大学,是年轻人的家,是他 们度过人生最好时光的地方!",
score: "8.5", },
honor: [ {
{ title: "中科院心理科" }, name: "赵晓",
{ title: "硕士" }, title: "专家咨询师",
{ title: "从业5年" }, imgsrc: "../../assets/images/home/index/expert.png",
{ title: "熟悉高考" }, integral: "985",
], score: "8.5",
slogan: "一所好的大学,是年轻人的家,是他 们度过人生最好时光的地方!", honor: [{
}, title: "中科院心理科"
{ },
name: "赵晓", {
title: "专家咨询师", title: "硕士"
imgsrc: "../../assets/images/home/index/expert.png", },
integral: "985", {
score: "8.5", title: "从业5年"
honor: [ },
{ title: "中科院心理科" }, {
{ title: "硕士" }, title: "熟悉高考"
{ title: "从业5年" }, },
{ title: "熟悉高考" }, ],
], slogan: "一所好的大学,是年轻人的家,是他 们度过人生最好时光的地方!",
slogan: "一所好的大学,是年轻人的家,是他 们度过人生最好时光的地方!", },
}, {
{ name: "赵晓",
name: "赵晓", title: "专家咨询师",
title: "专家咨询师", imgsrc: "../../assets/images/home/index/expert.png",
imgsrc: "../../assets/images/home/index/expert.png", integral: "985",
integral: "985", score: "8.5",
score: "8.5", honor: [{
honor: [ title: "中科院心理科"
{ title: "中科院心理科" }, },
{ title: "硕士" }, {
{ title: "从业5年" }, title: "硕士"
{ title: "熟悉高考" }, },
], {
slogan: "一所好的大学,是年轻人的家,是他 们度过人生最好时光的地方!", title: "从业5年"
}, },
{ {
name: "赵晓", title: "熟悉高考"
title: "专家咨询师", },
imgsrc: "../../assets/images/home/index/expert.png", ],
integral: "985", slogan: "一所好的大学,是年轻人的家,是他 们度过人生最好时光的地方!",
score: "8.5", },
honor: [ {
{ title: "中科院心理科" }, name: "赵晓",
{ title: "硕士" }, title: "专家咨询师",
{ title: "从业5年" }, imgsrc: "../../assets/images/home/index/expert.png",
{ title: "熟悉高考" }, integral: "985",
], score: "8.5",
slogan: "一所好的大学,是年轻人的家,是他 们度过人生最好时光的地方!", honor: [{
}, title: "中科院心理科"
{ },
name: "赵晓", {
title: "专家咨询师", title: "硕士"
imgsrc: "../../assets/images/home/index/expert.png", },
integral: "985", {
score: "8.5", title: "从业5年"
honor: [ },
{ title: "中科院心理科" }, {
{ title: "硕士" }, title: "熟悉高考"
{ title: "从业5年" }, },
{ title: "熟悉高考" }, ],
], slogan: "一所好的大学,是年轻人的家,是他 们度过人生最好时光的地方!",
slogan: "一所好的大学,是年轻人的家,是他 们度过人生最好时光的地方!", },
}, {
{ name: "赵晓",
name: "赵晓", title: "专家咨询师",
title: "专家咨询师", imgsrc: "../../assets/images/home/index/expert.png",
imgsrc: "../../assets/images/home/index/expert.png", integral: "985",
integral: "985", score: "8.5",
score: "8.5", honor: [{
honor: [ title: "中科院心理科"
{ title: "中科院心理科" }, },
{ title: "硕士" }, {
{ title: "从业5年" }, title: "硕士"
{ title: "熟悉高考" }, },
], {
slogan: "一所好的大学,是年轻人的家,是他 们度过人生最好时光的地方!", title: "从业5年"
}, },
], {
}; title: "熟悉高考"
}, },
created() { ],
this.isScroll = true; slogan: "一所好的大学,是年轻人的家,是他 们度过人生最好时光的地方!",
window.addEventListener("scroll", this.eventScrollTop); },
this.checkExperInfo(); {
}, name: "赵晓",
methods: { title: "专家咨询师",
eventScrollTop() { imgsrc: "../../assets/images/home/index/expert.png",
let scrollTop = integral: "985",
document.body.scrollTop || document.documentElement.scrollTop; score: "8.5",
if (scrollTop >= 5) { honor: [{
if (this.isScroll) { title: "中科院心理科"
this.isScroll = false; },
this.isScrollTop = true; {
} title: "硕士"
} else { },
if (!this.isScroll) { {
this.isScroll = true; title: "从业5年"
this.isScrollTop = false; },
} {
} title: "熟悉高考"
}, },
goPage(path) { ],
this.$router.push(path); slogan: "一所好的大学,是年轻人的家,是他 们度过人生最好时光的地方!",
}, },
checkExperInfo() { {
let that = this; name: "赵晓",
this.axios title: "专家咨询师",
.post(this.HOME + "/api/user/center-info", {}) imgsrc: "../../assets/images/home/index/expert.png",
.then(function (res) { integral: "985",
console.log(res.data.data.expert); score: "8.5",
that.userData = res.data.data.expert; honor: [{
console.log( that.userData); title: "中科院心理科"
}); },
}, {
}, title: "硕士"
},
{
title: "从业5年"
},
{
title: "熟悉高考"
},
],
slogan: "一所好的大学,是年轻人的家,是他 们度过人生最好时光的地方!",
},
],
};
},
created() {
this.isScroll = true;
window.addEventListener("scroll", this.eventScrollTop);
this.checkExperInfo();
},
methods: {
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;
}
}
},
goPage(path) {
this.$router.push(path);
},
checkExperInfo() {
let that = this;
this.axios
.post(this.HOME + "/api/user/center-info", {})
.then(function(res) {
console.log(res.data.data.expert);
that.userData = res.data.data.expert;
console.log(that.userData);
});
},
},
destroyed() { destroyed() {
window.removeEventListener("scroll", this.eventScrollTop); window.removeEventListener("scroll", this.eventScrollTop);
}, },
//keep-alive //keep-alive
activated() { activated() {
this.isScroll = true; this.isScroll = true;
window.addEventListener("scroll", this.eventScrollTop); window.addEventListener("scroll", this.eventScrollTop);
}, },
//keep-alive //keep-alive
deactivated() { deactivated() {
window.removeEventListener("scroll", this.eventScrollTop); window.removeEventListener("scroll", this.eventScrollTop);
}, },
}; };
</script> </script>
<style scoped> <style scoped>
.expert-list{ .expert-list {
margin-top: 1.2rem; margin-top: 1.2rem;
} }
</style> </style>