智慧保安互联网APP
liuyg
2021-07-27 512923b6a441ce39898d793b55a24df581e35ca8
Merge branch 'master' of http://192.168.0.105:10010/r/zhba_app
7 files modified
7 files added
396 ■■■■■ changed files
api/mock/home.js 2 ●●● patch | view | raw | blame | history
api/mock/report.js 23 ●●●●● patch | view | raw | blame | history
package.json 1 ●●●● patch | view | raw | blame | history
pages.json 34 ●●●●● patch | view | raw | blame | history
pages/home/home.vue 1 ●●●● patch | view | raw | blame | history
pages/login/login-account.vue 1 ●●●● patch | view | raw | blame | history
pages/report/receive.vue 89 ●●●●● patch | view | raw | blame | history
pages/report/receiveDetail.vue 66 ●●●●● patch | view | raw | blame | history
pages/report/report.vue 86 ●●●●● patch | view | raw | blame | history
pages/report/send.vue 89 ●●●●● patch | view | raw | blame | history
static/images/report/receive.png patch | view | raw | blame | history
static/images/report/start.png patch | view | raw | blame | history
store/actions.js 2 ●●● patch | view | raw | blame | history
store/index.js 2 ●●● patch | view | raw | blame | history
api/mock/home.js
@@ -115,7 +115,7 @@
                {
                    name: '工作汇报',
                    img: '/static/images/home/report001.png',
                    url: ''
                    url: '../report/report'
                },
                {
                    name: '调度指令',
api/mock/report.js
New file
@@ -0,0 +1,23 @@
// 获取服务按钮数据
export function fakeServiceButton() {
    return new Promise((resolute, reject) => {
        try {
            const list = [{
                    name: '发送汇报',
                    img: '/static/images/report/start.png',
                    url: '../report/send'
                },
                {
                    name: '接受汇报',
                    img: '/static/images/report/receive.png',
                    url: '../report/receive'
                }
            ];
            resolute(list);
        } catch (e) {
            //模拟接口请求失败
            reject(e);
        }
    })
}
package.json
@@ -4,6 +4,7 @@
    "axios": "^0.21.1",
    "js-md5": "^0.7.3",
    "uni-read-pages": "^1.0.5",
    "uni-simple-router": "^2.0.6",
    "uview-ui": "^1.8.4"
  },
  "name": "qfqk-android",
pages.json
@@ -2,7 +2,7 @@
    "easycom": {
        "^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
    },
    "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
    "pages": [
        {
            "path": "pages/login/login-account",
            "style": {
@@ -85,6 +85,38 @@
                "navigationBarTextStyle": "white"
            }
        }, {
            "path": "pages/report/report",
            "style": {
                "navigationBarTitleText": "工作汇报",
                "enablePullDownRefresh": false,
                "navigationBarBackgroundColor": "#0BB9C8",
                "navigationBarTextStyle": "white"
            }
        }, {
            "path": "pages/report/send",
            "style": {
                "navigationBarTitleText": "发送汇报",
                "enablePullDownRefresh": false,
                "navigationBarBackgroundColor": "#0BB9C8",
                "navigationBarTextStyle": "white"
            }
        }, {
            "path": "pages/report/receive",
            "style": {
                "navigationBarTitleText": "接收汇报",
                "enablePullDownRefresh": false,
                "navigationBarBackgroundColor": "#0BB9C8",
                "navigationBarTextStyle": "white"
            }
        }, {
            "path": "pages/report/receiveDetail",
            "style": {
                "navigationBarTitleText": "接收汇报详情",
                "enablePullDownRefresh": false,
                "navigationBarBackgroundColor": "#0BB9C8",
                "navigationBarTextStyle": "white"
            }
        }, {
            "path": "pages/user/profile",
            "style": {
                "navigationBarTitleText": "个人资料",
pages/home/home.vue
@@ -180,6 +180,7 @@
            },
            //页面跳转
            goBusinessPage(url,index){
                console.log(url)
                uni.navigateTo({
                    url:url
                })
pages/login/login-account.vue
@@ -138,7 +138,6 @@
                this.judgeMsg();
            },
            OURpass() {
                debugger
                if (this.OURpass == true) {
                    // this.passwords = '******';
                    uni.hideNavigationBarLoading();
pages/report/receive.vue
New file
@@ -0,0 +1,89 @@
<template>
    <view class="container">
        <u-search shape="square" class="u-search" input-align="center" height="70"></u-search>
        <view class="inTmain" v-for="(item,index) in dataList">
            <u-card :title="item.deptName" @click="goDetail(item)">
                    <view class="" slot="body">
                        <view>
                            <view style="margin-bottom: 10px;" class="u-body-item-title u-line-2">汇报人:{{item.realName}}</view>
                        </view>
                        <view>
                            <view class="u-body-item-title u-line-2">汇报类型:{{item.type == 1 ? '日报' : item.type == 2 ? '周报' : '月报' }}</view>
                        </view>
                    </view>
                    <view class="" slot="foot"></u-icon>汇报时间:{{item.reportTime}}</view>
            </u-card>
        </view>
    </view>
</template>
<script>
    export default {
        data() {
            return {
                dataList:[]
            };
        },
        onLoad() {
        },
        onReachBottom() {
        },
        mounted() {
            this.getCompany();
        },
        methods: {
            getCompany(){
                var that = this;
                uni.request({
                    url: this.$store.state.piAPI + "/workReport/pageReply",
                    method:"get",
                    data:{
                    },
                    success:(res)=> {
                        var resdata = res.data.data.records;
                        that.dataList = resdata;
                    }
                });
            },
            goDetail(item){
                uni.navigateTo({
                    url: './receiveDetail?detailData=' + JSON.stringify(item)
                });
            }
        }
    };
</script>
<style lang="scss">
    .u-card-wrap {
            background-color: $u-bg-color;
            padding: 1px;
        }
    .u-body-item {
        font-size: 32rpx;
        color: #333;
        padding: 20rpx 10rpx;
    }
    .u-body-item image {
        width: 120rpx;
        flex: 0 0 120rpx;
        height: 120rpx;
        border-radius: 8rpx;
        margin-left: 12rpx;
    }
    .u-search {
        padding: 20rpx 30rpx 0 30rpx;
    }
    .inTmain{
    }
</style>
pages/report/receiveDetail.vue
New file
@@ -0,0 +1,66 @@
<template>
    <view class="container">
        <u-form :model="detailData" ref="uForm" class="companyForm">
            <u-form-item label-position="top" label="汇报人">
                {{ detailData.realName }}
            </u-form-item>
            <u-form-item label-position="top" label="汇报人单位">
                {{ detailData.deptName }}
            </u-form-item>
            <u-form-item label-position="top" label="汇报类型">
                {{ detailData.type == 1 ? '日报' : detailData.type == 2 ? '周报' : '月报'}}
            </u-form-item>
            <u-form-item label-position="top" label="汇报内容">
                {{ detailData.content }}
            </u-form-item>
            <u-form-item label-position="top" label="回复内容">
                {{ detailData.replyContent }}
            </u-form-item>
            <u-form-item label-position="top" label="汇报时间">
                {{ detailData.reportTime }}
            </u-form-item>
            <u-form-item label-position="top" label="回复时间">
                {{ detailData.replyTime }}
            </u-form-item>
        </u-form>
    </view>
</template>
<script>
    export default {
        data() {
            return {
                list: [{
                        name: '注册信息'
                    },
                    {
                        name: '保安员管理'
                    }
                ],
                current: 0,
                detailData: {},
            };
        },
        onLoad(event) {
            var that = this;
            this.detailData = JSON.parse(decodeURIComponent(event.detailData));
            console.log(this.detailData)
        },
        onReachBottom() {
        },
        mounted() {
        },
        methods: {
        }
    };
</script>
<style lang="scss">
    .companyForm {
        padding: 0 30rpx;
    }
</style>
pages/report/report.vue
New file
@@ -0,0 +1,86 @@
<template>
    <view class="container">
        <view class="service-box">
            <u-grid :col="4" :border="false">
                <u-grid-item bg-color="transparent" v-for="(item, index) in serviceButton" :key="index" @click="goBusinessPage(item.url,index)">
                    <navigator url="" hover-class="none" class="service-item">
                        <image :src="item.img" mode="widthFix" class="img"></image>
                        <view class="name">{{ item.name }}</view>
                    </navigator>
                </u-grid-item>
            </u-grid>
        </view>
    </view>
</template>
<script>
    import {
        fakeServiceButton
    } from "@/api/mock/report.js";
    export default {
        data() {
            return {
                dataList:[],
                serviceButton: []
            };
        },
        onLoad() {
        },
        onReachBottom() {
        },
        mounted() {
        },
        methods: {
            onLoad() {
                // 加载服务按钮数据
                fakeServiceButton().then(data => {
                    this.serviceButton = data;
                });
            },
            //页面跳转
            goBusinessPage(url,index){
                console.log(url)
                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>
pages/report/send.vue
New file
@@ -0,0 +1,89 @@
<template>
    <view class="container">
        <u-search shape="square" class="u-search" input-align="center" height="70"></u-search>
        <view class="inTmain" v-for="(item,index) in dataList">
            <u-card :title="item.enterprisename" @click="goDetail(item)">
                    <view class="" slot="body">
                        <view>
                            <view style="margin-bottom: 10px;" class="u-body-item-title u-line-2">公司地址:{{item.address}}</view>
                        </view>
                        <view>
                            <view class="u-body-item-title u-line-2">经营范围:{{item.business}}</view>
                        </view>
                    </view>
                    <view class="" slot="foot"></u-icon>法定代表人:{{item.representative}}</view>
            </u-card>
        </view>
    </view>
</template>
<script>
    export default {
        data() {
            return {
                dataList:[]
            };
        },
        onLoad() {
        },
        onReachBottom() {
        },
        mounted() {
            this.getCompany();
        },
        methods: {
            getCompany(){
                var that = this;
                uni.request({
                    url: this.$store.state.piAPI + "/information/page",
                    method:"get",
                    data:{
                    },
                    success:(res)=> {
                        var resdata = res.data.data.records;
                        that.dataList = resdata;
                    }
                });
            },
            goDetail(item){
                uni.navigateTo({
                    url: './companyDetail?detailData=' + JSON.stringify(item)
                });
            }
        }
    };
</script>
<style lang="scss">
    .u-card-wrap {
            background-color: $u-bg-color;
            padding: 1px;
        }
    .u-body-item {
        font-size: 32rpx;
        color: #333;
        padding: 20rpx 10rpx;
    }
    .u-body-item image {
        width: 120rpx;
        flex: 0 0 120rpx;
        height: 120rpx;
        border-radius: 8rpx;
        margin-left: 12rpx;
    }
    .u-search {
        padding: 20rpx 30rpx 0 30rpx;
    }
    .inTmain{
    }
</style>
static/images/report/receive.png
static/images/report/start.png
store/actions.js
@@ -16,7 +16,7 @@
                },
            ],
            pasw = md5(data.pass),
            url = 'http://192.168.0.105:80/api/blade-auth/oauth/token?tenantId=963841&username=' + data.name +
            url = 'http://192.168.0.108:81/blade-auth/oauth/token?tenantId=000000&username=' + data.name +
            ' &password=' + pasw + '&grant_type=password&scope=all&type=account';
        // url ='http://192.168.0.109:82/blade-auth/oauth/token';
        // url ='http://192.168.0.109:82/blade-auth/oauth/token?tenantId=000000&username=admin&password=93369e86dc5fa854a0eaf75558c4039d&grant_type=password';
store/index.js
@@ -48,7 +48,7 @@
            useName: '过客 ',
        },
        logPath: '',
        piAPI: 'http://192.168.0.104',
        piAPI: 'http://192.168.0.108:81',
        // piAPI: 'http://localhost:82/',
        puserName: '',
        puserID: '',