101 lines
1.9 KiB
Vue
101 lines
1.9 KiB
Vue
<template>
|
||
<tpx-dialog type="type-dialog" :show="show" :title="title" @onClose="handleCloseModal">
|
||
<view style="position: relative;min-height: 260rpx; width: 500rpx;display:flex;flex-direction: column;padding: 0 10rpx 10rpx 10rpx;">
|
||
|
||
<u-row custom-style="flex: 1;" align="center" justify="center">
|
||
<slot name="body">
|
||
|
||
</slot>
|
||
</u-row>
|
||
|
||
<view class="pd-20 pt-20" >
|
||
<u-row justify="between">
|
||
<u-button @click="handleBtnCheck('no')" size="large" shape="circle"
|
||
custom-style="height:80rpx;font-size: 30rpx;width:45%;margin:0;">
|
||
{{cancelText}}
|
||
</u-button>
|
||
<u-button @click="handleBtnCheck('yes')" type="primary" size="large" shape="circle"
|
||
custom-style="height:80rpx;font-size: 30rpx;width:45%;margin:0;">
|
||
{{sureText}}
|
||
</u-button>
|
||
</u-row>
|
||
</view>
|
||
</view>
|
||
</tpx-dialog>
|
||
</template>
|
||
|
||
<script>
|
||
export default {
|
||
// computed: {
|
||
// filDataList() {
|
||
// return []
|
||
// },
|
||
// },
|
||
props: {
|
||
title: {
|
||
default () {
|
||
return ''
|
||
}
|
||
},
|
||
show: {
|
||
default () {
|
||
return false
|
||
}
|
||
},
|
||
cancelText: {
|
||
default () {
|
||
return '取消'
|
||
}
|
||
},
|
||
sureText: {
|
||
default () {
|
||
return '确认'
|
||
}
|
||
},
|
||
},
|
||
data() {
|
||
return {
|
||
curDealPromise: {}
|
||
}
|
||
},
|
||
created() {
|
||
|
||
},
|
||
onHide() {
|
||
|
||
},
|
||
unmounted() {},
|
||
|
||
methods: {
|
||
handleCloseModal() {
|
||
this.$emit('update:show', false)
|
||
|
||
},
|
||
handleBtnCheck(type) {
|
||
if(type == 'yes') {
|
||
this.$emit('onSure')
|
||
this.curDealPromise?.resolve?.(true)
|
||
} else {
|
||
this.handleCloseModal()
|
||
this.curDealPromise?.resolve?.(false)
|
||
this.$emit('onClose')
|
||
this.$emit('onCancel')
|
||
}
|
||
this.curDealPromise = {}
|
||
},
|
||
getConfirmResult(){
|
||
// 显示弹框,并返回promise
|
||
this.$emit('update:show', true)
|
||
return new Promise((resolve, reject)=> {
|
||
this.curDealPromise = {
|
||
resolve
|
||
}
|
||
})
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style scoped lang="scss">
|
||
|
||
</style> |