MrShi
6 天以前 97158794d69fd2beee1bf27577aa7cadea8d847d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<template>
    <view class="box">
        <view class="cate">
            <u-tabs :list="list1" :current="current" @click="clickItem" activeStyle="color: #2E68C4; font-weight: 600;" lineColor="#2E68C4"></u-tabs>
        </view>
        <view class="content" v-if="list1.length > 0">
            <view class="content-image" v-if="list1[current].fileList && list1[current].fileList.length > 0">
                <image :src="item.url" mode="widthFix" v-for="(item, index) in list1[current].fileList" :key="index"></image>
            </view>
            <image class="wu" src="/static/default_noranking@2x.png" mode="widthFix" v-else></image>
        </view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                list1: [],
                current: 0
            };
        },
        onLoad() {
            this.getAll()
        },
        methods: {
            getAll() {
                this.$u.api.categoryList({ type: 1, rank: 1 })
                    .then(res => {
                        if (res.code === 200) {
                            res.data.active = false
                            this.list1 = res.data
                        }
                    })
            },
            clickItem(e) {
                this.current = e.index
            }
        }
    }
</script>
 
<style>
    page {
        background-color: #f7f7f7;
    }
</style>
<style lang="scss" scoped>
    .box {
        width: 100%;
        .content {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            .content-image {
                width: 100%;
                display: flex;
                flex-direction: column;
                image {
                    width: 100%;
                }
            }
            .wu {
                width: 200rpx;
                height: 200rpx;
                margin-top: 200rpx;
            }
        }
        .cate {
            width: 100%;
            height: 88rpx;
            background: #FFFFFF;
            position: sticky;
            top: 0;
            left: 0;
            z-index: 9;
        }
    }
</style>