提交 151912a5 编写于 作者: huangwensu's avatar huangwensu

收起和详情修改

上级 3a09d323
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="item-intro-container"> <div class="item-intro-container">
<div class="basic-title">项目介绍</div> <div class="basic-title">项目介绍</div>
<div class="content"> <div class="content">
<div class="text">{{newText}}</div> <div class="text">{{textContent}}</div>
<div class="desc" @click="allText"> <div class="desc" @click="allText">
<span>{{btnText}}</span> <span>{{btnText}}</span>
<img v-if="!allTextFlag" src="../../images/down.png"/> <img v-if="!allTextFlag" src="../../images/down.png"/>
...@@ -25,22 +25,17 @@ export default { ...@@ -25,22 +25,17 @@ export default {
allTextFlag: false allTextFlag: false
} }
}, },
computed: {
newText: function () {
return this.textContent.length > 69 ? this.textContent.slice(0,69) + "..." : this.textContent;
}
},
methods: { methods: {
allText() { allText() {
if(!this.allTextFlag) { let _this = this;
this.newText = this.textContent; if(!_this.allTextFlag) {
this.btnText = '收起'; _this.btnText = '收起';
this.allTextFlag = true; _this.allTextFlag = true;
}else { }else {
this.newText = this.textContent.length > 69 ? this.textContent.slice(0,69) + "..." : this.textContent; _this.btnText = '详情';
this.btnText = '详情'; _this.allTextFlag = false;
this.allTextFlag = false;
} }
_this.$emit("itemIntroText", {allTextFlag: _this.allTextFlag});
} }
} }
} }
...@@ -66,9 +61,10 @@ export default { ...@@ -66,9 +61,10 @@ export default {
color: #676869; color: #676869;
} }
.desc { .desc {
position: absolute; // position: absolute;
right: 0; // right: 0;
bottom: px2rem(1px); // bottom: px2rem(1px);
text-align: right;
background: #fff; background: #fff;
line-height: px2rem(14px); line-height: px2rem(14px);
z-index: 99; z-index: 99;
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</div> </div>
</div> </div>
<div class="content"> <div class="content">
<div class="text">{{newText}}</div> <div class="text">{{leaderText}}</div>
<div class="desc" @click="allText"> <div class="desc" @click="allText">
<span>{{btnText}}</span> <span>{{btnText}}</span>
<img v-if="!allTextFlag" src="../../images/down.png" /> <img v-if="!allTextFlag" src="../../images/down.png" />
...@@ -25,6 +25,10 @@ export default { ...@@ -25,6 +25,10 @@ export default {
projectLeader: { projectLeader: {
type: Object, type: Object,
default: () => {} default: () => {}
},
leaderText: {
type: String,
default: ""
} }
}, },
data() { data() {
...@@ -33,29 +37,16 @@ export default { ...@@ -33,29 +37,16 @@ export default {
allTextFlag: false allTextFlag: false
}; };
}, },
computed: {
newText: function() {
if (this.projectLeader.info) {
return this.projectLeader.info.length > 66
? this.projectLeader.info.slice(0, 66) + "..."
: this.projectLeader.info;
}
}
},
methods: { methods: {
allText() { allText() {
if (!this.allTextFlag) { if (!this.allTextFlag) {
this.newText = this.projectLeader.info;
this.btnText = "收起"; this.btnText = "收起";
this.allTextFlag = true; this.allTextFlag = true;
} else { } else {
this.newText =
this.projectLeader.info.length > 66
? this.projectLeader.info.slice(0, 66) + "..."
: this.projectLeader.info;
this.btnText = "详情"; this.btnText = "详情";
this.allTextFlag = false; this.allTextFlag = false;
} }
this.$emit("changeLeaderText",{allTextFlag: this.allTextFlag});
} }
} }
}; };
...@@ -110,9 +101,10 @@ export default { ...@@ -110,9 +101,10 @@ export default {
color: #676869; color: #676869;
} }
.desc { .desc {
position: absolute; // position: absolute;
right: 0; // right: 0;
bottom: px2rem(1px); // bottom: px2rem(1px);
text-align: right;
background: #fff; background: #fff;
line-height: px2rem(14px); line-height: px2rem(14px);
z-index: 99; z-index: 99;
......
...@@ -60,8 +60,11 @@ ...@@ -60,8 +60,11 @@
/> />
<LearnKnow :mustKnow="project.mustKnow"></LearnKnow> <LearnKnow :mustKnow="project.mustKnow"></LearnKnow>
<CommonSpliteLine></CommonSpliteLine> <CommonSpliteLine></CommonSpliteLine>
<ItemIntro :textContent="project.projectIntro"></ItemIntro> <ItemIntro :textContent="textContent" @itemIntroText="itemIntroText"></ItemIntro>
<ItemLeader :projectLeader="projectLeader"></ItemLeader> <ItemLeader
:projectLeader="projectLeader"
:leaderText="leaderText"
@changeLeaderText="changeLeaderText"/>
<TeacterIntro :doctorList="doctorList"></TeacterIntro> <TeacterIntro :doctorList="doctorList"></TeacterIntro>
</div> </div>
<CommonSpliteLine></CommonSpliteLine> <CommonSpliteLine></CommonSpliteLine>
...@@ -117,6 +120,8 @@ export default { ...@@ -117,6 +120,8 @@ export default {
data() { data() {
return { return {
// token: "9B62E5874DA94979A54DB3E9DFC1443F", // token: "9B62E5874DA94979A54DB3E9DFC1443F",
textContent: "",
leaderText: "",
pageTitle: "", pageTitle: "",
isShowShare: true, isShowShare: true,
premissionFlag: false, premissionFlag: false,
...@@ -387,7 +392,13 @@ export default { ...@@ -387,7 +392,13 @@ export default {
// 先设置视频URL再显示视频组件 ------------ END // 先设置视频URL再显示视频组件 ------------ END
_this.project = res.data; _this.project = res.data;
if(_this.project.projectIntro) {
_this.textContent = _this.project.projectIntro.length > 66 ? _this.project.projectIntro.slice(0, 66) + "..." : this.project.projectIntro;
}
_this.projectLeader = res.data.projectLeader || {}; _this.projectLeader = res.data.projectLeader || {};
if(_this.projectLeader.info) {
_this.leaderText = _this.projectLeader.info.length > 66 ? _this.projectLeader.info.slice(0, 66) + "..." : this.projectLeader.info;
}
_this.doctorList = res.data.doctorList; _this.doctorList = res.data.doctorList;
//_this.projectStatus = res.data.projectStatus; //_this.projectStatus = res.data.projectStatus;
...@@ -398,6 +409,28 @@ export default { ...@@ -398,6 +409,28 @@ export default {
//_this.showLoading = false; //_this.showLoading = false;
}); });
}, },
// 项目负责人--详情(收起)
changeLeaderText(data) {
let _this = this;
if(_this.projectLeader.info) {
if(!data.allTextFlag) {
_this.leaderText = _this.projectLeader.info.length > 66 ? _this.projectLeader.info.slice(0, 66) + "..." : this.projectLeader.info;
}else {
_this.leaderText = _this.projectLeader.info;
}
}
},
// 项目介绍
itemIntroText(data) {
let _this = this;
if(_this.project.projectIntro) {
if(!data.allTextFlag) {
_this.textContent = _this.project.projectIntro.length > 66 ? _this.project.projectIntro.slice(0, 66) + "..." : this.project.projectIntro;
}else {
_this.textContent = _this.project.projectIntro;
}
}
},
setListData(data) { setListData(data) {
let _this = this; let _this = this;
let list = data; let list = data;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册