duihuanmaDialog.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <!-- 小弹窗 一行文字 -->
  2. <template>
  3. <uni-popup ref="tipSmallPopup" :animation="true" :is-mask-click="false"
  4. mask-background-color="rgba(255, 255, 255, 0.6);">
  5. <view class="ezy-tip-dialog tip-small-dialog duihuan-dialog" style="height: 100vh">
  6. <view class="tip-content-box">
  7. <view class="icon-title-navBar-box">
  8. <view class="nav-bar-title">{{title}}</view>
  9. </view>
  10. <view>{{nickName}}</view>
  11. <view>{{userName}}</view>
  12. <input class="duihuan-input" type="text" focus v-model="duihuamaValue" placeholder="请输入兑换码" />
  13. <view class="tip-btn-box">
  14. <view class="confirm-btn" @click="confirmBtn"></view>
  15. </view>
  16. </view>
  17. </view>
  18. </uni-popup>
  19. </template>
  20. <script setup>
  21. import { ref } from 'vue';
  22. const props = defineProps({
  23. title: {
  24. type: String,
  25. default: '提示'
  26. },
  27. content: {
  28. type: String,
  29. require: true,
  30. default: ''
  31. },
  32. userName: {
  33. type: String,
  34. default: ''
  35. },
  36. nickName: {
  37. type: String,
  38. default: ''
  39. },
  40. });
  41. const tipSmallPopup = ref(null); // 索引
  42. const duihuamaValue = ref(''); // 索引
  43. const $emit = defineEmits(['confirm-btn'])
  44. // 打开弹窗
  45. function handleShow() {
  46. tipSmallPopup.value.open('bottom');
  47. }
  48. // 取消
  49. function handleClose() {
  50. duihuamaValue.value = ''
  51. tipSmallPopup.value.close();
  52. }
  53. // 确认
  54. function confirmBtn(){
  55. $emit('confirm-btn',duihuamaValue.value);
  56. tipSmallPopup.value.close();
  57. duihuamaValue.value = ''
  58. }
  59. defineExpose({
  60. handleShow
  61. })
  62. </script>
  63. <style>
  64. </style>