123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <template>
- <view>
- <uni-popup ref="popupRef" type="dialog" :animation="false" :is-mask-click="false"
- mask-background-color="rgba(0, 0, 0, 0.4);">
- <uni-popup-dialog mode="input" class="phone-ksxz-dialog" title="身份确认" :duration="2000" :before-close="true"
- cancelText="修改" @close="handleClose" @confirm="handleConfirm">
- <view @click="handleCloseOnly" class="ksxz-close-icon"></view>
- <view class="ksxz-content-box">
- <view class="ksxz-img-box">
- <!-- #ifdef H5 -->
- <img :src="data.icon" v-if="data.icon" alt="">
- <icon class="phone-default-userImg" v-else></icon>
- <!-- <image :src="data.icon" /> -->
- <!-- #endif -->
- </view>
- <view :class="{isEmpty: !data.realName}">姓名:{{data.realName}}</view>
- <view :class="{isEmpty: !data.realName}">电话:{{data.userName}}</view>
- <view>职业:{{data.zyName}}</view>
- <view>等级:{{data.zyLevelName}}</view>
- <view :class="{isEmpty: !data.realName}">证件号:{{data.idcard}}</view>
- </view>
- </uni-popup-dialog>
- </uni-popup>
- </view>
- </template>
- <script setup>
- import {
- ref,
- reactive
- } from "vue"
- const popupRef = ref(null)
- const data = reactive({
- realName: '',
- userName: '',
- zyLevelName: '',
- zyName: '',
- idcard: '',
- icon: '',
- gender: '',
- userId: '',
- })
- const emits = defineEmits(['confirm', 'changeData'])
- function handleCloseOnly() {
- popupRef.value.close()
- }
- function showDialog(options) {
- data.realName = options.realName;
- data.userName = options.userName;
- data.zyLevelName = options.zyLevelName;
- data.zyName = options.zyName;
- data.idcard = options.idcard;
- data.icon = options.icon;
- data.userId = options.userId;
- data.gender = options.gender; // 1男 2女 0未知
- popupRef.value.open()
- }
- function handleClose() {
- emits('changeData');
- popupRef.value.close()
- }
- function handleConfirm() {
- let arr = [];
- if (!data.realName) {
- arr.push('姓名');
- }
- if (!data.userName) {
- arr.push('电话');
- }
- if (!data.icon) {
- arr.push('头像');
- }
- if (!data.idcard) {
- arr.push('证件号');
- }
- if (!data.realName || !data.userName||!data.icon||!data.idcard) {
- uni.showToast({
- icon: 'none',
- title: `请完善${arr.join('、')}信息!`
- })
- return;
- }
-
- emits('confirm', data);
- popupRef.value.close()
- }
- defineExpose({
- showDialog
- })
- </script>
- <style scoped lang="scss">
- .isEmpty {
- color: #ff0101;
- }
- </style>
|