logo和名称替换

This commit is contained in:
谢宇宁
2026-10-14 11:23:36 +07:00
parent 1cb514cd02
commit c5c04a7967
478 changed files with 8990 additions and 4948 deletions
@@ -2,11 +2,11 @@ import 'dart:math';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:hgmj/extension/extensions.dart';
import 'package:hgmj/hj_page/pre_sale/pre_sale_provider.dart';
import 'package:hgmj/hj_utils/screen.dart';
import 'package:hgmj/tools_base/global_store/store.dart';
import 'package:hgmj/tools_base/widget/net_image_widget.dart';
import 'package:wydj/extension/extensions.dart';
import 'package:wydj/hj_page/pre_sale/pre_sale_provider.dart';
import 'package:wydj/hj_utils/screen.dart';
import 'package:wydj/tools_base/global_store/store.dart';
import 'package:wydj/tools_base/widget/net_image_widget.dart';
import 'package:provider/provider.dart';
import '../widgets/gradient_text.dart';
@@ -16,7 +16,8 @@ class UserChargeView extends StatelessWidget {
/// true:旧版文案/配色(会员中心 A / DISABLED)
final bool classic;
const UserChargeView({super.key, this.isFromCoin = false, this.classic = false});
const UserChargeView(
{super.key, this.isFromCoin = false, this.classic = false});
@override
Widget build(BuildContext context) {
@@ -49,7 +50,9 @@ class UserChargeView extends StatelessWidget {
Text(
provider.meInfo == null
? '未知'
: provider.meInfo?.name?.substring(0, min(provider.meInfo?.name?.length ?? 0, 9)) ?? '',
: provider.meInfo?.name?.substring(
0, min(provider.meInfo?.name?.length ?? 0, 9)) ??
'',
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: const TextStyle(
@@ -61,7 +64,8 @@ class UserChargeView extends StatelessWidget {
8.sizeBoxW,
if (!provider.isVIP)
Container(
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
padding:
const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
border: Border.all(color: Color(0x14FFFFFF), width: 1),
@@ -138,7 +142,9 @@ class UserChargeView extends StatelessWidget {
Text(
provider.meInfo == null
? '未知'
: provider.meInfo?.name?.substring(0, min(provider.meInfo?.name?.length ?? 0, 9)) ?? '',
: provider.meInfo?.name?.substring(
0, min(provider.meInfo?.name?.length ?? 0, 9)) ??
'',
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
@@ -148,7 +154,8 @@ class UserChargeView extends StatelessWidget {
),
),
12.sizeBoxW,
if (provider.isVIP && vipIcon.isNotEmpty) Image.asset(vipIcon, height: 20),
if (provider.isVIP && vipIcon.isNotEmpty)
Image.asset(vipIcon, height: 20),
],
),
4.sizeBoxH,
@@ -1,6 +1,6 @@
import 'package:get/get.dart';
import 'package:hgmj/hj_utils/api_service/mine_service.dart';
import 'package:hgmj/tools_base/toast.dart';
import 'package:wydj/hj_utils/api_service/mine_service.dart';
import 'package:wydj/tools_base/toast.dart';
import '../../../hj_model/mine/exchange/recharge_list_model.dart';
import '../../../hj_model/mine/exchange/recharge_type_list_model.dart';
@@ -14,7 +14,8 @@ class MineChargeCoinLogic extends GetxController {
/// 下单埋点上下文(短剧付费墙要带 mediaId/contentId/checkoutContextId 做归因)
final PayOrderTrackInfo? orderTrack;
MineChargeCoinLogic({this.sourcePage = PaySourcePage.unknown, this.orderTrack});
MineChargeCoinLogic(
{this.sourcePage = PaySourcePage.unknown, this.orderTrack});
bool isInitLoading = true; // 首屏加载中
RechargeListModel? model; // 金币充值档位列表
@@ -57,7 +58,8 @@ class MineChargeCoinLogic extends GetxController {
Get.bottomSheet(
OnlinePayPage(
coinRcModel: selectedCoin,
orderTrack: (orderTrack ?? const PayOrderTrackInfo()).copyWith(sourcePage: sourcePage),
orderTrack: (orderTrack ?? const PayOrderTrackInfo())
.copyWith(sourcePage: sourcePage),
),
isScrollControlled: true,
);
@@ -1,11 +1,11 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:hgmj/assets_tool/app_colors.dart';
import 'package:hgmj/assets_tool/images.dart';
import 'package:hgmj/hj_utils/screen.dart';
import 'package:hgmj/tools_base/global_store/store.dart';
import 'package:hgmj/tools_base/loading/loading_center_widget.dart';
import 'package:wydj/assets_tool/app_colors.dart';
import 'package:wydj/assets_tool/images.dart';
import 'package:wydj/hj_utils/screen.dart';
import 'package:wydj/tools_base/global_store/store.dart';
import 'package:wydj/tools_base/loading/loading_center_widget.dart';
import 'package:provider/provider.dart';
import '../../../hj_utils/widget_util.dart';
@@ -20,7 +20,8 @@ class MineChargeCoinPage extends StatelessWidget {
/// 下单来源,入口不传则 UNKNOWN(金币没有专属来源枚举,别拿会员的顶上)
final PaySourcePage sourcePage;
const MineChargeCoinPage({super.key, this.sourcePage = PaySourcePage.unknown});
const MineChargeCoinPage(
{super.key, this.sourcePage = PaySourcePage.unknown});
@override
Widget build(BuildContext context) {
@@ -31,7 +32,8 @@ class MineChargeCoinPage extends StatelessWidget {
return Scaffold(
body: () {
if (controller.isInitLoading) return const LoadingCenterWidget();
if (controller.model == null) return CErrorWidget(retryOnTap: () => controller.loadData());
if (controller.model == null)
return CErrorWidget(retryOnTap: () => controller.loadData());
return Column(
children: [
Expanded(
@@ -50,10 +52,12 @@ class MineChargeCoinPage extends StatelessWidget {
actions: [
InkWell(
enableFeedback: false,
onTap: () => Get.to(RecordsPage(RecordType.recharge)),
onTap: () =>
Get.to(RecordsPage(RecordType.recharge)),
child: Text(
'充值记录',
style: TextStyle(color: Color(0xff666666), fontSize: 16.sp),
style: TextStyle(
color: Color(0xff666666), fontSize: 16.sp),
),
),
18.w.sizeBoxW
@@ -75,7 +79,8 @@ class MineChargeCoinPage extends StatelessWidget {
SliverPadding(
padding: EdgeInsets.symmetric(horizontal: 16),
sliver: SliverGrid.builder(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
gridDelegate:
const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
mainAxisSpacing: 12,
crossAxisSpacing: 6,
@@ -84,7 +89,8 @@ class MineChargeCoinPage extends StatelessWidget {
itemCount: controller.model?.list?.length ?? 0,
itemBuilder: (BuildContext context, int index) {
final model = controller.model!.list![index];
final isSelected = controller.selectedCoin?.id == model.id;
final isSelected =
controller.selectedCoin?.id == model.id;
return CoinItem(
model,
onTap: () => controller.onSelectCoin(index),
@@ -97,7 +103,8 @@ class MineChargeCoinPage extends StatelessWidget {
SliverToBoxAdapter(
child: Text(
'*如提示【交易失败】【账户风险】等,可重新发起订单,或在15分钟后重试支付。',
style: TextStyle(color: Color(0xff666666), fontSize: 12),
style:
TextStyle(color: Color(0xff666666), fontSize: 12),
).paddingSymmetric(horizontal: 16),
),
],
@@ -122,11 +129,16 @@ class MineChargeCoinPage extends StatelessWidget {
child: Container(
height: 44,
margin: EdgeInsets.symmetric(horizontal: 16),
decoration: BoxDecoration(color: AppColors.actionRed, borderRadius: BorderRadius.circular(22)),
decoration: BoxDecoration(
color: AppColors.actionRed,
borderRadius: BorderRadius.circular(22)),
alignment: Alignment.center,
child: Text(
'¥${controller.selectedCoin?.moneyYuan ?? 0}/立即支付',
style: TextStyle(color: Colors.black, fontSize: 16, fontWeight: FontWeight.w500),
style: TextStyle(
color: Colors.black,
fontSize: 16,
fontWeight: FontWeight.w500),
),
),
),
@@ -151,7 +163,10 @@ class MineChargeCoinPage extends StatelessWidget {
children: [
Text(
'我的金币余额',
style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.w500),
style: TextStyle(
color: Colors.white,
fontSize: 14,
fontWeight: FontWeight.w500),
),
8.sizeBoxH,
Row(
@@ -164,13 +179,17 @@ class MineChargeCoinPage extends StatelessWidget {
final total = (wallet?.amount ?? 0) + (wallet?.income ?? 0);
return Text(
"$total",
style: TextStyle(color: Color(0xffFFD460), fontSize: 32, fontWeight: FontWeight.w600),
style: TextStyle(
color: Color(0xffFFD460),
fontSize: 32,
fontWeight: FontWeight.w600),
);
}),
Spacer(),
InkWell(
enableFeedback: false,
onTap: () => Get.to(RecordsPage(RecordType.bill), opaque: false),
onTap: () =>
Get.to(RecordsPage(RecordType.bill), opaque: false),
child: Container(
alignment: Alignment.center,
height: 30,
@@ -1,11 +1,11 @@
import 'package:carousel_slider/carousel_controller.dart';
import 'package:flutter/widgets.dart';
import 'package:get/get.dart';
import 'package:hgmj/hj_page/pre_sale/pre_sale_provider.dart';
import 'package:hgmj/alert/vip_guide/guide_manager.dart';
import 'package:hgmj/alert/vip_guide/timed_popup_manager.dart';
import 'package:hgmj/tools_base/toast.dart';
import 'package:hgmj/hj_utils/screen.dart';
import 'package:wydj/hj_page/pre_sale/pre_sale_provider.dart';
import 'package:wydj/alert/vip_guide/guide_manager.dart';
import 'package:wydj/alert/vip_guide/timed_popup_manager.dart';
import 'package:wydj/tools_base/toast.dart';
import 'package:wydj/hj_utils/screen.dart';
import '../../../alert/vip_guide/guide_countdown_dialog.dart';
import '../../../alert/vip_guide/guide_config.dart';
@@ -35,7 +35,11 @@ class MineChargeVipLogic extends GetxController {
/// 入口透传的整份下单上下文,字段比 [videoId] 全时以它为准(短剧付费墙带 mediaId/contentId/checkoutContextId)
final PayOrderTrackInfo? orderTrack;
MineChargeVipLogic({this.vipID, this.sourcePage = PaySourcePage.vipCenter, this.videoId, this.orderTrack});
MineChargeVipLogic(
{this.vipID,
this.sourcePage = PaySourcePage.vipCenter,
this.videoId,
this.orderTrack});
/// 当前选中的会员卡(页面级状态,多入口各自独立)
VipProductModel? currentProductModel;
@@ -101,7 +105,8 @@ class MineChargeVipLogic extends GetxController {
void _selectCard(VipProductModel card) {
_guideCardId = card.productID;
if (vipProductManager.isLoading || !pageCtr.ready) return;
final index = vipProductManager.vipCards.indexWhere((e) => e.productID == card.productID);
final index = vipProductManager.vipCards
.indexWhere((e) => e.productID == card.productID);
if (index >= 0) pageCtr.animateToPage(index, curve: Curves.fastOutSlowIn);
}
@@ -113,13 +118,17 @@ class MineChargeVipLogic extends GetxController {
/// 数据就绪后按优先级确定默认选中卡,并滚动到对应位置;UI 展示后再上报曝光
void _syncSelection() {
currentProductModel = vipProductManager.defaultVipCard(vipID: _guideCardId ?? vipID, current: currentProductModel);
currentProductModel = vipProductManager.defaultVipCard(
vipID: _guideCardId ?? vipID, current: currentProductModel);
final pid = currentProductModel?.productID;
final index = pid == null ? -1 : vipProductManager.vipCards.indexWhere((e) => e.productID == pid);
final index = pid == null
? -1
: vipProductManager.vipCards.indexWhere((e) => e.productID == pid);
// 会话尽早创建:避免仅在 post-frame 里建,用户快速返回时 onClose 拿不到 session、CLOSE 丢报。
// 必须等有卡数据再建:首次请求失败时卡列表还是空,会把「无实验」快照锁进 session,
// 之后错误页重试成功也不会上报(快照 late final 不可变)。
if (vipProductManager.vipCards.isNotEmpty) _analytics ??= VipCardAnalyticsSession();
if (vipProductManager.vipCards.isNotEmpty)
_analytics ??= VipCardAnalyticsSession();
WidgetsBinding.instance.addPostFrameCallback((_) {
if (isClosed) return;
// 卡列表为空时页面渲染的是错误页,轮播压根没 build,controller 没 attach,
@@ -127,7 +136,8 @@ class MineChargeVipLogic extends GetxController {
if (index >= 0 && pageCtr.ready) pageCtr.jumpToPage(index);
// 曝光必须在 UI 实际展示后上报
_analytics?.reportPageViewAfterPaint();
_analytics?.reportProductImpression(currentProductModel, afterPaint: true);
_analytics?.reportProductImpression(currentProductModel,
afterPaint: true);
});
update();
}
@@ -143,7 +153,8 @@ class MineChargeVipLogic extends GetxController {
final model = data[index];
final card = VipCardItem(
model,
isSelect: currentProductModel?.productID != null && currentProductModel?.productID == model.productID,
isSelect: currentProductModel?.productID != null &&
currentProductModel?.productID == model.productID,
callback: () {
pageCtr.animateToPage(index, curve: Curves.fastOutSlowIn);
},
@@ -202,7 +213,8 @@ class MineChargeVipLogic extends GetxController {
checkoutContextId: base?.checkoutContextId,
sessionId: base?.sessionId ?? _analytics?.sessionId,
experimentId: vipProductManager.isExperimentActive
? (currentProductModel?.experimentId ?? vipProductManager.experimentId)
? (currentProductModel?.experimentId ??
vipProductManager.experimentId)
: null,
experimentVariant: vipProductManager.isExperimentActive
? (currentProductModel?.variant ?? vipProductManager.variant)
@@ -3,11 +3,11 @@ import 'dart:math' as math;
import 'package:carousel_slider/carousel_slider.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:hgmj/assets_tool/images.dart';
import 'package:hgmj/hj_utils/screen.dart';
import 'package:hgmj/tools_base/loading/loading_center_widget.dart';
import 'package:hgmj/tools_base/unique_tag_mixin.dart';
import 'package:hgmj/tools_base/widget/net_image_widget.dart';
import 'package:wydj/assets_tool/images.dart';
import 'package:wydj/hj_utils/screen.dart';
import 'package:wydj/tools_base/loading/loading_center_widget.dart';
import 'package:wydj/tools_base/unique_tag_mixin.dart';
import 'package:wydj/tools_base/widget/net_image_widget.dart';
import 'package:provider/provider.dart';
import '../../pre_sale/pre_sale_entry.dart';
@@ -37,12 +37,14 @@ class MineChargeVipPage extends StatefulWidget {
}
// 多入口可叠栈,用 per-实例唯一 tag 隔离 controller,避免轮播/选中卡/onReady 串味
class _MineChargeVipPageState extends State<MineChargeVipPage> with UniqueTagMixin {
class _MineChargeVipPageState extends State<MineChargeVipPage>
with UniqueTagMixin {
@override
Widget build(BuildContext context) {
return GetBuilder<MineChargeVipLogic>(
tag: uniqueTag,
init: MineChargeVipLogic(vipID: widget.vipID, sourcePage: widget.sourcePage),
init: MineChargeVipLogic(
vipID: widget.vipID, sourcePage: widget.sourcePage),
builder: (logic) => Consumer<VipProductManager>(
builder: (_, mgr, __) {
// ACTIVE+B → 改版 UI;A / DISABLED / 无实验 → 旧版 UI
@@ -59,7 +61,10 @@ class _MineChargeVipPageState extends State<MineChargeVipPage> with UniqueTagMix
InkWell(
enableFeedback: false,
onTap: () => Get.to(RecordsPage(RecordType.recharge)),
child: Text('充值记录', style: TextStyle(color: Colors.white.withValues(alpha: .45), fontSize: 12)),
child: Text('充值记录',
style: TextStyle(
color: Colors.white.withValues(alpha: .45),
fontSize: 12)),
),
16.sizeBoxW,
],
@@ -134,7 +139,8 @@ class _MineChargeVipPageState extends State<MineChargeVipPage> with UniqueTagMix
),
],
),
Positioned(bottom: 0, left: 0, right: 0, child: _buildPay(classic: classic)),
Positioned(
bottom: 0, left: 0, right: 0, child: _buildPay(classic: classic)),
],
);
}
@@ -179,7 +185,9 @@ class _MineChargeVipPageState extends State<MineChargeVipPage> with UniqueTagMix
mainAxisSize: MainAxisSize.min,
children: [
// classic ? _buildClassicCorePrivileges(coreList) : _buildCorePrivileges(coreList),
classic ? _buildClassicMorePrivileges(privileges) : _buildMorePrivileges(privileges),
classic
? _buildClassicMorePrivileges(privileges)
: _buildMorePrivileges(privileges),
],
);
},
@@ -200,7 +208,7 @@ class _MineChargeVipPageState extends State<MineChargeVipPage> with UniqueTagMix
if (list.isEmpty) return const SizedBox.shrink();
return Column(
children: [
// const VipSectionTitle("会员权益", classic: true),
// const VipSectionTitle("会员权益", classic: true),
VipMoreSectionTitleImage(),
12.sizeBoxH,
GridView.builder(
@@ -214,7 +222,8 @@ class _MineChargeVipPageState extends State<MineChargeVipPage> with UniqueTagMix
childAspectRatio: 63 / 100,
),
itemCount: list.length,
itemBuilder: (_, index) => VipProductPrivilegeItem(list[index], classic: true),
itemBuilder: (_, index) =>
VipProductPrivilegeItem(list[index], classic: true),
),
],
);
@@ -256,7 +265,8 @@ class _VipMorePrivilegesPanel extends StatefulWidget {
const _VipMorePrivilegesPanel({required this.list, required this.title});
@override
State<_VipMorePrivilegesPanel> createState() => _VipMorePrivilegesPanelState();
State<_VipMorePrivilegesPanel> createState() =>
_VipMorePrivilegesPanelState();
}
class _VipMorePrivilegesPanelState extends State<_VipMorePrivilegesPanel> {
@@ -274,7 +284,8 @@ class _VipMorePrivilegesPanelState extends State<_VipMorePrivilegesPanel> {
@override
Widget build(BuildContext context) {
final canToggle = widget.list.length > _collapsedCount;
final showCount = (!_expanded && canToggle) ? _collapsedCount : widget.list.length;
final showCount =
(!_expanded && canToggle) ? _collapsedCount : widget.list.length;
return Container(
margin: const EdgeInsets.symmetric(horizontal: 16),
@@ -299,14 +310,16 @@ class _VipMorePrivilegesPanelState extends State<_VipMorePrivilegesPanel> {
padding: EdgeInsets.zero,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
gridDelegate:
const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 4,
mainAxisSpacing: 12,
crossAxisSpacing: 10,
childAspectRatio: 72 / 110,
),
itemCount: showCount,
itemBuilder: (_, index) => VipProductPrivilegeItem(widget.list[index]),
itemBuilder: (_, index) =>
VipProductPrivilegeItem(widget.list[index]),
),
if (canToggle) ...[
8.sizeBoxH,
@@ -326,7 +339,9 @@ class _VipMorePrivilegesPanelState extends State<_VipMorePrivilegesPanel> {
),
),
Icon(
_expanded ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down,
_expanded
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down,
size: 16,
color: Colors.white.withValues(alpha: 0.55),
),
+90 -36
View File
@@ -3,13 +3,13 @@ import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:hgmj/extension/extensions.dart';
import 'package:hgmj/hj_page/pre_sale/pre_sale_provider.dart';
import 'package:hgmj/hj_utils/screen.dart';
import 'package:hgmj/tools_base/loading/loading_center_widget.dart';
import 'package:hgmj/tools_base/refresh/pull_refresh.dart';
import 'package:hgmj/tools_base/toast.dart';
import 'package:hgmj/tools_base/widget/sheet_handle_bar.dart';
import 'package:wydj/extension/extensions.dart';
import 'package:wydj/hj_page/pre_sale/pre_sale_provider.dart';
import 'package:wydj/hj_utils/screen.dart';
import 'package:wydj/tools_base/loading/loading_center_widget.dart';
import 'package:wydj/tools_base/refresh/pull_refresh.dart';
import 'package:wydj/tools_base/toast.dart';
import 'package:wydj/tools_base/widget/sheet_handle_bar.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import '../../../assets_tool/app_colors.dart';
@@ -62,13 +62,16 @@ class _OnlinePayPageState extends State<OnlinePayPage> {
CouponModel? coupon;
// 支付方式列表。会员卡与金币档位二选一,getter 每次访问都会重建列表,故每帧只取一次
List<RchgType> get _payTypes => widget.vipProductModel?.rchgTypeUI ?? widget.coinRcModel!.rechargeTypeListUI;
List<RchgType> get _payTypes =>
widget.vipProductModel?.rchgTypeUI ??
widget.coinRcModel!.rechargeTypeListUI;
/// 支付按钮文案:预售(尾款/升级/预订) → 会员卡(升级/普通) → 金币充值
String get _payText {
final vip = widget.vipProductModel;
if (vip == null) return '¥${widget.coinRcModel?.moneyYuan ?? 0}/立即支付';
if (!vip.isPreSale) return '¥${vip.discountedPriceUI}/${vip.isUpgrade == true ? '补差价升级' : '立即支付'}';
if (!vip.isPreSale)
return '¥${vip.discountedPriceUI}/${vip.isUpgrade == true ? '补差价升级' : '立即支付'}';
// 预售:可付尾款优先,其次升级,最后预订
final preSale = PreSaleProvider();
final detail = preSale.preSaleModel?.detailModel;
@@ -110,11 +113,14 @@ class _OnlinePayPageState extends State<OnlinePayPage> {
18.sizeBoxH,
const Text(
'选择支付方式',
style: TextStyle(fontSize: 20, fontWeight: FontWeight.w500, color: Colors.white),
style: TextStyle(
fontSize: 20, fontWeight: FontWeight.w500, color: Colors.white),
),
18.sizeBoxH,
//支付方式列表
Wrap(children: [for (var i = 0; i < types.length; i++) _payItem(types[i], i)]),
Wrap(children: [
for (var i = 0; i < types.length; i++) _payItem(types[i], i)
]),
//支付小贴士
Padding(
padding: EdgeInsets.only(bottom: 24.h, left: 16, right: 16),
@@ -123,13 +129,15 @@ class _OnlinePayPageState extends State<OnlinePayPage> {
children: [
Text(
'支付小贴士:',
style: textStyle(14, Colors.white.withValues(alpha: .9), FontWeight.w500),
style: textStyle(
14, Colors.white.withValues(alpha: .9), FontWeight.w500),
),
6.sizeBoxH,
Text(
'''1.因超时支付无法到账,请重新发起。
2.每天发起支付不能超过5次,连续发起且未支付,账号可能被加入黑名单。''',
style: textStyle(12, Colors.white.withValues(alpha: .45), FontWeight.w400),
style: textStyle(
12, Colors.white.withValues(alpha: .45), FontWeight.w400),
),
],
),
@@ -148,7 +156,10 @@ class _OnlinePayPageState extends State<OnlinePayPage> {
),
child: Text(
_payText,
style: TextStyle(fontWeight: FontWeight.w500, fontSize: 20.sp, color: Colors.black),
style: TextStyle(
fontWeight: FontWeight.w500,
fontSize: 20.sp,
color: Colors.black),
),
),
),
@@ -178,15 +189,22 @@ class _OnlinePayPageState extends State<OnlinePayPage> {
margin: EdgeInsets.only(bottom: 20.h),
child: Row(
children: [
icon.isEmpty ? const SizedBox(width: 36, height: 36) : Image.asset(icon, width: 36),
icon.isEmpty
? const SizedBox(width: 36, height: 36)
: Image.asset(icon, width: 36),
13.sizeBoxW,
Expanded(
child: Text(
"${type.typeName}",
style: textStyle(16, Colors.white.withValues(alpha: .9), FontWeight.w500),
style: textStyle(
16, Colors.white.withValues(alpha: .9), FontWeight.w500),
),
),
Image.asset(payIndex == index ? 'radio_sel.png'.commonImgPath : 'mine_withdraw_nor.png'.mineImgPath, width: 16),
Image.asset(
payIndex == index
? 'radio_sel.png'.commonImgPath
: 'mine_withdraw_nor.png'.mineImgPath,
width: 16),
],
),
),
@@ -231,10 +249,14 @@ class _OnlinePayPageState extends State<OnlinePayPage> {
contentId: base.contentId,
checkoutContextId: base.checkoutContextId,
experimentId: vipProductManager.isExperimentActive
? (base.experimentId ?? (vip == null ? null : vip.experimentId ?? vipProductManager.experimentId))
? (base.experimentId ??
(vip == null
? null
: vip.experimentId ?? vipProductManager.experimentId))
: null,
experimentVariant: vipProductManager.isExperimentActive
? (base.experimentVariant ?? (vip == null ? null : vip.variant ?? vipProductManager.variant))
? (base.experimentVariant ??
(vip == null ? null : vip.variant ?? vipProductManager.variant))
: null,
);
final urlModel = await MineService.chargeGoldCoin(
@@ -242,7 +264,9 @@ class _OnlinePayPageState extends State<OnlinePayPage> {
productId: productId,
isVip: vip != null,
goldExtraID: coupon?.cId,
finalPayStatus: vip?.isPreSale == true ? PreSaleProvider().preSaleModel?.detailModel?.balancePayment : null,
finalPayStatus: vip?.isPreSale == true
? PreSaleProvider().preSaleModel?.detailModel?.balancePayment
: null,
orderTrack: orderTrack,
);
LoadingHelper.dismissLoading();
@@ -285,10 +309,20 @@ class _OnlinePayPageState extends State<OnlinePayPage> {
vip?.discountedPrice,
source: 'online_pay',
jumpWalletOnInsufficient: false, // 当前就在充值页,余额不足不跳转
finalPayStatus: vip?.isPreSale == true ? PreSaleProvider().preSaleModel?.detailModel?.balancePayment : null,
finalPayStatus: vip?.isPreSale == true
? PreSaleProvider().preSaleModel?.detailModel?.balancePayment
: null,
// 与 /mine/topay 一致:仅实验 ACTIVE 时回传;sessionId 有则带上
experimentId: experimentActive ? (track?.experimentId ?? vip?.experimentId ?? vipProductManager.experimentId) : null,
experimentVariant: experimentActive ? (track?.experimentVariant ?? vip?.variant ?? vipProductManager.variant) : null,
experimentId: experimentActive
? (track?.experimentId ??
vip?.experimentId ??
vipProductManager.experimentId)
: null,
experimentVariant: experimentActive
? (track?.experimentVariant ??
vip?.variant ??
vipProductManager.variant)
: null,
sessionId: track?.sessionId,
//短剧付费墙开卡:金币余额支付这条也要带归因,否则只有第三方充值那条统计得到
mediaId: track?.mediaId,
@@ -307,7 +341,8 @@ class _OnlinePayPageState extends State<OnlinePayPage> {
}
///代充支付:拼装代充参数后跳 H5 收银台
Future<void> _payByDc(bool isVip, RchgType payType, DCModel? dcModel, int? money) async {
Future<void> _payByDc(
bool isVip, RchgType payType, DCModel? dcModel, int? money) async {
// daichong 是所有会员卡/金币档位共用的同一实例,下面的改写只为拼给 H5,必须在副本上做:
// 原地改会把 payInfos 截成单条(支付方式列表变短→下标越界)、ordUrl 被重复拼 host
final dc = dcModel!.clone();
@@ -341,7 +376,8 @@ class _OnlinePayPageState extends State<OnlinePayPage> {
//bt64
final data = base64Encode(utf8.encode(json.encode(dc)));
if (isVip) VipCardAnalyticsSession.markPurchaseOnActiveSessions();
Get.to(H5Page(title: "代理充值", url: "$channel/?data=$data&token=$token"), opaque: false);
Get.to(H5Page(title: "代理充值", url: "$channel/?data=$data&token=$token"),
opaque: false);
}
}
@@ -378,7 +414,9 @@ class _ChoseCouponViewState extends State<ChoseCouponView> {
refreshCtr?.refreshCompleted();
_dataSource.clear();
}
_dataSource.length < 20 ? refreshCtr?.loadNoData() : refreshCtr?.loadComplete();
_dataSource.length < 20
? refreshCtr?.loadNoData()
: refreshCtr?.loadComplete();
_dataSource.addAll(res);
page += 1;
setState(() {});
@@ -411,7 +449,10 @@ class _ChoseCouponViewState extends State<ChoseCouponView> {
const Center(
child: Text(
'选择加赠券',
style: TextStyle(color: Colors.black, fontSize: 18, fontWeight: FontWeight.w600),
style: TextStyle(
color: Colors.black,
fontSize: 18,
fontWeight: FontWeight.w600),
),
)
],
@@ -443,7 +484,9 @@ class _ChoseCouponViewState extends State<ChoseCouponView> {
padding: const EdgeInsets.only(left: 24, right: 11),
alignment: Alignment.centerLeft,
width: double.infinity,
decoration: BoxDecoration(color: Color(0xffff891c).withValues(alpha: .4), borderRadius: BorderRadius.circular(4)),
decoration: BoxDecoration(
color: Color(0xffff891c).withValues(alpha: .4),
borderRadius: BorderRadius.circular(4)),
child: Row(
children: [
//券面额
@@ -460,13 +503,18 @@ class _ChoseCouponViewState extends State<ChoseCouponView> {
4.sizeBoxW,
Text(
'${model.price ?? 0}',
style: TextStyle(color: Colors.black, fontSize: 24, fontWeight: FontWeight.w500, height: 33 / 24),
style: TextStyle(
color: Colors.black,
fontSize: 24,
fontWeight: FontWeight.w500,
height: 33 / 24),
)
],
),
Text(
'充值加送金币',
style: TextStyle(color: Colors.black.withValues(alpha: .6), fontSize: 12),
style: TextStyle(
color: Colors.black.withValues(alpha: .6), fontSize: 12),
)
],
),
@@ -476,10 +524,11 @@ class _ChoseCouponViewState extends State<ChoseCouponView> {
height: 45,
child: DecoratedBox(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Colors.black.withValues(alpha: 0), Colors.black.withValues(alpha: .5), Colors.black.withValues(alpha: 0)],
begin: Alignment.topCenter,
end: Alignment.bottomCenter),
gradient: LinearGradient(colors: [
Colors.black.withValues(alpha: 0),
Colors.black.withValues(alpha: .5),
Colors.black.withValues(alpha: 0)
], begin: Alignment.topCenter, end: Alignment.bottomCenter),
),
),
),
@@ -512,11 +561,16 @@ class _ChoseCouponViewState extends State<ChoseCouponView> {
GestureDetector(
onTap: () => widget.onSelect(model),
child: Container(
decoration: BoxDecoration(color: Color(0xffF68216), borderRadius: BorderRadius.circular(22)),
decoration: BoxDecoration(
color: Color(0xffF68216),
borderRadius: BorderRadius.circular(22)),
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 5),
child: Text(
'立即使用',
style: TextStyle(color: Colors.white, fontSize: 10, fontWeight: FontWeight.w500),
style: TextStyle(
color: Colors.white,
fontSize: 10,
fontWeight: FontWeight.w500),
),
),
)
@@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:hgmj/assets_tool/app_colors.dart';
import 'package:hgmj/hj_utils/screen.dart';
import 'package:hgmj/tools_base/widget/common_dialog.dart';
import 'package:wydj/assets_tool/app_colors.dart';
import 'package:wydj/hj_utils/screen.dart';
import 'package:wydj/tools_base/widget/common_dialog.dart';
import '../../../tools_base/global_store/store.dart';
@@ -43,7 +43,8 @@ class PaySuccessAlert extends StatelessWidget {
),
),
24.sizeBoxH,
InkWell(enableFeedback: false,
InkWell(
enableFeedback: false,
onTap: () {
globalStore.updateUserInfo();
Get.back();
@@ -1,10 +1,10 @@
import 'package:flutter/scheduler.dart';
import 'package:hgmj/hj_model/mine/vip_card_analytics_event.dart';
import 'package:hgmj/hj_page/mine/mine_vip/vip_product_manager.dart';
import 'package:hgmj/hj_page/mine/mine_vip/vip_support_model.dart';
import 'package:hgmj/hj_utils/api_service/mine_service.dart';
import 'package:hgmj/hj_utils/date_time_util.dart';
import 'package:hgmj/tools_base/debug_log.dart';
import 'package:wydj/hj_model/mine/vip_card_analytics_event.dart';
import 'package:wydj/hj_page/mine/mine_vip/vip_product_manager.dart';
import 'package:wydj/hj_page/mine/mine_vip/vip_support_model.dart';
import 'package:wydj/hj_utils/api_service/mine_service.dart';
import 'package:wydj/hj_utils/date_time_util.dart';
import 'package:wydj/tools_base/debug_log.dart';
import 'package:uuid/uuid.dart';
/// VIP 卡片统计:一次进入会员卡页/购买弹窗对应一个 session,关闭时按是否下单上报。
@@ -33,10 +33,12 @@ class VipCardAnalyticsSession {
bool _purchased = false;
bool _closed = false;
String? _lastImpressedProductId;
/// 同一帧内 jumpToPage + onPageChanged 去重
String? _pendingImpressionProductId;
static String _nowUtc() => DateTimeUtil.format2utc(DateTime.now().toUtc()) ?? '';
static String _nowUtc() =>
DateTimeUtil.format2utc(DateTime.now().toUtc()) ?? '';
/// DISABLED / 无实验 ID:不上报(空 experimentId 会参数错误)
bool get _canReport {
@@ -82,9 +84,11 @@ class VipCardAnalyticsSession {
}
/// 套餐曝光:选中 / 默认选中各算一次;同 product 连续重复不重复报
void reportProductImpression(VipProductModel? product, {bool afterPaint = false}) {
void reportProductImpression(VipProductModel? product,
{bool afterPaint = false}) {
final productId = product?.productID;
if (productId == null || productId.isEmpty || _closed || !_canReport) return;
if (productId == null || productId.isEmpty || _closed || !_canReport)
return;
if (_lastImpressedProductId == productId) return;
void doReport() {
@@ -128,7 +132,8 @@ class VipCardAnalyticsSession {
_closed = true;
_active.remove(this);
if (_purchased) {
debugLog('VipCardAnalytics', 'skip CLOSE_WITHOUT_PURCHASE: already purchased');
debugLog(
'VipCardAnalytics', 'skip CLOSE_WITHOUT_PURCHASE: already purchased');
return;
}
if (!_canReport) {
+57 -22
View File
@@ -3,9 +3,9 @@ import 'dart:math' as math;
import 'package:easy_rich_text/easy_rich_text.dart';
import 'package:flutter/material.dart';
import 'package:hgmj/assets_tool/images.dart';
import 'package:hgmj/hj_utils/screen.dart';
import 'package:hgmj/tools_base/widget/net_image_widget.dart';
import 'package:wydj/assets_tool/images.dart';
import 'package:wydj/hj_utils/screen.dart';
import 'package:wydj/tools_base/widget/net_image_widget.dart';
import '../../main_page/provider/msg_provider.dart';
import 'vip_product_manager.dart';
@@ -17,7 +17,8 @@ class VipCardItem extends StatefulWidget {
final bool isSelect;
final VipProductModel model;
const VipCardItem(this.model, {super.key, this.callback, this.isSelect = false});
const VipCardItem(this.model,
{super.key, this.callback, this.isSelect = false});
@override
State<StatefulWidget> createState() {
@@ -57,7 +58,11 @@ class _VipCardItemState extends State<VipCardItem> {
if (!_isNewerOfferCard) return null;
final layered = MineMsgProvider().countdownConfig;
if (layered != null) {
return (hour: layered.discountHour, min: layered.discountMin, sec: layered.discountSec);
return (
hour: layered.discountHour,
min: layered.discountMin,
sec: layered.discountSec
);
}
final hours = widget.model.showCountdownTime ?? 0;
if (hours <= 0) return null;
@@ -106,10 +111,9 @@ class _VipCardItemState extends State<VipCardItem> {
}
}
String get _title =>
(widget.model.newName?.trim().isNotEmpty == true)
? widget.model.newName!.trim()
: (widget.model.productName ?? '');
String get _title => (widget.model.newName?.trim().isNotEmpty == true)
? widget.model.newName!.trim()
: (widget.model.productName ?? '');
@override
Widget build(BuildContext context) {
@@ -223,7 +227,10 @@ class _VipCardItemState extends State<VipCardItem> {
? const LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [Color(0xffFBF0CD), Color(0xffE5B75D)],
colors: [
Color(0xffFBF0CD),
Color(0xffE5B75D)
],
)
: null,
),
@@ -273,8 +280,10 @@ class _VipCardItemState extends State<VipCardItem> {
Widget _buildBCardBody(bool selected) {
final titleColor = selected ? const Color(0xff3B2B0E) : Color(0xffF6EEDC);
final priceColor = selected ? const Color(0xff3B2B0E) : const Color(0xffF6EEDC);
final originColor = selected ? const Color(0xff6C644F) : const Color(0xff9A927C);
final priceColor =
selected ? const Color(0xff3B2B0E) : const Color(0xffF6EEDC);
final originColor =
selected ? const Color(0xff6C644F) : const Color(0xff9A927C);
final showOrigin = widget.model.originalPriceUI > 0 &&
widget.model.originalPriceUI != widget.model.discountedPriceUI;
@@ -368,7 +377,10 @@ class _VipCardItemState extends State<VipCardItem> {
4.sizeBoxW,
const Text(
'结束',
style: TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w600),
style: TextStyle(
color: Colors.white,
fontSize: 12,
fontWeight: FontWeight.w600),
),
],
),
@@ -437,8 +449,10 @@ class _VipCardItemState extends State<VipCardItem> {
fg = const Color(0xFFE8C078);
border = Border.all(color: const Color(0xFFE8C078), width: 0.8);
} else {
bg = apiBg ?? (isMostPopular ? const Color(0xCC1A1A1A) : const Color(0xffE1351F));
fg = apiFg ?? (isMostPopular ? const Color(0xFFE8C078) : const Color(0xE5FFFFFF));
bg = apiBg ??
(isMostPopular ? const Color(0xCC1A1A1A) : const Color(0xffE1351F));
fg = apiFg ??
(isMostPopular ? const Color(0xFFE8C078) : const Color(0xE5FFFFFF));
border = (apiBg == null && isMostPopular)
? Border.all(color: const Color(0xFFE8C078), width: 0.8)
: null;
@@ -508,20 +522,29 @@ class _VipCardItemState extends State<VipCardItem> {
),
child: Text(
value,
style: const TextStyle(color: Colors.white, fontSize: 10, fontWeight: FontWeight.w500, height: 1.0),
style: const TextStyle(
color: Colors.white,
fontSize: 10,
fontWeight: FontWeight.w500,
height: 1.0),
),
);
}
Widget _timerColon() => const Padding(
padding: EdgeInsets.symmetric(horizontal: 3),
child: Text(':', style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.w600)),
child: Text(':',
style: TextStyle(
color: Colors.white,
fontSize: 14,
fontWeight: FontWeight.w600)),
);
}
class VipProductPrivilegeItem extends StatelessWidget {
final NewPrivilege? model;
final bool isShowOnePrivilege;
/// true:旧版白字圆图标样式(会员中心 A / DISABLED)
final bool classic;
@@ -547,7 +570,10 @@ class VipProductPrivilegeItem extends StatelessWidget {
Text(
model?.privilegeName ?? '',
maxLines: 1,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w500, color: Colors.white.withValues(alpha: .9)),
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w500,
color: Colors.white.withValues(alpha: .9)),
),
if (!isShowOnePrivilege) ...[
4.sizeBoxH,
@@ -591,7 +617,8 @@ class VipProductPrivilegeItem extends StatelessWidget {
model?.privilegeName ?? '',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: const TextStyle(fontSize: 12, fontWeight: FontWeight.w500, color: Colors.white),
style: const TextStyle(
fontSize: 12, fontWeight: FontWeight.w500, color: Colors.white),
),
),
if (!isShowOnePrivilege) ...[
@@ -750,7 +777,11 @@ class VipCorePrivilegeCard extends StatelessWidget {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
NetworkImageLoader(imageUrl: model?.img ?? '', width: 22, height: 22, borderRadius: 0),
NetworkImageLoader(
imageUrl: model?.img ?? '',
width: 22,
height: 22,
borderRadius: 0),
5.sizeBoxH,
ShaderMask(
shaderCallback: (bounds) => const LinearGradient(
@@ -765,7 +796,10 @@ class VipCorePrivilegeCard extends StatelessWidget {
textAlign: TextAlign.center,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: const TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w500),
style: const TextStyle(
color: Colors.white,
fontSize: 12,
fontWeight: FontWeight.w500),
),
),
3.sizeBoxH,
@@ -807,7 +841,8 @@ class VipCorePrivilegeCard extends StatelessWidget {
raw,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: const TextStyle(color: Color(0xff9A927C), fontSize: 11, height: 1.2),
style:
const TextStyle(color: Color(0xff9A927C), fontSize: 11, height: 1.2),
);
}
}
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:hgmj/assets_tool/app_colors.dart';
import 'package:hgmj/hj_page/pre_sale/pre_sale_alert.dart';
import 'package:hgmj/hj_page/pre_sale/pre_sale_provider.dart';
import 'package:wydj/assets_tool/app_colors.dart';
import 'package:wydj/hj_page/pre_sale/pre_sale_alert.dart';
import 'package:wydj/hj_page/pre_sale/pre_sale_provider.dart';
import 'mine_charge_vip_logic.dart';
import 'vip_support_model.dart';
@@ -20,7 +20,8 @@ class VipPayButton extends StatelessWidget {
//预售首付或非升级预售 → 预售按钮(透传会员中心 sessionId / 实验字段)
if (product?.isPreSale == true && product?.isUpgrade == false) {
return PreSaleActivityButton(onTap: () async {
await PreSaleProvider().startPay(product!, orderTrack: logic.buildOrderTrack());
await PreSaleProvider()
.startPay(product!, orderTrack: logic.buildOrderTrack());
logic.update();
});
}
@@ -68,7 +69,8 @@ class VipPayButton extends StatelessWidget {
),
child: Text(
_payText,
style: const TextStyle(color: Colors.black, fontSize: 16, fontWeight: FontWeight.w500),
style: const TextStyle(
color: Colors.black, fontSize: 16, fontWeight: FontWeight.w500),
),
),
);
@@ -1,9 +1,9 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:hgmj/hj_utils/api_service/mine_service.dart';
import 'package:hgmj/tools_base/global_store/store.dart';
import 'package:hgmj/tools_base/loading/loading_helper.dart';
import 'package:hgmj/tools_base/toast.dart';
import 'package:wydj/hj_utils/api_service/mine_service.dart';
import 'package:wydj/tools_base/global_store/store.dart';
import 'package:wydj/tools_base/loading/loading_helper.dart';
import 'package:wydj/tools_base/toast.dart';
import '../../../hj_page/main_page/provider/msg_provider.dart';
import '../../../hj_page/pre_sale/pre_sale_provider.dart';
@@ -24,7 +24,9 @@ class VipProductManager with ChangeNotifier {
/// 空串必须当「未指定」:分层/实验/短剧默认卡没配时下发的都是空串,
/// 不拦会跟 productID 为空的脏数据撞上
VipProductModel? _pick(List<VipProductModel> list, String? id) =>
(id ?? '').isEmpty ? null : list.firstWhereOrNull((e) => e.productID == id);
(id ?? '').isEmpty
? null
: list.firstWhereOrNull((e) => e.productID == id);
// ===== 会员卡数据 =====
@@ -69,7 +71,8 @@ class VipProductManager with ChangeNotifier {
}
/// 角标配色:按套餐 badgeType 匹配皮肤配置
VipBadgeStyle? badgeStyleFor(String? badgeType) => _uiConfig?.styleFor(badgeType);
VipBadgeStyle? badgeStyleFor(String? badgeType) =>
_uiConfig?.styleFor(badgeType);
// ===== 会员卡:请求 / 组装 =====
@@ -143,7 +146,9 @@ class VipProductManager with ChangeNotifier {
return _pick(vipCards, vipID) ??
_pick(vipCards, MineMsgProvider().payTier?.config?.vipCard) ??
_pick(vipCards, _abCardId) ??
(globalStore.meInfo?.isUpgrade == true ? _cheapestUpgrade(vipCards) : null) ??
(globalStore.meInfo?.isUpgrade == true
? _cheapestUpgrade(vipCards)
: null) ??
_pick(vipCards, current?.productID) ?? // 二次刷新时保留当前选中
vipCards.first;
}
@@ -179,7 +184,9 @@ class VipProductManager with ChangeNotifier {
final card = _pick(list, cardId) ??
_pick(list, MineMsgProvider().payTier?.config?.vipCard) ??
_pick(list, _abCardId) ??
(globalStore.meInfo?.isUpgrade == true ? _cheapestUpgrade(list) : null) ??
(globalStore.meInfo?.isUpgrade == true
? _cheapestUpgrade(list)
: null) ??
list.first;
if (card.rchgTypeUI.isEmpty) {
showToast("未配置支付方式,请联系客服");
@@ -199,8 +206,12 @@ class VipProductManager with ChangeNotifier {
contentId: base.contentId,
checkoutContextId: base.checkoutContextId,
// DISABLED:正常下单但不传实验字段
experimentId: isExperimentActive ? (base.experimentId ?? card.experimentId ?? experimentId) : null,
experimentVariant: isExperimentActive ? (base.experimentVariant ?? card.variant ?? variant) : null,
experimentId: isExperimentActive
? (base.experimentId ?? card.experimentId ?? experimentId)
: null,
experimentVariant: isExperimentActive
? (base.experimentVariant ?? card.variant ?? variant)
: null,
);
analytics?.reportPageViewAfterPaint();
analytics?.reportProductImpression(card, afterPaint: true);
@@ -229,7 +240,9 @@ class VipProductManager with ChangeNotifier {
/// 升级比价用价:预售卡用实际待付(已付首款=尾款 balanceAmount / 未付=定金 advanceAmount),普通卡用 discountedPrice(对齐 mrhs)
int _upgradePrice(VipProductModel card) {
if (card.isPreSale) {
return PreSaleProvider().isPayFirst ? (card.balanceAmount ?? 0) : (card.advanceAmount ?? 0);
return PreSaleProvider().isPayFirst
? (card.balanceAmount ?? 0)
: (card.advanceAmount ?? 0);
}
return card.discountedPrice ?? 0;
}
@@ -1,6 +1,6 @@
//会员支持model
import 'package:hgmj/assets_tool/images.dart';
import 'package:hgmj/hj_page/pre_sale/pre_sale_provider.dart';
import 'package:wydj/assets_tool/images.dart';
import 'package:wydj/hj_page/pre_sale/pre_sale_provider.dart';
import '../../../hj_model/mine/exchange/dc_model.dart';
@@ -71,16 +71,22 @@ class VipSupportModel {
bool? isNewUser;
List<VipProductListModel>? list;
List<VipProductModel>? upgradeableVipCardList;
/// A/B 实验状态:ACTIVE / DISABLED
String? experimentStatus;
/// A/B 实验:实验 ID(下单时原样回传;DISABLED 时后端不返回)
String? experimentId;
/// A/B 实验:分组 A / B(下单时原样回传)
String? variant;
/// A/B 实验:默认选中卡 ID
String? defaultProductId;
/// 皮肤 key,如 vip-card-skin-b(视觉皮肤标识,UI 分支仍以 variant 为准)
String? skinKey;
/// 皮肤 UI 配置(背景图 / 角标样式表)
VipUiConfig? uiConfig;
@@ -102,7 +108,8 @@ class VipSupportModel {
});
VipSupportModel.fromJson(Map<String, dynamic>? json) {
daichong = json?['daichong'] != null ? DCModel.fromJson(json?['daichong']) : null;
daichong =
json?['daichong'] != null ? DCModel.fromJson(json?['daichong']) : null;
if (json?['integralList'] != null) {
integralList = <IntegralList>[];
json?['integralList'].forEach((v) {
@@ -115,7 +122,9 @@ class VipSupportModel {
variant = json?['variant']?.toString();
defaultProductId = json?['defaultProductId']?.toString();
skinKey = json?['skinKey']?.toString();
uiConfig = json?['uiConfig'] != null ? VipUiConfig.fromJson(json?['uiConfig']) : null;
uiConfig = json?['uiConfig'] != null
? VipUiConfig.fromJson(json?['uiConfig'])
: null;
/// 升级卡
upgradeableVipCardList = (json?['upgradeableVipCardList'] as List?)
@@ -124,7 +133,8 @@ class VipSupportModel {
if (json?['list'] != null) {
list = <VipProductListModel>[];
json?['list'].forEach((v) {
VipProductListModel vipModel = VipProductListModel.fromJson(v, daichong);
VipProductListModel vipModel =
VipProductListModel.fromJson(v, daichong);
list!.add(vipModel);
});
}
@@ -182,7 +192,14 @@ class IntegralList {
int? type;
String? bgImg;
IntegralList({this.desc, this.duration, this.id, this.img, this.name, this.price, this.type});
IntegralList(
{this.desc,
this.duration,
this.id,
this.img,
this.name,
this.price,
this.type});
IntegralList.fromJson(Map<String, dynamic> json) {
desc = json['desc'];
@@ -214,7 +231,8 @@ class VipProductListModel {
String? positionID;
int? showType;
VipProductListModel({this.list, this.position, this.positionID, this.showType});
VipProductListModel(
{this.list, this.position, this.positionID, this.showType});
VipProductListModel.fromJson(Map<String, dynamic> json, DCModel? daichong) {
if (json['list'] != null) {
@@ -244,8 +262,10 @@ class VipProductListModel {
class VipProductModel {
String? actionDesc;
/// 角标类型,如 MOST_POPULAR
String? badgeType;
/// 角标文案,如「最受欢迎」
String? badgeText;
int? aiUndressCount;
@@ -522,12 +542,12 @@ class VipProductModel {
vipCardDesc = json['vipCardDesc'];
vipLevel = json['vipLevel'];
isPreSale = false;
isUpgrade= json['isUpgrade'];
currentVipName= json['currentVipName'];
currentVipPrice= "${json['currentVipPrice']}";
purchasePrice= json['purchasePrice'];
advanceAmount= json['advanceAmount'];
balanceAmount= json['balanceAmount'];
isUpgrade = json['isUpgrade'];
currentVipName = json['currentVipName'];
currentVipPrice = "${json['currentVipPrice']}";
purchasePrice = json['purchasePrice'];
advanceAmount = json['advanceAmount'];
balanceAmount = json['balanceAmount'];
}
//是否有折扣
@@ -598,12 +618,12 @@ class VipProductModel {
data['videoDiscount'] = videoDiscount;
data['vipCardDesc'] = vipCardDesc;
data['vipLevel'] = vipLevel;
data['isUpgrade']= isUpgrade;
data['currentVipName']= currentVipName;
data['currentVipPrice']= currentVipPrice;
data['purchasePrice']= purchasePrice;
data['advanceAmount']= advanceAmount;
data['balanceAmount']= balanceAmount;
data['isUpgrade'] = isUpgrade;
data['currentVipName'] = currentVipName;
data['currentVipPrice'] = currentVipPrice;
data['purchasePrice'] = purchasePrice;
data['advanceAmount'] = advanceAmount;
data['balanceAmount'] = balanceAmount;
return data;
}
}
@@ -667,7 +687,8 @@ class RchgType {
bool? isOfficial = false; // 官方推荐
int? payMethod;
RchgType({this.channel, this.incTax, this.incrAmount, this.type, this.typeName});
RchgType(
{this.channel, this.incTax, this.incrAmount, this.type, this.typeName});
RchgType.fromJson(Map<String, dynamic> json) {
channel = json['channel'];
+14 -6
View File
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:hgmj/assets_tool/images.dart';
import 'package:hgmj/hj_utils/screen.dart';
import 'package:wydj/assets_tool/images.dart';
import 'package:wydj/hj_utils/screen.dart';
/// VIP 金色标题渐变 #F5E7BC → #DCAD55
/// 会员中心 / 购买弹窗 / 权益标题等金色文案共用,调色只改此处
@@ -56,6 +56,7 @@ class VipMoreSectionTitleImage extends StatelessWidget {
/// 区块标题:两侧「金渐变横线 + 菱形」+ 居中金渐变文字(会员中心 B / 购买弹窗共用)
class VipSectionTitle extends StatelessWidget {
final String text;
/// true:旧版橙色标题(会员中心 A / DISABLED)
final bool classic;
@@ -71,7 +72,11 @@ class VipSectionTitle extends StatelessWidget {
children: [
_classicDeco(lineFirst: true),
8.sizeBoxW,
Text(text, style: const TextStyle(color: _classicOrange, fontSize: 18, fontWeight: FontWeight.w600)),
Text(text,
style: const TextStyle(
color: _classicOrange,
fontSize: 18,
fontWeight: FontWeight.w600)),
8.sizeBoxW,
_classicDeco(lineFirst: false),
],
@@ -85,7 +90,8 @@ class VipSectionTitle extends StatelessWidget {
VipGradientMask(
child: Text(
text,
style: const TextStyle(color: Colors.white, fontSize: 20, fontWeight: FontWeight.w600),
style: const TextStyle(
color: Colors.white, fontSize: 20, fontWeight: FontWeight.w600),
),
),
8.sizeBoxW,
@@ -109,7 +115,8 @@ class VipSectionTitle extends StatelessWidget {
// 标题两侧装饰:金渐变细横线 + 菱形(lineFirst=true 横线在外侧,false 镜像)
Widget _buildDeco({required bool lineFirst}) {
const line = VipGradientMask(
child: SizedBox(width: 40, height: 0.5, child: ColoredBox(color: Colors.white)),
child: SizedBox(
width: 40, height: 0.5, child: ColoredBox(color: Colors.white)),
);
return Row(
mainAxisSize: MainAxisSize.min,
@@ -121,7 +128,8 @@ class VipSectionTitle extends StatelessWidget {
Widget get _diamond => Transform.rotate(
angle: 0.7853981633974483,
child: const VipGradientMask(
child: SizedBox(width: 5, height: 5, child: ColoredBox(color: Colors.white)),
child: SizedBox(
width: 5, height: 5, child: ColoredBox(color: Colors.white)),
),
);
}
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:hgmj/assets_tool/images.dart';
import 'package:hgmj/hj_model/mine/exchange/recharge_type_list_model.dart';
import 'package:hgmj/hj_utils/screen.dart';
import 'package:wydj/assets_tool/images.dart';
import 'package:wydj/hj_model/mine/exchange/recharge_type_list_model.dart';
import 'package:wydj/hj_utils/screen.dart';
// 金币充值档位卡片
class CoinItem extends StatelessWidget {
@@ -24,7 +24,9 @@ class CoinItem extends StatelessWidget {
decoration: BoxDecoration(
color: Colors.white.withValues(alpha: .1),
borderRadius: BorderRadius.circular(8),
border: isSelected ? Border.all(width: 1, color: const Color(0xffF9C142)) : null,
border: isSelected
? Border.all(width: 1, color: const Color(0xffF9C142))
: null,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
@@ -33,12 +35,14 @@ class CoinItem extends StatelessWidget {
4.sizeBoxH,
Text(
"${model.amount}金币",
style: const TextStyle(color: Color(0xFF656565), fontSize: 14),
style:
const TextStyle(color: Color(0xFF656565), fontSize: 14),
),
4.sizeBoxH,
Text(
'¥${model.moneyYuan}',
style: const TextStyle(color: Color(0xffF9C142), fontWeight: FontWeight.w500),
style: const TextStyle(
color: Color(0xffF9C142), fontWeight: FontWeight.w500),
),
4.sizeBoxH,
],
@@ -53,7 +57,9 @@ class CoinItem extends StatelessWidget {
height: 20,
padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 5),
decoration: const BoxDecoration(
borderRadius: BorderRadius.only(topLeft: Radius.circular(12), bottomRight: Radius.circular(12)),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(12),
bottomRight: Radius.circular(12)),
color: Color(0xffFFD460),
),
child: Text(
@@ -1,12 +1,12 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:hgmj/assets_tool/app_colors.dart';
import 'package:hgmj/assets_tool/images.dart';
import 'package:hgmj/hj_utils/screen.dart';
import 'package:hgmj/tools_base/global_store/store.dart';
import 'package:hgmj/tools_base/loading/loading_center_widget.dart';
import 'package:wydj/assets_tool/app_colors.dart';
import 'package:wydj/assets_tool/images.dart';
import 'package:wydj/hj_utils/screen.dart';
import 'package:wydj/tools_base/global_store/store.dart';
import 'package:wydj/tools_base/loading/loading_center_widget.dart';
import 'package:provider/provider.dart';
import 'package:hgmj/tools_base/widget/sheet_handle_bar.dart';
import 'package:wydj/tools_base/widget/sheet_handle_bar.dart';
import '../../make_money/mine_withdrawal_record_page.dart';
import '../mine_charge_coin_logic.dart';
@@ -21,7 +21,10 @@ class CoinPayBottomSheet extends StatelessWidget {
/// 下单埋点上下文(短剧付费墙充金币要带剧/集/付费墙上下文)
final PayOrderTrackInfo? orderTrack;
const CoinPayBottomSheet({super.key, this.sourcePage = PaySourcePage.videoBottomSheet, this.orderTrack});
const CoinPayBottomSheet(
{super.key,
this.sourcePage = PaySourcePage.videoBottomSheet,
this.orderTrack});
/// 弹窗展示中,防连点叠多个 bottomSheet
static bool _isShowing = false;
@@ -166,7 +169,8 @@ class CoinPayBottomSheet extends StatelessWidget {
children: [
const Text(
'我的金币余额',
style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.w500),
style: TextStyle(
color: Colors.white, fontSize: 14, fontWeight: FontWeight.w500),
),
8.sizeBoxH,
Row(
@@ -191,7 +195,8 @@ class CoinPayBottomSheet extends StatelessWidget {
const Spacer(),
InkWell(
enableFeedback: false,
onTap: () => Get.to(RecordsPage(RecordType.bill), opaque: false),
onTap: () =>
Get.to(RecordsPage(RecordType.bill), opaque: false),
child: Container(
alignment: Alignment.center,
height: 30,