2024-11-11 06:46:14 +00:00
|
|
|
<script setup>
|
|
|
|
import {ref,nextTick} from 'vue'
|
|
|
|
import WdPopup from "@/uni_modules/wot-design-uni/components/wd-popup/wd-popup.vue";
|
|
|
|
import TmButton from "@/uni_modules/tmui/components/tm-button/tm-button.vue";
|
2024-12-20 08:59:58 +00:00
|
|
|
import {language} from "@/uni_modules/tmui/tool/lib/language"
|
2024-11-11 06:46:14 +00:00
|
|
|
const confirmState=ref(false)
|
|
|
|
const cancel=ref(true)
|
|
|
|
let onConfirm=null
|
|
|
|
let onCancel=null
|
|
|
|
const confirm=ref(true)
|
|
|
|
const contentText=ref('')
|
2024-12-20 08:59:58 +00:00
|
|
|
const imageRef=ref('')
|
|
|
|
const confirmLabel=ref(language('components.confirm.confirmText'))
|
|
|
|
const cancelLabel=ref(language('components.confirm.cancelText'))
|
2024-11-11 06:46:14 +00:00
|
|
|
const sendCancel=()=>{
|
|
|
|
confirmState.value=false
|
|
|
|
if (typeof onCancel==='function'){
|
|
|
|
onCancel()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const sendConfirm=()=>{
|
|
|
|
confirmState.value=false
|
|
|
|
if (typeof onConfirm==='function'){
|
|
|
|
onConfirm()
|
|
|
|
}
|
|
|
|
}
|
2024-12-20 08:59:58 +00:00
|
|
|
const showConfirm=({content,image,onConfirm:confirm,onCancel:cancel,confirmText,cancelText})=>{
|
2024-11-11 06:46:14 +00:00
|
|
|
confirmState.value=true
|
|
|
|
contentText.value=content
|
2024-12-20 08:59:58 +00:00
|
|
|
imageRef.value = image?image:''
|
2024-11-11 06:46:14 +00:00
|
|
|
onConfirm=confirm
|
|
|
|
onCancel=cancel
|
2024-12-20 08:59:58 +00:00
|
|
|
confirmLabel.value = confirmText || confirmLabel.value
|
|
|
|
cancelLabel.value = cancelText || cancelLabel.value
|
2024-11-11 06:46:14 +00:00
|
|
|
}
|
|
|
|
defineExpose({
|
|
|
|
showConfirm
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
<template>
|
2024-12-20 08:59:58 +00:00
|
|
|
<wd-popup custom-style="border-radius: 16rpx;" modal-style="background-color: #000000;opacity: 0.6;" v-model="confirmState">
|
|
|
|
<div class="flex flex-col w-[640rpx]">
|
|
|
|
<div v-if="imageRef===''" class="flex justify-center items-center h-[288rpx] text-[32rpx] font-bold text-[#1A1A1A]">
|
2024-11-11 06:46:14 +00:00
|
|
|
{{contentText}}
|
|
|
|
</div>
|
2024-12-20 08:59:58 +00:00
|
|
|
<div v-else class="flex flex-col items-center h-[456rpx] text-[32rpx] font-bold text-[#1A1A1A]" >
|
|
|
|
<div class="wrap1 mt-[32rpx] mb-[44rpx]" >
|
|
|
|
<img :src="imageRef" alt="">
|
|
|
|
</div>
|
|
|
|
<div class="mb-[56rpx]" > {{contentText}} </div>
|
|
|
|
</div>
|
2024-11-11 06:46:14 +00:00
|
|
|
<div class="flex flex-grow border-t-solid border-[#E7E7E7] border-1rpx text-[32rpx]">
|
|
|
|
<div class="flex justify-center items-center text-[#1A1A1A]">
|
2024-12-20 08:59:58 +00:00
|
|
|
<tm-button
|
|
|
|
@click="sendCancel"
|
|
|
|
:width="319"
|
|
|
|
@touchstart="cancel=false"
|
|
|
|
@touchend="cancel=true"
|
|
|
|
:fontSize="32"
|
|
|
|
:height="112"
|
|
|
|
:margin="[0]"
|
|
|
|
:font-color="'#1A1A1A'"
|
|
|
|
:transprent="cancel"
|
|
|
|
text
|
|
|
|
:label="cancelLabel"></tm-button>
|
2024-11-11 06:46:14 +00:00
|
|
|
</div>
|
|
|
|
<div class="h-[112rpx] w-[1rpx] bg-[#E7E7E7]"></div>
|
|
|
|
<div class="flex justify-center items-center text-[#CF3050]">
|
2024-12-20 08:59:58 +00:00
|
|
|
<tm-button
|
|
|
|
@click="sendConfirm"
|
|
|
|
@touchstart="confirm=false"
|
|
|
|
@touchend="confirm=true"
|
|
|
|
:width="319"
|
|
|
|
:fontSize="32"
|
|
|
|
:transprent="confirm"
|
|
|
|
:height="112"
|
|
|
|
:margin="[0]"
|
|
|
|
:font-color="'#46299D'"
|
|
|
|
text
|
|
|
|
:label="confirmLabel"></tm-button>
|
2024-11-11 06:46:14 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</wd-popup>
|
|
|
|
</template>
|
2024-12-20 08:59:58 +00:00
|
|
|
<style scoped lang="scss">
|
|
|
|
.wrap1 {
|
|
|
|
img {
|
|
|
|
width: 381.59rpx;
|
|
|
|
height: 280.14rpx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|