shuishen
2022-02-23 07644d789be371ed447bc0992feeeaf77f1cd3b0
副本
1 files modified
295 ■■■■■ changed files
pages/registerUser/registerUser - 副本.vue 295 ●●●●● patch | view | raw | blame | history
pages/registerUser/registerUser - 副本.vue
@@ -3,20 +3,23 @@
        <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-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" />
                <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-form-item label="工作单位" prop="obj" left-icon="home-fill" label-width="200" :required="true">
                <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 label="所在地区" prop="xq" left-icon="map-fill" label-width="200" :required="true">
                <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="详细地址" prop="address" left-icon="map" label-width="200" :required="true">
                <u-input v-model="form.address" placeholder="详细地址" />
            </u-form-item>
            <u-form-item label="性别" label-width="200" left-icon="man">
                <u-radio-group v-model="form.sex">
@@ -37,7 +40,7 @@
        </u-form>
        <view class="agree">
            注册即代表同意
            <text class="a">《用户协议》</text>
            <text class="a" @click="">《用户协议》</text>
            和
            <text class="a">《隐私政策》</text>
        </view>
@@ -124,7 +127,6 @@
                marker: [],
                show: false,
                showxq: false,
                xqShow: true,
                listbm: [],
                listxq: [],
                deptXb: "",
@@ -138,6 +140,7 @@
                    },
                    {
                        title: '密码',
                        type: 'password',
                        img: 'lock-fill',
                        froms: 'pass',
                        requireds: true,
@@ -145,6 +148,7 @@
                    },
                    {
                        title: '确认密码',
                        type: 'password',
                        img: 'lock-fill',
                        froms: 'passTwo',
                        requireds: true,
@@ -193,7 +197,8 @@
                    objId: '',
                    xq: '',
                    xqobjId: '',
                    jsid: ''
                    jsid: '',
                    address: ''
                },
                rules: {
                    user: [{
@@ -248,6 +253,12 @@
                        // 可以单个或者同时写两个触发验证方式 
                        trigger: ['change', 'blur'],
                    }],
                    address: [{
                        required: true,
                        message: '请输入详细地址',
                        // 可以单个或者同时写两个触发验证方式
                        trigger: ['change', 'blur'],
                    }],
                    role: [{
                        required: true,
                        message: '请选择角色',
@@ -285,105 +296,102 @@
                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: {
            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('市', '市派出所');
                }
            regionClick() {
                this.regionShow = true;
            },
            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, //透明度
                        }]
            regionSelect(e) {
                this.form.xq = e[0].label
                this.form.xqobjId = e[0].value
                        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
                    }
                })
                this.regionShow = false;
            },
            zc() {
                var that = this;
@@ -416,136 +424,13 @@
                                });
                            }
                        });
                    }
                });
            },
            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);
                this.show = true;
            },
            // 选中任一radio时,由radio-group触发
            radioGroupChange(e) {