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

收起和详情修改

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