智慧保安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
<template>
    <view class="container">
        <view class="service-box">
            <u-grid :col="3" :border="false">
                <u-grid-item bg-color="transparent" v-for="(item, index) in serviceButton" :key="index"
                    @click="goBusinessPage(item.url,index)">
                    <view class="service-item">
                        <image :src="item.img" mode="widthFix" class="img"></image>
                        <view class="name">{{ item.name }}</view>
                    </view>
                </u-grid-item>
            </u-grid>
        </view>
    </view>
</template>
 
<script>
    import {
        fakeServiceButton
    } from "@/api/mock/dispatch.js";
 
    export default {
        data() {
            return {
                dataList: [],
                serviceButton: []
            };
        },
        onLoad() {
 
        },
        onReachBottom() {
 
        },
        mounted() {},
        methods: {
            onLoad() {
                if (this.$store.state.UserData.rname[0] == '保安') {
 
                    this.serviceButton = [{
                        name: '接收指令查询',
                        img: '/static/images/dispatch/look.png',
                        url: '../dispatch/receive'
                    }]
 
                } else if (this.$store.state.UserData.rname[0] == '保安公司管理员') {
 
                    this.serviceButton = [{
                        name: '接收指令查询',
                        img: '/static/images/dispatch/look.png',
                        url: '../dispatch/receive'
                    }]
 
                } else {
                    this.serviceButton = [{
                            name: '下发指令查询',
                            img: '/static/images/dispatch/up-down.png',
                            url: '../dispatch/send'
                        },
                        {
                            name: '文字指令下发',
                            img: '/static/images/dispatch/issue.png',
                            url: '../dispatch/text'
                        },
                        {
                            name: '图片指令下发',
                            img: '/static/images/dispatch/imgissue.png',
                            url: '../dispatch/imgissue'
                        }
                    ]
                }
                // 加载服务按钮数据
                // fakeServiceButton().then(data => {
                //     this.serviceButton = data;
                // });
            },
            //页面跳转
            goBusinessPage(url, index) {
                uni.navigateTo({
                    url: url
                })
            },
        }
    };
</script>
 
 
<style lang="scss">
    .container {
        background-color: #f7f7f7;
        min-height: 100vh;
        overflow: hidden;
    }
 
    .service-box {
        background: #ffffff;
        border-radius: 20px 20px 20px 20px;
        margin: 30rpx 20rpx 0;
        padding: 0rpx 20rpx;
 
        .service-item {
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            align-items: center;
            width: 100%;
            height: 120rpx;
            font-size: 26rpx;
            font-family: PingFang SC;
            font-weight: 500;
            color: #585b61;
 
            .img {
                width: 70rpx;
                height: auto;
            }
        }
    }
</style>