当前位置:网站首页>uniapp uni-popup change
uniapp uni-popup change
2022-07-18 12:00:00 【nicepainkiller】
uniapp uni-popup change Record a small function
monitor pop Display and hide of page ;
<template>
<uni-popup ref="popup" type="bottom" background-color="#ffffff" @change="change" @maskClick="maskClick">
<view class="pop-content">
<view class="audio-top">
<view class="top-left" @click="onCancel()">
Cancel
</view>
<view class="top-right" @click="onComfirm()">
complete
</view>
</view>
<view class="audio-conetnt">
<image src="/static/animation/audio-record-pink.gif" mode=""></image>
</view>
</view>
</uni-popup>
</template>
<script>
export default {
data() {
return {
eventStartAudio: 'safetydetial-startaudio',
eventCancelAudio: 'recordaduio-cancelaudio',
eventStopAudio: 'recordaduio-stopaudio',
timer: null,
}
},
mounted() {
console.log("pop mounted")
uni.$on(this.eventStartAudio, args => {
this.onOpen()
})
},
methods: {
onOpen() {
this.$refs.popup.open()
},
change(e) {
console.log("closeMask:", e)
// When showing or hiding Clear timer
if (this.timer) {
clearTimeout(this.timer)
this.timer = null
}
// Start the timer when it is displayed
if (e.show) {
this.timer = setTimeout(() => {
this.onComfirm()
}, 5 * 1000);
}
},
maskClick() {
console.log("maskClick")
uni.$emit(this.eventCancelAudio)
},
onCancel() {
console.log("onCancel")
this.$refs.popup.close()
uni.$emit(this.eventCancelAudio)
},
onComfirm() {
console.log("onComfirm")
this.$refs.popup.close()
uni.$emit(this.eventStopAudio)
}
},
destroyed() {
uni.$off(this.eventStartAudio)
}
}
</script>
<style lang="scss" scoped>
.pop-content {
width: 100%;
height: 350rpx;
background-color: #ffffff;
display: flex;
flex-direction: column;
align-items: center;
.audio-top {
width: 100%;
height: 80rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
font-size: 28rpx;
border-bottom: 1px solid #dddddd;
.top-left {
margin-left: 24rpx;
padding: 2px 8rpx;
border: 1px solid #1D69F9;
border-radius: 6rpx;
}
.top-right {
margin-right: 24rpx;
padding: 2px 8rpx;
border: 1px solid #1D69F9;
border-radius: 6rpx;
}
}
.audio-conetnt {
flex: 1;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
image {
width: 200rpx;
height: 200rpx;
}
}
}
</style>
边栏推荐
- C语言力扣第206题之反转链表。双指针法,迭代递归(三种方法)。图文保姆教程
- Redis五种常用数据类型有哪些?对应的数据存储空间又是怎样的?带你从零开始学习
- 为何消费者都不愿买国产而买iPhone?因为国产手机贬值太快了
- Heavyweight: Mobileye officially announced the postponement of IPO, slowing down the growth of revenue and intensifying market competition
- YGG established a new subdao - YGG Japan
- [MySQL project actual combat optimization] add index through execution plan analysis
- Professional qualities of network security practitioners
- [pytorch] simple linear regression model
- 【图像融合】基于matlab DCT域多焦点图像融合【含Matlab源码 1973期】
- GDB或delve调试Go程序查看变量显示<optimized out>解决办法
猜你喜欢
![[C language] dynamic address book](/img/3e/6cf7ad1a0e5c697a57ab2d55231270.png)
[C language] dynamic address book

浅析websocket劫持

Linux上安装mysql

UE4_UE5播放音频(播放、停止功能)(附工程)
![[LSTM regression prediction] Based on MATLAB tpa-lstm time attention mechanism, long-term and short-term memory neural network regression prediction (multiple input and single output) [including Matla](/img/78/3d0256bb44e199270560e57a18dac8.png)
[LSTM regression prediction] Based on MATLAB tpa-lstm time attention mechanism, long-term and short-term memory neural network regression prediction (multiple input and single output) [including Matla

How to build modern search engine system, intelligent question answering system and intelligent recommendation system based on knowledge map technology?

重磅:Mobileye官宣推迟IPO,营收增速放缓、市场竞争加剧

利用Mysql+Excel处理数据

Ue5 simple role collision detection function

【C语言】自定义类型总结
随机推荐
Delete After the idea directory, the SVN menu resumes operation
What effective measures can be taken to improve the efficiency of discussing research issues?
Hidden Markov model (HMM)
Plug in development of meshlab
【C语言】字符串函数和内存操作函数
Mobile layout - fit
Surpass traditional giants and take the top place in the list of senior engineers! What does this local enterprise rely on?
二叉树遍历
移动机器人学(二)姿态解算
.NET7之MiniAPI(特别篇) :Preview6 缓存和限流
End of summer vacation 2022.6.29-7.13 my trip to Shenzhen (experience)
[es practice] spark writes es support
JVM简介
How to calculate the running time of terminal equipment (such as water pump) during TIA Bo (attached with FB library file)?
map集合转对象,map字段有横线,对象转map
MySQL JSON field query
C语言力扣第206题之反转链表。双指针法,迭代递归(三种方法)。图文保姆教程
Wireless communication safety operation 4
How to use jedis to operate redis database?
Pdf manual | 1666 pages zabbix6.0 official Chinese operation manual pdf free!
