logo和名称替换
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hgmj/hj_utils/const.dart';
|
||||
import 'package:wydj/hj_utils/const.dart';
|
||||
|
||||
class BaseBottomProvider extends ChangeNotifier {
|
||||
bool showTop = false; //选中的 tab 是否变成「回到顶部」
|
||||
@@ -9,7 +9,8 @@ class BaseBottomProvider extends ChangeNotifier {
|
||||
ScrollController? _curCtr;
|
||||
|
||||
/// 绑定第 [index] 个 tab 的滚动控制器,[controller] 不传则复用缓存里的
|
||||
void setScrollController(int index, {ScrollController? controller, bool forceToTop = false}) {
|
||||
void setScrollController(int index,
|
||||
{ScrollController? controller, bool forceToTop = false}) {
|
||||
controller ??= _ctrCaches[index];
|
||||
if (controller == null) {
|
||||
_curCtr?.removeListener(_onScroll); //没有可绑的目标,旧监听也一并摘掉
|
||||
@@ -98,5 +99,6 @@ class CommunityBottomProvider extends BaseBottomProvider {
|
||||
|
||||
@Deprecated('请使用 scrollCtr / subIndex')
|
||||
@override
|
||||
void setScrollController(int index, {ScrollController? controller, bool forceToTop = false}) {}
|
||||
void setScrollController(int index,
|
||||
{ScrollController? controller, bool forceToTop = false}) {}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hgmj/hj_model/splash/domain_source_model.dart';
|
||||
import 'package:hgmj/hj_page/mine/mine_vip/vip_product_manager.dart';
|
||||
import 'package:hgmj/hj_utils/api_service/common_service.dart';
|
||||
import 'package:hgmj/hj_utils/api_service/mine_service.dart';
|
||||
import 'package:hgmj/tools_base/global_store/store.dart';
|
||||
import 'package:wydj/hj_model/splash/domain_source_model.dart';
|
||||
import 'package:wydj/hj_page/mine/mine_vip/vip_product_manager.dart';
|
||||
import 'package:wydj/hj_utils/api_service/common_service.dart';
|
||||
import 'package:wydj/hj_utils/api_service/mine_service.dart';
|
||||
import 'package:wydj/tools_base/global_store/store.dart';
|
||||
|
||||
import '../../../hj_utils/light_model.dart';
|
||||
|
||||
@@ -38,14 +38,17 @@ class MineMsgProvider with ChangeNotifier {
|
||||
/// 支付状态分层配置(分层/卡ID/各展示位图片)——全站唯一数据源,原 Config.paymentStatusPopup 迁来此统一管理
|
||||
PayTierModel? payTier;
|
||||
|
||||
static String get _payPopupShownKey => "PayLayeredPopup_shown_${globalStore.meInfo?.uid}"; // 支付分层首弹是否已弹过
|
||||
final ValueNotifier<int> tick = ValueNotifier<int>(0); //分层倒计时秒级 tick,倒计时块用 ValueListenableBuilder 监听它,避免每秒重建整卡/图片
|
||||
static String get _payPopupShownKey =>
|
||||
"PayLayeredPopup_shown_${globalStore.meInfo?.uid}"; // 支付分层首弹是否已弹过
|
||||
final ValueNotifier<int> tick = ValueNotifier<int>(
|
||||
0); //分层倒计时秒级 tick,倒计时块用 ValueListenableBuilder 监听它,避免每秒重建整卡/图片
|
||||
Timer? _payTimer; //支付分层倒计时(基于 config.lastDiscountTime)
|
||||
int? _lastExpireRefreshAt; //上次"归零刷新"的时间戳(秒),用于 30s 防抖
|
||||
|
||||
/// 刷新用户分层弹窗配置(payTier),成功后写回并通知 UI 刷新
|
||||
Future<PayTierModel?> refreshPayPopup() async {
|
||||
final model = await CommonService.refreshPayPopup(keys: ['paymentPopup', 'paymentGuide']);
|
||||
final model = await CommonService.refreshPayPopup(
|
||||
keys: ['paymentPopup', 'paymentGuide']);
|
||||
// 容错:接口返回空数据时 model 为 null,保留本地状态不替换
|
||||
if (model != null) {
|
||||
// 分层状态前后不一致 → 用户权益/升级状态已变(VIP 支付是异步的,以分层变化为准),清会员卡缓存下次重开强制重拉
|
||||
@@ -80,14 +83,17 @@ class MineMsgProvider with ChangeNotifier {
|
||||
}
|
||||
|
||||
/// 支付分层首弹是否已弹过(不分新人/老人,全局只弹一次)
|
||||
static Future<bool> isPayPopupShown() async => await lightKV.getBool(_payPopupShownKey) ?? false;
|
||||
static Future<bool> isPayPopupShown() async =>
|
||||
await lightKV.getBool(_payPopupShownKey) ?? false;
|
||||
|
||||
static Future<void> markPayPopupShown() async => await lightKV.setBool(_payPopupShownKey, true);
|
||||
static Future<void> markPayPopupShown() async =>
|
||||
await lightKV.setBool(_payPopupShownKey, true);
|
||||
|
||||
/// 倒计时归零后刷新分层配置(带 30s 防抖,避免后端返回临界时间导致频繁刷新)
|
||||
void _refreshOnExpire() {
|
||||
final nowSec = DateTime.now().millisecondsSinceEpoch ~/ 1000;
|
||||
if (_lastExpireRefreshAt != null && nowSec - _lastExpireRefreshAt! < 30) return;
|
||||
if (_lastExpireRefreshAt != null && nowSec - _lastExpireRefreshAt! < 30)
|
||||
return;
|
||||
_lastExpireRefreshAt = nowSec;
|
||||
refreshPayPopup(); // 成功后内部会按新 lastDiscountTime 重启/不重启计时
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user