123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- <template>
- <view>
- <navigator class="list-item" url="#" v-for="(item, index) in list " hover-class="navigator-hover"
- :key="item.sat_coursewareid" @click="onClick(index)">
- <view style="position: relative;">
- <image class="image" :src="item.cover" mode="aspectFill" lazy-load="true" />
- <block v-if="showStatus">
- <view v-if="item.status == '发布'" class="status" style="background: #FFF0F2;color: #E3041F;">
- 已审核
- </view>
- <view v-else class="status">
- 未审核
- </view>
- </block>
- <view class="createby-box">
- <image class="headpic"
- :src="item.headpic || 'https://yossys06593.obs.cn-east-3.myhuaweicloud.com:443/202406011717209838416B6150695f.webp'"
- mode="aspectFill" lazy-load="true" />
- <view class="name u-line-1">{{ item.createby }}</view>
- </view>
- </view>
- <view class="tips">
- <view class="label u-line-1">{{ item.title_c || item.title }}</view>
- <view class="iconfont-box">
- <text class="iconfont icon-pinglun-hui">
- <text style="padding-left: 2px;" />{{ item.commentcount }}
- </text>
- <text class="iconfont icon-yidianzan">
- <text style="padding-left: 2px;" />{{ item.likecount }}
- </text>
- <text class="iconfont icon-yishoucang">
- <text style="padding-left: 2px;" />{{ item.collectcount }}
- </text>
- </view>
- </view>
- </navigator>
- </view>
- </template>
- <script>
- import { formattedFiles } from "../utils/settleFiles"
- export default {
- props: {
- list: {
- type: Array,
- },
- toDetail: {
- type: Function
- },
- showStatus: {
- type: Boolean
- }
- },
- methods: {
- handleList(list) {
- return list.map(v => {
- v.attinfos = formattedFiles(v.attinfos);
- v.cover = v.attinfos.length ? this.getSpecifiedImage(v.attinfos.find(s => s.usetype == "sat_sharematerial" && s.fileType == 'image') || v.attinfos.find(s => s.fileType == 'image')) : uni.getStorageSync("site").logo || ''
- return v
- })
- },
- onClick(index) {
- this.$emit("toDetail", index)
- }
- },
- }
- </script>
- <style lang="scss" scoped>
- .list-item {
- width: 355px;
- margin: 0 auto 20px;
- border-radius: 5px;
- overflow: hidden;
- .image {
- position: relative;
- width: 355px;
- height: 240px;
- border-radius: 5px;
- overflow: hidden;
- }
- .status {
- position: absolute;
- top: 10px;
- right: 0;
- display: flex;
- align-items: center;
- justify-content: center;
- width: 56px;
- height: 24px;
- background: #E3041F;
- border-radius: 12px 0px 0px 12px;
- font-family: Source Han Sans SC, Source Han Sans SC;
- font-size: 12px;
- color: #FFFFFF;
- }
- .createby-box {
- position: absolute;
- display: flex;
- height: 24px;
- line-height: 24px;
- background: rgba($color: #333333, $alpha: 0.8);
- border-radius: 12px;
- bottom: 10px;
- left: 10px;
- padding-right: 10px;
- .headpic {
- width: 24px;
- height: 24px;
- border-radius: 50%;
- margin-left: -1px;
- }
- .name {
- font-family: Source Han Sans SC, Source Han Sans SC;
- font-size: 12px;
- color: #FFFFFF;
- margin-left: 5px;
- max-width: 200px;
- }
- }
- .tips {
- display: flex;
- height: 20px;
- line-height: 20px;
- justify-content: space-between;
- .title {
- flex: 1;
- font-family: PingFang SC, PingFang SC;
- font-size: 14px;
- color: #333333;
- margin-top: 10px;
- margin-bottom: 20px;
- }
- .iconfont-box {
- .iconfont {
- font-family: Source Han Sans SC, Source Han Sans SC;
- font-size: 12px;
- color: #999999;
- margin-right: 15px;
- }
- .iconfont:last-child {
- margin-right: 0;
- }
- }
- }
- }
- </style>
|