智慧保安APP验收版本
zengh
2021-12-06 886a9f2deb311453f12cb0302bcb882a9d331d7a
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<template>
    <view class="container">
        <view class="head">
            <u-navbar :is-fixed="false" :border-bottom="false" :is-back="true" back-icon-name="arrow-leftward"
                back-icon-color="#fff" back-icon-size="35" :background="{ background: '#0BB9C8' }" title="服务"
                title-color="#fff"></u-navbar>
            <view class="head-bg"></view>
            <!-- 我的订阅 start -->
            <view class="card sub">
                <view class="title">我的订阅</view>
                <view class="list">
                    <u-grid :col="4" :border="false">
                        <u-grid-item bg-color="transparent" v-for="(item, index) in subscribeList" :key="index">
                            <navigator url="" hover-class="none" class="nav-item">
                                <image :src="item.img" mode="widthFix" class="nav-item-img"></image>
                                <view class="nav-item-name">{{ item.name }}</view>
                            </navigator>
                        </u-grid-item>
                    </u-grid>
                </view>
            </view>
            <!-- 我的订阅 end -->
 
            <!-- 服务列表 start -->
            <view class="card wrap" v-for="(item, index) in serviceList" :key="index">
                <view class="title">{{item.name}}</view>
                <view class="list">
                    <u-grid :col="4" :border="false">
                        <u-grid-item bg-color="transparent" v-for="(_item, _index) in item.list" :key="_index">
                            <navigator url="" hover-class="none" class="nav-item">
                                <image :src="_item.img" mode="widthFix" class="nav-item-img"></image>
                                <view class="nav-item-name">{{ _item.name }}</view>
                            </navigator>
                        </u-grid-item>
                    </u-grid>
                </view>
            </view>
            <!-- 服务列表 end -->
 
        </view>
    </view>
</template>
 
<script>
    import {
        fakeSubscribeList,
        fakeServiceList,
    } from "@/api/mock/service.js";
    export default {
        data() {
            return {
                // 我的订阅
                subscribeList: [],
                // 服务列表
                serviceList: [],
            };
        },
        onLoad() {
            // 后续将改为与后端联动
            // 加载我的订阅数据
            fakeSubscribeList().then(data => {
                this.subscribeList = data;
            })
            // 加载服务集合数据
            fakeServiceList().then(data => {
                this.serviceList = data;
            })
        }
    };
</script>
 
<style lang="scss">
    .container {
        background-color: #f7f7f7;
        min-height: 100vh;
        overflow: hidden;
    }
 
    .head {
        position: relative;
        top: 0;
        left: 0;
        z-index: 1;
    }
 
    .head-bg {
        position: absolute;
        left: 0px;
        top: 0px;
        z-index: -1;
        width: 750rpx;
        height: 270rpx;
        background: #0bb9c8;
    }
 
    .card {
        margin: 30rpx;
        background: #ffffff;
        border-radius: 20rpx;
        margin-top: 36rpx;
    }
 
    .sub {
        .title {
            padding-top: 36rpx;
            display: flex;
            justify-content: center;
            align-items: center;
 
            font-size: 30rpx;
            font-family: Source Han Sans CN;
            font-weight: 500;
            color: #000000;
 
            &::before {
                content: '';
                display: block;
                width: 135rpx;
                height: 1rpx;
                background: #e4e7ed;
                margin: 0 17rpx;
            }
 
            &::after {
                content: '';
                display: block;
                width: 135rpx;
                height: 1rpx;
                background: #e4e7ed;
                margin: 0 17rpx;
            }
        }
    }
 
    .list {
        display: flex;
        flex-wrap: wrap;
        padding: 0 0 30rpx;
 
        .nav-item {
            width: 100%;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            align-items: center;
            font-size: 30rpx;
            font-family: Source Han Sans CN;
            font-weight: 400;
            color: #131313;
            line-height: 48rpx;
            opacity: 0.77;
 
            &-img {
                width: 54rpx;
                height: 54rpx;
                margin-bottom: 30rpx;
            }
 
            &-name {
                font-size: 26rpx;
                font-family: PingFang SC;
                font-weight: 400;
                color: #585b61;
            }
        }
    }
 
    .wrap {
        .title {
            padding: 36rpx 16rpx;
            display: flex;
            align-items: center;
            font-size: 32rpx;
            font-family: Source Han Sans CN;
            font-weight: 500;
            color: #000000;
 
            &::before {
                content: "";
                display: block;
                width: 5rpx;
                height: 36rpx;
                margin-right: 10rpx;
                background: #3ac4d1;
            }
        }
    }
</style>