Browse Source

no message

dev-2.0
ZHR007 2 months ago
parent
commit
78ea9ef2e3
3 changed files with 42 additions and 14 deletions
  1. 17
      lib/controller/setting/spread_controller.dart
  2. 37
      lib/pages/setting/match_spread_page.dart
  3. 2
      lib/pages/setting/match_task_page.dart

17
lib/controller/setting/spread_controller.dart

@ -105,6 +105,9 @@ class SpreadController extends GetxController {
}
activePay.value = index;
canApply.value = false;
if(enableIndex.value == roseList.length){
return;
}
int hours = roseList[activePay.value].liveDurationHours!;
int rose = roseList[activePay.value].liveConsumptionAmount!;
if(hours > 0 && consumption.value.liveDurationMins! >= 60 * hours){
@ -139,7 +142,19 @@ class SpreadController extends GetxController {
{'icon': '4', 'desc': '新徒弟首月收益的10%(平台奖励)'},
];
}
}
String getNameByType(int type) {
if(type == 1){
return '实习红娘';
}
if(type == 2){
return '线上红娘';
}
if(type == 3){
return '签约红娘';
}
return ''; // HI位置
}
// @override
@ -213,7 +228,7 @@ class SpreadController extends GetxController {
}
if(matchmakerFlag.value){
final index = roseList.indexWhere((item) => item.type == GlobalData().userData!.matchmakerType!);
enableIndex.value = index >= 0 ? index : 0;
enableIndex.value = index >= 0 ? index + 1 : 0;
changePayActive(enableIndex.value);
} else {
changePayActive(0);

37
lib/pages/setting/match_spread_page.dart

@ -76,18 +76,31 @@ class MatchSpreadPage extends StatelessWidget {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ConstrainedBox(
constraints: BoxConstraints( maxWidth: 120.w),
child: Text(
"${controller.userData.value?.nickName ?? ""}",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 24.w,
color: Colors.white,
fontWeight: FontWeight.w700
Row(
children: [
ConstrainedBox(
constraints: BoxConstraints( maxWidth: 120.w),
child: Text(
controller.userData.value?.nickName ?? "",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 22.w,
color: Colors.white,
fontWeight: FontWeight.w700
),
),
),
),
if(controller.userData.value!.matchmakerFlag!)SizedBox(width: 4.w,),
if(controller.userData.value!.matchmakerFlag!)Text(
"[${controller.getNameByType(controller.userData.value!.matchmakerType!)}]",
style: TextStyle(
fontSize: 16.w,
color: Colors.white,
fontWeight: FontWeight.w500
),
),
],
),
Text(
"ID:${controller.userId.value ?? ""}",
@ -201,7 +214,7 @@ class MatchSpreadPage extends StatelessWidget {
],
)
),
bottomNavigationBar: controller.roseList.isNotEmpty ? SafeArea(
bottomNavigationBar: (controller.roseList.isNotEmpty && controller.enableIndex.value < controller.roseList.length) ? SafeArea(
child: Container(
height: 60,
padding: EdgeInsets.symmetric(vertical: 5.w, horizontal: 20.w),

2
lib/pages/setting/match_task_page.dart

@ -20,7 +20,7 @@ class MatchTaskPage extends StatelessWidget {
child: TDLoading(
size: TDLoadingSize.medium,
icon: TDLoadingIcon.activity,
text: '加载中',
text: '加载中...',
axis: Axis.vertical,
duration: 500,
)

Loading…
Cancel
Save