|
|
<script setup>
|
|
|
/**
|
|
|
* name:
|
|
|
* user:sa0ChunLuyu
|
|
|
* date:2023年4月12日 19:00:04
|
|
|
*/
|
|
|
import {
|
|
|
ref
|
|
|
} from 'vue'
|
|
|
import {
|
|
|
UserPersonDeleteAction,
|
|
|
UserPersonListAction,
|
|
|
$image,
|
|
|
$response
|
|
|
} from '@/api'
|
|
|
import {
|
|
|
onShow
|
|
|
} from '@dcloudio/uni-app'
|
|
|
onShow(() => {
|
|
|
GetGreySet()
|
|
|
uni.$lu.user((info) => {
|
|
|
if (!!info.id) {
|
|
|
UserPersonList()
|
|
|
} else {
|
|
|
uni.reLaunch({
|
|
|
url: '/pages/main/home/home'
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
const user_person_list = ref([])
|
|
|
const UserPersonList = async () => {
|
|
|
const response = await UserPersonListAction()
|
|
|
$response(response, () => {
|
|
|
user_person_list.value = response.data.list
|
|
|
})
|
|
|
}
|
|
|
|
|
|
const toPersonClick = (id) => {
|
|
|
uni.navigateTo({
|
|
|
url: `/pages/user/edit/edit?id=${id}`
|
|
|
})
|
|
|
}
|
|
|
|
|
|
const del_show = ref(false)
|
|
|
const del_popup_ref = ref(null)
|
|
|
const delPopupRef = (e) => {
|
|
|
del_popup_ref.value = e
|
|
|
del_popup_ref.value.open('center')
|
|
|
}
|
|
|
const delChange = ({
|
|
|
show
|
|
|
}) => {
|
|
|
del_show.value = show
|
|
|
}
|
|
|
const delete_active = ref(0)
|
|
|
const UserPersonDelete = async () => {
|
|
|
const response = await UserPersonDeleteAction({
|
|
|
id: delete_active.value
|
|
|
})
|
|
|
$response(response, () => {
|
|
|
delete_active.value = 0
|
|
|
uni.$lu.toast(response.message)
|
|
|
del_show.value = false
|
|
|
UserPersonList()
|
|
|
})
|
|
|
}
|
|
|
const delPersonClick = (id) => {
|
|
|
delete_active.value = id
|
|
|
del_show.value = true
|
|
|
}
|
|
|
//设置灰度
|
|
|
const SysGreyType=ref(0)
|
|
|
const GetGreySet=()=>{
|
|
|
uni.getStorage({
|
|
|
key: 'SysGreytype',
|
|
|
success: function (res) {
|
|
|
console.log(res.data);
|
|
|
if(res.data==1){
|
|
|
SysGreyType.value=1
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
</script>
|
|
|
<template>
|
|
|
<view :class="SysGreyType==1? 'grey' :''">
|
|
|
<view v-if="del_show">
|
|
|
<uni-popup :ref="delPopupRef" background-color="#ffffff00" @change="delChange">
|
|
|
<view class="login_popup_wrapper">
|
|
|
<view class="top_blank_wrapper"></view>
|
|
|
<view class="login_popup_text_wrapper">
|
|
|
<view class="login_popup_text_title_wrapper">是否确认删除该体检人</view>
|
|
|
</view>
|
|
|
<view @click="UserPersonDelete()" class="login_popup_button_wrapper">确认</view>
|
|
|
<view @click="del_show = false" class="login_popup_cancel_button_wrapper">取消</view>
|
|
|
</view>
|
|
|
</uni-popup>
|
|
|
</view>
|
|
|
|
|
|
<view v-if="user_person_list.length === 0" class="no_person_wrapper">
|
|
|
<view class="no_person_icon_wrapper">
|
|
|
<image mode="scaleToFill" :src="$image('/storage/assets/mp/order/没有数据@2x.png')"></image>
|
|
|
</view>
|
|
|
<view class="no_person_text_wrapper">暂无体检人</view>
|
|
|
</view>
|
|
|
|
|
|
<view v-else class="user_person_list_wrapper">
|
|
|
<view v-for="(i,k) in user_person_list" :key="k" class="user_person_item_wrapper">
|
|
|
<view class="user_person_info_tag_wrapper" :class="[
|
|
|
i.relationship === '本人' ? 'user_person_info_tag_active_wrapper' : ''
|
|
|
]">{{ i.relationship }}</view>
|
|
|
<view class="user_person_info_content_wrapper">
|
|
|
<view class="user_person_info_wrapper">
|
|
|
<view class="user_person_info_name_wrapper">{{ i.name }}</view>
|
|
|
<view class="user_person_info_sex_wrapper">{{ Number(i.sex) === 1 ? '男' : '女' }}性</view>
|
|
|
<view class="user_person_info_marriage_wrapper">{{ Number(i.marriage) === 1 ? '已婚' : '未婚' }}</view>
|
|
|
</view>
|
|
|
<view class="user_person_info_id_number_wrapper">{{ i.id_number }}</view>
|
|
|
</view>
|
|
|
<view @click="delPersonClick(i.id)" class="button_wrapper">
|
|
|
<view class="button_icon_wrapper">
|
|
|
<image :src="$image('/storage/assets/mp/person/删除@2x.png')"></image>
|
|
|
</view>
|
|
|
<view class="button_text_wrapper">删除</view>
|
|
|
</view>
|
|
|
<view @click="toPersonClick(i.id)" class="button_wrapper edit_button_wrapper">
|
|
|
<view class="button_icon_wrapper">
|
|
|
<image :src="$image('/storage/assets/mp/person/编辑@2x.png')"></image>
|
|
|
</view>
|
|
|
<view class="button_text_wrapper">编辑</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view @click="toPersonClick(0)" class="add_button_wrapper">
|
|
|
<view class="add_button_icon_wrapper">
|
|
|
<image :src="$image('/storage/assets/mp/person/添加体检人@2x.png')"></image>
|
|
|
</view>
|
|
|
<view class="add_button_text_wrapper">添加体检人</view>
|
|
|
</view>
|
|
|
<view class="button_blank_wrapper"></view>
|
|
|
<view class="blank_wrapper"></view>
|
|
|
</view>
|
|
|
</template>
|
|
|
<style>
|
|
|
page {
|
|
|
background: #ffffff;
|
|
|
}
|
|
|
</style>
|
|
|
<style scoped>
|
|
|
.no_person_wrapper {
|
|
|
margin-top: 200rpx;
|
|
|
}
|
|
|
|
|
|
.no_person_icon_wrapper image {
|
|
|
width: 318rpx;
|
|
|
height: 251rpx;
|
|
|
display: block;
|
|
|
}
|
|
|
|
|
|
.no_person_icon_wrapper {
|
|
|
width: 318rpx;
|
|
|
height: 251rpx;
|
|
|
margin: 0 auto;
|
|
|
}
|
|
|
|
|
|
.no_person_text_wrapper {
|
|
|
font-size: 28rpx;
|
|
|
font-weight: 500;
|
|
|
color: #CDCDCD;
|
|
|
line-height: 1;
|
|
|
text-align: center;
|
|
|
margin-top: 20rpx;
|
|
|
}
|
|
|
|
|
|
.login_popup_text_title_wrapper {
|
|
|
font-size: 32rpx;
|
|
|
font-weight: bold;
|
|
|
color: #3D3D3D;
|
|
|
margin-top: 65rpx;
|
|
|
line-height: 42rpx;
|
|
|
line-height: 1;
|
|
|
}
|
|
|
|
|
|
.login_popup_cancel_button_wrapper {
|
|
|
width: 445rpx;
|
|
|
height: 84rpx;
|
|
|
background: #bbbbbb;
|
|
|
border-radius: 42rpx;
|
|
|
font-size: 30rpx;
|
|
|
font-weight: bold;
|
|
|
color: #FFFFFF;
|
|
|
line-height: 84rpx;
|
|
|
text-align: center;
|
|
|
margin: 38rpx auto 0;
|
|
|
}
|
|
|
|
|
|
.login_popup_button_wrapper {
|
|
|
width: 445rpx;
|
|
|
height: 84rpx;
|
|
|
background: linear-gradient(90deg, #23D3AF, #0DC5CF);
|
|
|
border: 2px solid #D0EEEF;
|
|
|
border-radius: 42rpx;
|
|
|
font-size: 30rpx;
|
|
|
font-weight: bold;
|
|
|
color: #FFFFFF;
|
|
|
line-height: 84rpx;
|
|
|
border: none !important;
|
|
|
margin: 80rpx auto 0;
|
|
|
text-align: center;
|
|
|
}
|
|
|
|
|
|
.login_popup_text_wrapper {
|
|
|
text-align: center;
|
|
|
}
|
|
|
|
|
|
.login_popup_icon_wrapper image {
|
|
|
width: 152rpx;
|
|
|
height: 152rpx;
|
|
|
display: block;
|
|
|
}
|
|
|
|
|
|
.login_popup_icon_wrapper {
|
|
|
width: 152rpx;
|
|
|
height: 152rpx;
|
|
|
position: absolute;
|
|
|
top: -64rpx;
|
|
|
left: 50%;
|
|
|
transform: translateX(-50%);
|
|
|
}
|
|
|
|
|
|
.login_popup_wrapper {
|
|
|
position: relative;
|
|
|
width: 569rpx;
|
|
|
height: 465rpx;
|
|
|
background: #FFFFFF;
|
|
|
box-shadow: 0rpx 2rpx 8rpx 0rpx rgba(0, 0, 0, 0.2);
|
|
|
border-radius: 20rpx;
|
|
|
}
|
|
|
|
|
|
.check_login_popup_wrapper {
|
|
|
position: relative;
|
|
|
z-index: 9999;
|
|
|
}
|
|
|
|
|
|
.user_person_info_tag_wrapper {
|
|
|
position: absolute;
|
|
|
width: 76rpx;
|
|
|
height: 32rpx;
|
|
|
background: #668EA7;
|
|
|
border-radius: 10rpx 0 10rpx 0;
|
|
|
font-size: 20rpx;
|
|
|
font-weight: 500;
|
|
|
color: #FAFDFE;
|
|
|
line-height: 32rpx;
|
|
|
text-align: center;
|
|
|
top: 0;
|
|
|
left: 0;
|
|
|
}
|
|
|
|
|
|
.user_person_info_tag_active_wrapper {
|
|
|
background: linear-gradient(-20deg, #0CBAED, #00DED7);
|
|
|
box-shadow: 2rpx 3rpx 2rpx 0 rgba(2, 95, 78, 0.2);
|
|
|
}
|
|
|
|
|
|
.edit_button_wrapper {
|
|
|
margin-left: 40rpx;
|
|
|
}
|
|
|
|
|
|
.button_text_wrapper {
|
|
|
font-size: 26rpx;
|
|
|
font-weight: 500;
|
|
|
color: #6A6A6A;
|
|
|
line-height: 1;
|
|
|
margin-left: 13rpx;
|
|
|
}
|
|
|
|
|
|
.button_icon_wrapper image {
|
|
|
width: 24rpx;
|
|
|
height: 26rpx;
|
|
|
display: block;
|
|
|
}
|
|
|
|
|
|
.button_icon_wrapper {
|
|
|
width: 24rpx;
|
|
|
height: 26rpx;
|
|
|
}
|
|
|
|
|
|
.button_wrapper {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
}
|
|
|
|
|
|
.user_person_info_id_number_wrapper {
|
|
|
font-size: 26rpx;
|
|
|
font-weight: 500;
|
|
|
color: #6A6A6A;
|
|
|
line-height: 1;
|
|
|
margin-top: 22rpx;
|
|
|
}
|
|
|
|
|
|
.user_person_info_content_wrapper {
|
|
|
margin-left: 40rpx;
|
|
|
width: 400rpx;
|
|
|
}
|
|
|
|
|
|
.user_person_info_marriage_wrapper {
|
|
|
font-size: 26rpx;
|
|
|
font-weight: 500;
|
|
|
color: #6A6A6A;
|
|
|
line-height: 1;
|
|
|
margin-left: 20rpx;
|
|
|
}
|
|
|
|
|
|
.user_person_info_sex_wrapper {
|
|
|
font-size: 26rpx;
|
|
|
font-weight: 500;
|
|
|
color: #6A6A6A;
|
|
|
line-height: 1;
|
|
|
margin-left: 20rpx;
|
|
|
}
|
|
|
|
|
|
.user_person_info_name_wrapper {
|
|
|
font-size: 30rpx;
|
|
|
font-weight: 500;
|
|
|
color: #181818;
|
|
|
line-height: 1;
|
|
|
}
|
|
|
|
|
|
.user_person_info_wrapper {
|
|
|
display: flex;
|
|
|
align-items: flex-end;
|
|
|
}
|
|
|
|
|
|
.button_blank_wrapper {
|
|
|
height: calc(120rpx + var(--safe-area-inset-bottom));
|
|
|
}
|
|
|
|
|
|
.user_person_list_wrapper {
|
|
|
margin-top: 40rpx;
|
|
|
}
|
|
|
|
|
|
.user_person_item_wrapper {
|
|
|
position: relative;
|
|
|
width: 690rpx;
|
|
|
height: 160rpx;
|
|
|
background: linear-gradient(0deg, rgba(235, 250, 251, 0.4), rgba(249, 254, 254, 0.4));
|
|
|
box-shadow: 0rpx 3rpx 6rpx 4rpx rgba(2, 95, 78, 0.07);
|
|
|
border-radius: 10rpx;
|
|
|
margin: 20rpx auto 0;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
}
|
|
|
|
|
|
.add_button_text_wrapper {
|
|
|
font-size: 31rpx;
|
|
|
font-weight: 500;
|
|
|
color: #F6FDFD;
|
|
|
margin-left: 32rpx;
|
|
|
}
|
|
|
|
|
|
.add_button_icon_wrapper image {
|
|
|
width: 30rpx;
|
|
|
height: 30rpx;
|
|
|
display: block;
|
|
|
}
|
|
|
|
|
|
.add_button_icon_wrapper {
|
|
|
width: 30rpx;
|
|
|
height: 30rpx;
|
|
|
}
|
|
|
|
|
|
.add_button_wrapper {
|
|
|
position: fixed;
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
|
z-index: 1;
|
|
|
width: 580rpx;
|
|
|
height: 90rpx;
|
|
|
background: linear-gradient(-90deg, #23D3AF, #0DC5CF);
|
|
|
border-radius: 45rpx;
|
|
|
bottom: calc(69rpx + var(--safe-area-inset-bottom));
|
|
|
left: 50%;
|
|
|
transform: translateX(-50%);
|
|
|
}
|
|
|
.grey{
|
|
|
filter: grayscale(100%);
|
|
|
}
|
|
|
</style> |