|
|
|
@ -32,6 +32,12 @@ class _VipPageState extends State<VipPage> { |
|
|
|
{"img": Assets.imagesVipVoice, "label": "语音弹幕"}, |
|
|
|
]; |
|
|
|
|
|
|
|
List<Map> vipList = [ |
|
|
|
{"title": "12个月", "mouthPrice": "18.2", "price": "218"}, |
|
|
|
{"title": "3个月", "mouthPrice": "19.3", "price": "58"}, |
|
|
|
{"title": "1个月", "mouthPrice": "30", "price": "30"}, |
|
|
|
]; |
|
|
|
|
|
|
|
int payActive = 0; |
|
|
|
|
|
|
|
final Fluwx fluwx = Fluwx(); |
|
|
|
@ -195,22 +201,12 @@ class _VipPageState extends State<VipPage> { |
|
|
|
Row( |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
children: [ |
|
|
|
VipItem(active: vipActive, index: 0,).onTap((){ |
|
|
|
vipActive = 0; |
|
|
|
setState(() { |
|
|
|
|
|
|
|
}); |
|
|
|
}), |
|
|
|
VipItem(active: vipActive, index: 1,).onTap((){ |
|
|
|
vipActive = 1; |
|
|
|
setState(() { |
|
|
|
|
|
|
|
}); |
|
|
|
}), |
|
|
|
VipItem(active: vipActive, index: 2,).onTap((){ |
|
|
|
vipActive = 2; |
|
|
|
setState(() { |
|
|
|
...vipList.asMap().entries.map((entry){ |
|
|
|
return VipItem(active: vipActive, index: entry.key, item: entry.value,).onTap((){ |
|
|
|
vipActive = entry.key; |
|
|
|
setState(() { |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}), |
|
|
|
], |
|
|
|
@ -474,7 +470,8 @@ class _VipPageState extends State<VipPage> { |
|
|
|
class VipItem extends StatefulWidget { |
|
|
|
final int index; |
|
|
|
final int active; |
|
|
|
const VipItem({super.key, required this.index, required this.active}); |
|
|
|
final Map item; |
|
|
|
const VipItem({super.key, required this.index, required this.active, required this.item}); |
|
|
|
|
|
|
|
@override |
|
|
|
State<VipItem> createState() => _VipItemState(); |
|
|
|
@ -514,7 +511,7 @@ class _VipItemState extends State<VipItem> { |
|
|
|
child: Column( |
|
|
|
children: [ |
|
|
|
Text( |
|
|
|
"3个月", |
|
|
|
"${widget.item["title"]}", |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 11.w, |
|
|
|
fontWeight: FontWeight.w700 |
|
|
|
@ -522,7 +519,7 @@ class _VipItemState extends State<VipItem> { |
|
|
|
), |
|
|
|
SizedBox(height: 2.w,), |
|
|
|
Text( |
|
|
|
"¥29.3/月", |
|
|
|
"¥${widget.item["mouthPrice"]}/月", |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 11.w, |
|
|
|
color: const Color.fromRGBO(144, 144, 144, 1) |
|
|
|
@ -543,7 +540,7 @@ class _VipItemState extends State<VipItem> { |
|
|
|
) |
|
|
|
), |
|
|
|
TextSpan( |
|
|
|
text: "88", |
|
|
|
text: "${widget.item["price"]}", |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 23.w |
|
|
|
) |
|
|
|
@ -554,7 +551,7 @@ class _VipItemState extends State<VipItem> { |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
Positioned( |
|
|
|
if(widget.active == widget.index) Positioned( |
|
|
|
left: 0, |
|
|
|
top: -5.w, |
|
|
|
child: Stack( |
|
|
|
|