提交 73529170 作者: 宇宙超人

农场去掉下拉刷新,退出登陆弹框组件

上级 58a9556e
<template>
<view v-if="show" class="confirm-dialog-overlay" @click="handleCancel">
<view class="confirm-dialog-container" @click.stop>
<!-- 关闭按钮 -->
<view class="close-btn" @click="handleCancel">
<text class="close-icon"></text>
</view>
<!-- 标题 -->
<view class="dialog-title">{{ title }}</view>
<!-- 内容 -->
<view class="dialog-content">{{ content }}</view>
<!-- 按钮组 -->
<view class="dialog-buttons">
<view class="cancel-btn" @click="handleCancel">
<text class="cancel-text">{{ cancelText }}</text>
</view>
<view class="confirm-btn" @click="handleConfirm">
<text class="confirm-text">{{ confirmText }}</text>
</view>
</view>
</view>
</view>
</template>
<script setup lang="ts">
interface Props {
show?: boolean
title?: string
content?: string
cancelText?: string
confirmText?: string
}
const props = withDefaults(defineProps<Props>(), {
show: false,
title: '提示',
content: '',
cancelText: '取消',
confirmText: '确认',
})
const emit = defineEmits<{
(e: 'update:show', value: boolean): void
(e: 'cancel'): void
(e: 'confirm'): void
}>()
function handleCancel() {
emit('update:show', false)
emit('cancel')
}
function handleConfirm() {
emit('update:show', false)
emit('confirm')
}
</script>
<style lang="scss" scoped>
.confirm-dialog-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 9999;
}
.confirm-dialog-container {
position: relative;
width: 600rpx;
background: linear-gradient(180deg, #E8F5E9 0%, #FFFFFF 30%);
border-radius: 32rpx;
padding: 60rpx 48rpx 48rpx;
box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.1);
}
.close-btn {
position: absolute;
top: 24rpx;
right: 24rpx;
width: 48rpx;
height: 48rpx;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.close-icon {
font-size: 36rpx;
color: #999999;
font-weight: 300;
}
.dialog-title {
font-size: 36rpx;
font-weight: 600;
color: #333333;
text-align: center;
margin-bottom: 32rpx;
}
.dialog-content {
font-size: 28rpx;
color: #666666;
text-align: center;
line-height: 40rpx;
margin-bottom: 48rpx;
}
.dialog-buttons {
display: flex;
gap: 24rpx;
}
.cancel-btn,
.confirm-btn {
flex: 1;
height: 80rpx;
border-radius: 40rpx;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.cancel-btn {
background-color: #FFFFFF;
border: 2rpx solid #5DB66F;
}
.cancel-text {
font-size: 28rpx;
color: #5DB66F;
font-weight: 500;
}
.confirm-btn {
background: linear-gradient(135deg, #5DB66F 0%, #4CAF50 100%);
box-shadow: 0 4rpx 12rpx rgba(93, 182, 111, 0.3);
}
.confirm-text {
font-size: 28rpx;
color: #FFFFFF;
font-weight: 500;
}
.cancel-btn:active {
opacity: 0.8;
}
.confirm-btn:active {
opacity: 0.9;
transform: scale(0.98);
}
</style>
......@@ -43,7 +43,7 @@
"navigationBarTitleText": "农场",
"backgroundColorTop": "#e6f5e8",
"backgroundColorBottom": "#e6f5e8",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"app-plus": {
"titleNView": true,
"bounce": false
......
<script setup lang="ts">
import { useRuntime } from '@/hooks/app/useRuntime'
import ConfirmDialog from '@/components/ConfirmDialog/index.vue'
import { convertKB } from '@/utils'
import { calculateCacheSize, cleanCache } from '@/components/CacheImage/index'
......@@ -35,11 +36,12 @@
}
// 退出登录
function logOut() {
Message.confirm('确认退出登录状态?', '温馨提示').then((confirm) => {
if (confirm) {
loginOut()
}
})
model.showLogoutDialog = true
}
// 确认退出
function handleConfirmLogout() {
loginOut()
}
// 调用登出
......@@ -73,6 +75,7 @@
state: '',
version: '',
loading: false,
showLogoutDialog: false,
})
// 用户默认层级
......@@ -284,6 +287,17 @@
退出登录
</fui-button>
</view>
<!-- 退出登录确认对话框 -->
<ConfirmDialog
v-model:show="model.showLogoutDialog"
title="退出登录"
content="确认退出当前账号?"
cancelText="取消"
confirmText="确认"
@confirm="handleConfirmLogout"
/>
<!-- 权限提示组件 -->
<!-- <Permissions @register="registerPermissions" /> -->
</view>
......
<script setup lang="ts">
import { reactive } from 'vue'
import { onPullDownRefresh, onShow } from '@dcloudio/uni-app'
import { onShow } from '@dcloudio/uni-app'
import WeatherForecast from './components/WeatherForecast.vue'
import Navigate from '@/utils/page/navigate'
import dayjs from 'dayjs'
......@@ -27,14 +27,6 @@ onShow(() => {
getFarmList()
})
// 下拉刷新
onPullDownRefresh(() => {
setTimeout(function () {
uni.stopPullDownRefresh()
Message.toast('刷新成功')
}, 1000)
})
// 页面数据
const pageData = reactive({
// 顶部标题和搜索
......
......@@ -10,6 +10,7 @@ declare module 'vue' {
AffixFilter: typeof import('./../src/components/Map/Widgets/AffixFilter/src/AffixFilter.vue')['default']
BottomBar: typeof import('./../src/components/Map/Widgets/BottomBar/src/BottomBar.vue')['default']
CacheImage: typeof import('./../src/components/CacheImage/index.vue')['default']
ConfirmDialog: typeof import('./../src/components/ConfirmDialog/index.vue')['default']
Empty: typeof import('./../src/components/Empty/index.vue')['default']
FDragItem: typeof import('./../src/components/FirstUI/fui-drag/f-drag-item.vue')['default']
FIndexListItem: typeof import('./../src/components/FirstUI/fui-index-list/f-index-list-item.vue')['default']
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论