首页开启消息提示弹窗

This commit is contained in:
wangxiaowei
2025-12-30 18:18:42 +08:00
parent a9b34c58ad
commit 76bee6568b

View File

@ -42,7 +42,7 @@
<view class="ball-center-title">{{ item.name }}</view>
<view class="d-b-c">
<view class="reserve-time">营业时间{{ item.start_time }}-{{ item.end_time }}</view>
<view class="reserve-btn">立即支付</view>
<view class="reserve-btn">{{ item.type_id == 1 ? '立即预约' : '立即支付' }}</view>
</view>
</view>
</view>
@ -110,14 +110,10 @@
<!-- 温馨提示 -->
<Popup :show="tipsPopup" radius="16rpx">
<view class="notice-popup">
<view class="notice-popup" style="width: 100%;">
<view class="title">温馨提示</view>
<view class="desc">
尊敬的客户感谢您的关注为提
供更全面优质的服务我们正在对手
机端相关功能进行最后的优化与升
该精彩板块即将与您见面敬请
期待
<view class="desc" style="text-align: left;">
{{ tipsContent }}
</view>
<view class="btn" @tap="handleKnow(2)">我知道了</view>
</view>
@ -193,6 +189,7 @@ export default {
},
noticePopup: false,
tipsPopup: false,
tipsContent: '',
venueList: [], // 场馆列表
notice: '',
company: {},
@ -241,6 +238,7 @@ export default {
}
},
onShow() {
console.log(this.setting);
this.getTabBarLinks();
},
onTabItemTap() {
@ -294,6 +292,26 @@ export default {
function(res) {
if (res.code) {
self.setting = res.data.lists;
self.tipsContent = self.setting.pop; // 设置提示弹窗内容
// 弹窗逻辑
if (self.setting.pop_status == 'false') {
console.log('关闭弹窗');
uni.removeStorageSync('tipsPopup');
self.tipsPopup = false;
} else {
// 判断缓存时间
const tipsPopupTime = uni.getStorageSync('tipsPopup');
const now = Date.now();
const oneDay = 24 * 60 * 60 * 1000;
if (!tipsPopupTime || now - tipsPopupTime >= oneDay) {
// 超时或首次弹窗,显示弹窗并重置时间
self.tipsPopup = true;
uni.setStorageSync('tipsPopup', now);
} else {
// 未超时,不显示弹窗
self.tipsPopup = false;
}
}
res.data.lists.carousel.map(items => {
console.log("🚀 ~ items:", items)
self.bannerData.data.push({imgUrl: items.file_path, height: '400px'})