pyt
2025-03-17 5f55564fe91bc7aab00a9f773c04196b95b48517
feat
6个文件已修改
4个文件已添加
900 ■■■■ 已修改文件
H5/components/customPopup.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/pages/authentication/authentication.vue 379 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/pages/authentication/service.js 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/pages/components/certificate/certificate.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/pages/index/index.vue 254 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/pages/index/service.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/pages/party-member-info/party-member-info.vue 212 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/pages/party-member-info/service.js 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/static/home/拒绝@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
H5/static/home/注册@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
H5/components/customPopup.vue
@@ -61,12 +61,14 @@
            },
            closeFun() {
                this.$emit('close')
                this.show = false
            },
            comfirmFun() {
                if (this.isCountDown && this.num != 0) {
                    return
                }
                this.$emit('comfirm')
                this.show = false
            },
            showPopup() {
                this.show = true
H5/pages/authentication/authentication.vue
@@ -1,15 +1,15 @@
<template>
    <view class="content">
        <!--     <view class="">
        <view v-if="info.auditStatus === 2" class="">
            <view class="flex a-center color2 fs-44 font-bold">
                <image src="/static/info/审核不通过@2x.png" mode="aspectFill" class="w-46 h-46 mr-15 ml-31"></image>
                审核不通过
            </view>
            <view class="fs-27 color2 lh-38 ml-27 mt-15 mb-23">
                信息填写不规范,请重新填写
                {{ info.refuseReason }}
            </view>
        </view> -->
        <view class="">
        </view>
        <view v-if="info.auditStatus === 0" class="">
            <view class="flex a-center color2 fs-44 font-bold pb-38">
                <image src="/static/info/审核中@2x.png" mode="aspectFill" class="w-46 h-46 mr-15 ml-31"></image>
                审核中
@@ -21,15 +21,17 @@
                    姓名
                </view>
                <view class="value">
                    <input type="text" placeholder="请输入姓名" placeholder-class="placeholderStyle" class="fs-27" />
                    <input type="text" v-model="form.name" :disabled="disable" placeholder="请输入姓名"
                        placeholder-class="placeholderStyle" class="fs-27" />
                </view>
            </view>
            <view class="formItem border1">
                <view class="label">
                    身份证号
                </view>
                <view class="value">
                    <input type="text" placeholder="请输入身份证号" placeholder-class="placeholderStyle" class="fs-27" />
                <view class="value flex1">
                    <input type="text" v-model="form.idNumber" :disabled="disable" placeholder="请输入身份证号"
                        placeholder-class="placeholderStyle" class="fs-27" />
                </view>
            </view>
            <view class="formItem border1">
@@ -37,8 +39,9 @@
                    服务社区
                </view>
                <view @tap.stop="showSelectCommunity" class="value flex j-between a-center flex1">
                    <text class="placeholderStyle">请选择服务社区</text>
                    <image src="/static/Appeal/left.png" mode="aspectFill" class="h-19 w-19"></image>
                    <text v-if="address">{{ address }}</text>
                    <text v-else class="placeholderStyle">请选择服务社区</text>
                    <image src="/static/Appeal/left.png" mode="aspectFill" class="h-19 w-19 ml-10"></image>
                </view>
            </view>
            <view class="formItem border1">
@@ -46,7 +49,8 @@
                    服务对象
                </view>
                <view class="value">
                    <input type="text" placeholder="请输入服务对象" placeholder-class="placeholderStyle" class="fs-27" />
                    <input type="text" v-model="form.serviceTarget" :disabled="disable" placeholder="请输入服务对象"
                        placeholder-class="placeholderStyle" class="fs-27" />
                </view>
            </view>
            <view class="formItem border1">
@@ -54,7 +58,8 @@
                    所在党组织
                </view>
                <view class="value">
                    <input type="text" placeholder="请输入所在党组织" placeholder-class="placeholderStyle" class="fs-27" />
                    <input type="text" v-model="form.partyOrganization" :disabled="disable" placeholder="请输入所在党组织"
                        placeholder-class="placeholderStyle" class="fs-27" />
                </view>
            </view>
            <view class="color1 fs-27 mt-35 ml-31">
@@ -74,41 +79,41 @@
                <!--     <view v-if="imgUrls.includes('loading')" class="w-140 h-140 flex a-center j-center mr-15 border2 br-8">
                    <u-loading-icon></u-loading-icon>
                </view> -->
                <image @tap="uploadImg(1)" src="/static/Appeal/add.png" class="w-140 h-140 shrink0" />
                <image v-if="localImageUrls.length == 0" @tap="uploadImg(1)" src="/static/Appeal/add.png"
                    class="w-140 h-140 shrink0" />
            </view>
            <view class="h-146">
            <view v-if="detail == 1" class="h-212">
            </view>
            <!-- <view class="h-212">
            </view> -->
        </view>
            <view v-else class="h-146">
        <view class="footerButton">
            <view class="btns">
                <view class="ok fs-35 font-bold">
                    保存
                </view>
            </view>
        </view>
        <!-- <view class="footer">
        <view v-if="detail == 1" class="footer">
            <view class="tip">
                可编辑后重新提交审核!
            </view>
            <view class="btns">
                <view class="cancel">
                <view class="cancel" @click="back">
                    关闭
                </view>
                <view class="ok">
                    编辑
                <view class="ok" @click="save">
                    {{ disable ? '编辑' : '保存' }}
                </view>
            </view>
        </view> -->
        </view>
        <view v-else class="footerButton">
            <view class="btns">
                <view @click="save" class="ok fs-35 font-bold">
                    保存
                </view>
            </view>
        </view>
        <!-- 选择服务社区 -->
        <u-popup :show="selectPopup" round="16rpx" :close-on-click-overlay="false" @open="openSelectPopup">
            <view class="relative">
        <u-popup :show="selectPopup" round="16rpx" @close="selectPopup = false" :safe-area-inset-bottom="false"
            @open="openSelectPopup">
            <view class="relative pb-40">
                <image @tap.stop="selectPopup = false" src="@/static/closeImg.png" class="w-35 h-35 absolute"
                    style="right: 31rpx;top: 46rpx;" />
                <view class="txt-center pt-38 pb-40 fs-35 lh-48 font-bold">请选择服务社区</view>
@@ -118,32 +123,46 @@
                    <view class="flex1">社区</view>
                </view>
                <view class="mb-20">
                    <picker-view :value="value" @change="bindChange" class="picker-view">
                    <picker-view :value="value" @change="bindChange" class="picker-view" immediate-change>
                        <picker-view-column>
                            <view class="item" v-for="(item, index) in county" :key="index">
                                {{ item }}
                                {{ item.name }}
                            </view>
                        </picker-view-column>
                        <picker-view-column>
                            <view class="item" v-for="(item, index) in street" :key="index">
                                {{ item }}
                                {{ item.name }}
                            </view>
                        </picker-view-column>
                        <picker-view-column>
                            <view class="item" v-for="(item, index) in community" :key="index">
                                {{ item }}
                                {{ item.name }}
                            </view>
                        </picker-view-column>
                    </picker-view>
                </view>
                <view class="submitBtn">确认</view>
                <view class="submitBtn" @click="chooseCommunity">确认</view>
            </view>
        </u-popup>
        <CustomPopup ref="savePop" :isOneBtn="true" @comfirm="back">
            <view class="txt-center fs-31 lh-42 pt-44 pb-35 color5">
                <view class="">
                    提交成功,党员信息已提交平
                </view>
                台审核!
            </view>
        </CustomPopup>
    </view>
</template>
<script>
    import config from '@/config/index.js'
    import {
        getRegionTree,
        apply,
        getDetail,
        edit
    } from './service.js'
    export default {
        data() {
            return {
@@ -151,80 +170,264 @@
                localImageUrls: [],
                selectPopup: false,
                value: [0, 0, 0],
                confirmValue: [0, 0, 0],
                county: [], //区县
                street: [], //街道
                community: [], //社区
                form: {},
                address: '',
                detail: '',
                disable: false,
                info: {},
                loading: false, // 新增加载状态
                uploading: false // 新增上传状态
            }
        },
        onLoad(e) {
            this.getTree()
            if (e.detail == 1) {
                this.detail = e.detail
                this.disable = true
            }
            if (e.detail == 2) {
                this.detail = e.detail
            }
        },
        methods: {
            bindChange(e) {
            // 返回小程序主页
            back() {
                let userInfo = uni.getStorageSync('userInfo')
                if (userInfo.isAdmin) {
                    uni.navigateBack()
                }
            },
            // 提交(优化后)
            async save() {
                if (this.detail && this.disable) {
                    this.disable = false
                    return
                }
                if (this.loading) return;
                this.loading = true;
                try {
                    // 必填字段校验
                    const requiredFields = [{
                            field: this.form.name?.trim(),
                            message: '请输入姓名'
                        },
                        {
                            field: this.form.idNumber?.trim(),
                            message: '请输入身份证号'
                        },
                        {
                            field: this.form.districtsCode,
                            message: '请选择区县'
                        },
                        {
                            field: this.form.streetId,
                            message: '请选择街道'
                        },
                        {
                            field: this.form.communityId,
                            message: '请选择社区'
                        },
                        {
                            field: this.imgUrls[0],
                            message: '请上传头像'
                        }
                    ];
                    const invalidField = requiredFields.find(({
                        field
                    }) => !field);
                    if (invalidField) {
                        uni.showToast({
                            title: invalidField.message,
                            icon: 'none'
                        });
                        return;
                    }
                    // 身份证格式校验
                    if (!this.validateIdNumber(this.form.idNumber)) {
                        uni.showToast({
                            title: '身份证号码格式不正确',
                            icon: 'none'
                        });
                        return;
                    }
                    this.form.avatar = this.imgUrls[0];
                    if (this.detail) {
                        await edit(this.form);
                        this.loading = false;
                    } else {
                        await apply(this.form);
                        this.loading = false;
                    }
                    this.$refs.savePop.showPopup();
                } catch (error) {
                    uni.showToast({
                        title: '提交失败,请重试',
                        icon: 'none'
                    });
                } finally {
                    this.loading = false;
                }
            },
            // 新增身份证验证方法
            validateIdNumber(id) {
                const reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
                return reg.test(id);
            },
            //选择服务社区
            chooseCommunity() {
                this.form.districts = this.county[this.value[0]].name
                this.form.districtsCode = this.county[this.value[0]].id
                this.form.street = this.street[this.value[1]].name
                this.form.streetId = this.street[this.value[1]].id
                this.form.community = this.community[this.value[2]].name
                this.form.communityId = this.community[this.value[2]].id
                this.address = `${this.form.districts}-${this.form.street}-${this.form.community}`;
                this.confirmValue = this.value
                this.selectPopup = false
            },
            // 获取社区树结构(优化后)
            async getTree() {
                try {
                    let userInfo = uni.getStorageSync('userInfo');
                    const res = await getRegionTree();
                    if (this.detail) {
                        const res1 = await getDetail();
                        this.info = res1.data
                        userInfo = res1.data
                        this.form.name = userInfo.name
                        this.form.idNumber = userInfo.idNumber
                        this.form.serviceTarget = userInfo.serviceTarget
                        this.form.partyOrganization = userInfo.partyOrganization
                        this.form.avatar = userInfo.avatar
                        this.localImageUrls = [userInfo.avatar]
                        this.imgUrls = [userInfo.avatar]
                    }
                    this.county = res.data;
                    if (userInfo?.districtsCode && userInfo?.streetId && userInfo?.communityId) {
                        const index1 = this.county.findIndex(item => userInfo.districtsCode === item.id);
                        if (index1 !== -1) {
                            this.street = this.county[index1].children;
                            const index2 = this.street.findIndex(item => userInfo.streetId === item.id);
                            if (index2 !== -1) {
                                this.community = this.street[index2].children;
                                const index3 = this.community.findIndex(item => userInfo.communityId === item.id);
                                if (index3 !== -1) {
                                    this.confirmValue = [index1, index2, index3];
                                    this.form = {
                                        ...this.form,
                                        districts: this.county[index1].name,
                                        districtsCode: this.county[index1].id,
                                        street: this.street[index2].name,
                                        streetId: this.street[index2].id,
                                        community: this.community[index3].name,
                                        communityId: this.community[index3].id
                                    };
                                    this.address = `${this.form.districts}-${this.form.street}-${this.form.community}`;
                                }
                            }
                        }
                    }
                } catch (error) {
                    uni.showToast({
                        title: '获取社区信息失败',
                        icon: 'none'
                    });
                }
            },
            // 切换社区
            bindChange(e, index) {
                if (e.detail.value[0] != this.value[0]) {
                    e.detail.value[1] = 0
                    e.detail.value[2] = 0
                }
                if (e.detail.value[1] != this.value[1]) {
                    e.detail.value[2] = 0
                }
                this.value = e.detail.value
                this.street = this.county[this.value[0]].children
                this.community = this.street[this.value[1]].children
            },
            showSelectCommunity() {
                this.selectPopup = true
                if (!this.disable) {
                    this.selectPopup = true
                }
            },
            delImg(item) {
                this.localImageUrls = this.localImageUrls.filter(i => i != item)
                this.imgUrls = this.imgUrls.filter(i => i != item)
                if (!this.disable) {
                    this.localImageUrls = this.localImageUrls.filter(i => i != item)
                    this.imgUrls = this.imgUrls.filter(i => i != item)
                }
            },
            viewImage(item) {
                uni.previewImage({
                    urls: [item]
                })
            },
            // 图片上传(优化后)
            uploadImg() {
                if (this.uploading || this.disable) return;
                this.uploading = true;
                uni.chooseImage({
                    count: 1,
                    success: (chooseImageRes) => {
                        this.imgUrls.push('loading')
                        let imgPathList = chooseImageRes.tempFilePaths;
                        if (imgPathList.length > 0) {
                            uni.uploadFile({
                                url: config.imageUrl,
                                filePath: imgPathList[0],
                                timeout: 1000 * 45,
                                name: 'file',
                                header: {
                                    Authorization: uni.getStorageSync('token')
                                },
                                success: (res) => {
                                    if (JSON.parse(res.data).code == 200) {
                                        this.imgUrls = this.imgUrls.filter(item => item !=
                                            'loading')
                                        this.$nextTick(() => {
                                            this.imgUrls.push(JSON.parse(res.data)
                                                .data)
                                            this.localImageUrls.push(imgPathList[0])
                                        })
                                    } else {
                                        this.imgUrls = this.imgUrls.filter(
                                            item => item != 'loading')
                                        uni.showToast({
                                            title: '上传失败,请重新上传',
                                            icon: 'none',
                                            mask: true
                                        })
                    success: async (chooseImageRes) => {
                        try {
                            this.imgUrls.push('loading');
                            const imgPathList = chooseImageRes.tempFilePaths;
                            if (imgPathList.length > 0) {
                                const res = await uni.uploadFile({
                                    url: config.imageUrl,
                                    filePath: imgPathList[0],
                                    timeout: 1000 * 45,
                                    name: 'file',
                                    header: {
                                        Authorization: uni.getStorageSync('token')
                                    }
                                },
                                fail: (err) => {
                                    this.imgUrls = this.imgUrls.filter(
                                        item => item != 'loading')
                                    uni.showToast({
                                        title: '上传失败,请重新上传',
                                        icon: 'none',
                                        mask: true
                                    })
                                });
                                const data = JSON.parse(res.data);
                                if (data.code === 200) {
                                    this.imgUrls = this.imgUrls.filter(item => item !== 'loading');
                                    this.imgUrls.push(data.data);
                                    this.localImageUrls.push(imgPathList[0]);
                                } else {
                                    throw new Error('上传失败');
                                }
                            })
                            }
                        } catch (error) {
                            this.imgUrls = this.imgUrls.filter(item => item !== 'loading');
                            uni.showToast({
                                title: '上传失败,请重新上传',
                                icon: 'none',
                                mask: true
                            });
                        }
                    },
                    fail: () => {}
                })
                    fail: () => {
                        uni.showToast({
                            title: '选择图片失败',
                            icon: 'none'
                        });
                    },
                    complete: () => {
                        this.uploading = false;
                    }
                });
            },
            openSelectPopup() {
                this.county = ['仁和区']
                this.street = ['仁和镇']
                this.community = ['仁和街社区']
                this.value = this.confirmValue
                this.street = this.county[this.value[0]].children
                this.community = this.street[this.value[1]].children
            }
        }
    }
@@ -338,6 +541,14 @@
        color: #fff;
    }
    .color5 {
        color: #666160;
    }
    .bgcolor5 {
        background-color: rgba(0, 0, 0, .23);
    }
    .placeholderStyle {
        color: #B2B2B2;
    }
H5/pages/authentication/service.js
New file
@@ -0,0 +1,20 @@
import request from '@/utils/request.js'
// 获取区县-街道-社区树
export const getRegionTree =()=>{
    return request.get(`/api/huacheng-sangeshenbian/bc-region/regionTree-applet`)
}
// 党员申请
export const apply =(params)=>{
    return request.post(`/api/huacheng-sangeshenbian/applet/party-member/apply`,params)
}
// 编辑党员信息
export const edit =(params)=>{
    return request.post(`/api/huacheng-sangeshenbian/applet/party-member/edit`,params)
}
// 党员信息详情
export const getDetail =(params)=>{
    return request.post(`/api/huacheng-sangeshenbian/applet/party-member/detail`, params)
}
H5/pages/components/certificate/certificate.vue
@@ -6,7 +6,7 @@
                    <text class="fs-35 font-bold color3 mt-46">党员证件</text>
                    <view class="bg font-w500 fs-23 mt-38 flex  flex-column a-center">
                        <image src="/static/home/img9.png" class="w-133 h-156 mt-52" mode=""></image>
                        <view class="flex">
                        <view class="flex j-between" style="width: 481rpx;">
                            <view class="flex flex-column mr-40 lh-44">
                                <text>姓名:</text>
                                <text>身份证号码:</text>
@@ -16,7 +16,7 @@
                            <view class="flex flex-column a-end font-bold lh-44">
                                <text>{{info.name}}</text>
                                <text>{{info.idCard}}</text>
                                <text>仁和区-仁和镇-仁和街社区</text>
                                <text>{{info.districts}}-{{ info.street }}-{{ info.community }}</text>
                                <text>{{info.partyOrganization}}</text>
                            </view>
                        </view>
@@ -26,7 +26,7 @@
                        <view class="btn_left" @click="onclose">
                            关闭
                        </view>
                    <!--     <view class="btn_right" @click="onclose">
                        <!--     <view class="btn_right" @click="onclose">
                            编辑
                        </view> -->
                    </view>
@@ -47,16 +47,15 @@
        },
        data() {
            return {
info:{},
                info: {},
            };
        },
        methods: {
            open() {
                getInfo().then(resp => {
                    if(resp.code==200){
                        this.info =resp.data
                    if (resp.code == 200) {
                        this.info = resp.data
                    }
                })
            },
H5/pages/index/index.vue
@@ -17,16 +17,23 @@
                </swiper>
            </view>
        </view>
        <!-- <view class="flex fs-27 font-bold a-center pt-38 pl-31">
        <view v-if="userInfo.isAdmin == 0" class="flex fs-27 font-bold a-center pt-38 pl-31">
            <image src="/static/home/社区@2x.png" mode="aspectFill" class="w-31 h-31 mr-12"></image>
            服务社区:文化社区
        </view> -->
        <view class="flex j-between a-center pt-38 pl-31 pr-31">
            服务社区:{{ userInfo.roleName }}
        </view>
        <view v-if="userInfo.isAdmin == 1" class="flex j-between a-center pt-38 pl-31 pr-31">
            <view class="flex fs-27 font-bold a-center">
                <image src="/static/home/角色管理@2x.png" mode="aspectFill" class="w-31 h-31 mr-12"></image>
                当前角色:沙沟社区管理员
                <view class="flex a-center">
                    <view class="shrink0">
                        当前角色:
                    </view>
                    <view class="">
                        {{ userInfo.roleName }}
                    </view>
                </view>
            </view>
            <view class="fs-23 flex a-center border1 w-154 h-38 j-center br-29">
            <view @click="showChangeRole" class="fs-23 flex a-center border1 w-154 h-38 j-center br-29">
                <image src="/static/home/切换@2x.png" mode="aspectFill" class="w-19 h-19 mr-8"></image>
                切换角色
            </view>
@@ -38,9 +45,14 @@
                <text class="color2 fs-27" @click="showData =!showData">查看更多</text>
            </view>
            <view class="flex flex-wrap j-between">
                <view class="pt-38 pb-38 bg1 w-333 br-19 mt-19 flex a-center relative" :class="true ? 'bg2' : 'bg1'"
                    @click="onClick()">
                    <!-- <image src="/static/home/审核中@2x (1).png" mode="aspectFill" class="w-112 h-85 absolute" style="right: -12rpx;top: -23rpx;"></image> -->
                <view class="pt-38 pb-38 bg1 w-333 br-19 mt-19 flex a-center relative"
                    :class="userInfo.isPartymember === false && 'bg2'" @click="onClick()">
                    <image v-if="userInfo.auditStatus === null" src="/static/home/注册@2x.png" mode="aspectFill"
                        class="w-112 h-85 absolute" style="right: -12rpx;top: -23rpx;"></image>
                    <image v-if="userInfo.auditStatus == 2" src="/static/home/拒绝@2x.png" mode="aspectFill"
                        class="w-112 h-85 absolute" style="right: -12rpx;top: -23rpx;"></image>
                    <image v-if="userInfo.auditStatus == 0" src="/static/home/审核中@2x (1).png" mode="aspectFill"
                        class="w-112 h-85 absolute" style="right: -12rpx;top: -23rpx;"></image>
                    <image class="w-94 h-77 ml-38" src="/static/home/img7.png" mode=""></image>
                    <text class="ml-37 font-bold">党员证件</text>
                </view>
@@ -61,7 +73,7 @@
                    <image class="w-81 h-77 ml-38" src="/static/home/img8.png" mode=""></image>
                    <text class="ml-37 font-bold">统计分析</text>
                </view>
                <view class="pt-38 pb-38 bg1 w-333 br-19 mt-19 flex a-center" v-if="showData">
                <view class="pt-38 pb-38 bg1 w-333 br-19 mt-19 flex a-center" v-if="showData && userInfo.isAdmin == 1">
                    <image class="w-81 h-77 ml-38" src="/static/home/Group 2@2x.png" mode=""></image>
                    <text class="ml-37 font-bold">党员审核</text>
                </view>
@@ -92,49 +104,87 @@
                    <view class="flex a-center mb-27" v-for="item in isactive==1?msgList:msgLists" :key="item.id">
                        <view class="avater pb-33">
                            <image class="w-85 h-85 br50" src="/static/home/img9.png" mode=""></image>
                            <view class="tips" v-if="item.readStatus==2">
                            </view>
                            <view class="tips" v-if="item.readStatus==2"></view>
                        </view>
                        <view class="border-b flex1 ml-18 pb-33">
                            <view class="fs-31  font-w500 flex  flex1 j-between">
                                <text>{{item.title}}</text>
                                <text class="fs-23 font-w400">{{item.time}}</text>
                            </view>
                            <view class="fs-27 flex j-between mt-8">
                                <text style="color: rgba(102, 102, 102, 1);">{{item.promptType==1?'临期提醒':'超时提醒'}}</text>
                                <view class="read" v-if="item.readStatus==1">已读</view>
                                <view class="noread" v-else>未读</view>
                            </view>
                        </view>
                    </view>
                    <text v-if="isactive==1?msgList.length > 0:msgLists.length > 0"
                        class="flex j-center fs-27 color4 pb-48" @click="Allread">全部已读</text>
                </view>
            </view>
        </view>
        <popupCertificate :show="isClick" @onCancel="isClick=false"></popupCertificate>
        <!-- 用户多个角色时切换角色弹窗 -->
        <u-popup :show="changeRolePopup" round="16rpx" @close="changeRolePopup = false">
            <view class="relative">
                <image @tap.stop="changeRolePopup = false" src="@/static/closeImg.png" class="w-35 h-35 absolute"
        <u-popup :show="changeRolePopup" round="16rpx" @close="closeChangeRole">
            <view class="relative pb-20">
                <image @tap.stop="closeChangeRole" src="@/static/closeImg.png" class="w-35 h-35 absolute"
                    style="right: 31rpx;top: 46rpx;" />
                <view class="txt-center pt-38 pb-40 fs-35 lh-48 font-bold">选择角色</view>
                <view class="lineBox mb-10"></view>
                <view style="height: 546rpx;overflow-y: auto;">
                    <view @tap.stop="changeRole(item)" v-for="(item,index) in 10" :key="index"
                        :class="index == activeRole && 'bgcolor2'"
                    <view @tap.stop="changeRole(item)" v-for="(item,index) in userInfo.permissions" :key="index"
                        :class="item.identity == userInfo.identity && 'bgcolor2'"
                        class="mt-38 bgcolor1 br-58 fs-31 ml-54 mr-62 py-37 txt-center">
                        <view>XXXXXXXX管理员</view>
                        <view>{{ item.name }}</view>
                    </view>
                </view>
            </view>
        </u-popup>
        <!-- 认证弹窗 -->
        <CustomPopup ref="renzhengPop" confirmText="去认证" @close="closeH5" @comfirm="toRenzheng">
            <view class="txt-center fs-31 lh-42 pt-50 pb-17 color5">
                <view class="">
                    您暂未认证党员信息,
                </view>
                请认证后查看!
            </view>
        </CustomPopup>
        <!-- 审核中弹窗 -->
        <CustomPopup ref="shenhePop" confirmText="查看详情" @close="closeH5" @comfirm="toRenzhengDetail">
            <view class="txt-center fs-31 lh-42 pt-50 pb-35 color5">
                <view class="">
                    您提交的党员信息正在审核中,
                </view>
                请稍后!
            </view>
        </CustomPopup>
        <!-- 拒绝弹窗 -->
        <CustomPopup ref="jujuePop" confirmText="查看详情" @close="closeH5" @comfirm="toRenzhengDetail">
            <view class="txt-center fs-31 lh-42 pt-50 pb-60 color5">
                您提交的党员信息审核不通过!
            </view>
        </CustomPopup>
        <!-- 冻结弹窗 -->
        <CustomPopup ref="dongjiePop" confirmText="确认" :isOneBtn="true" @comfirm="comfirmDongjie">
            <view class="txt-center fs-31 lh-42 pt-50 pb-60 color5">
                当前账号已冻结,请联系管理员!
            </view>
        </CustomPopup>
        <!-- 确认弹窗 -->
        <CustomPopup ref="confirmPop" confirmText="确认" :isCountDown="true" :isOneBtn="true" @comfirm="comfirm">
            <view class="txt-center fs-31 lh-42 pt-48 pb-58 color5">
                <view class="">
                    请仔细核对账号信息以及功能是否与
                </view>
                <view class="">
                    组织要求的职责匹配,如不匹配,请
                </view>
                <view class="">
                    向社区、部门反映修改权限!
                </view>
            </view>
        </CustomPopup>
    </view>
</template>
@@ -145,7 +195,10 @@
        getBanner,
        getMessagelist,
        getappletcinfo,
        getread
        getread,
        getCurrentUserInfo,
        changeIdentity,
        confirmContent
    } from './service.js'
    export default {
        components: {
@@ -162,7 +215,6 @@
                msgList: [],
                msgLists: [],
                msgListTotal: [],
                member: 1,
                userInfo: {},
                isLoading: false,
                noreadlist: [],
@@ -187,35 +239,143 @@
            if (e.token) {
                uni.setStorageSync('token', 'Bearer ' + e.token)
            }
        },
        onShow() {
            this.getBanner()
            this.getMessagelist()
            this.getappletcinfo()
        },
        methods: {
            changeRole(item) {
                this.activeRole = item - 1
            // 管理员确认
            comfirm() {
                confirmContent()
            },
            //关闭切换角色弹窗
            closeChangeRole() {
                this.getMessagelist()
                this.getappletcinfo()
                this.changeRolePopup = false
            },
            //确认冻结
            comfirmDongjie() {
                let arr = this.userInfo.permissions.filter(item => {
                    return !item.isFrozen
                })
                if (arr.length == 0) {
                    //全部身份被冻结,返回小程序主页
                } else {
                    this.changeRolePopup = true
                }
            },
            // 认证详情
            toRenzhengDetail() {
                uni.navigateTo({
                    url: '/pages/authentication/authentication?detail=1'
                })
            },
            // 切换角色
            changeRole(e) {
                if (e.isFrozen) {
                    //冻结状态
                    this.changeRolePopup = false
                    this.$refs.dongjiePop.showPopup()
                } else {
                    changeIdentity({
                        identity: e.identity
                    }).then(res => {
                        this.changeRolePopup = false
                        this.getMessagelist()
                        this.getappletcinfo()
                    })
                }
            },
            showChangeRole() {
                this.changeRolePopup = true
            },
            // 跳转认证
            toRenzheng() {
                uni.navigateTo({
                    url: '/pages/authentication/authentication'
                })
            },
            // 关闭webview
            closeH5() {
                if (this.userInfo.isAdmin == 1) {
                    //是上级则不返回小程序
                    return
                }
                wx.config({
                    debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来
                    appld: 'wx0cef797390444b75',
                    timestamp: 1742191791, // 必填,生成签名的 时间戳
                    noncestr: '312321412', // 必填,生成签名的随机串
                    signature: '614377884544e5d51a9f327e90160199ddae04e4', // 必填,签名
                    jsApiList: [] // 必填,需要使用的JS接口列表
                })
                wx.miniProgram.navigateBack()
            },
            Allread() {
                getread().then(resp => {
                    this.getMessagelist()
                })
            },
            getBanner() {
                getBanner().then(resp => {
                    this.bannerlist = resp.data
                })
            },
            getappletcinfo() {
                getappletcinfo().then(resp => {
            async getappletcinfo() {
                // 获取三个身边当前用户信息 用于判断用户是否是上级
                let res = await getCurrentUserInfo()
                // 获取身份信息
                let resp = await getappletcinfo()
                if (resp.data.permissions.length > 0) {
                    resp.data.roleName = resp.data.permissions.find(item => item.identity == resp.data.identity).name
                }
                resp.data.isAdmin = res.data ? 1 : 0
                this.userInfo = {
                    ...resp.data,
                    ...res.data
                }
                uni.setStorageSync('userInfo', this.userInfo)
                if (this.userInfo.isFrozen) {
                    //账号被冻结
                    this.$refs.dongjiePop.showPopup()
                    return
                }
                if (!this.userInfo.isPartymember && this.userInfo.identity == '1' && this.userInfo.auditStatus ==
                    null) {
                    // 党员没有认证,多个角色
                    this.$refs.renzhengPop.showPopup()
                    return
                }
                if (!this.userInfo.isPartymember && this.userInfo.auditStatus === null && !this.userInfo.identity) {
                    // 没有认证过且没有提交认证,单个角色
                    this.$refs.renzhengPop.showPopup()
                    return
                }
                if (!this.userInfo.isPartymember && this.userInfo.auditStatus === 0 && this.userInfo.identity == '1') {
                    // 审核中
                    this.$refs.shenhePop.showPopup()
                    return
                }
                if (!this.userInfo.isPartymember && this.userInfo.auditStatus === 2 && this.userInfo.identity == '1') {
                    // 审核拒绝
                    this.$refs.jujuePop.showPopup()
                    return
                }
                if (this.userInfo.identity == 1 && !this.userInfo.isConfirm && this.userInfo.auditStatus == 1) {
                    //没有确认党员信息
                    uni.navigateTo({
                        url: '/pages/party-member-info/party-member-info'
                    })
                    return
                }
                    this.userInfo = resp.data
                    this.member = resp.data ? 2 : 1
                    uni.setStorageSync('userInfo', resp.data)
                    uni.setStorageSync('member', this.member)
                })
                if (this.userInfo.identity == 2 && !this.userInfo.isConfirmContent) {
                    //管理员确认
                    this.$refs.confirmPop.showPopup()
                }
            },
            getMessagelist() {
                const data = {
@@ -239,7 +399,6 @@
                        const timeDifference = new Date().getTime() - new Date(item.createTime)
                            .getTime()
                        // 使用 dayjs 的 duration 来处理时间差
                        // 计算总秒数
                        const totalSeconds = Math.floor(timeDifference / 1000);
@@ -288,10 +447,23 @@
            change() {
            },
            onClick() {
                if (!this.userInfo.isPartymember && this.userInfo.auditStatus === null) {
                    // 没有认证过且没有提交认证
                    this.$refs.renzhengPop.showPopup()
                    return
                }
                if (!this.userInfo.isPartymember && this.userInfo.auditStatus === 0) {
                    // 认证审核中
                    this.$refs.shenhePop.showPopup()
                    return
                }
                if (!this.userInfo.isPartymember && this.userInfo.auditStatus === 2) {
                    // 认证拒绝
                    this.$refs.jujuePop.showPopup()
                    return
                }
                this.isClick = true
            },
            goTopage() {
                uni.navigateTo({
@@ -335,6 +507,10 @@
        color: rgba(0, 0, 0, 0.4);
    }
    .color5 {
        color: #666160;
    }
    .bgcolor1 {
        background: #F7F7F7;
    }
H5/pages/index/service.js
@@ -7,8 +7,17 @@
    return request.post(`/api/huacheng-sangeshenbian/applet/home/message`,params)
export const getappletcinfo =(params)=>{
    return request.get(`/api/huacheng-sangeshenbian/applet/home/identity-info`,params)
}
export const getCurrentUserInfo =(params)=>{
    return request.get(`/api/huacheng-sangeshenbian/applet/home/current-user-info`,params)
export const getread=(params)=>{
    return request.post(`/api/huacheng-sangeshenbian/applet/home/read`,params)
export const changeIdentity =(params)=>{
    return request.get(`/api/huacheng-sangeshenbian/applet/home/change-identity`,params)
}
export const confirmContent =(params)=>{
    return request.get(`/api/huacheng-sangeshenbian/applet/home/confirm-content`,params)
}
H5/pages/party-member-info/party-member-info.vue
@@ -6,7 +6,7 @@
                    姓名
                </view>
                <view class="value">
                    聂波岩
                    {{ info.name }}
                </view>
            </view>
            <view class="formItem border1">
@@ -14,7 +14,7 @@
                    身份证号
                </view>
                <view class="value">
                    500000200009096543
                    {{ info.idNumber }}
                </view>
            </view>
            <view class="formItem border1">
@@ -22,7 +22,7 @@
                    服务社区
                </view>
                <view class="value">
                    东区-东华街道-文化社区
                    {{ info.districts }}-{{ info.street }}-{{ info.community }}
                </view>
            </view>
            <view class="formItem border1">
@@ -30,24 +30,24 @@
                    所在党组织
                </view>
                <view class="value">
                    攀枝花组织部
                    {{ info.partyOrganization }}
                </view>
            </view>
            <view class="color1 fs-27 mt-35 ml-31">
                上传头像
            </view>
            <image src="/static/logo.png" mode="aspectFill" class="w-140 h-140 br-8 mt-27 ml-31"></image>
            <image :src="info.avatar" mode="aspectFill" class="w-140 h-140 br-8 mt-27 ml-31"></image>
        </view>
        <view class="footer">
            <view class="tip">
                请仔细确认您的党员信息是否正确!
            </view>
            <view class="btns">
                <view class="cancel">
                <view class="cancel" @click="toEdit">
                    有问题,去编辑
                </view>
                <view class="ok">
                    确认无误(3S)
                <view class="ok" :class="{ disabled: countdown > 0 }" @click="ok">
                    {{ countdown > 0 ? `确认无误(${countdown}S)` : '确认无误' }}
                </view>
            </view>
        </view>
@@ -55,95 +55,139 @@
</template>
<script>
    export default {
        data() {
            return {
            }
import { getDetail,confirm } from './service'
export default {
    data() {
        return {
            info: {},
            countdown: 3, // 新增倒计时
            timer: null // 新增定时器
        }
    },
    onLoad() {
        this.startCountdown();
        getDetail().then(res => {
            this.info = res.data
        })
    },
    methods: {
        ok() {
            if (this.countdown > 0) return;
            confirm().then(res => {
                uni.navigateBack()
            })
        },
        methods: {
        toEdit() {
            uni.redirectTo({
                url: '/pages/authentication/authentication?detail=2'
            })
        },
        // 新增倒计时方法
        startCountdown() {
            this.timer = setInterval(() => {
                if (this.countdown > 0) {
                    this.countdown--;
                } else {
                    clearInterval(this.timer);
                }
            }, 1000);
        }
    },
    // 组件销毁时清除定时器
    beforeDestroy() {
        if (this.timer) {
            clearInterval(this.timer);
        }
    }
}
</script>
<style scoped lang="scss">
    .content {
        background-image: url('/static/home/bg@2x.png');
        background-size: 750rpx 648rpx;
        padding-top: 100rpx;
        .container {
            background: #FFFFFF;
            border-radius: 35rpx 35rpx 0 0;
            .formItem {
                display: flex;
                align-items: center;
                justify-content: space-between;
                height: 112rpx;
                margin: 0 31rpx;
                font-size: 27rpx;
                .label {
                    opacity: 0.88;
                    font-weight: 400;
                }
                .value {
                    font-weight: 600;
                }
            }
        }
.disabled {
        opacity: 0.6;
        pointer-events: none;
    }
    .footer {
        position: fixed;
        bottom: 0;
        box-shadow: 0rpx -4rpx 27rpx 0rpx rgba(0,0,0,0.08);
        width: 100%;
        background-color: #fff;
        .tip {
            text-align: center;
            font-weight: 500;
            font-size: 27rpx;
            color: #FC8D55;
            padding-top: 31rpx;
        }
        .btns {
.content {
    background-image: url('/static/home/bg@2x.png');
    background-size: 750rpx 648rpx;
    padding-top: 100rpx;
    .container {
        background: #FFFFFF;
        border-radius: 35rpx 35rpx 0 0;
        .formItem {
            display: flex;
            justify-content: center;
            align-items: center;
            justify-content: space-between;
            height: 112rpx;
            margin: 0 31rpx;
            font-size: 27rpx;
            margin-top: 60rpx;
            margin-bottom: 33rpx;
            .cancel {
                width: 331rpx;
                height: 77rpx;
                border: 2rpx solid rgba(252, 141, 85, 1);
                border-radius: 38rpx;
                display: flex;
                align-items: center;
                justify-content: center;
                color: #FF4948;
            .label {
                opacity: 0.88;
                font-weight: 400;
            }
            .ok {
                width: 331rpx;
                height: 77rpx;
                background: linear-gradient( 270deg, #FC8D55 0%, #FF4948 100%);
                border-radius: 48rpx;
                display: flex;
                align-items: center;
                justify-content: center;
                margin-left: 27rpx;
                color: #FFFFFF;
            .value {
                font-weight: 600;
            }
        }
    }
    .border1 {
        border-bottom: 2rpx solid #EDEEEF;
}
.footer {
    position: fixed;
    bottom: 0;
    box-shadow: 0rpx -4rpx 27rpx 0rpx rgba(0, 0, 0, 0.08);
    width: 100%;
    background-color: #fff;
    .tip {
        text-align: center;
        font-weight: 500;
        font-size: 27rpx;
        color: #FC8D55;
        padding-top: 31rpx;
    }
    .color1 {
        color: #4C4C4C;
    .btns {
        display: flex;
        justify-content: center;
        font-size: 27rpx;
        margin-top: 60rpx;
        margin-bottom: 33rpx;
        .cancel {
            width: 331rpx;
            height: 77rpx;
            border: 2rpx solid rgba(252, 141, 85, 1);
            border-radius: 38rpx;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #FF4948;
        }
        .ok {
            width: 331rpx;
            height: 77rpx;
            background: linear-gradient(270deg, #FC8D55 0%, #FF4948 100%);
            border-radius: 48rpx;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-left: 27rpx;
            color: #FFFFFF;
        }
    }
}
.border1 {
    border-bottom: 2rpx solid #EDEEEF;
}
.color1 {
    color: #4C4C4C;
}
</style>
H5/pages/party-member-info/service.js
New file
@@ -0,0 +1,11 @@
import request from '@/utils/request.js'
// 党员信息详情
export const getDetail =(params)=>{
    return request.post(`/api/huacheng-sangeshenbian/applet/party-member/detail`, params)
}
// 确认党员信息
export const confirm =(params)=>{
    return request.get(`/api/huacheng-sangeshenbian/applet/party-member/confirm-party-member-info`, params)
}
H5/static/home/拒绝@2x.png
H5/static/home/注册@2x.png