liuyg
2021-07-02 3fad070b9ed1e21363f59e1959ff66f3a7b8c5f5
Merge branch 'master' of http://192.168.0.105:10010/r/qfqk-android
9 files modified
1 files added
288 ■■■■ changed files
api/mock/home.js 16 ●●●● patch | view | raw | blame | history
manifest.json 2 ●●● patch | view | raw | blame | history
pages.json 11 ●●●●● patch | view | raw | blame | history
pages/alarm_list/alarm_list.vue 1 ●●●● patch | view | raw | blame | history
pages/clockSignIn/clockSignIn.vue 71 ●●●●● patch | view | raw | blame | history
pages/groupChat/groupChat.vue 2 ●●● patch | view | raw | blame | history
pages/handle/handle.vue 91 ●●●●● patch | view | raw | blame | history
pages/home/home.vue 92 ●●●● patch | view | raw | blame | history
pages/patrol/patrol.vue 1 ●●●● patch | view | raw | blame | history
store/state.js 1 ●●●● patch | view | raw | blame | history
api/mock/home.js
@@ -60,7 +60,7 @@
    })
}
// 获取顶部按钮数据
// 获取业务按钮数据
export function fakeNavButton() {
    return new Promise((resolute, reject) => {
        try {
@@ -103,39 +103,39 @@
    })
}
// 获取服务按钮数据
// 获取业务按钮数据
export function fakeServiceButton() {
    return new Promise((resolute, reject) => {
        try {
            const list = [{
                    name: '我要看',
                    img: '/static/images/home/s1.png',
                    url: ''
                    url: '../article/article'
                },
                {
                    name: '我要查',
                    img: '/static/images/home/search004.png',
                    url: ''
                    url: '../alarm_list/alarm_list'
                },
                {
                    name: '我要报',
                    img: '/static/images/home/report001.png',
                    url: ''
                    url: '../reported/reported'
                },
                {
                    name: '我要说',
                    img: '/static/images/home/s4.png',
                    url: ''
                    url: '../groupChat/groupChat'
                },
                {
                    name: '我要巡',
                    img: '/static/images/home/s6.png',
                    url: ''
                    url: '../patrol/patrol'
                },
                {
                    name: '我要办',
                    img: '/static/images/home/handle001.png',
                    url: ''
                    url: '../handle/handle'
                }
            ];
            resolute(list);
manifest.json
@@ -1,6 +1,6 @@
{
    "name" : "群防群控",
    "appid" : "__UNI__1A57486",
    "appid" : "__UNI__88EDF2B",
    "description" : "",
    "versionName" : "1.0.0",
    "versionCode" : "100",
pages.json
@@ -125,10 +125,7 @@
            "path": "pages/groupChat/groupChat",
            "name": "groupChat",
            "style": {
                "navigationBarTitleText": "聊天室",
                "app-plus":{
                    "titleNView":false
                }
                "navigationBarTitleText": "聊天室"
            }
        },
        {
@@ -233,6 +230,12 @@
            }
        },
        {
            "path": "pages/handle/handle",
            "style": {
                "navigationBarTitleText": "我要办"
            }
        },
        {
            "path": "pages/alarm_list/alarm_list",
            "name": "alarm_list",
            "style": {
pages/alarm_list/alarm_list.vue
@@ -195,7 +195,6 @@
                            "content-type": "application/x-www-form-urlencoded"
                        },
                        success(res) {
                            console.log(res, 123);
                            if (res.data.code == 200) {
                                that.data = res.data.data.page;
                                that.totalNumber = res.data.data.number[0];
pages/clockSignIn/clockSignIn.vue
@@ -24,7 +24,7 @@
                        <view class="btn1">
                            <view class="btn0">
                                <view class="btn">
                                    <view class="btn-title">打卡</view>
                                    <view class="btn-title" @click="goClock()">打卡</view>
                                    <view class="btn-time">{{nowTime}}</view>
                                </view>
                            </view>
@@ -47,7 +47,11 @@
        data() {
            return {
                urls: '',
                nowTime:''
                nowTime:'',
                name:'',
                jd:'',
                wd:'',
                address:''
            }
        },
        mounted() {
@@ -59,6 +63,8 @@
            }, 1000);
        },
        onLoad: function(options) {
            //获取个人信息
            this.getOneselfInFo();
            //long 转换为字符串
            var code = JSON.stringify(this.$store.state.puserID.toString());
            this.urls = "http://s16s652780.51mypc.cn/xcxjingqingmap_clock_sign_in/xcxmap.html?snumber="+code;
@@ -66,20 +72,71 @@
        methods: {
            //获取当前位置信息
            getNowPosition(){
                var that = this;
                uni.getLocation({
                    type: 'wgs84',
                    geocode:'true',
                    success: function (res) {
                        debugger;
                        // debugger;
                        console.log('当前位置:' + res);
                        console.log('当前位置的经度:' + res.longitude);
                        console.log('当前位置的纬度:' + res.latitude);
                        that.jd =  res.longitude;
                        that.wd =  res.latitude;
                    }
                });
            },
            //返回上一页
            goBack() {
                uni.navigateBack({})
            },
            //获取个人信息
            getOneselfInFo() {
                var that = this;
                //保安信息查询
                uni.request({
                    url:'http://s16s652780.51mypc.cn/api/blade-user/details?id='+this.$store.state.puserID,
                    method:'POST',
                    success(resdata) {
                        that.name = resdata.data.data.realName;
                    }
                })
            },
            //去打卡
            goClock() {
                var that = this;
                axios({
                    method: "POST",
                    url: this.$store.state.piAPI + `/attendance/AppSave`,
                    params: {
                        number: this.$store.state.puserID,
                        name: this.name,
                        clockTime: this.getNowTime(1),
                        jd: this.jd,
                        wd: this.wd,
                        address: this.address
                    },
                }).then((resdata) => {
                    //不在考勤范围内
                    if (resdata.data.code == 400) {
                        layui.use('layer', function() {
                            var layer = layui.layer;
                            layer.msg('打卡失败,不在考勤范围', {
                                icon: 0
                            });
                        });
                    }
                    //打卡成功
                    if (resdata.data.code == 200) {
                        layui.use('layer', function() {
                            var layer = layui.layer;
                            layer.msg('打卡成功!', {
                                icon: 1
                            });
                        });
                    }
                });
            },
            
            //获取当前时间
@@ -165,7 +222,8 @@
            flex-direction: row;
            align-items: center;
            // background-color:#0078A8;
            width: 100%;
            width: 92%;
            margin: 0 auto;
            height: 50px;
            margin-top: 20px;
            
@@ -176,7 +234,6 @@
                
                image {
                    // background-color: #00BFFF;
                    margin-left: 1rem;
                    width: 1.6rem;
                    height: 1.6rem;
                }
pages/groupChat/groupChat.vue
@@ -2,7 +2,7 @@
<template>
    <view class="work">
        <!-- 自定义顶部导航栏 -->
        <navBarTop :title="'聊天室'"></navBarTop>
        <!-- <navBarTop :title="'聊天室'"></navBarTop> -->
        <view class="main">
            <div>
                <div class="m-main">
pages/handle/handle.vue
New file
@@ -0,0 +1,91 @@
<template>
    <view class="form-info">
        <u-form :model="form" ref="uForm">
            <u-form-item label="证件类型" :label-width="lableWidth">
                <picker @change="typeClassSelect" :range="typeClassArray" class="typeClass-select">
                      <label :style="{color:typeClassArrayTypeColor}" v-model="form.type">{{ typeClassArrayType }}</label>
                </picker>
            </u-form-item>
            <u-form-item label="姓名" :label-width="lableWidth">
                <u-input v-model="form.name" placeholder="请输入姓名"/>
            </u-form-item>
            <u-form-item label="身份证号码" :label-width="lableWidth">
                <u-input v-model="form.idCardNo" placeholder="请输入身份证号码"/>
            </u-form-item>
            <u-form-item label="手机号" :label-width="lableWidth">
                <u-input v-model="form.phone" placeholder="请输入手机号"/>
            </u-form-item>
            <u-form-item label="联系地址" :label-width="lableWidth">
                <u-input v-model="form.address" placeholder="请输入联系地址" />
            </u-form-item>
            <u-form-item label="有效时间" :label-width="lableWidth">
                <!-- <u-input v-model="form.sex" type="select" placeholder="请选择有效时间"/> -->
                <picker @change="timeClassSelect" :range="timeClassArray" class="timeClass-select">
                      <label :style="{color:timeClassArrayTypeColor}" v-model="durationTime">{{ timeClassArrayType }}</label>
                </picker>
            </u-form-item>
            <u-form-item label="备注" :label-width="lableWidth">
                <u-input v-model="form.remark"  placeholder="请输入备注"/>
            </u-form-item>
            <u-button class="btn" type="primary">提交</u-button>
        </u-form>
    </view>
</template>
<script>
export default {
    data() {
        return {
            form: {
                name: '',
                idCardNo: '',
                type: '',
                phone:'',
                address:'',
                durationTime:'',
                remark:'',
            },
            lableWidth:160,
            typeClassArrayTypeColor:"#C0C4CC",
            typeClassArray:['通行证','寄养证'],
            typeClassArrayIndex:0,
            typeClassArrayType:'请选择证件类型',
            timeClassArrayTypeColor:"#C0C4CC",
            timeClassArray:["1个月","2个月","3个月","6个月","1年","2年"],
            timeClassArrayIndex:0,
            timeClassArrayType:'请选择有效时长',
        }
    },
    methods:{
        //证件类型下拉改变事件
        typeClassSelect(e){
            var that = this;
            this.typeClassArrayIndex = e.target.value;
            this.typeClassArrayType=this.typeClassArray[this.typeClassArrayIndex];
            //修改样式
            this.typeClassArrayTypeColor ="#000000";
        },
        //有效时长下拉改变事件
        timeClassSelect(e){
            var that = this;
            this.timeClassArrayIndex = e.target.value;
            this.timeClassArrayType=this.timeClassArray[this.timeClassArrayIndex];
            //修改样式
            this.timeClassArrayTypeColor ="#000000";
        },
    }
};
</script>
<style lang="scss" scoped>
    .form-info{
        width: 92%;
        margin: 0 auto;
    }
    .btn{
        margin-top: 1.5rem;
    }
</style>
pages/home/home.vue
@@ -40,7 +40,7 @@
        <view class="service-box">
            <u-grid :col="4" :border="false">
                <u-grid-item bg-color="transparent" v-for="(item, index) in serviceButton" :key="index">
                    <navigator url="" hover-class="none" class="service-item">
                    <navigator hover-class="none" class="service-item" @click="goBusinessPage(item.url,index)">
                        <image :src="item.img" mode="widthFix" class="img"></image>
                        <view class="name">{{ item.name }}</view>
                    </navigator>
@@ -98,14 +98,15 @@
                    v-for="(item, index) in newsList" :key="index">
                    <view class="left">
                        <view class="info">
                            [中国空间站] 神舟十二号载人发射任务取得圆满成功
                            {{item.title}}
                        </view>
                        <view class="date">
                            <image src="/static/images/home/date.png" class="icon" mode=""></image>
                            2021.06.17
                            <!-- <image src="/static/images/home/date.png" class="icon" mode=""></image> -->
                            <view class="advisory-title-name">{{item.sourceName}}</view>
                            <view class="advisory-title-time">{{item.createTime}}</view>
                        </view>
                    </view>
                    <image src="/static/workbench/huojian.png" mode="" class="img"></image>
                    <image :src="item.url" mode="" class="img"></image>
                </navigator>
                <u-loadmore :status="status" />
            </view>
@@ -113,7 +114,7 @@
        </view>
        
        <!-- 底部导航条 -->
        <u-tabbar :list="tabbar" :mid-button="false"></u-tabbar>
        <u-tabbar :list="tabbar" :mid-button="false" height="50px" icon-size="40"></u-tabbar>
    </view>
</template>
@@ -132,12 +133,13 @@
                positionArr: [],
                status: 'loadmore',
                list: 15,
                page: 0,
                page: 1,
                pagesize: 2,
                keyword: '',
                focus: false,
                bannerList: [],
                noticeList: [],
                newsList: [{}, {}],
                newsList: [],
                navButton: [],
                serviceButton: [],
                tabbar:this.$store.state.tabbar
@@ -166,8 +168,11 @@
            fakeServiceButton().then(data => {
                this.serviceButton = data;
            });
            //获取新闻信息
            this.getArtcilePageList();
        },
        onReachBottom() {
            // 后续将改为与后端联动
            if (this.page >= 3) return;
            this.status = 'loading';
@@ -176,7 +181,8 @@
                this.list += 10;
                if (this.page >= 3) this.status = 'nomore';
                else this.status = 'loading';
                this.newsList.push(...[{}, {}]);
                // this.newsList.push(...[{}, {}]);
                this.getArtcilePageList();
            }, 2000);
        },
        methods: {
@@ -189,6 +195,56 @@
            },
            handleSearchBlur() {
                this.focus = false;
            },
            //页面跳转
            goBusinessPage(url,index){
                if(index==0){
                    //我要看在tabbar
                    uni.switchTab({
                        url:url
                    })
                }else{
                    uni.navigateTo({
                        url:url
                    })
                }
            },
            //获取资讯信息
            getArtcilePageList() {
                var that = this;
                uni.request({
                    url: this.$store.state.piAPI + '/article/article/page',
                    method: 'GET',
                    data: {
                        current: this.page,
                        size: this.pagesize
                    },
                    success: (res) => {
                        if (res.data.code == 200) {
                            if (res.data.data.records) {
                                //如果总数小于pageSize,不做其他操作
                                if (res.data.data.total < this.pagesize) {
                                    that.newsList = res.data.data.records;
                                } else {
                                    if (res.data.data.records.length < this.pagesize) {
                                        //如果数量小于分页数量,则为最后一页
                                        this.status = 'nomore'
                                    } else {
                                        //如果数量小于分页数量,则为最后一页
                                        this.status = 'loading';
                                    }
                                    res.data.data.records.forEach(item =>{
                                        that.newsList.push(item);
                                    })
                                }
                            } else {
                                // this.isLoadMore=true;
                                // this.loadStatus='nomore';
                            }
                            uni.stopPullDownRefresh();
                        }
                    }
                });
            }
        }
    };
@@ -453,9 +509,10 @@
                        font-size: 28rpx;
                        font-family: PingFang SC;
                        font-weight: 500;
                        font-weight: 550;
                        color: #585b61;
                        line-height: 36rpx;
                        letter-spacing: 1px;
                    }
                    .date {
@@ -472,13 +529,24 @@
                        font-family: PingFang SC;
                        font-weight: 500;
                        color: #a6abb5;
                        .advisory-title-name{
                            font-size: 0.7rem;
                            letter-spacing: 1px;
                        }
                        .advisory-title-time{
                            margin-left: 0.8rem;
                            font-size: 0.7rem;
                        }
                    }
                }
                .img {
                    flex-shrink: 0;
                    width: 252rpx;
                    height: 160rpx;
                    width: 232rpx;
                    height: 140rpx;
                    border-radius: 20rpx;
                    background-color: #82848a;
                }
pages/patrol/patrol.vue
@@ -16,6 +16,7 @@
        onLoad: function(options) {
            //long 转换为字符串
            var code = JSON.stringify(this.$store.state.puserID.toString());
            // var code = JSON.stringify("1370564873280430082");
            this.urls = "http://s16s652780.51mypc.cn/xcxjingqingmap_patrol/xcxmap.html?snumber="+code;
        },
    }
store/state.js
@@ -15,7 +15,6 @@
            iconPath: "/static/tabbar/index01.png",
            selectedIconPath: "/static/tabbar/index02.png",
            text: '首页',
            pagePath: "/pages/home/home"
        },
        {