identification.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <view>
  3. <uni-popup ref="popupRef" type="dialog" :animation="false" :is-mask-click="false"
  4. mask-background-color="rgba(0, 0, 0, 0.4);">
  5. <uni-popup-dialog mode="input" class="phone-ksxz-dialog" title="身份确认" :duration="2000" :before-close="true"
  6. cancelText="修改" @close="handleClose" @confirm="handleConfirm">
  7. <view class="ksxz-content-box">
  8. <view>头像:
  9. <image :src="data.icon" />
  10. </view>
  11. <view>姓名:{{data.realName}}</view>
  12. <view>电话:{{data.userName}}</view>
  13. <view>职业:{{data.zyName}}</view>
  14. <view>等级:{{data.zyLevelName}}</view>
  15. <view>身份证号(护照号):{{data.idcard}}</view>
  16. <view>性别:{{data.gender == 0?'未知': data.gender == '2' ? '女': '男'}}</view>
  17. </view>
  18. </uni-popup-dialog>
  19. </uni-popup>
  20. </view>
  21. </template>
  22. <script setup>
  23. import {
  24. ref,
  25. reactive
  26. } from "vue"
  27. const popupRef = ref(null)
  28. const data = reactive({
  29. realName: '',
  30. userName: '',
  31. zyLevelName: '',
  32. zyName: '',
  33. idcard: '',
  34. icon: '',
  35. gender: '',
  36. userId: '',
  37. })
  38. const emits = defineEmits(['confirm', 'changeData'])
  39. function showDialog(options) {
  40. data.realName = options.realName;
  41. data.userName = options.userName;
  42. data.zyLevelName = options.zyLevelName;
  43. data.zyName = options.zyName;
  44. data.idcard = options.idcard;
  45. data.icon = options.icon;
  46. data.userId = options.userId;
  47. data.gender = options.gender; // 1男 2女 0未知
  48. popupRef.value.open()
  49. }
  50. function handleClose() {
  51. emits('changeData');
  52. popupRef.value.close()
  53. }
  54. function handleConfirm() {
  55. emits('confirm', data);
  56. popupRef.value.close()
  57. }
  58. defineExpose({
  59. showDialog
  60. })
  61. </script>
  62. <style lang="scss">
  63. </style>