添加选中效果样式

UI_2022-02-10
yujialong 3 years ago
parent 51e5de52c5
commit 7d6f5c21ec
  1. 13
      src/pages/course/details/index.vue
  2. 14
      src/pages/station/preview/index.vue

@ -57,7 +57,9 @@
<div class="chapter" v-for="(item,index) in videoList" :key="index"> <div class="chapter" v-for="(item,index) in videoList" :key="index">
<div class="chapterName">{{item.name}}</div> <div class="chapterName">{{item.name}}</div>
<div class="section" v-if="item.subsectionList.length"> <div class="section" v-if="item.subsectionList.length">
<div class="sectionName" v-for="(section,i) in item.subsectionList" :key="i" @click="preview(section)">{{section.name}}</div> <div v-for="(section,i) in item.subsectionList" :key="i" @click="preview(section, item.name)">
<p class="sectionName" :class="{active: curLink === `${item.name}${section.name}`}">{{ section.name }}</p>
</div>
</div> </div>
</div> </div>
</template> </template>
@ -103,7 +105,8 @@ export default {
currentPage: 0, // pdf currentPage: 0, // pdf
pageCount: 0, // pdf pageCount: 0, // pdf
fileType: 'pdf', // fileType: 'pdf', //
desShrink: false desShrink: false,
curLink: "", //
}; };
}, },
computed: { computed: {
@ -149,7 +152,8 @@ export default {
if('mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv'.includes(ext)) return '视频' if('mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv'.includes(ext)) return '视频'
return ext return ext
}, },
preview(row){ preview(row, chapterName){
this.curLink = `${chapterName}${row.name}`;
this.player = null this.player = null
this.playauth = '' this.playauth = ''
this.coverUrl = '' this.coverUrl = ''
@ -357,6 +361,9 @@ $height: 700px;
color: rgba(0, 0, 0, 0.65); color: rgba(0, 0, 0, 0.65);
cursor: pointer; cursor: pointer;
@include ellipsis; @include ellipsis;
&.active{
color: #9278FF;
}
} }
} }
} }

@ -57,8 +57,8 @@
<div class="chapter" v-for="(item,index) in chapterList" :key="index"> <div class="chapter" v-for="(item,index) in chapterList" :key="index">
<div class="chapterName">{{ item.name }}</div> <div class="chapterName">{{ item.name }}</div>
<div class="section" v-if="item.subsectionList.length"> <div class="section" v-if="item.subsectionList.length">
<div class="sectionName" v-for="(section,i) in item.subsectionList" :key="i" <div v-for="(section,i) in item.subsectionList" :key="i" @click="preview(section, item.name)">
@click="preview(section)">{{ section.name }} <p class="sectionName" :class="{active: curLink === `${item.name}${section.name}`}">{{ section.name }}</p>
</div> </div>
</div> </div>
</div> </div>
@ -109,7 +109,7 @@ export default {
briefIntroduction: "", // briefIntroduction: "", //
teachingObjectives: "", // teachingObjectives: "", //
assessmentList: "", // assessmentList: "", //
curLink: "", //
playAuth: "", playAuth: "",
player: null, player: null,
previewImg: "", previewImg: "",
@ -159,7 +159,7 @@ export default {
this.chapterList = res.chapterList; this.chapterList = res.chapterList;
if (this.chapterList.length && this.chapterList[0].subsectionList && this.chapterList[0].subsectionList.length) { if (this.chapterList.length && this.chapterList[0].subsectionList && this.chapterList[0].subsectionList.length) {
// console.log(this.chapterList[0].subsectionList[0]); // console.log(this.chapterList[0].subsectionList[0]);
this.preview(this.chapterList[0].subsectionList[0]); this.preview(this.chapterList[0].subsectionList[0], this.chapterList[0].name);
} }
}, },
// //
@ -185,7 +185,8 @@ export default {
if ("mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv".includes(ext)) return "视频"; if ("mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv".includes(ext)) return "视频";
return ext; return ext;
}, },
preview(row) { preview(row, chapterName) {
this.curLink = `${chapterName}${row.name}`; // +
this.player = null; this.player = null;
this.playauth = ""; this.playauth = "";
this.coverUrl = ""; this.coverUrl = "";
@ -438,6 +439,9 @@ $height: 700px;
color: rgba(0, 0, 0, 0.65); color: rgba(0, 0, 0, 0.65);
cursor: pointer; cursor: pointer;
@include ellipsis; @include ellipsis;
&.active{
color: #9278FF;
}
} }
} }
} }

Loading…
Cancel
Save