Files
jdt-user/src/components/Popup.vue
YuanHuakk 1d8532eccf
All checks were successful
continuous-integration/drone/push Build is passing
feat(custom): 新增消息订阅
2024-08-27 17:06:59 +08:00

69 lines
1.1 KiB
Vue

<script setup lang="ts">
import {ref} from 'vue';
import Taro from '@tarojs/taro';
const show = ref(false);
const overlay = ref();
defineExpose({
show,
});
defineProps({
src: {
required: true,
type: String,
default: '',
},
type: Number,
cb: {
required: true,
type: Function,
default: () => {},
},
});
Taro.useLoad(async () => {
if (Taro.getStorageSync('token')) show.value = true;
// const res = await getSignRecord()
// console.log(res)
});
</script>
<template>
<nut-overlay
v-model:visible="show"
:lock-scroll="true"
:close-on-click-overlay="false">
<view class="wrapper">
<view @click.stop="cb(type)">
<image class="image" :src="src" />
</view>
<view @click.stop="show = false">
<image class="icon" src="../static/index/close.png" />
</view>
</view>
</nut-overlay>
</template>
<style lang="scss">
.wrapper {
display: flex;
height: 100%;
align-items: center;
justify-content: center;
flex-direction: column;
}
.image {
width: 500px;
height: 600px;
}
.icon {
width: 80px;
height: 80px;
}
</style>