Commit e4daab1b authored by Facius's avatar Facius Committed by Damon

style:题库选择页面样式修改

parent 0c581937
<template>
<view class="select-category">
<u-navbar
back-icon-color="#333333"
background="transparent"
title="选择题库"
titleColor="#191C27"
:border-bottom="false"
title-bold
></u-navbar>
<!-- 类别 -->
<view>
<view class="category-view">
<text>{{ category.name}}</text>
</view>
</view>
<view class="label-title">
<view>题库列表</view>
</view>
<view class="add-exam-content">
<view class="label-content">
<view v-for="(label, index) in list" :key="index" class="label-item">
<!-- 选中为蓝底,非选中状态为白底 -->
<view class="label-normal">
<view>{{ label.name }}</view>
<view class="label-text">
共
<text class="label-blue">{{label.quantity}}</text>道精编试题,通过率
<text class="label-blue">{{ label.pass }}</text>
</view>
</view>
<u-button :customStyle="buttonStyle" @click="handleClick(index)">
<u-icon name="plus"></u-icon>添加
</u-button>
</view>
</view>
<!-- 标签加载中 -->
<view class="tag-loading-view" v-if="loading">
<u-loading mode="flower"></u-loading>
</view>
<!-- 无供应商、无品牌 -->
<view class="tag-loading-view" v-else-if="list.length <= 0">暂无数据</view>
</view>
</view>
</template>
<script>
import uButton from '../../uview-ui/components/u-button/u-button.vue'
import UIcon from '../../uview-ui/components/u-icon/u-icon.vue'
export default {
components: { uButton, UIcon },
data() {
return {
category: {},
list: [], // 题库列表
loading: true,
}
},
computed: {
buttonStyle() {
return {
width: '120rpx',
height: '64rpx',
backgroundColor: '#2953FF',
color: '#FFFFFF',
fontSize: '26rpx',
borderRadius: '12rpx',
}
},
},
onLoad(e) {
if (e && e.name) {
this.category.name = decodeURIComponent(e.name)
}
if (e && e.id) {
this.category.id = e.id
}
this.loadList() // 获取题库列表
},
methods: {
// 点击了添加按钮
handleClick(index) {
this.selected[key] = label
},
// 获取题库列表
loadList() {
// async loadList() {
// this.loading = true;
// let res = await this.$u.api.fileLabel({categoryId: this.category.id});
// this.loading = false
// if (res && res.code == 200) {
// this.list = res.data || [];
for (var i = 0; i < 10; i++) {
// 测试模拟多条数据
this.list.push({
name: '登高架设作业',
quantity: '80000',
pass: '98%',
})
}
// }
},
},
}
</script>
<style lang="scss" scoped>
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
display: none;
}
.select-category {
height: 100vh;
display: flex;
flex-direction: column;
background-color: #f8fafd;
background-image: linear-gradient(to top, #f8fafd 0%, #e9f3ff 50%);
background-size: 100% 520rpx;
background-repeat: no-repeat;
padding: 0 24rpx 0rpx 24rpx;
.category-view {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
border-radius: 12rpx;
font-size: 36rpx;
font-weight: bold;
background-color: #ffffff;
color: #2953ff;
height: 160rpx;
padding: 0 60rpx;
}
.label-title {
font-size: 32rpx;
font-weight: bold;
color: #9ea5bb;
margin-bottom: 30rpx;
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 40rpx;
}
.add-exam-content {
height: 100%;
overflow: auto;
.label-content {
margin-bottom: 44rpx;
.label-item {
padding: 40rpx 24rpx 40rpx 30rpx;
background-color: #ffffff;
border-radius: 12rpx;
margin-bottom: 24rpx;
display: flex;
justify-content: space-between;
align-items: center;
.label-normal {
width: 470rpx;
font-size: 36rpx;
color: #191c27;
font-weight: bold;
word-break: break-all;
.label-text {
margin-top: 24rpx;
font-size: 26rpx;
color: #5a6073;
.label-blue {
color: #2953ff;
}
}
}
}
}
}
.tag-loading-view {
display: flex;
align-items: center;
justify-content: center;
margin-top: 400rpx;
color: #999999;
text-align: center;
position: absolute;
width: 100%;
padding-right: 11rpx;
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment