123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- <template>
- <div class="keep-group">
- <div class="flex-r-c">
- <div class="title-group flex-r-c center left">
- <h5>{{ title }}</h5>
- </div>
- </div>
- <div class="hot-keep-group flex-r-c wrap">
- <div class="card-item flex-r-c" v-for="item in options" :key="item.id" @click="goContent(item)">
- <div class="mini-img-group">
- <img :src="item.img" alt="">
- <i :class="'el-icon-jy-' + item.type" />
- </div>
- <div class="flex-c-c">
- <div class="flex">
- <div class="title-text van-multi-ellipsis--l2">{{item.title}}</div>
- </div>
- <div class="money-group flex-r-c center left">
- {{ item.docTags }}
- </div>
- <div class="flex-c-c info-text">
- <span v-if="item.contribution">贡献者: {{item.contribution}}</span>
- <div class="info-text-group flex-r-c center left">
- <span v-if="item.viewTimes">{{item.viewTimes}}次浏览</span>
- <span v-if="item.page">共{{item.page}}页</span>
- <span v-if="item.size">{{item.size | sizeFormatter}}</span>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- export default {
- name: 'SelectedRecommend',
- props: {
- title: {
- type: String,
- default: '精选推荐'
- },
- options: {
- type: Array,
- default: () => []
- }
- },
- data () {
- return {}
- },
- methods: {
- goContent (item) {
- this.$emit('click', item)
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .keep-group {
- margin-top: 38px;
- padding-bottom: 50px;
- @include diy-icon('iconJianYu', 24, 24);
- @include diy-icon('pdf', 24);
- @include diy-icon('word', 24);
- @include diy-icon('excel', 24);
- @include diy-icon('ppt', 24);
- .title-group {
- margin-bottom: 16px;
- h5 {
- color: #1D1D1D;
- font-family: Microsoft YaHei;
- font-size: 18px;
- font-weight: 400;
- line-height: 28px;
- letter-spacing: 0px;
- text-align: left;
- margin-right: 9px;
- }
- }
- .card-item {
- cursor: pointer;
- justify-content: flex-start;
- padding: 8px 0 12px;
- box-sizing: border-box;
- &:hover {
- .title-text {
- color: #2ABED1;
- }
- }
- .money-group {
- margin-top: 18px;
- font-size: 14px;
- line-height: 22px;
- color: #999999;
- }
- .mini-img-group {
- flex-shrink: 0;
- position: relative;
- border-radius: 4px;
- border: 1px solid #ececec;
- width: 80px;
- height: 112px;
- margin-right: 16px;
- overflow: hidden;
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: center;
- img {
- width: 100%;
- }
- i {
- position: absolute;
- right: 0;
- bottom: 0;
- }
- }
- .info-text-group {
- span {
- display: inline-block;
- &:last-child {
- &::after {
- content: unset;
- }
- }
- &::after {
- content: "|";
- padding: 0 4px;
- color: #ececec;
- }
- }
- }
- .info-text {
- font-family: Microsoft YaHei;
- font-style: normal;
- font-weight: normal;
- font-size: 14px;
- line-height: 24px;
- color: #999999;
- }
- .red-text {
- color: #FF3A20;
- font-family: Microsoft YaHei;
- font-style: normal;
- font-weight: normal;
- font-size: 18px;
- line-height: 28px;
- }
- .title-text {
- width: 183px;
- font-family: Microsoft YaHei;
- font-style: normal;
- font-weight: normal;
- font-size: 16px;
- line-height: 24px;
- color: #1D1D1D;
- word-wrap: break-word;
- }
- }
- .van-ellipsis {
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .van-multi-ellipsis--l2 {
- display: -webkit-box;
- overflow: hidden;
- text-overflow: ellipsis;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- }
- .hot-keep-group {
- .card-item {
- width: 279px;
- overflow: hidden;
- }
- }
- }
- </style>
|