smartmeter-app/pages_teacher/teacher_teachers/components/slander.vue

237 lines
4.9 KiB
Vue
Raw Normal View History

2023-12-05 18:51:43 +08:00
<template>
<!-- 口语下拉 -->
2023-12-05 21:18:18 +08:00
<view>
<view class="view_left">
<view class="view_left_pd" @click="arrow_xl">
{{selectedOption}}
<u-icon name="arrow-down" size="22" class="pd_icon"></u-icon>
<view class="pull_Down" v-if="arrow">
<view v-for="(item,index) in options" :key="index" @click="arrow_options(item.id)">{{item.name}}</view>
</view>
2023-12-05 18:51:43 +08:00
</view>
2023-12-05 21:18:18 +08:00
<view class="view_left_pd" @click="arrow_xl2">
{{categorize}}
<u-icon name="arrow-down" size="22" class="pd_icon"></u-icon>
<view class="pull_DownTow" v-if="arrowDown">
<view v-for="(item,index) in options2 " :key="index" @click="Classification(item.id)">{{item.name}}</view>
</view>
2023-12-05 18:51:43 +08:00
</view>
</view>
2023-12-05 21:18:18 +08:00
<!-- 口语主体 -->
<view v-for="(item,index) in slander" :key="index">
<view class="view_inuygs">
<view class="header_part">
<view class="unite">{{selectedOption}}</view>
<view class="unite">{{item.label}}</view>
</view>
<view style="display: flex;">
<view class="slander_an">串题</view>
<view class="slander_an blue">跟读</view>
<view class="slander_an blue">模考</view>
</view>
</view>
<view class="slander_for">
<view class="slander_behavior" v-for="(items,indexs) in item.list" :key='indexs'>
<view class="slander_left">{{items.topicEn}}</view>
2023-12-05 18:51:43 +08:00
</view>
</view>
</view>
2023-12-05 21:18:18 +08:00
</view>
2023-12-05 18:51:43 +08:00
</template>
<script>
export default {
data(){
return {
postdata :{
"key": "",
"pageNum": 0,
"mode": "home",
"part": "part1",
"order": "0",
"type": "",
"isStudy": 0,
"isFavorite": 0,
"isEvlua": 0,
"isFun": 0,
"level": 0,
"isNew": 0
},
//口语
slander: [],
categorize:'分类',
// 下拉框的v-if布尔值
selectedOption:'Part1',
arrow:false,
arrowDown:false,
options:[
{
id:1,
name:'Part1'
},
{
id:2,
name:'Part2'
}
],
options2:[
{
id:1,
name:'环境类'
},
{
id:2,
name:'学习类'
}
],
}
},
2023-12-05 21:18:18 +08:00
created() {
2023-12-05 18:51:43 +08:00
this.getList()
},
methods:{
getList() {
this.$u.post('https://api.admin-v2.langsi.online/admin-api/speaking/topic/home/list',this.postdata).then(res => {
let keyArr = Object.keys(res.data)
let valueArr = Object.values(res.data)
this.slander = keyArr.map((item, index) => {
return {
label: item,
list: valueArr[index]
}
})
})
},
//下拉显示下拉框
arrow_xl(){
this.arrow=!this.arrow
},
arrow_xl2(){
this.arrowDown=!this.arrowDown
},
arrow_options(id){
this.options.forEach(item=>{
if(item.id== id){
this.selectedOption=item.name
2023-12-05 21:18:18 +08:00
2023-12-05 18:51:43 +08:00
}else if(id==2){
this.postdata.part="part2"
this.getList()
}else{
this.postdata.part="part1"
this.getList()
}
})
},
// 下拉然后更新里面的值
Classification(id){
this.options2.forEach(item=>{
if(item.id == id){
this.categorize =item.name
}
})
},
}
}
</script>
<style lang="scss" scoped>
.view_left {
display: flex;
justify-content: left;
margin-top: 20rpx;
}
2023-12-05 21:18:18 +08:00
.view_inuygs{
display: flex;
justify-content: space-between;
align-items: center;
}
2023-12-05 18:51:43 +08:00
.view_left_pd {
position: relative;
padding: 12rpx 32rpx;
background: #FFFFFF;
border-radius: 20rpx 20rpx 20rpx 20rpx;
margin-right: 15rpx;
font-size: 24rpx;
2023-12-05 21:18:18 +08:00
color: #072F5A;
2023-12-05 18:51:43 +08:00
}
.unite {
font-size: 28rpx;
font-family: 'PingFang';
font-weight: 800;
color: #2E4975;
2023-12-05 21:18:18 +08:00
margin-right: 20rpx;
2023-12-05 18:51:43 +08:00
}
.slander_for {
background: #FFFFFF;
border-radius: 20rpx 20rpx 20rpx 20rpx;
padding: 0 30rpx;
}
.slander_behavior {
2023-12-05 21:18:18 +08:00
2023-12-05 18:51:43 +08:00
padding: 20rpx 0rpx;
border-bottom: 2rpx solid #F2F2F2;
}
.slander_left {
2023-12-05 21:18:18 +08:00
2023-12-05 18:51:43 +08:00
}
.pull_DownTow{
width: 150rpx;
position: absolute;
bottom: -133rpx;
left: 50%;
margin-left: -72rpx;
box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(0,0,0,0.25);
border-radius: 20rpx 20rpx 20rpx 20rpx;
background: #FFFFFF;
border-bottom: 2rpx solid #F2F2F2;
text-align: center;
view {
padding: 15rpx 0rpx;
border-bottom: 2rpx solid #F2F2F2;
}
}
.pull_Down {
position: absolute;
bottom: -130rpx;
left: 50%;
margin-left: -79rpx;
box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(0,0,0,0.25);
border-radius: 20rpx 20rpx 20rpx 20rpx;
background: #FFFFFF;
border-bottom: 2rpx solid #F2F2F2;
view {
padding: 15rpx 50rpx;
border-bottom: 2rpx solid #F2F2F2;
}
}
.pull_Down view:last-child {
border: none;
}
.pd_icon {
margin-left: 8rpx;
2023-12-05 21:18:18 +08:00
}
.header_part{
display: flex;
align-items: center;
margin: 26rpx 0rpx;
}
.slander_an{
padding: 6rpx 18rpx;
background: #fff;
border-radius: 12rpx 12rpx 12rpx 12rpx;
margin-left: 12rpx;
color: #65748C;
}
.blue {
background: rgba(45,124,230,0.1);
color: #2D7CE6;
2023-12-05 18:51:43 +08:00
}
</style>