liuyg
2022-02-21 70b1fa32dee4a5c7739016179094ce02ace58d7b
Merge branch 'master' of http://192.168.0.105:10010/r/qfqk-android
10 files modified
1 files added
1202 ■■■■ changed files
api/mock/home.js 8 ●●●● patch | view | raw | blame | history
leafletMapOur/loginMap/js/vueMain.js 19 ●●●● patch | view | raw | blame | history
pages.json 4 ●●● patch | view | raw | blame | history
pages/article/article.vue 41 ●●●●● patch | view | raw | blame | history
pages/business/business.vue 115 ●●●●● patch | view | raw | blame | history
pages/currentMap/currentMap.vue 6 ●●●● patch | view | raw | blame | history
pages/home/home.vue 12 ●●●●● patch | view | raw | blame | history
pages/issue/issue.vue 20 ●●●● patch | view | raw | blame | history
pages/myself/myself.vue 21 ●●●● patch | view | raw | blame | history
pages/registerUser/registerUser - 副本.vue 677 ●●●●● patch | view | raw | blame | history
pages/registerUser/registerUser.vue 279 ●●●●● patch | view | raw | blame | history
api/mock/home.js
@@ -20,12 +20,12 @@
        try {
            const list = [{
                id: '1',
                img: '/static/images/home/homeTop1.png',
                url: ''
                img: 'http://223.82.109.183:2081/zhba/upload/20210913/3d9fd42a80094268ab83fdd3bcb18541.jpg',
                url: '../article/article_detail?detailData=' + '{"id":"119"}'
            }, {
                id: '2',
                img: '/static/images/home/homeTop2.png',
                url: ''
                img: 'http://223.82.109.183:2081/zhba/upload/20220216/b3d4c45eb7202974b3155318914df829.jpg',
                url: '../article/article_video?detailData=' + '{"id":981,"title":"千万别被“冰墩墩”的诱惑冲昏头 小心被盯上!","content":"","url":"http://223.82.109.183:2081/zhba/upload/20220216/b3d4c45eb7202974b3155318914df829.jpg","videoUrl":"http://223.82.109.183:2081/zhba/upload/depl/aed8c0b92b8f49b18c7c2d5056290af8.mp4","createTime":"2022-02-15 00:00:00","updateTime":"2022-02-16 22:49:21","sourceId":"","sourceName":"中国警察网","articleType":"ksp003","recommend":-1,"publish":"0","iscomment":"","iswords":"0","wordsContent":"","type":0}'
            }, {
                id: '3',
                img: '/static/images/home/homeTop3.png',
leafletMapOur/loginMap/js/vueMain.js
@@ -23,11 +23,13 @@
        popupDisplay: "none",
        regionName: '',
        byValue: ''
    },
    methods: {
        getLocalPoliceStation () {
            this.regionName = this.byValue
            uni.postMessage({
                data: this.regionName
            })
        },
        getDataList () {
@@ -121,7 +123,7 @@
            // 定位成功之后调用的方法
            function showPosition (position) {
                that.byValue = position.district || position.city
                that.regionName = position.district || position.city
                that.lat = position.lat //
                that.lng = position.lng //火星坐标 //TODO 实现业务代码逻辑 
@@ -170,17 +172,6 @@
    },
    created () {
        var that = this
        document.addEventListener('UniAppJSBridgeReady', function (e) {
            uni.getEnv(function (res) {
                console.log('当前环境:' + JSON.stringify(res))
            })
            // 向uniapp底座发送消息
            uni.postMessage({
                data: that.regionName
            })
        })
    },
    mounted () {
        this.getDataList()
pages.json
@@ -403,9 +403,7 @@
            "style": {
                "navigationBarTitleText": "获取辖区",
                "navigationBarBackgroundColor": "#103289",
                "navigationBarTextStyle": "white",
                "enablePullDownRefresh": false,
                "navigationStyle": "custom"
                "navigationBarTextStyle": "white"
            }
        },
        {
pages/article/article.vue
@@ -6,14 +6,13 @@
                :style="titleNum==index? 'color:#000000':'color:#808080'">{{item}}</view>
        </view> -->
        <view>
            <u-dropdown style="height:0rpx">
            <u-dropdown style="height:0rpx" @open="open">
                <u-dropdown-item v-model="value1" title="看新闻" @change="change" :options="options1"></u-dropdown-item>
                <u-dropdown-item v-model="value1" title="看视频" @change="change" :options="options2"></u-dropdown-item>
                <u-dropdown-item v-model="value1" title="行业圈" @change="change" :options="options3"></u-dropdown-item>
                <u-dropdown-item v-model="value1" title="看现场" @change="change" :options="options4"></u-dropdown-item>
            </u-dropdown>
        </view>
        <view>
            <view class="search-block" style="height: 35px">
                <view class="search-ico-wapper">
@@ -26,13 +25,12 @@
                </view> -->
            </view>
        </view>
        <scroll-view id="articleBox" :style="{ height: swiperHeight + 'px' }" class="article-content" scroll-y
            style="width: 100%; margin-top: 100rpx;" :refresher-enabled="refresherFlag" :refresher-threshold="threshold"
            :refresher-triggered="triggered" @refresherrefresh="refreshing" @refresherrestore="refresherrestore">
            <view style="text-align: center;">
                <u-loading size="90" mode="flower" :show="loading"></u-loading>
            </view>
            <view v-for="i in data" class="advisory-model" @click="goDetail(i)">
                <view class="advisory-left">
                    <view class="advisory-title-top">
@@ -51,9 +49,9 @@
        </scroll-view>
        <!-- <view class="article-content">
        </view> -->
        <u-toast ref="uToast" />
        <!-- 底部导航条 -->
        <u-tabbar :list="tabbar" :mid-button="true"></u-tabbar>
    </view>
@@ -69,8 +67,9 @@
            return {
                // pathUrl:"http://localhost:89/",
                pathUrl: this.$store.state.piAPI + "",
                loading:true,//加载动画
                page: 1,
                pagesize: 99999,
                pagesize: 20,
                status: 'loadmore',
                // loadStatus:'loading',  //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
                isLoadMore: false, //是否加载中
@@ -139,6 +138,9 @@
                    {
                        label: '知识讨论',
                        value: 'hyq003',
                    }, {
                        label: '个人',
                        value: 'hyq004',
                    }
                ],
                options4: [{
@@ -173,7 +175,7 @@
                    query
                        .select('#articleBox')
                        .boundingClientRect(data => {
                            that.swiperHeight = (safeArea.bottom - data.top - 50);
                            that.swiperHeight = (safeArea.bottom - data.top - 70);
                        })
                        .exec();
@@ -183,7 +185,6 @@
        //上拉加载更多
        onReachBottom() {
            console.log(2323232)
            if (this.status == 'nomore') return;
            this.page = ++this.page;
            setTimeout(() => {
@@ -199,18 +200,17 @@
                let detail = {
                    id: e.id
                };
                if(e.articleType.indexOf("ksp") != -1){
                if (e.articleType.indexOf("ksp") != -1) {
                    //去跳转
                    uni.navigateTo({
                        url: './article_video?detailData=' + (JSON.stringify(e))
                    });
                }else{
                } else {
                    //去跳转
                    uni.navigateTo({
                        url: './article_detail?detailData=' + JSON.stringify(detail)
                    });
                }
            },
            //on input 通过 keyword 关键字查询
            getKeyword() {
@@ -242,6 +242,7 @@
                    data: paramData,
                    success: (res) => {
                        if (res.data.code == 200) {
                            that.loading = false;
                            if (res.data.data.records) {
                                //如果总数小于pageSize,不做其他操作
                                if (res.data.data.total < that.pagesize) {
@@ -251,7 +252,7 @@
                                    if (res.data.data.records.length < that.pagesize) {
                                        //如果数量小于分页数量,则为最后一页
                                        that.status = 'nomore'
                                    } else {
                                    } else {
                                        //否则继续加载更多数据
                                        that.status = 'loading';
                                    }
@@ -271,6 +272,14 @@
            change(e) {
                this.page = 1;
                this.getArtcilePageList(e);
            },
            open(e) {
                if (e >= 2) {
                    this.$refs.uToast.show({
                        title: '功能研发中',
                        type: 'warning',
                    })
                }
            },
            refreshing() {
                if (this.isRefreshing) {
@@ -293,7 +302,7 @@
</script>
<style>
</style>
<style lang="scss" scoped>
pages/business/business.vue
@@ -10,36 +10,10 @@
                <view class="title">常用工具</view>
                <view class="list">
                    <u-grid :col="4" :border="false">
                        <u-grid-item bg-color="transparent">
                            <navigator url="" hover-class="none" class="nav-item">
                                <image src="../../static/workbench/task1.png" mode="widthFix" class="nav-item-img"></image>
                                <view class="nav-item-name">群防任务</view>
                            </navigator>
                        </u-grid-item>
                        <u-grid-item bg-color="transparent">
                            <navigator url="/pages/patrol/patrol" hover-class="none" class="nav-item">
                                <image src="../../static/workbench/task2.png" mode="widthFix" class="nav-item-img"></image>
                                <view class="nav-item-name">巡逻任务</view>
                            </navigator>
                        </u-grid-item>
                        <u-grid-item bg-color="transparent">
                            <navigator url="/pages/reported/reported" hover-class="none" class="nav-item">
                                <image src="../../static/workbench/task3.png" mode="widthFix" class="nav-item-img"></image>
                                <view class="nav-item-name">事件上报</view>
                            </navigator>
                        </u-grid-item>
                        <u-grid-item bg-color="transparent">
                            <!-- url="/pages/groupChat/groupChat?txlType=2" -->
                            <navigator  hover-class="none" class="nav-item">
                                <image src="../../static/workbench/task8.png" mode="widthFix" class="nav-item-img"></image>
                                <view class="nav-item-name">积分商城</view>
                            </navigator>
                        </u-grid-item>
                        <u-grid-item bg-color="transparent">
                            <!-- url="/pages/groupChat/groupChat?txlType=2" -->
                            <navigator  hover-class="none" class="nav-item">
                                <image src="../../static/workbench/task4.png" mode="widthFix" class="nav-item-img"></image>
                                <view class="nav-item-name">通讯录</view>
                        <u-grid-item bg-color="transparent" v-for="(item, index) in dataOne" :key="index">
                            <navigator hover-class="none" class="nav-item" @click="goBusinessPage(item.url,index)">
                                <image :src="item.img" mode="widthFix" class="nav-item-img"></image>
                                <view class="nav-item-name">{{item.title}}</view>
                            </navigator>
                        </u-grid-item>
                    </u-grid>
@@ -51,22 +25,10 @@
                <view class="title">管理</view>
                <view class="list">
                    <u-grid :col="4" :border="false">
                        <u-grid-item bg-color="transparent">
                            <navigator url="/pages/voting/voteManage" hover-class="none" class="nav-item">
                                <image src="../../static/workbench/task5.png" mode="widthFix" class="nav-item-img"></image>
                                <view class="nav-item-name">参与投票</view>
                            </navigator>
                        </u-grid-item>
                        <u-grid-item bg-color="transparent">
                            <navigator url="/pages/voting/vote" hover-class="none" class="nav-item">
                                <image src="../../static/workbench/task7.png" mode="widthFix" class="nav-item-img"></image>
                                <view class="nav-item-name">投票发起</view>
                            </navigator>
                        </u-grid-item>
                        <u-grid-item bg-color="transparent">
                            <navigator url="/pages/voting/votRanking" hover-class="none" class="nav-item">
                                <image src="../../static/workbench/task6.png" mode="widthFix" class="nav-item-img"></image>
                                <view class="nav-item-name">投票排行</view>
                        <u-grid-item bg-color="transparent" v-for="(item, index) in dataTwo" :key="index">
                            <navigator hover-class="none" class="nav-item" @click="goBusinessPage(item.url,index)">
                                <image :src="item.img" mode="widthFix" class="nav-item-img"></image>
                                <view class="nav-item-name">{{item.title}}</view>
                            </navigator>
                        </u-grid-item>
                    </u-grid>
@@ -74,6 +36,7 @@
            </view>
            
        </view>
        <u-toast ref="uToast" />
        <!-- 底部导航条 -->
        <u-tabbar :list="tabbar" :mid-button="true"></u-tabbar>
    </view>
@@ -83,11 +46,67 @@
    export default {
        data() {
            return {
                tabbar:this.$store.state.tabbar
                tabbar:this.$store.state.tabbar,
                dataOne:[{
                    title:'群防任务',
                    img:'../../static/workbench/task1.png',
                    url:''
                },{
                    title:'巡逻任务',
                    img:'../../static/workbench/task2.png',
                    url:'/pages/patrol/patrol'
                },{
                    title:'事件上报',
                    img:'../../static/workbench/task3.png',
                    url:'/pages/reported/reported'
                },{
                    title:'积分商城',
                    img:'../../static/workbench/task8.png',
                    url:''
                },{
                    title:'通讯录',
                    img:'../../static/workbench/task4.png',
                    url:''
                }],
                dataTwo:[{
                    title:'参与投票',
                    img:'../../static/workbench/task5.png',
                    url:'/pages/voting/voteManage'
                },{
                    title:'投票发起',
                    img:'../../static/workbench/task7.png',
                    url:'/pages/voting/vote'
                },{
                    title:'投票排行',
                    img:'../../static/workbench/task6.png',
                    url:'/pages/voting/votRanking'
                }]
            };
        },
        onLoad() {
        },mounted(){
            if(this.$store.state.UserData.stype != "1"){
                this.$refs.uToast.show({
                    title: '功能暂未开放',
                    type: 'warning',
                });
            }
        },methods: {
            //页面跳转
            goBusinessPage(url,index){
                if(this.$store.state.UserData.stype != "1"){
                    this.$refs.uToast.show({
                        title: '功能暂未开放',
                        type: 'warning',
                    });
                    return;
                }else{
                    uni.navigateTo({
                        url:url
                    })
                }
            }
        }
    };
</script>
pages/currentMap/currentMap.vue
@@ -19,11 +19,11 @@
                console.log(event)
                var regionName = event.detail.data[0]
                if (regionName.indexOf('区') != -1) {
                    that.regionName = regionName.replace('区', '派出所');
                    that.regionName = regionName.replace('区', '分局');
                } else if (regionName.indexOf('县') != -1) {
                    that.regionName = regionName.replace('县', '派出所');
                    that.regionName = regionName.replace('县', '分局');
                } else if (regionName.indexOf('市') != -1) {
                    that.regionName = regionName.replace('市', '市派出所');
                    that.regionName = regionName.replace('市', '市公安局');
                }
                
                this.goBack()
pages/home/home.vue
@@ -115,7 +115,7 @@
            </view>
            <!-- 新闻模块 end -->
        </view>
        <u-toast ref="uToast" />
        <!-- 底部导航条 -->
        <u-tabbar :list="tabbar" :mid-button="true" height="50px" icon-size="40"></u-tabbar>
    </view>
@@ -200,7 +200,6 @@
                let detail = {
                    id: e.id
                };
                if(e.articleType.indexOf("ksp") != -1){
                    //去跳转
                    uni.navigateTo({
@@ -230,13 +229,18 @@
                    uni.switchTab({
                        url:url
                    })
                }else if(this.$store.state.UserData.stype != "1"){
                    this.$refs.uToast.show({
                        title: '功能暂未开放',
                        type: 'warning',
                    })
                    return;
                }else if (index==4){
                    uni.navigateTo({
                        url:'../grabOrders/grabOrders?detailData=' + (JSON.stringify(this.cout))
                    })
                }
                else{
                    console.log("23232"+url+"dasdsada "+index)
                    uni.navigateTo({
                        url:url
                    })
@@ -261,7 +265,7 @@
            getArtcilePageList() {
                var that = this;
                uni.request({
                    url: this.$store.state.piAPI + '/article/article/page',
                    url: this.$store.state.piAPI + '/article/article/selectArticleG',
                    method: 'GET',
                    data: {
                        current: this.page,
pages/issue/issue.vue
@@ -40,6 +40,7 @@
        <view class="but">
            <u-button class="custom-style" type="primary" @click="inits"> 我发布</u-button>
        </view>
        <u-toast ref="uToast" />
        <u-tabbar :list="tabs" :mid-button="true"></u-tabbar>
    </view>
</template>
@@ -82,13 +83,22 @@
            inits() {
                var datas = this.form;
                var that = this;
                if(this.$store.state.UserData.stype != "1"){
                    this.$refs.uToast.show({
                        title: '功能暂未开放',
                        type: 'warning',
                    });
                    return;
                }
                var content = "";
                var videoUrl = "";
                if(datas.c == "文字类"){
                    datas.c = "kxw"
                    datas.c = "hyq004"
                    content = datas.g;
                }else{
                    datas.c = "ksp"
                    datas.c = "hyq004"
                    videoUrl = that.videos
                }
                
@@ -101,8 +111,10 @@
                        publish: 0,
                        url:that.fileList[0].url,
                        videoUrl:videoUrl,
                        sourceName:"群众",
                        content:content
                        sourceName:uni.getStorageSync("name"),
                        sourceId:uni.getStorageSync("ids"),
                        content:content,
                        type:"1"
                    },
                    success: (res) => {
                        if (res.data.code == 200) {
pages/myself/myself.vue
@@ -36,7 +36,7 @@
        </view>
        <uniPopup :textmsg="textmsg" @cancel='operation(1)' @confirm='operation(2)' v-show="showTextmsg">
        </uniPopup>
        <u-toast ref="uToast" />
        <!-- 底部导航条 -->
        <u-tabbar :list="tabbar" :mid-button="true"></u-tabbar>
    </view>
@@ -77,11 +77,11 @@
                        imgSrc: '../../static/myself/souc.png',
                        open: 'collect'
                    },
                    {
                        title: '能量树',
                        imgSrc: '../../static/myself/shu.png',
                        open: 'chenzs'
                    },
                    // {
                    //     title: '能量树',
                    //     imgSrc: '../../static/myself/shu.png',
                    //     open: 'chenzs'
                    // },
                    {
                        title: '关于我们',
                        imgSrc: '../../static/myself/us003.png',
@@ -137,6 +137,15 @@
        },
        methods: {
            goToAttendance(){
                if(this.$store.state.UserData.stype != "1"){
                    this.$refs.uToast.show({
                        title: '功能暂未开放',
                        type: 'warning',
                    });
                    return;
                }
                uni.navigateTo({
                    url:'../clockSignIn/clockSignIn'
                })
pages/registerUser/registerUser - 副本.vue
New file
@@ -0,0 +1,677 @@
<template>
    <view class="registerUser">
        <u-form :model="form" ref="uForm">
            <u-form-item :label="item.title" :prop="item.froms" label-width="200" :left-icon="item.img"
                :required="item.requireds" v-for="(item, index) in list" :key="index">
                <u-input v-model="form[item.froms]" :placeholder="item.placeholder" />
            </u-form-item>
            <u-form-item label="角色" prop="role" left-icon="account-fill" label-width="200" :required="true">
                <u-input v-model="form.role" type="select" placeholder="请选择角色" :border="true" @click="depl" />
                <u-select v-model="show" mode="mutil-column-auto" :list="roleList" @confirm="radioGroupChange">
                </u-select>
            </u-form-item>
            <u-form-item label="工作单位" prop="obj" left-icon="account-fill" label-width="200" :required="true"
                v-if="xqShow">
                <u-input v-model="form.obj" placeholder="请输入工作单位" />
            </u-form-item>
            <u-form-item label="辖区" prop="xq" left-icon="account-fill" label-width="200" :required="true">
                <u-input v-model="form.xq" type="select" placeholder="请选择辖区" :border="true" @click="openLoginMap" />
                <!-- <u-select v-model="showxq" mode="mutil-column-auto" :list="listxq" @confirm="confirmxq"></u-select> -->
            </u-form-item>
            <u-form-item label="性别" label-width="200" left-icon="man">
                <u-radio-group v-model="form.sex">
                    <u-radio v-for="(item, index) in sex" :key="index" :name="item.name" :disabled="item.disabled">
                        {{ item.name }}
                    </u-radio>
                </u-radio-group>
            </u-form-item>
            <u-form-item label="是否人脸登录" label-width="240" left-icon="server-man">
                <u-radio-group v-model="radioValue">
                    <u-radio v-for="(item, index) in radioList" :key="index" :name="item.name"
                        :disabled="item.disabled">
                        {{item.name}}
                    </u-radio>
                </u-radio-group>
                (功能研发中)
            </u-form-item>
        </u-form>
        <view class="agree">
            注册即代表同意
            <text class="a">《用户协议》</text>
            和
            <text class="a">《隐私政策》</text>
        </view>
        <div class="login-map-bc" v-if="mapShow">
            <div @click="mapShow = false">
            </div>
            <div class="login-map-content">
                <u-icon class="login-map-close" name="close" @click="mapShow = false"></u-icon>
                <view style="width: 100%; height: 100%; position: absolute; ">
                    <web-view :src="loginMapUrl"></web-view>
                </view>
            </div>
        </div>
        <u-button class="submit" @click="zc">
            下一步</u-button>
        <!-- <u-button class="submit" @click="submit">提交</u-button> -->
    </view>
</template>
<script>
    export default {
        data() {
            var validateUser = (rule, value, callback) => {
                var phone = /^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/;
                var identity =
                    /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}$)/;
                if (value.length <= 11) {
                    if (phone.test(value)) {
                        return true
                    } else {
                        return callback(new Error('手机号格式不正确'));
                    }
                }
                if (value.length <= 18) {
                    if (identity.test(value)) {
                        return true
                    } else {
                        return callback(new Error('身份证号格式不正确'));
                    }
                }
            };
            return {
                regionName: '',
                loginMapUrl: "",
                radioList: [{
                        name: '是',
                        disabled: false
                    },
                    {
                        name: '否',
                        disabled: false
                    }
                ],
                radioValue: '否',
                mapShow: false,
                latitude: 28.68, //纬度
                longitude: 115.85, //经度
                scale: 12, //缩放级别
                polyline: [
                    //     { //指定一系列坐标点,从数组第一项连线至最后一项
                    //     points: [{
                    //             latitude: 34.79977,
                    //             longitude: 113.66072
                    //         },
                    //         {
                    //             latitude: 34.795541,
                    //             longitude: 113.681646
                    //         },
                    //     ],
                    //     color: "#0000AA", //线的颜色
                    //     width: 1, //线的宽度
                    //     //     dottedLine:true,//是否虚线
                    //     arrowLine: true, //带箭头的线 开发者工具暂不支持该属性
                    // },
                ],
                marker: [],
                show: false,
                showxq: false,
                xqShow: true,
                listbm: [],
                listxq: [],
                deptXb: "",
                flag: false,
                list: [{
                        title: '账号',
                        img: 'man-add-fill',
                        froms: 'user',
                        requireds: true,
                        placeholder: '请输入身份证号或手机号'
                    },
                    {
                        title: '密码',
                        img: 'lock-fill',
                        froms: 'pass',
                        requireds: true,
                        placeholder: '请输入6~16位密码'
                    },
                    {
                        title: '确认密码',
                        img: 'lock-fill',
                        froms: 'passTwo',
                        requireds: true,
                        placeholder: '请确认密码'
                    },
                    {
                        title: '姓名',
                        img: 'account',
                        froms: 'name',
                        requireds: true,
                        placeholder: '请输入姓名'
                    },
                    {
                        title: '手机号',
                        img: 'phone-fill',
                        froms: 'phone',
                        requireds: false,
                        placeholder: '请输入手机号'
                    },
                    // {
                    //     title: '部门',
                    //     img: 'phone-fill',
                    //     froms: 'depl',
                    //     placeholder: '请选择部门'
                    // },
                ],
                sex: [{
                        name: '男',
                        disabled: false
                    },
                    {
                        name: '女',
                        disabled: false
                    },
                ],
                form: {
                    user: '',
                    pass: '',
                    passTwo: '',
                    name: '',
                    carId: '',
                    phone: '',
                    sex: '男',
                    obj: '',
                    objId: '',
                    xq: '',
                    xqobjId: '',
                    jsid: ''
                },
                rules: {
                    user: [{
                        /*
                         u-form提供的可直接调用的js验证,
                         具体有哪些可以观看官方文档,这里就不在赘述了。
                        */
                        validator: validateUser,
                        trigger: ['change', 'blur'],
                    }, ],
                    pass: [{
                        required: true,
                        message: '请输入6~16位密码',
                        // 可以单个或者同时写两个触发验证方式
                        trigger: ['change', 'blur'],
                    }, {
                        min: 6,
                        message: '密码不能少于6位',
                        trigger: ['change', 'blur']
                    }, {
                        max: 16,
                        message: '密码不能超出16位',
                        trigger: ['change', 'blur']
                    }],
                    passTwo: [{
                        required: true,
                        message: '请再次输入密码',
                        // 可以单个或者同时写两个触发验证方式
                        trigger: ['change', 'blur'],
                    }, {
                        validator: (rule, value, callback) => {
                            console.log(this.form.pass, value)
                            if (this.form.pass == value) {
                                return true
                            } else {
                                return false
                            }
                            // return this.$u.test.code(this.form.pass,value);
                        },
                        message: '两次输入密码不正确',
                        trigger: ['change', 'blur'],
                    }],
                    name: [{
                        required: true,
                        message: '请输入姓名',
                        // 可以单个或者同时写两个触发验证方式
                        trigger: ['change', 'blur'],
                    }],
                    obj: [{
                        required: true,
                        message: '请输入工作单位',
                        // 可以单个或者同时写两个触发验证方式
                        trigger: ['change', 'blur'],
                    }],
                    role: [{
                        required: true,
                        message: '请选择角色',
                        // 可以单个或者同时写两个触发验证方式
                        trigger: ['change', 'blur'],
                    }],
                    xq: [{
                        required: true,
                        message: '请选择辖区',
                        // 可以单个或者同时写两个触发验证方式
                        trigger: ['change', 'blur'],
                    }],
                    depts: [{
                        required: true,
                        message: '请输入姓名',
                        // 可以单个或者同时写两个触发验证方式
                        trigger: ['change', 'blur'],
                    }],
                    // phone: [{
                    //     required: false,
                    //     message: '请输入手机号',
                    //     // 可以单个或者同时写两个触发验证方式
                    //     trigger: ['change', 'blur'],
                    // }, {
                    //     validator: (rule, value, callback) => {
                    //         return this.$u.test.mobile(value);
                    //     },
                    //     message: '手机号码不正确',
                    //     trigger: ['change', 'blur'],
                    // }],
                },
                showGetFace: false,
                faceState: -2,
                facebc: '#fff',
                faceco: '#000',
                faceMsg: '',
                roleList: [{
                        label: '民警',
                        value: 1417092295132561409
                    },
                    {
                        label: '治保会队伍',
                        value: 1424615693403414529
                    },
                    {
                        label: '内保干部队伍',
                        value: 1424615773594312705
                    },
                    {
                        label: '治安巡防队伍',
                        value: 1424615835435130881
                    },
                    {
                        label: '信息员队伍',
                        value: 1424615909959524354
                    },
                    {
                        label: '保安员队伍',
                        value: 1424615972718895106
                    },
                    {
                        label: '警务辅助队伍',
                        value: 1424616047083905026
                    },
                    {
                        label: '平安志愿者',
                        value: 1494565079268491266
                    }
                ]
            };
        },
        onShow() {
            let that = this
            uni.$on('updateDataRegionName', function(data) {
                that.regionName = data
                that.form.xq = that.regionName
            })
        },
        methods: {
            handleMessage(name) {
                console.log(name)
                if (name.indexOf('区') != -1) {
                    that.regionName = name.replace('区', '派出所');
                } else if (name.indexOf('县') != -1) {
                    that.regionName = name.replace('县', '派出所');
                } else if (name.indexOf('市') != -1) {
                    that.regionName = name.replace('市', '市派出所');
                }
            },
            openLoginMap() {
                var that = this
                uni.getLocation({
                    type: 'wgs84',
                    success: function(res) {
                        console.log('当前位置的经度:' + res.longitude);
                        console.log('当前位置的纬度:' + res.latitude);
                        that.latitude = res.latitude
                        that.longitude = res.longitude
                        that.marker = [{
                            id: 0,
                            latitude: res.latitude, //纬度
                            longitude: res.longitude, //经度
                            iconPath: '/static/img/map/location.png', //显示的图标
                            rotate: 0, // 旋转度数
                            width: 20, //宽
                            height: 20, //高
                            title: '位置', //标注点名
                            alpha: 1, //透明度
                        }]
                        var data = [{
                            "id": '100000',
                            "place": '无数据',
                            "state": '0',
                            "dtype": '0',
                            "size": '300',
                            "jd": res.longitude,
                            "wd": res.latitude
                        }]
                        uni.navigateTo({
                            url: '/pages/currentMap/currentMap?data=' + JSON.stringify(data)
                        })
                        // that.loginMapUrl =
                        //     'http://192.168.0.115:5500/leafletMapOur/loginMap/loginMap.html?data=' + data
                        // // that.loginMapUrl = 'http://223.82.109.183:2082/loginMap/loginMap.html?data=' + data
                        // that.mapShow = true
                    }
                })
            },
            zc() {
                var that = this;
                uni.request({
                    url: that.$store.state.piAPI + '/zc/inspect',
                    method: 'GET',
                    data: {
                        username: this.form.user
                    },
                    success: (res) => {
                        if (res.data.code == 400) {
                            uni.showToast({
                                title: res.data.msg,
                                icon: 'none',
                                duration: 2000
                            });
                            return
                        }
                        that.$refs.uForm.validate(valid => {
                            if (valid) {
                                var d = that.form;
                                uni.navigateTo({
                                    url: '/pages/registerUser/idphoto?data= ' +
                                        encodeURIComponent(JSON.stringify(
                                            d))
                                });
                            }
                        });
                    }
                });
            },
            depl() {
                var that = this;
                that.show = true;
            },
            // depl() {
            //     var that = this;
            //     uni.request({
            //         url: that.$store.state.piAPI + "/blade-system/dept/trees",
            //         method: 'get',
            //         success: (res) => {
            //             var routerArr = res.data.data;
            //             var arr = that.formatRoutes(routerArr);
            //             var list = [];
            //             if (that.deptXb != "") {
            //                 list.push(arr[that.deptXb]);
            //                 for (var i = 0; i < list.length; i++) {
            //                     list[i].children.unshift({
            //                         label: '--请选择--',
            //                         value: 0,
            //                         children: []
            //                     })
            //                     for (var j = 0; j < list[i].children.length; j++) {
            //                         list[i].children[j].children.unshift({
            //                             label: '--请选择--',
            //                             value: 0,
            //                         })
            //                     }
            //                 }
            //                 that.listbm = list;
            //                 that.show = true;
            //             } else {
            //                 uni.showToast({
            //                     title: '请选择角色',
            //                     icon: "none",
            //                     duration: 1000
            //                 });
            //             }
            //         }
            //     })
            // },
            deplxq() {
                var that = this;
                uni.request({
                    url: that.$store.state.piAPI + "/jurisdiction/tree",
                    method: 'get',
                    success: (res) => {
                        var routerArr = res.data.data;
                        var arr = that.formatRoutes(routerArr);
                        var list = [];
                        list.push(arr);
                        for (var i = 0; i < arr.length; i++) {
                            arr[i].children.unshift({
                                label: '--请选择--',
                                value: 0,
                                children: []
                            })
                            for (var j = 0; j < arr[i].children.length; j++) {
                                arr[i].children[j].children.unshift({
                                    label: '--请选择--',
                                    value: 0,
                                })
                            }
                        }
                        that.listxq = arr;
                        that.showxq = true;
                    }
                })
            },
            confirmxq(e) {
                var arr = "";
                var data = [];
                for (var i = 0; i < e.length; i++) {
                    if (e[i].value != "0") {
                        arr += e[i].value + ",";
                        data.push(e[i]);
                    }
                }
                var obj = arr.substr(0, arr.length - 1);
                this.form.xq = data[data.length - 1].label;
                this.form.xqobjId = obj;
                console.log(obj)
            },
            formatRoutes(routerArr) {
                var that = this;
                const arr = [];
                let obj = {};
                routerArr.forEach(router => {
                    const tmp = {
                        ...router
                    };
                    if (tmp.hasChildren == true) {
                        tmp.children = that.formatRoutes(tmp.children);
                        const {
                            id,
                            title
                        } = router;
                        obj = {
                            label: tmp.title,
                            value: tmp.id,
                            children: tmp.children
                        }
                    } else if (tmp.hasChildren == false || typeof(tmp.hasChildren) == 'undefined') {
                        obj = {
                            label: tmp.title,
                            value: tmp.id,
                            children: []
                        }
                    }
                    arr.push(obj);
                })
                return arr;
            },
            startRecord() {
                this.flag = true;
                // this.$message.success('开始录制')
                this.$refs.video.startRecord();
            },
            stopRecord() {
                this.flag = false;
                // this.$message.success('请看控制台视频文件的base64')
                this.$refs.video.stopRecord();
            },
            dataChange(data) {
                console.log(data);
            },
            // 选中任一radio时,由radio-group触发
            radioGroupChange(e) {
                this.form.role = e[0].label
                this.form.jsid = e[0].value
                this.show = false;
            }
        },
        onReady() {
            this.$refs.uForm.setRules(this.rules);
        },
        watch: {
            faceState() {
                // console.log(this.faceState);
                if (this.faceState == -1) {
                    this.facebc = '#ff7f29';
                    this.faceco = '#fff';
                    this.faceMsg = '(信息有误!请重新验证)';
                } else if (this.faceState == 1) {
                    this.facebc = '#15dd55';
                    this.faceMsg = '(验证成功!)';
                    this.faceco = '#fff';
                } else if (this.faceState == 0) {
                    this.facebc = '#f7f7f7';
                    this.faceco = '#000';
                    this.faceMsg = '(服务连接失败!)';
                }
            }
        }
    };
</script>
</script>
<style lang="scss" scoped>
    .login-map-bc {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 111;
        background: rgba(0, 0, 0, .3);
    }
    .login-map-content {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 222;
        border-radius: 15px 15px 0 0;
        overflow: hidden;
        iframe {
            border: none;
        }
    }
    .login-map-close {
        position: absolute;
        top: 10px;
        right: 10px;
        width: 20px;
        height: 20px;
        z-index: 11;
    }
    .warp {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
    }
    .rect {
        text-align: center;
        width: 120px;
        height: 120px;
    }
    .submit {
        margin: 30rpx 50rpx 50rpx;
        border: none;
        width: 572rpx;
        height: 86rpx;
        line-height: 86rpx;
        box-sizing: border-box;
        border-radius: 15rpx;
        background-color: #103289;
        color: #ffffff;
        &::after {
            content: none;
        }
        &::before {
            content: none;
        }
        &[disabled='true'] {
            background: #e4e4e4;
            font-size: 36rpx;
            font-family: Source Han Sans CN;
            font-weight: 500;
            color: #ffffff;
        }
    }
    .registerUser {
        padding: 0 1.2rem;
    }
    .agree {
        margin: 27rpx 95rpx 0;
        font-size: 22rpx;
        font-family: Adobe Heiti Std;
        font-weight: normal;
        color: #cacaca;
        line-height: 34rpx;
        .a {
            color: #000000;
        }
    }
</style>
pages/registerUser/registerUser.vue
@@ -1,9 +1,9 @@
<template>
    <view class="registerUser">
        <u-form :model="form" ref="uForm">
            <u-form-item :label="item.title" :prop="item.froms" label-width="200" :left-icon="item.img"
            <u-form-item :label="item.title" :prop="item.froms" label-width="200" :left-icon="item.img"
                :required="item.requireds" v-for="(item, index) in list" :key="index">
                <u-input v-model="form[item.froms]" :placeholder="item.placeholder" />
                <u-input v-model="form[item.froms]" :placeholder="item.placeholder" :type="item.type" />
            </u-form-item>
            <u-form-item label="角色" prop="role" left-icon="account-fill" label-width="200" :required="true">
                <u-input v-model="form.role" type="select" placeholder="请选择角色" :border="true" @click="depl" />
@@ -15,8 +15,9 @@
                <u-input v-model="form.obj" placeholder="请输入工作单位" />
            </u-form-item>
            <u-form-item label="辖区" prop="xq" left-icon="account-fill" label-width="200" :required="true">
                <u-input v-model="form.xq" type="select" placeholder="请选择辖区" :border="true" @click="openLoginMap" />
                <!-- <u-select v-model="showxq" mode="mutil-column-auto" :list="listxq" @confirm="confirmxq"></u-select> -->
                <u-input v-model="form.xq" type="select" placeholder="请选择辖区" :border="true" @click="regionClick" />
                <u-select v-model="regionShow" mode="mutil-column-auto" :list="regionList" @confirm="regionSelect">
                </u-select>
            </u-form-item>
            <u-form-item label="性别" label-width="200" left-icon="man">
                <u-radio-group v-model="form.sex">
@@ -138,6 +139,7 @@
                    },
                    {
                        title: '密码',
                        type: 'password',
                        img: 'lock-fill',
                        froms: 'pass',
                        requireds: true,
@@ -145,6 +147,7 @@
                    },
                    {
                        title: '确认密码',
                        type: 'password',
                        img: 'lock-fill',
                        froms: 'passTwo',
                        requireds: true,
@@ -285,51 +288,104 @@
                faceco: '#000',
                faceMsg: '',
                roleList: [{
                        label: '群众',
                        value: "1416225849858883585"
                    }, {
                        label: '民警',
                        value: 1417092295132561409
                        value: "1417092295132561409"
                    },
                    {
                        label: '治保会队伍',
                        value: 1424615693403414529
                        value: "1495714130024673282"
                    },
                    {
                        label: '内保干部队伍',
                        value: 1424615773594312705
                        value: "1495714221926068225"
                    },
                    {
                        label: '治安巡防队伍',
                        value: 1424615835435130881
                        value: "1495714272471625729"
                    },
                    {
                        label: '信息员队伍',
                        value: 1424615909959524354
                        value: "1495714309071122434"
                    },
                    {
                        label: '保安员队伍',
                        value: 1424615972718895106
                        value: "1495714343888039937"
                    },
                    {
                        label: '警务辅助队伍',
                        value: 1424616047083905026
                        value: "1495714378025480193"
                    },
                    {
                        label: '平安志愿者',
                        value: 1494565079268491266
                        value: "1416225906918195201"
                    }
                ]
                ],
                regionList: [{
                        label: '东湖区',
                        value: '1415619841521414145'
                    },
                    {
                        label: '西湖区',
                        value: '1415619917295710209'
                    },
                    {
                        label: '青云谱区',
                        value: '1415619986417840129'
                    },
                    {
                        label: '湾里区',
                        value: '1415620058526314497'
                    },
                    {
                        label: '青山湖区',
                        value: '1415620118307729409'
                    },
                    {
                        label: '新建区',
                        value: '1415620188289691649'
                    },
                    {
                        label: '南昌县',
                        value: '1415620235718881282'
                    },
                    {
                        label: '安义县',
                        value: '1415620288487419906'
                    },
                    {
                        label: '进贤县',
                        value: '1415620344112279553'
                    },
                    {
                        label: '经济技术开发区区',
                        value: '1415620404103409666'
                    },
                    {
                        label: '红谷滩区',
                        value: '1415620472965492738'
                    },
                    {
                        label: '高新技术开发区',
                        value: '1415620707473223681'
                    }
                ],
                regionShow: false
            };
        },
        onShow() {
            let that = this
            uni.$on('updateDataRegionName', function(data) {
                that.regionName = data
                that.form.xq = that.regionName
            })
        },
        methods: {
            regionClick() {
                this.regionShow = true;
            },
            regionSelect() {
                this.form.xq = e[0].label
                this.form.xqobjId = e[0].value
                this.regionShow = false;
            },
            handleMessage(name) {
                console.log(name)
                if (name.indexOf('区') != -1) {
                    that.regionName = name.replace('区', '派出所');
                } else if (name.indexOf('县') != -1) {
@@ -337,53 +393,6 @@
                } else if (name.indexOf('市') != -1) {
                    that.regionName = name.replace('市', '市派出所');
                }
            },
            openLoginMap() {
                var that = this
                uni.getLocation({
                    type: 'wgs84',
                    success: function(res) {
                        console.log('当前位置的经度:' + res.longitude);
                        console.log('当前位置的纬度:' + res.latitude);
                        that.latitude = res.latitude
                        that.longitude = res.longitude
                        that.marker = [{
                            id: 0,
                            latitude: res.latitude, //纬度
                            longitude: res.longitude, //经度
                            iconPath: '/static/img/map/location.png', //显示的图标
                            rotate: 0, // 旋转度数
                            width: 20, //宽
                            height: 20, //高
                            title: '位置', //标注点名
                            alpha: 1, //透明度
                        }]
                        var data = [{
                            "id": '100000',
                            "place": '无数据',
                            "state": '0',
                            "dtype": '0',
                            "size": '300',
                            "jd": res.longitude,
                            "wd": res.latitude
                        }]
                        uni.navigateTo({
                            url: '/pages/currentMap/currentMap?data=' + JSON.stringify(data)
                        })
                        // that.loginMapUrl =
                        //     'http://192.168.0.115:5500/leafletMapOur/loginMap/loginMap.html?data=' + data
                        // // that.loginMapUrl = 'http://223.82.109.183:2082/loginMap/loginMap.html?data=' + data
                        // that.mapShow = true
                    }
                })
            },
            zc() {
                var that = this;
@@ -406,101 +415,46 @@
                        }
                        that.$refs.uForm.validate(valid => {
                            if (valid) {
                                var d = that.form;
                                uni.navigateTo({
                                    url: '/pages/registerUser/idphoto?data= ' +
                                        encodeURIComponent(JSON.stringify(
                                            d))
                        var that = this;
                        var d = that.form;
                        var url = that.$store.state.piAPI + '/zc/inster',
                            data = {
                                // deptid: ,
                                password: d.pass,
                                password2: d.passTwo,
                                phone: d.phone,
                                sex: d.sex == '男' ? 1 : 2,
                                sname: d.name,
                                username: d.user,
                                deptid: d.objId,
                                parentId: d.jsid,
                                jurisdiction: d.xqobjId,
                                cardid: d.carId
                            }
                        uni.request({
                            url: url,
                            method: 'POST',
                            data: data,
                            success: (res) => {
                                uni.showToast({
                                    title: '注册成功,请等待审核',
                                    icon: 'none',
                                    duration: 2000
                                });
                                setTimeout(function() {
                                    uni.navigateTo({
                                        url: '/pages/loging/loging'
                                    })
                                }, 2000);
                            }
                        });
                    }
                });
            },
            depl() {
                var that = this;
                that.show = true;
            },
            // depl() {
            //     var that = this;
            //     uni.request({
            //         url: that.$store.state.piAPI + "/blade-system/dept/trees",
            //         method: 'get',
            //         success: (res) => {
            //             var routerArr = res.data.data;
            //             var arr = that.formatRoutes(routerArr);
            //             var list = [];
            //             if (that.deptXb != "") {
            //                 list.push(arr[that.deptXb]);
            //                 for (var i = 0; i < list.length; i++) {
            //                     list[i].children.unshift({
            //                         label: '--请选择--',
            //                         value: 0,
            //                         children: []
            //                     })
            //                     for (var j = 0; j < list[i].children.length; j++) {
            //                         list[i].children[j].children.unshift({
            //                             label: '--请选择--',
            //                             value: 0,
            //                         })
            //                     }
            //                 }
            //                 that.listbm = list;
            //                 that.show = true;
            //             } else {
            //                 uni.showToast({
            //                     title: '请选择角色',
            //                     icon: "none",
            //                     duration: 1000
            //                 });
            //             }
            //         }
            //     })
            // },
            deplxq() {
                var that = this;
                uni.request({
                    url: that.$store.state.piAPI + "/jurisdiction/tree",
                    method: 'get',
                    success: (res) => {
                        var routerArr = res.data.data;
                        var arr = that.formatRoutes(routerArr);
                        var list = [];
                        list.push(arr);
                        for (var i = 0; i < arr.length; i++) {
                            arr[i].children.unshift({
                                label: '--请选择--',
                                value: 0,
                                children: []
                            })
                            for (var j = 0; j < arr[i].children.length; j++) {
                                arr[i].children[j].children.unshift({
                                    label: '--请选择--',
                                    value: 0,
                                })
                            }
                        }
                        that.listxq = arr;
                        that.showxq = true;
                    }
                })
            },
            confirmxq(e) {
                var arr = "";
                var data = [];
                for (var i = 0; i < e.length; i++) {
                    if (e[i].value != "0") {
                        arr += e[i].value + ",";
                        data.push(e[i]);
                    }
                }
                var obj = arr.substr(0, arr.length - 1);
                this.form.xq = data[data.length - 1].label;
                this.form.xqobjId = obj;
                console.log(obj)
                this.show = true;
            },
            formatRoutes(routerArr) {
                var that = this;
@@ -533,19 +487,6 @@
                    arr.push(obj);
                })
                return arr;
            },
            startRecord() {
                this.flag = true;
                // this.$message.success('开始录制')
                this.$refs.video.startRecord();
            },
            stopRecord() {
                this.flag = false;
                // this.$message.success('请看控制台视频文件的base64')
                this.$refs.video.stopRecord();
            },
            dataChange(data) {
                console.log(data);
            },
            // 选中任一radio时,由radio-group触发
            radioGroupChange(e) {