12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <!-- 中弹窗 二行文字 -->
- <template>
- <uni-popup ref="tipMiddlePopup" :animation="false" :is-mask-click="false"
- mask-background-color="rgba(255, 255, 255, 0.6);">
- <view class="phone-tip-dialog tip-middle-dialog">
- <view class="tip-content-box">
- <view class="tip-title">{{title}}</view>
- <view class="tip-content">{{content}}</view>
- <view class="tip-btn-box" style="position: relative">
- <view v-if="closeFlag" class="not-confirm-btn" @click="handleClose"></view>
- <view class="confirm-btn" @click="confirmBtn" style="text-align: center;">确认</view>
- <view v-if="showTip" @click="handleShowImage" style="position: absolute;right: 0;top: -5px"><uni-icons type="info" size="30"></uni-icons></view>
- </view>
- </view>
- </view>
- </uni-popup>
- <!-- 自定义预览弹窗 -->
- <uni-popup ref="previewPopup" type="center" :safe-area="false" :is-mask-click="false">
- <view class="custom-preview" style="position: relative">
- <image
- src="/static/images/login/ggg.gif"
- mode="widthFix"
- class="preview-image"
- />
- <view class="close-btn" @click="handleCloseImg" style="position: absolute;top: -30px;right: 5px">
- <text class="close-icon" style="color:#fff">关闭</text>
- </view>
- </view>
- </uni-popup>
- </template>
- <script setup>
- import { ref } from 'vue';
- const props = defineProps({
- title: {
- type: String,
- default: '提示'
- },
- closeFlag: {
- type: Boolean,
- default: true
- },
- content: {
- type: String,
- require: true,
- default: ''
- },
- notClose: {
- type: Boolean,
- default: false
- },
- showTip: {
- type: Boolean,
- default: false
- }
- });
- const tipMiddlePopup = ref(null); // 索引
- const previewPopup = ref(null)
- const $emit = defineEmits(['confirm-btn'])
- // 打开弹窗
- function handleShow() {
- tipMiddlePopup.value.open();
- }
- // 取消
- function handleClose() {
- tipMiddlePopup.value.close();
- }
- // 确认
- function confirmBtn(){
- $emit('confirm-btn');
- if (!props.notClose) {
- tipMiddlePopup.value.close();
- }
- }
- function handleCloseImg() {
- previewPopup.value.close()
- }
- function handleShowImage() {
- previewPopup.value.open()
- // uni.previewImage({
- // urls: ['/static/images/login/ggg.gif'],
- // });
- }
- defineExpose({
- handleShow,
- handleClose
- })
- </script>
- <style>
- </style>
|