123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- <template>
- <view class="episode" :style="[customStyle]" @click="handlePlay">
- <view class="cover-image" :style="[imageStyle]">
- <view v-if="rank" class="rank" :class="{first: rank === 1}">
- <text>{{ rank }}</text>
- </view>
- <image :src="episode.cover_img" mode="aspectFill" :style="[imageStyle]" />
- <view v-if="recent" class="special">最近播放 </view>
- <view v-if="guess" class="special guess">猜你喜欢 </view>
- </view>
- <u-text
- :text="episode.name"
- :lines="1"
- size="32rpx"
- margin="20rpx 0 10rpx"
- :color="$colors.defaultColor"
- />
- <view class="status-box dir-left-nowrap">
- <u-text
- :text="episode.status_text"
- :lines="1"
- size="24rpx"
- :custom-style="{flex: 'unset'}"
- :color="$colors.primaryColor"
- />
- <u-text
- :text="`共${episode.total}集`"
- :lines="1"
- size="24rpx"
- margin="0 0 0 10rpx"
- :color="$colors.infoColor"
- />
- </view>
- </view></template>
- <script>
- import UText from '../../uni_modules/uview-ui/components/u--text/u--text'
- export default {
- name: 'Episode',
- components: { UText },
- props: {
- episode: {
- type: Object,
- required: true
- },
- customStyle: {
- type: Object,
- default() {
- return {}
- }
- },
- imageStyle: {
- type: Object,
- default() {
- return {}
- }
- },
- recent: {
- type: Boolean,
- default: false
- },
- guess: {
- type: Boolean,
- default: false
- },
- rank: {
- type: Number,
- default: 0
- },
- redirect: {
- type: Boolean,
- default: true
- }
- },
- data() {
- return {}
- },
- computed: {},
- methods: {
- handlePlay() {
- if (!this.redirect) return
- this.$u.route({
- url: '/pages/episode/play',
- params: {
- id: this.episode.id
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .episode {
- width: calc((#{750rpx} - #{80rpx}) / 3);
- margin-bottom: 30rpx;
- .cover-image{
- position: relative;
- overflow: hidden;
- height: 330rpx;
- image{
- width: 100%;
- height: inherit;
- }
- .special{
- background: rgba(48, 98, 97, 0.65);
- text-align: center;
- color: #fff;
- padding: 10rpx 0;
- position: absolute;
- bottom: 0;
- width: 100%;
- font-size: 26rpx;
- &.guess{
- background: rgba(124, 78, 112, 0.65);
- }
- }
- .rank{
- position: absolute;
- top: -35rpx;
- left: -35rpx;
- width: 70rpx;
- height: 70rpx;
- transform: rotate(45deg);
- background: rgba(251, 54, 81, 0.6);
- color: #fff;
- font-size: 26rpx;
- z-index: 99;
- &.first{
- background: #FE3552;
- }
- text{
- position: absolute;
- right: 5px;
- top: 10px;
- transform: rotate(-45deg);
- }
- }
- }
- .status-box{
- }
- }
- </style>
|