flat: 注入全局弹窗

This commit is contained in:
Apcallover
2025-12-17 18:27:59 +08:00
19 changed files with 3132 additions and 509 deletions

View File

@@ -48,11 +48,10 @@ import Tabbar from '@/components/tabbar/midell-box.vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
import IndexRefactor from './components/index-refactor.vue';
import IndexTwo from './components/index-two.vue';
import useScreenStore from '@/stores/useScreenStore'
const screenStore = useScreenStore()
const {isWideScreen} = screenStore
import useScreenStore from '@/stores/useScreenStore';
const screenStore = useScreenStore();
const { isWideScreen } = screenStore;
const loadedMap = reactive([false, false]);
const swiperRefs = [ref(null), ref(null)];
@@ -71,21 +70,20 @@ const THRESHOLD = 5;
watch(
() => screenStore.isWideScreen,
(newVal) => {
showTabbar.value = newVal
showTabbar.value = newVal;
},
{ immediate: true }
)
);
onLoad(() => {
// 判断浏览器是否有 fristEntry 第一次进入
let fristEntry = uni.getStorageSync('fristEntry') === false ? false : true; // 默认未读
maskFristEntry.value = fristEntry
maskFristEntry.value = fristEntry;
if (fristEntry) {
if(!isWideScreen)uni.hideTabBar();
else showTabbar.value = false
}else{
if(isWideScreen)showTabbar.value = true
if (!isWideScreen) uni.hideTabBar();
else showTabbar.value = false;
} else {
if (isWideScreen) showTabbar.value = true;
}
// 预加载较重页面
setTimeout(() => {
@@ -147,11 +145,11 @@ function handleTouchMove(e) {
}
function changeShowTabbar(val) {
if(isWideScreen){
showTabbar.value=val
}else{
if(val)uni.showTabBar()
else uni.hideTabBar()
if (isWideScreen) {
showTabbar.value = val;
} else {
if (val) uni.showTabBar();
else uni.hideTabBar();
}
}
@@ -207,14 +205,14 @@ function changeSwiperMsgType(e) {
function closeFristEntry() {
uni.setStorageSync('fristEntry', false);
maskFristEntry.value = false;
if(!isWideScreen)uni.showTabBar();
else showTabbar.value=true
if (!isWideScreen) uni.showTabBar();
else showTabbar.value = true;
}
function goExperience() {
closeFristEntry();
if(!isWideScreen)uni.showTabBar();
else showTabbar.value = true
if (!isWideScreen) uni.showTabBar();
else showTabbar.value = true;
state.current = 1;
}
</script>
@@ -377,4 +375,4 @@ function goExperience() {
background: #FFFFFF
width: 4rpx
height: 20rpx
</style>
</style>