123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- <template>
- <view class="trace-container">
- <!--我的收藏-->
- <view class="collect-container">
- <view class="header main-between cross-center" @click="$u.route('/pages/trace/collect')">
- <text>我的收藏</text>
- <view class="more main-left cross-center">查看全部
- <u-icon name="arrow-right" />
- </view>
- </view>
- <!--剧集-->
- <view class="content main-left cross-center">
- <episode
- v-for="(item,index) in collect"
- :key="index"
- :episode="item.episode"
- :custom-style="{
- marginRight: ((index+1) % 4 !== 0 ? '10rpx' :''),
- width: ((710 - 60) / 4 )+'rpx' // 60为间隔 710为 collect-container宽度
- }"
- :image-style="{
- height: '200rpx'
- }"
- />
- </view>
- </view>
- <!--其他剧集-->
- <view class="title">其他剧集</view>
- <view
- v-for="(item,index) in category"
- :key="index"
- class="category main-left"
- >
- <view class="name">{{ item.name }}</view>
- <view class="episode-box dir-left-wrap">
- <episode
- v-for="(episode,episodeIndex) in item.episodes"
- :key="episodeIndex"
- :episode="episode"
- :custom-style="{
- marginRight: ((episodeIndex + 1) % 3 !== 0 ? '10rpx' :''),
- width: ((700 - 80) / 3 )+'rpx'
- }"
- :image-style="{
- height: '280rpx'
- }"
- />
- </view>
- </view>
- <!--tab bar-->
- <tab-bar />
- </view>
- </template>
- <script>
- import Episode from '../../components/Episode/index'
- import TabBar from '../../components/TabBar/index'
- export default {
- name: 'Trace',
- components: { TabBar, Episode },
- data() {
- return {
- collect: [],
- category: []
- }
- },
- computed: {},
- methods: {
- getCollect() {
- this.$api.user.collect.record({ limit: 4 }).then(res => {
- this.collect = res.data
- })
- },
- getTrace() {
- this.$loading()
- this.$api.episode.trace().then(res => {
- this.$hideLoading()
- this.category = res.data
- })
- }
- },
- onLoad() {
- this.getCollect()
- this.getTrace()
- },
- onShow() {
- this.getCollect()
- }
- }
- </script>
- <style lang="scss" scoped>
- .trace-container {
- padding: 20rpx 0 120rpx;
- font-size: 30rpx;
- color: $default-color;
- .status-box{
- margin-top: 10rpx;
- color: $info-color;
- font-size: 28rpx;
- .status{
- color: $primary-color;
- margin-right: 14rpx;
- }
- }
- .collect-container{
- background: #1B203C;
- border-radius: 30rpx;
- padding: 20rpx;
- width: 710rpx;
- margin: 0 auto;
- .header{
- text{
- color: $primary-color;
- font-size: 38rpx;
- font-weight: 800;
- }
- .more{
- color: $info-color;
- }
- }
- .content{
- margin-top: 20rpx;
- min-height: 200rpx;
- .collect-item{
- .cover-image{
- image{
- width: 200rpx;
- height: 280rpx;
- }
- }
- .name{
- margin-top: 10rpx;
- }
- }
- }
- }
- .title{
- color: $primary-color;
- font-size: 38rpx;
- font-weight: 800;
- padding: 0 20rpx;
- margin: 40rpx 0 30rpx;
- }
- .category{
- margin-bottom: 30rpx;
- .name{
- background: #284150;
- writing-mode: vertical-lr;
- padding: 0 20rpx;
- border-top-right-radius: 30rpx;
- border-bottom-right-radius: 30rpx;
- text-align: center;
- min-height: 400rpx;
- }
- .episode-box{
- margin-left: 20rpx;
- }
- }
- }
- </style>
|