Lou
2024-04-28 d2f4d757191c4f892135ffcbbe03be6976f9234a
更新
4 files modified
90 ■■■■ changed files
pages/login/login-account.vue 10 ●●●● patch | view | raw | blame | history
subPackage/school/security.vue 57 ●●●● patch | view | raw | blame | history
subPackage/school/trouble.vue 2 ●●● patch | view | raw | blame | history
utils/func.js 21 ●●●●● patch | view | raw | blame | history
pages/login/login-account.vue
@@ -169,16 +169,20 @@
                },
                screenHeight: "",
                loginType: 1, //登录类型 1账号密码   2 一键登录
                isAgreement: true
                isAgreement: true,
                pageType: ""
            }
        },
        onLoad(option) {
            console.log(option);
            if (option.type) {
                //type 1   安全隐患    2 矛盾纠纷   3 护学打卡
                //type 1   安全隐患    2 矛盾纠纷   3 护学打卡  4校园安保
                uni.setStorageSync("pageType", option.type);
            }
            if (option.code) {
                uni.setStorageSync("houseCode", option.code);
            }
@@ -205,7 +209,7 @@
                        .then(data => {
                            uni.setStorageSync("phoneNmber", this.form.phone)
                            // this.getUserInfo(data);
                            this.$u.func.login(data)
                            this.$u.func.login(data, this.pageType)
                        })
                        .catch(err => {
                            this.$u.func.showToast({
subPackage/school/security.vue
@@ -1,7 +1,7 @@
<template>
    <view class="wrap">
        <view class="info-row flex j-c-s-b a-i-c bgc-ff" @click="isShowPopup = true">
        <view class="info-row flex j-c-s-b a-i-c bgc-ff" @click="isShowPopup = true" v-if="!from">
            <text class="f-28">场所名称</text>
            <view class="flex">
                <text class="mr-10">{{selectedPlace.placeName}}</text>
@@ -135,7 +135,9 @@
        updatePlaceCheck,
        auditPlaceCheck
    } from "@/api/reporting/reporting.js"
    import {
        getQrCodeDetail
    } from "@/api/system/index"
    export default {
        mixins: [uploadMixin],
        data() {
@@ -187,7 +189,8 @@
                isShowPopup: false,
                selectedPlace: {},
                placeList: [],
                placeName: ""
                placeName: "",
                from: "" //页面进入来源
            }
        },
        async onLoad(option) {
@@ -196,20 +199,21 @@
                this.isEdit = true;
                this.getDetail(option.taskId)
            } else {
                this.info.houseCode = "d8460d16ec5a40ccbfe64ba65d34159c7427";
                this.info.placeName = "校学小学场所"
                // this.info.houseCode = uni.getStorageSync("siteInfo").houseCode;
                // this.info.placeName = uni.getStorageSync("siteInfo").name;
                if (uni.getStorageSync("houseCode")) {
                    let houseCode = uni.getStorageSync("houseCode");
                    this.getHouseType(houseCode);
                } else {
                    this.info.houseCode = "d8460d16ec5a40ccbfe64ba65d34159c7427";
                    this.info.placeName = "校学小学场所"
                }
            }
            this.getPlaceList();
            // if (option.houseCode) {
            //     this.info.houseCode = option.houseCode;
            // }
        },
        methods: {
            getPlaceList() {
                getLocationRecord({
                    roleName: uni.getStorageSync('activeRole').roleName,
@@ -492,11 +496,40 @@
                this.selectedPlace = item;
                this.info.houseCode = item.houseCode;
                this.isShowPopup = false;
            },
            getHouseType(code) {
                getQrCodeDetail({
                    roleName: uni.getStorageSync("activeRole").roleName,
                    addressCode: code
                }).then(res => {
                    let {
                        isJur,
                        doorplateType,
                        addressLevel
                    } = res.data;
                    if (isJur == 1) {
                        if (doorplateType == "中门牌" || doorplateType == "小门牌") {
                            if (res.data.labelCode == 160102 || res.data.labelCode == 160103) {
                                this.info.houseCode = code;
                                this.info.placeName = poi;
                                this.from = "jump"
                            } else {
                                this.$showTips("该场所不是校园类型");
                            }
                        }
                    } else {
                        uni.showModal({
                            title: "提示!",
                            content: "该区域不是您管辖范围",
                            showCancel: false
                        })
                    }
                })
            },
        }
    }
</script>
subPackage/school/trouble.vue
@@ -97,7 +97,7 @@
            async getAllBizDict() {
                //反诈类别
                await this.getBizDict('hiddenDangerType', this.troubleTypeList);
            },
utils/func.js
@@ -11,7 +11,7 @@
const install = (Vue, vm) => {
    // 登录操作 1
    const login = async (userInfo) => {
    const login = async (userInfo, pageType) => {
        vm.$u.vuex('userInfo', userInfo)
        vm.$u.vuex('accessToken', userInfo.access_token)
        vm.$u.vuex('isLogin', true)
@@ -33,11 +33,16 @@
        let appMenu = data.filter(e => e.name == 'app')[0].children
        console.log("当前角色菜单:", appMenu)
        store.commit('SET_MENU', appMenu)
        //跳转到首页
        uni.switchTab({
            url: '/pages/home/index'
        })
        if (pageType == 4 && resDetail.data.roleAlias == "mj") {
            uni.navigateTo({
                url: '/subPackage/school/security'
            })
        } else {
            //跳转到首页
            uni.switchTab({
                url: '/pages/home/index'
            })
        }
    }
@@ -53,7 +58,9 @@
        if (uni.getStorageSync("pageType")) {
            uni.removeStorageSync("pageType")
        }
        if (uni.getStorageSync("houseCode")) {
            uni.removeStorageSync("houseCode")
        }
        uni.redirectTo({
            url: '/pages/login/login-account'
        })