78 行
1.7 KiB
Plaintext
78 行
1.7 KiB
Plaintext
<template>
|
|
<view class="dialog-container">
|
|
<view class="dialog-content">
|
|
<text>title: {{ title }}</text>
|
|
<button class="mt-10" @click="closeThisDialog">
|
|
closeThisDialog
|
|
</button>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script setup lang="uts">
|
|
const currentPage = getCurrentInstance()?.proxy?.$page
|
|
|
|
import { state, setLifeCycleNum } from '@/store/index.uts'
|
|
|
|
const title = ref('dialog 6')
|
|
|
|
onPageShow(() => {
|
|
console.log('dialog 6 onShow')
|
|
uni.setNavigationBarColor({
|
|
frontColor: '#000000',
|
|
backgroundColor: '#ff0000',
|
|
success(res) {
|
|
console.log('setNavigationBarColor success', res)
|
|
setLifeCycleNum(state.lifeCycleNum + 1)
|
|
},
|
|
fail(err) {
|
|
console.log('setNavigationBarColor fail', err)
|
|
setLifeCycleNum(state.lifeCycleNum - 1)
|
|
},
|
|
complete(res) {
|
|
console.log('setNavigationBarColor complete', res)
|
|
setLifeCycleNum(state.lifeCycleNum + 1)
|
|
}
|
|
})
|
|
})
|
|
|
|
function closeThisDialog() {
|
|
if (currentPage != null) {
|
|
uni.closeDialogPage({
|
|
dialogPage: currentPage,
|
|
success(res) {
|
|
console.log('closeThisDialog success', res)
|
|
},
|
|
fail(err) {
|
|
console.log('closeThisDialog fail', err)
|
|
},
|
|
complete(res) {
|
|
console.log('closeThisDialog complete', res)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
.dialog-container {
|
|
width: 100%;
|
|
height: 100%;
|
|
background-color: rgba(0, 0, 0, 0.3);
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
}
|
|
|
|
.dialog-content {
|
|
width: 80%;
|
|
padding: 10px;
|
|
background-color: #fff;
|
|
border-radius: 6px;
|
|
}
|
|
|
|
.mt-10 {
|
|
margin-top: 10px;
|
|
}
|
|
</style>
|