logo和名称替换
This commit is contained in:
@@ -5,9 +5,9 @@ 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/hj_utils/screen.dart';
|
||||
import 'package:hgmj/tools_base/unique_tag_mixin.dart';
|
||||
import 'package:hgmj/tools_base/widget/sheet_handle_bar.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:wydj/tools_base/unique_tag_mixin.dart';
|
||||
import 'package:wydj/tools_base/widget/sheet_handle_bar.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../hj_model/splash/domain_source_model.dart';
|
||||
@@ -26,10 +26,12 @@ import 'buy_vip_alert_logic.dart';
|
||||
class BuyVipAlert extends StatefulWidget {
|
||||
final String? vipId; //外部指定卡ID(可选),不传走分层卡/升级卡兜底
|
||||
final String? videoId; //在看的那条内容 id,下单时透传给服务端做归因
|
||||
final PayOrderTrackInfo? orderTrack; //整份下单上下文,短剧付费墙要带 mediaId/contentId/checkoutContextId
|
||||
final PayOrderTrackInfo?
|
||||
orderTrack; //整份下单上下文,短剧付费墙要带 mediaId/contentId/checkoutContextId
|
||||
const BuyVipAlert({super.key, this.vipId, this.videoId, this.orderTrack});
|
||||
|
||||
static Future show({String? vipId, String? videoId, PayOrderTrackInfo? orderTrack}) {
|
||||
static Future show(
|
||||
{String? vipId, String? videoId, PayOrderTrackInfo? orderTrack}) {
|
||||
return Get.bottomSheet(
|
||||
BuyVipAlert(vipId: vipId, videoId: videoId, orderTrack: orderTrack),
|
||||
isScrollControlled: true,
|
||||
@@ -42,7 +44,10 @@ class BuyVipAlert extends StatefulWidget {
|
||||
|
||||
// 可叠弹(试看结束/超时长等多处触发),用 per-实例唯一 tag 隔离 controller
|
||||
class _BuyVipAlertState extends State<BuyVipAlert> with UniqueTagMixin {
|
||||
late final logic = BuyVipAlertLogic(vId: widget.vipId, videoId: widget.videoId, orderTrack: widget.orderTrack);
|
||||
late final logic = BuyVipAlertLogic(
|
||||
vId: widget.vipId,
|
||||
videoId: widget.videoId,
|
||||
orderTrack: widget.orderTrack);
|
||||
|
||||
static const _sheetRadius = 26.0;
|
||||
|
||||
@@ -109,14 +114,18 @@ class _BuyVipAlertState extends State<BuyVipAlert> with UniqueTagMixin {
|
||||
_selectionBuilder(
|
||||
(_) => Text(
|
||||
_title,
|
||||
style: const TextStyle(color: Color(0xE5FFFFFF), fontSize: 16, fontWeight: FontWeight.w500),
|
||||
style: const TextStyle(
|
||||
color: Color(0xE5FFFFFF),
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
),
|
||||
_buildCountdown(),
|
||||
],
|
||||
),
|
||||
14.sizeBoxH,
|
||||
_selectionBuilder((_) => _buildPriceInfo()), //原价 / 限时特价 / 优惠
|
||||
_selectionBuilder(
|
||||
(_) => _buildPriceInfo()), //原价 / 限时特价 / 优惠
|
||||
16.sizeBoxH,
|
||||
Expanded(
|
||||
child: _buildContent(),
|
||||
@@ -169,7 +178,8 @@ class _BuyVipAlertState extends State<BuyVipAlert> with UniqueTagMixin {
|
||||
child: CarouselSlider.builder(
|
||||
carouselController: logic.pageCtr,
|
||||
itemCount: mgr.vipCards.length + 2,
|
||||
itemBuilder: (_, index, __) => _selectionBuilder((l) => l.instanceChildItem(index)),
|
||||
itemBuilder: (_, index, __) => _selectionBuilder(
|
||||
(l) => l.instanceChildItem(index)),
|
||||
options: CarouselOptions(
|
||||
height: logic.cardHeight,
|
||||
viewportFraction: logic.itemRatio,
|
||||
@@ -180,7 +190,8 @@ class _BuyVipAlertState extends State<BuyVipAlert> with UniqueTagMixin {
|
||||
enlargeCenterPage: false,
|
||||
padEnds: false,
|
||||
clipBehavior: Clip.none,
|
||||
onPageChanged: (index, __) => logic.onPageChanged(index),
|
||||
onPageChanged: (index, __) =>
|
||||
logic.onPageChanged(index),
|
||||
scrollDirection: Axis.horizontal,
|
||||
),
|
||||
),
|
||||
@@ -230,7 +241,8 @@ class _BuyVipAlertState extends State<BuyVipAlert> with UniqueTagMixin {
|
||||
decoration: TextDecoration.lineThrough,
|
||||
decorationColor: Color(0x8cFFFFFF),
|
||||
);
|
||||
const normal = TextStyle(color: Color(0x8cFFFFFF), fontSize: 14, fontWeight: FontWeight.w500);
|
||||
const normal = TextStyle(
|
||||
color: Color(0x8cFFFFFF), fontSize: 14, fontWeight: FontWeight.w500);
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
@@ -238,16 +250,20 @@ class _BuyVipAlertState extends State<BuyVipAlert> with UniqueTagMixin {
|
||||
24.sizeBoxW,
|
||||
_priceItem("限时特价", "¥$discounted", normal),
|
||||
24.sizeBoxW,
|
||||
_priceItem("优惠", "¥${(original - discounted).clamp(0, original)}", normal),
|
||||
_priceItem(
|
||||
"优惠", "¥${(original - discounted).clamp(0, original)}", normal),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _priceItem(String title, String value, TextStyle valueStyle, {TextStyle? titleStyle}) {
|
||||
Widget _priceItem(String title, String value, TextStyle valueStyle,
|
||||
{TextStyle? titleStyle}) {
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(title, style: titleStyle ?? const TextStyle(color: Color(0x99FFFFFF), fontSize: 14)),
|
||||
Text(title,
|
||||
style: titleStyle ??
|
||||
const TextStyle(color: Color(0x99FFFFFF), fontSize: 14)),
|
||||
4.sizeBoxW,
|
||||
Text(value, style: valueStyle),
|
||||
],
|
||||
@@ -260,7 +276,8 @@ class _BuyVipAlertState extends State<BuyVipAlert> with UniqueTagMixin {
|
||||
valueListenable: MineMsgProvider().tick,
|
||||
builder: (_, __, ___) {
|
||||
final c = MineMsgProvider().payTier?.config;
|
||||
if (c == null || !c.hasDiscountCountdown) return const SizedBox.shrink();
|
||||
if (c == null || !c.hasDiscountCountdown)
|
||||
return const SizedBox.shrink();
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
@@ -281,27 +298,35 @@ class _BuyVipAlertState extends State<BuyVipAlert> with UniqueTagMixin {
|
||||
width: 24,
|
||||
height: 24,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(color: const Color(0xffE1351F), borderRadius: BorderRadius.circular(3)),
|
||||
child: Text(value, style: const TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.w500)),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xffE1351F),
|
||||
borderRadius: BorderRadius.circular(3)),
|
||||
child: Text(value,
|
||||
style: const TextStyle(
|
||||
color: Colors.white, fontSize: 14, fontWeight: FontWeight.w500)),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _colon() => const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 2),
|
||||
child: Text(":", style: TextStyle(color: Color(0xffDD001B), fontSize: 20)),
|
||||
child:
|
||||
Text(":", style: TextStyle(color: Color(0xffDD001B), fontSize: 20)),
|
||||
);
|
||||
|
||||
/// 权益区:与会员中心同实验分支 —— classic=A/DISABLED,改版=ACTIVE+B
|
||||
Widget _buildPrivilegeSections({required bool classic}) {
|
||||
return _selectionBuilder((l) {
|
||||
final privileges = l.currentProductModel?.newPrivilege ?? [];
|
||||
// final coreList = privileges.where((p) => p.isCore == true).toList();
|
||||
final moreList = privileges; // privileges.where((p) => p.isCore != true).toList();
|
||||
// final coreList = privileges.where((p) => p.isCore == true).toList();
|
||||
final moreList =
|
||||
privileges; // privileges.where((p) => p.isCore != true).toList();
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
// classic ? _buildClassicCorePrivileges(coreList) : _buildCorePrivileges(coreList),
|
||||
classic ? _buildClassicMorePrivileges(moreList) : _buildMorePrivileges(moreList),
|
||||
// classic ? _buildClassicCorePrivileges(coreList) : _buildCorePrivileges(coreList),
|
||||
classic
|
||||
? _buildClassicMorePrivileges(moreList)
|
||||
: _buildMorePrivileges(moreList),
|
||||
],
|
||||
);
|
||||
});
|
||||
@@ -358,7 +383,8 @@ class _BuyVipAlertState extends State<BuyVipAlert> with UniqueTagMixin {
|
||||
childAspectRatio: 63 / 100,
|
||||
),
|
||||
itemCount: list.length,
|
||||
itemBuilder: (_, i) => VipProductPrivilegeItem(list[i], classic: true),
|
||||
itemBuilder: (_, i) =>
|
||||
VipProductPrivilegeItem(list[i], classic: true),
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -410,6 +436,8 @@ class _BuyVipTopBorderPainter extends CustomPainter {
|
||||
|
||||
@override
|
||||
bool shouldRepaint(covariant _BuyVipTopBorderPainter oldDelegate) {
|
||||
return oldDelegate.gradient != gradient || oldDelegate.strokeWidth != strokeWidth || oldDelegate.topRadius != topRadius;
|
||||
return oldDelegate.gradient != gradient ||
|
||||
oldDelegate.strokeWidth != strokeWidth ||
|
||||
oldDelegate.topRadius != topRadius;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user