fix: 修复H5环境下关闭再打开日历的bug

This commit is contained in:
傅光孟 2026-02-09 17:00:23 +08:00
parent 37dee18a22
commit 71062c8e13
2 changed files with 32 additions and 17 deletions

View File

@ -32,7 +32,12 @@
<!-- 24小时榜 end --> <!-- 24小时榜 end -->
<view v-if="!loading" :class="['page-main ', { mask: !userStore.isLogin }]"> <view v-if="!loading" :class="['page-main ', { mask: !userStore.isLogin }]">
<view class="news-list-top"> <view class="news-list-top">
<view class="news-item" v-for="(item, index) in newsListTop" :key="item.news_id" @click="goDetail(item)"> <view
class="news-item"
v-for="(item, index) in newsListTop"
:key="item.news_id"
@click="goDetail(item)"
>
<view class="news-no"> {{ index + 1 }} </view> <view class="news-no"> {{ index + 1 }} </view>
<view class="news-info"> <view class="news-info">
<view class="news-title"> <view class="news-title">
@ -53,7 +58,12 @@
</view> </view>
<view class="news-list"> <view class="news-list">
<view class="news-item" v-for="(item, index) in newsList" :key="item.news_id" @click="goDetail(item)"> <view
class="news-item"
v-for="(item, index) in newsList"
:key="item.news_id"
@click="goDetail(item)"
>
<view class="news-no"> {{ index + 1 + topNum }} </view> <view class="news-no"> {{ index + 1 + topNum }} </view>
<view class="news-title"> <view class="news-title">
{{ item.title }} {{ item.title }}
@ -89,16 +99,19 @@
></u-loading-icon> ></u-loading-icon>
<!-- 日历 --> <!-- 日历 -->
<view v-if="calendarShow">
<u-calendar <u-calendar
:show="calendarShow" :show="true"
:min-date="calendar.minDate" :min-date="calendar.minDate"
:max-date="calendar.maxDate" :max-date="calendar.maxDate"
:monthNum="calendar.monthNum" :monthNum="calendar.monthNum"
:default-date="chooseDate.startDate" :default-date="chooseDate.startDate"
closeOnClickOverlay
@confirm="calendarConfirm" @confirm="calendarConfirm"
@close="hideCalendar" @close="hideCalendar"
> >
</u-calendar> </u-calendar>
</view>
<!-- 登录弹窗 start --> <!-- 登录弹窗 start -->
<LoginDialog <LoginDialog
@ -212,7 +225,7 @@ function calendarConfirm(dateList: string[]) {
getNewsList(); getNewsList();
calendarShow.value = false; calendarShow.value = false;
isExpAll.value = false; isExpAll.value = false;
lastNewsIndex.value = 10 lastNewsIndex.value = 10;
} }
async function getNewsList() { async function getNewsList() {
@ -240,7 +253,7 @@ function goDetail(item:any) {
url: `/pages/detail/indexNewsInfo?id=${item.news_id}`, url: `/pages/detail/indexNewsInfo?id=${item.news_id}`,
}); });
} else { } else {
handleShowLogin() handleShowLogin();
} }
} }

View File

@ -225,11 +225,13 @@ export default {
}, },
close() { close() {
this.$emit('close') this.$emit('close')
// this.scrollIntoView = ''; // bugH5bug
}, },
// //
confirm() { confirm() {
if (!this.buttonDisabled) { if (!this.buttonDisabled) {
this.$emit('confirm', this.selected) this.$emit('confirm', this.selected)
// this.scrollIntoView = ''; // bugH5bug
} }
}, },
// //