imageDialog.vue 1020 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <uni-popup ref="passwordPopup" :animation="false" :is-mask-click="false"
  3. mask-background-color="rgba(0, 0, 0, 0.4)">
  4. <view class="phone-common-dialog">
  5. <view class="common-body-box">
  6. <view class="common-title">二维码</view>
  7. <img :src="imgSrc" class="code-img"/>
  8. <view class="common-btn-box">
  9. <view class="confirm-btn" @click="handleClose">关闭</view>
  10. </view>
  11. </view>
  12. </view>
  13. </uni-popup>
  14. </template>
  15. <script setup>
  16. import * as myApi from "@/api/my.js";
  17. import {ref,reactive} from "vue"
  18. const passwordPopup = ref(null); // 索引
  19. const imgSrc = ref('');
  20. // const $emit = defineEmits(['confirm-btn'])
  21. function init(){
  22. myApi.getGlMineQrcode().then(res => {
  23. imgSrc.value = res.data;
  24. })
  25. }
  26. // 打开弹窗
  27. function handleShow() {
  28. init();
  29. passwordPopup.value.open();
  30. }
  31. // 取消
  32. function handleClose() {
  33. passwordPopup.value.close();
  34. }
  35. defineExpose({
  36. handleShow,
  37. handleClose
  38. })
  39. </script>
  40. <style>
  41. </style>