Commit ffd5f106 by 前端

组件

1 parent 1c55c877
<template> <template>
<uni-popup ref="tips" type="center" :is-mask-click="false" :animation="false"> <uni-popup
<view class="tips-wrapper"> ref="tips"
:type="position"
:is-mask-click="false"
:animation="false"
>
<view
class="tips-wrapper"
:style="{ width: popupW + 'rpx', height: popupH + 'rpx' }"
>
<view class="tips-content"> <view class="tips-content">
<view class="tips-title" <view class="tips-title"
>{{ title }} >{{ title }}
<view class="icon-close" @click="close">×</view> <view class="icon-close" @click="close">×</view>
</view> </view>
<view class="tips-text">{{ content }}</view> <view class="tips-text" v-if="content">{{ content }}</view>
<slot></slot>
</view> </view>
<view class="tips-footer"> <view class="tips-footer" v-if="isFooter">
<view class="tips-btn close" @click="close()">{{ cancelBtnText }}</view> <view class="tips-btn close" @click="close()">{{ cancelBtnText }}</view>
<view class="tips-btn preview" @click="confirm()">{{ <view class="tips-btn preview" @click="confirm()">{{
confirmBtnText confirmBtnText
...@@ -24,13 +33,29 @@ export default { ...@@ -24,13 +33,29 @@ export default {
return {}; return {};
}, },
props: { props: {
position: {
type: String,
default: "center",
},
popupW: {
type: Number,
default: 704,
},
popupH: {
type: Number,
default: 372,
},
isFooter: {
type: Boolean,
default: true,
},
title: { title: {
type: String, type: String,
default: "提示", default: "提示",
}, },
content: { content: {
type: String, type: String,
default: "提示", default: "",
}, },
confirmBtnText: { confirmBtnText: {
type: String, type: String,
...@@ -42,7 +67,7 @@ export default { ...@@ -42,7 +67,7 @@ export default {
}, },
}, },
mounted() { mounted() {
this.$refs.tips.open("center"); this.$refs.tips.open();
}, },
methods: { methods: {
close() { close() {
...@@ -58,8 +83,6 @@ export default { ...@@ -58,8 +83,6 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.tips-wrapper { .tips-wrapper {
width: 704rpx;
height: 372rpx;
background: #ffffff; background: #ffffff;
border-radius: 20rpx; border-radius: 20rpx;
.tips-content { .tips-content {
...@@ -75,7 +98,7 @@ export default { ...@@ -75,7 +98,7 @@ export default {
.icon-close { .icon-close {
position: absolute; position: absolute;
right: 0; right: 0;
top: -24rpx; top: -30rpx;
width: 160rpx; width: 160rpx;
font-size: 50rpx; font-size: 50rpx;
text-align: right; text-align: right;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-04-08 11:28:48 * @Date: 2024-04-08 11:28:48
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-04-09 13:36:48 * @LastEditTime: 2024-04-09 16:26:16
* @FilePath: \gl_tape\mixin\click.js * @FilePath: \gl_tape\mixin\click.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -15,9 +15,8 @@ export default { ...@@ -15,9 +15,8 @@ export default {
voicePath: "", voicePath: "",
timer: null, timer: null,
times: 0, times: 0,
timeout: 10 * 60, timeout: 600, //十分钟提示
reaction: 10, reaction: 10,
message: "3",
}; };
}, },
mounted() { mounted() {
...@@ -93,23 +92,18 @@ export default { ...@@ -93,23 +92,18 @@ export default {
this.timer = setInterval(() => { this.timer = setInterval(() => {
this.times++; this.times++;
if (this.times >= this.timeout) { if (this.times >= this.timeout) {
// this.showToast(); console.log("弹框");
} }
if (this.times >= this.reaction + this.timeout) { if (this.times >= this.reaction + this.timeout) {
this.handleEnd(); //结束接待
this.stopAudio();
} }
}, 1000); }, 1000);
}, },
handleTouchStart() { handleTouchStart() {
console.log("点击");
this.times = 0; this.times = 0;
}, },
handleVisibilityChange() {
this.message = 999;
if (document.visibilityState === "hidden") {
// 屏幕被关闭
this.message = 999;
}
},
}, },
beforeCreate() { beforeCreate() {
clearInterval(this.timer); clearInterval(this.timer);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!